Asc: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
Line 1: | Line 1: | ||
Asc(''string'') | Asc(''string'') | ||
== Description == | |||
Asc returns the ANSI character code of a character. The required parameter, ''string'', is any valid string expression. If ''string'' is longer than one character, only the first character is used. | Asc returns the ANSI character code of a character. The required parameter, ''string'', is any valid string expression. If ''string'' is longer than one character, only the first character is used. | ||
== Example == | |||
<pre> | <pre> | ||
Line 17: | Line 17: | ||
</pre> | </pre> | ||
== Output == | |||
<pre> | <pre> | ||
Line 24: | Line 24: | ||
</pre> | </pre> | ||
== Related Items == | |||
[[chr|CHR]] | [[chr|CHR]] | ||
[[Category:Language Reference]] | [[Category:Language Reference]] |
Revision as of 20:16, 8 August 2012
Asc(string)
Description
Asc returns the ANSI character code of a character. The required parameter, string, is any valid string expression. If string is longer than one character, only the first character is used.
Example
REM Asc Example 'Asc returns an ANSI character code DIM CapitalA, LowerB CapitalA = Asc("A is for Apple") PRINT "Character code for A = " & CapitalA LowerB = Asc("b") PRINT "Character code for b = " & LowerB
Output
Character code for A = 65 Character code for b = 98