Asc: Difference between revisions

From NSB App Studio
Jump to navigation Jump to search
Brendon (talk | contribs)
No edit summary
Brendon (talk | contribs)
No edit summary
Line 1: Line 1:
ASC(''string'')
Asc(''string'')


'''Description'''
'''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'''
'''Example'''


<pre>
<pre>
REM ASC Example
REM Asc Example
'ASC returns an ANSI character code
'Asc returns an ANSI character code
DIM CapitalA, LowerB
DIM CapitalA, LowerB
CapitalA = ASC("A is for Apple")
CapitalA = Asc("A is for Apple")
PRINT "Character code for A = " & CapitalA
PRINT "Character code for A = " & CapitalA
LowerB = ASC("b")
LowerB = Asc("b")
PRINT "Character code for b = " & LowerB
PRINT "Character code for b = " & LowerB
</pre>
</pre>
Line 27: Line 27:


[[chr|CHR]]
[[chr|CHR]]
[[Category:Language Reference]]

Revision as of 20:15, 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

Related Items

CHR