R-CODE Coding Conventions

 

  1) A line may be up to 127 bytes long (total, including comments and a new line character).

 

  2) R-CODE commands consist of words separated by colons (:).

 

        Word1:Word2:Word3

 

  3) Only alphanumeric Ascii characters and underscores (_) may be used in words.

     NOTE: other symbols have special meanings.

 

  4) Space and Tab characters at the heads of lines are ignored (for indenting)

 

  5) Lines beginning with a colon (:) are considered to be label rows.

 

        :Label

 

  6) Lines whose first character is not an alphanumeric Ascii character or colon (:) are treated as comment lines, and ignored.

 

  7) If a double slash (//) is contained in a line, everything thereafter in that line is treated as a comment, and ignored.

 

        Word1:Word2:Word3  // comment

 

  8) Since colons (:), spaces, tabs, and newline characters are treated as separators, they cannot be used in names and the like.

     In order to include these characters in format strings and the like, wrap the entire string in double quotes ("").

 

        PRINT:"x = %d":x

 

  9) Words starting with the following characters are treated as numbers: + - 0 1 2 3 4 5 6 7 8 9

     Numbers whose first two characters are 0x or 0X are treated as hexadecimal numbers.

     Numbers whose first two characters are 0o or 0O are treated as octal numbers.

     Numbers whose first two characters are 0b or 0B are treated as binary numbers.

 

        SET:x:0x03FC

        SET:y:0o0777

        SET:z:0b00001111

 

 10) Words in ALL-CAPS are reserved for R-CODE system use.

     Please do not use ALL-CAPS for user variable names, etc.

 

        BAD -- SET:USER1:0 (could cause future conflicts with words reserved by the R-CODE system)

        GOOD -- SET:user1:0 (use of all lowercase variable names recommended)

        CAUTION -- SET:User1:0 (make sure capitalized names do not overlap with system variables)

 

 

First Simple program using R – CODE

 

_________________________________________

 

FOR:i:1:10                                    <== This program repeats the motion

    PLAY:ACTION:SIT                                 "sit and stand" 10 times.

    WAIT

    PLAY:ACTION:STAND

    WAIT

  NEXT