Contents | Index | < Browse | Browse >

3.1 Build-In Functions

3.1.1 Assign Operators

  Symbol         | Description
  ---------------+--------------------------------------------------------------
  x = y          | assign y to x (primitive types/pointers only)

3.1.2 Comparators

  Symbol         | Description
  ---------------+--------------------------------------------------------------
  x = y          | True if x is equal to y, False otherwise
  x >  y         | True if x is greater than y, False otherwise
  x >= y         | True if x is greater than or equal y, False otherwise
  x => y         | True if x is greater than or equal y, False otherwise
  x <  y         | True if x is smaller than y, False otherwise
  x <= y         | True if x is smaller than or equal y, False otherwise
  x =< y         | True if x is smaller than or equal y, False otherwise
  x >< y         | True if x is not equal to y, False otherwise
  x <> y         | True if x is not equal to y, False otherwise

3.1.3 Logic Operators

  Symbol         | Description
  ---------------+--------------------------------------------------------------
  NOT(x)         | logic NOT
  x AND y        | logic AND
  x OR y         | logic OR
  Xor(x,y)       | logic XOR, equals to (x AND NOT(y)) OR (NOT(x) AND y)

3.1.4 Bit Manipulating Operators

  Symbol         | Description
  ---------------+--------------------------------------------------------------
  NEG(x)         | bitwise negation of x (= XOR with all bits set)
  x & y          | bitwise AND (integer only)
  x | y          | bitwise OR  (integer only)
  Xor(x,y)       | bitwise XOR (integer only)
  x LSR y        | shift down x about y bits (unsigned)
  x ASR y        | shift down x about y bits (signed)
  x LSL y        | shift up x about y bits
  x ASL y        | shift up x about y bits

3.1.5 Math Operators

  Symbol         | Description
  ---------------+--------------------------------------------------------------
  -x             | negation of x
  x + y          | add x and y
  x - y          | subtract y from x
  x * y          | multiply x by y
  x / y          | divide x through y
  x MOD y        | x modulo y 
  x ^ y          | x power y
  Log(x.f,y.f)   | logarithm of x to base y

3.1.6 Trigonometric Functions

  Symbol         | Description
  ---------------+--------------------------------------------------------------
  Sin(x.f)       | Sinus of x
  Cos(x.f)       | Cosinus of x
  Tan(x.f)       | Tangents of x
  ASin(x.f)      | inverse Sinus of x
  ACos(x.f)      | inverse Cosinus of x
  ATan(x.f)      | inverse Tangents of x 

3.1.7 String Functions

  Symbol                    | Description
  --------------------------+---------------------------------------------------
  Mid$(str.s,pos.p,n.p)     | crop n characters starting from pos of str 
  Len(str.s)                | string length of str

3.1.8 Program Flow Functions

  Symbol                    | Description
  --------------------------+---------------------------------------------------
  DEFTYPE.t a               | declare and initialized variable a of type t
  Dim [KEEP] a.t(n)         | dimension an array of type t with n indices
  Dim List a.t(n)           | create a linked list of name a of type t
  NEWTPYE name              | declare a data structure
  Function name {...}       | declare a function
  Goto label                | unconditional branch
  Function Return (r)       | return from a function with return value r
  For i=a to b Step c       | "For" loop
  While c : ... : Wend      | "While" loop
  Repeat : ... : Until c    | "Repeat" loop
  If c Then ...             | "If" block
  Else ...                  | "Else" block
  Select x                  | "Select" switch
  Case y                    | "Case" block
  End                       | end program
  initbasic                 | init the Basic context

3.1.9 Memory Functions

  Symbol               | Description
  ---------------------+--------------------------------------------------------
  Dc.t value           | declare a value directly in binary code
  SizeOf.t             | memory size of type t
  Peek.t(mem)          | (flat) copy the data from mem to the structure
  Poke.t(mem)          | (flat) copy the data from the structure to mem

3.1.10 Casting Function

  Symbol        | Description
  --------------+---------------------------------------------------------------
  Val(x)        | convert string to float
  Vallong(x)    | convert string to integer
  Str(x)        | convert integer/float to string
  Int(x)        | convert float to integer


Contents | Index | < Browse | Browse >