Programming Syntax

From C64-Wiki
Jump to navigationJump to search

In order that a programmer knows what is the right way to use a programming directive without producing an error message, exists a common programming syntax (syntax for description of computer programs). In the scope of the articles describing programming languages like the BASIC keywords of version 2 in the Commodore 64, the programming syntax that was used mostly in the last decades in the computer world is used.

  1. The actual command is written in capital letters. When typing in a program the command needs to be typed in like printed in the article.
  2. When there are other characters than [],<>,… like comma, semicolon or colon after a command, they must be typed in.
  3. When there are square brackets [] after a command the enclosed parameters are optional (may be left out).
  4. The ellipsis … indicates that the optional parameters may be repeated.
  5. The pointy brackets <> embrace variable data that may not be left out.
  6. A slash / or vertical bar | indicates that parameters may be used alternatively.
  7. Data (parameters, arguments to functions, constants) in quotation marks "…" need to be typed in with quotation marks at this place.
  8. When there are character strings in curly brackets {} it is used to display control characters as keyboard input. For PRINT "{wht/white}"; the key combination CTRL  and 2  must be pressed.