•  Back 
  •  Main 
  •  Index 
  •  Tree View 
  •  Cross references 
  •  Help 
  •  Show info about hypertext 
  •  View a new file 
Topic       : The GFA-Basic Compendium
Author      : GFA Systemtechnik GmbH
Version     : GFABasic.HYP v2.98 (12/31/2023)
Subject     : Documentation/Programming
Nodes       : 899
Index Size  : 28056
HCP-Version : 3
Compiled on : Atari
@charset    : atarist
@lang       : 
@default    : Document not found
@help       : Help
@options    : +g -i -s +z
@width      : 75
@hostname   : STRNGSRV
@hostname   : CAB     
@hostname   : HIGHWIRE
@hostname   : THING   
View Ref-FileADD x,y
SUB x,y
MUL x,y
DIV x,y

x: avar
y: aexp

The instruction ADD increases the variable x by the value of y. With this
instruction x must be a numeric variable, and y must be a numerical expression.

The instruction SUB decreases the variable x by the value of y. With this
instruction x must be a numeric variable, and y must be a numerical expression.

The instruction MUL multiplies x by the value of y and assigns the result to x.
With this instruction x must be a numeric variable, and y must be a numerical
expression.

The instruction DIV divides x by the value of y and assigns the result to x.
With this instruction x must be a numeric variable, and y must be a numerical
expression.

These instructions can work with floating-point variables, but are
substantially faster with integers.

See also ADD(), SUB(), MUL(), and DIV().

Note: DIViding a variable by zero (0) results in an error.

Example:

    x%=1
    y%=2
    z%=3
    ADD x%,y%       !now x% is equal to 3
    SUB z%,(x%-1)/2 !the numerical expression (x%-1)/2 restults in 1
    PRINT x%,z%

--> The numbers 3 and 2 are displayed.