ASC()
This page was last modified 11:52, 19 November 2016 by Gdx. Based on work by Mars2000you and NYYRIKKI and others.

Contents

Effect

Returns the ASCII value of a character.

Remark: It will always return the value 1 for the characters 0 to 31 without giving the second value associated to these characters.

Syntax

ASC(<character>)

Parameter

<character> is an character between quotation mark. It can be a string or an alphanumeric variable but only the 1st character will be taken into account.

Example

10 PRINT "The ASCII value of B is ";ASC("B")
20 PRINT "The ASCII value of MSX is ";ASC("MSX")
 
RUN
The ASCII value of B is 66
The ASCII value of MSX is 77

Related to

CHR$(), STRING$()

Compatibility

MSX-BASIC 1.0 or higher