CODE

BASin

CODE

Function

CODE gives the code number of a character in the BASIC character set (see here for the complete set).

How to use CODE

CODE is followed by a string value, for example

90 IF CODE a$<65 OR CODE a$>90 THEN GO TO 80

A string expression must be enclosed in brackets. CODE returns the code number of the first character in the string. If this is a null string ("") then CODE returns 0.

SAVE/LOAD/VERIFY CODE

CODE is used in a different way with SAVE, LOAD and VERIFY. See their respective entries for more information.

Format

  • CODE string-const
  • CODE string-var
  • CODE (string-expr)

See also

Chapter 14.