32 of 323
ZBasic System Library 22 ZX Microcontroller Family Asc Type Function returning Byte Invocation Asc(str) Asc(str, index) Parameter Method Type Description str ByVal String The string from which a character will be returned. index ByVal int8/16 The 1-based position in the string from which the character will be returned. Discussion This function returns the ASCII character code of the character at the position of the string that is specified. If the second parameter is missing, position 1 is assumed. Note that if the index is less than 1 or larger than the number of characters in the string the return value will be zero. Example Dim s as String Dim b as Byte s = "Howdy" b = Asc(s) After execution, the variable b will have the value of 72 (48 hex), the character code for H. Compatibility BasicX does not support the presence of the second parameter. See Also Chr