You are here: Home DOCUMENTATION Reference nqBASIC Language Reference

nqBASIC

nqBASIC Language Reference

 

An nqBASIC program has the following structure:

  • constant, type and variable definitions first (CONST, TYPE and DIM),
  • functions and tasks next (SUB and TASK)
  • main-function at end (MAIN).

These definitions may be spread over several source-files (“.nqb” files, but should follow the order as listed above). I.e. after function-definitions NO variable definitions may follow.
All code is case-INsensitive
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Program Structure

Other Syntax

Constants

  • Const
  • ON | OFF
  • HIGH | LOW
  • TRUE | FALSE
  • FOREVER
  • MAX_WORD
  • MAX_BYTE
  • FILLUP_ZERO
  • FILLUP_SPACE

Data Types

  • byte 1byte (-128 to 127)
  • word 2 byte (-32768 to 32767)

Custom Types

Object Types


Boolean Operators

  • AND
  • OR
  • & (bitwise AND)
  • |  (bitwise OR)
  • ^  (bitwise XOR)

Variable/Object Declaration

Flow Control

Arithmetic Operators

Comparison Operators



 

Add comment


Security code
Refresh