beautypg.com

Variables, How to set and get cell values, If command – Juniper Systems Allegro CE Manual User Manual

Page 192

background image

Page 4-132 Windows CE

Variables
You can use variables in tasks.
Example:
ok = YesNoBox("Finish task?")
if ok then
Return()
end
There are no global variables. Use a workbook to store global data.

How to Set and Get Cell Values
Use Set(reference, value) function to set cell value.
Example:
Set(A1,1000)

If you need to create a cell reference using row and column numbers
(column A has number 1) use function CellRef(col, row [, sheetIndex]).
Parameter sheetIndex is optional.
Example:
i = 1
while i < 100
Set(CellRef(1,i), i)
i = i+1
end

If Command
if condition then
commandsTrue
end
if condition then
commandsTrue
else
commandsFalse
end

Executes commandsTrue if a condition is True or commandsFalse if a
condition is False.
Examples:
if a1<>0 then Set(c1, b1/a1) end
if a1=0 then
Set(c1, "Sorry...")
else
Set(c1, b1/a1)
end