INC
INC Variable
Увеличивает значение переменной.
Variable переменная должна быть числового типа.
То же самое что:
Variable = Variable + 1
or
Variable += 1
Examples
X = 7
INC X
PRINT X
DIM A AS Float[3, 3]
X = 2
Y = 1
A[X, Y] = PI
INC A[X, Y]
PRINT A[X, Y]
Here is a longer example in the terminal modus of :
STATIC PUBLIC SUB Main()
DIM x AS Float
DIM y AS Float
DIM pos AS Integer
DIM neg AS Integer
DIM nul AS Integer
pos = 0
neg = 0
nul = 0
FOR x = 1 TO 100
y = Rnd(-5, 5)
SELECT CASE Sgn(y)
CASE 0
INC nul
'the same as nul = nul + 1
CASE 1
INC pos
CASE -1
INC neg
END SELECT
NEXT
PRINT nul,pos,neg
END
Смотри также