
Commands - 58
INC and INCF
Statements
SYNTAX: INC variable
INCF variable
PURPOSE: To increment a variable by one (INC) or four (INC F). INCF is usually used to increment a pointer
for floating point number storage.
REMARK S: This is a fast increment of a simple or array variable.
A= A+ 1 slow
INC A fast
A= A+ 4 slow
INCF A fast
INC executes more than double the speed of the statement it replaces. Valid for simple and array
variables.
RELATED: DEC, DECF
EXAMPLE: 10 PRINT H
20 INC H
30 PRINT H
RUN
0
1
Line 10 increments element 8 of the array A.
10 INC A(8)
INCF is used to increment a pointer to a floating point number. The following example stores 15
floating point numbers to RAM segment 1.
fptr = &1000
do 15
a = ain(0) *.00232
fpoke fptr,a,1
incf fptr
enddo
ERROR: < Expected variable> – if parameter is not a variable
Commentaires sur ces manuels