Inc [r] 204 [r, Index id [r] 217 [r – Industrial Data Systems IDS Scale Basic User Manual
Page 27

Scale Basic 4.2E
Reference
Flag
on,
1
turn
on
flag
1
Display Memory1
set to display Memory1 (total)
End
if
End
if
End
End
of
function
If not (condition) / Else / End if
242 [nnn] / 251 / 240
Purpose: to control program flow using a condition code.
Remarks: sometimes it is more meaningful or more convenient to test for a false condition
rather than a true condition. In these situations, use the If not instruction.
Example:
If not, Centerz
If the scale is not at center of zero
Gosub
Zero
Zero
the
scale
End
if
End
if
Inc
[r]
204
[r]
Purpose: add 1 to a register. Set condition codes Positive, Negative, and Zero to reflect results.
Remarks: the decimal point is ignored. If Memory1 = 0.05, then Inc Memory1 = 0.06 This
instruction is useful for counting the number of times something occurs.
Example:
Set, Memory1, 25
For loop count = 25
Loop1
Do
:
:
Dec, Memory1
loop count = loop count - 1
If, Positive
While loop count > 0
Next1
Next
loop
End if
End of For/Next loop
Index
id
[r]
217
[r]
Purpose: to access Id memory as an array of records. The register [r] opens records by their
location in memory.
Remarks: the Get id, Make id, Write id, Erase id instructions access Id memory with randomly
assigned Id numbers (the Id key). The Index id instruction accesses an Id record by it’s
location in memory. With this instruction you view Id memory as (approx.) 490 records: | ID
record 1 | ID record 2 | ID record 3 | ……. | ID record 490 |. The condition code Zero is set
true if the index number > maximum or register [r] does not exist.
NOTE: In EZ Link, the fields in an ID record are accessed via Id1, Id2, …. Do not confuse
the ID record with the Id field access symbols.
Example: access ID record 3, set Id register 1 to 0, save the change to ID record 3.