Warning

You're browsing the old v2.x documentation. This version is no longer maintained. Click here to go the v3.x documentation.

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
syntax [2019/07/08 11:31] – [Case sensitivity] neilssyntax [2019/08/25 19:24] – [Syntax] neils
Line 3: Line 3:
 An **XC=BASIC** program is built from one or more plain ASCII text files that consist of lines, allowing only one statement per line. An **XC=BASIC** program is built from one or more plain ASCII text files that consist of lines, allowing only one statement per line.
  
-Each line may contain a statement, a label or both.+Each line may contain a label, a statement, or both:
  
   label1: print "hello world"   label1: print "hello world"
Line 43: Line 43:
 Keywords may be written in lowercase or uppercase as well. All identifiers (variable names, procedure names, etc.) can be mixed-case and are case sensitive by default. Keywords may be written in lowercase or uppercase as well. All identifiers (variable names, procedure names, etc.) can be mixed-case and are case sensitive by default.
  
-If the ''civars'' [[compiler_options|compiler option]] is turned on, variable names are treated cas insensitive. This only applies to variable names. Labels and other identifiers are case sensitive.+If the ''civars'' [[compiler_options|compiler option]] is turned on, variable names are treated insensitive. This only applies to variable names. Labels and other identifiers are case sensitive.
  
 ===== Identifiers ===== ===== Identifiers =====
Line 85: Line 85:
   print "{5}white text"   print "{5}white text"
      
 +Make sure to check the list of all [[petscii_escape_sequences|]].
 +===== Character literals =====
  
 +Since version 1.2, a character enclosed in single quotes (''''') evaluates to its PETSCII code.  Escape sequences are supported in character literals as well.
 +
 +Example:
 +
 +  print 'a' + 1
 +  rem -- will output: 66
 +  print '{white}'
 +  rem -- will output: 5