Download CIMPLICITY BCE Language Reference Manual

Transcript
Comments
Example
Parameter
Description
Region$
String. A unique identifier of the region to be operated on.
Consider the following example. Trigger is a point which caused the make decision to execute.
The function may be called in response to two separate events with a different Point ID. The
function will make a decision only if the timestamp of the point is more recent than the time the last
decision was made.
Dim lastTime as Date
sub MakeDecision(trigger as Point, decision as Point)
' Only one thread may be within this loop.
Acquire "MakeDecision"
' Make sure we release the "MakeDecision" section prior to leaving.
ON ERROR GOTO RELEASEIT
' If we made a decision after this point changed then return
if lastTime < trigger.TimeStamp then
goto RELEASEIT
end if
lastTime = trigger.TimeStamp
decision.Value = trigger.Value
decision.Write
RELEASEIT:
Release "MakeDecision"
exit sub
end sub
GFK-1283G
CIMPLICITY Extensions to Basic
26-3