Contents | Index | < Browse | Browse >
2 Syntax

  An AmiBlitz³ program is a sequence of expressions (and definitions/
  compiler directives).
  Two expressions are separated by a new line or by a ":" (colon).

  +-----------------------------------------------------------------------------
  |
  | expression
  | expression : expression
  |
  +-----------------------------------------------------------------------------

  An expression is usually a BlitzLib instruction, variable assignment or
  a function call.
 
  Example:
  +-----------------------------------------------------------------------------
  |
  | DEFTYPE.s myStringVar
  | myStringVar = "Hello World!" : NPrint a.s
  | End
  |
  +-----------------------------------------------------------------------------

2.0.1 Comments  

  A comment is added by using the ";" (semicolon), and always ends at
  the end of line:
  +-----------------------------------------------------------------------------
  | 
  | expression ; this is a comment
  | 
  +-----------------------------------------------------------------------------
  
2.0.2 Multi-Line Expressions  

  An expression can be spanned over multiple lines, if the new line is escaped
  by "@@" (two at-signs):
  +-----------------------------------------------------------------------------
  | 
  | expression part1 @@
  | expression part2
  | 
  +-----------------------------------------------------------------------------
  Note: AmiBlitz³ needs "new syntax mode" enabled by using optimize 4.

2.0.3 Blocks of Expressions  

  The "End something" instruction is used terminate a block of expressions
  that have been grouped together, e.g. if they make up the body of a loop,
  function, or the conditional block of an "If":
  +-----------------------------------------------------------------------------
  | 
  | If condition
  |   expression
  |   expression
  |   ...
  | End If
  | 
  | Function.t name{...}
  |   expression
  |   expression
  |   ...
  | End Function
  |  
  +-----------------------------------------------------------------------------
  Note: "condition" is an expression that evaluates to a boolean (true/false).
  Note: A single "End" terminates the whole program.
  Note: Some types of blocks (but not all) have a single-token shortcut, e.g.
        "End While" can be written as "Wend", "End If" as "EndIf".

  See section 2.1 Program Flow for more details.
  

Contents | Index | < Browse | Browse >