beautypg.com

While statement, For statement – Juniper Systems Allegro CX Manual User Manual

Page 170

background image

170 Allegro CX Owner’s Manual

Examples:

if a1<>0 then Set(c1, b1/a1) end

if a1=0 then

Set(c1, “Sorry...”)

else

Set(c1, b1/a1)

end

While Statement

while condition

commands

end

Executes commands as long as a condition is True.

Example:

while a1>0

Set(CellRef(2, a1), a1*100)

Set(a1, a1-1)

end

For Statement

for counterVariable = startValue to endValue [step stepValue]

commands

end

Repeats commands a specifi ed number of times.

Example:

for i = 1 to 10

Set(CellRef(1, i), i)

end

for j = 1 to 100 step 10

Set(a1, a1*j)

end