Reserved Identifiers
145
NetLinx Programming Language Reference Guide
Keywords & Run-Time Library Functions (Cont.)
REBUILD_EVENT() (Cont.)
DEFINE_EVENT
BUTTON_EVENT[panel,1]
{
PUSH:
{
ON[panel,1]
curModApoc = dvApoc2
// updates program event table to handle
// BUTTON_EVENT[1505:1:0,5]
REBUILD_EVENT()
}
RELEASE: OFF[panel,1]
}
BUTTON_EVENT[panel,2]
{
PUSH:
{
ON[panel,2]
curModApoc = dvApoc3
// updates program event table to handle
// BUTTON_EVENT[1303:1:0, 5]
REBUILD_EVENT()
// the following assignment has no affect on the program
// event table
curModApoc = dvApoc1
}
RELEASE: OFF[panel,2]
}
BUTTON_EVENT[curModApoc,5]
{
PUSH: ON[dvApoc3,5]
RELEASE: OFF[dvApoc3,5]
}
// end
// REBUILD_EVENT() rebuilds the event table for
// variables modified in the same block of code in which
// it resides.
//
// With no braces, a REBUILD_EVENT() in DEFINE_START
// should rebuild the event tables that use any variable
// modified in DEFINE_START, above the REBUILD_EVENT()
// statement.
// You can reduce the scope of the REBUILD_EVENT() by
// delineating a block with braces:
DEFINE_DEVICE
dvTP = 10001:1:0
DEFINE_VARIABLE
INTEGER X // loop counter
INTEGER nBTNS[4000]
DEFINE_START
FOR (X = 1; X <= 4000; X++)
{
nBtns[X] = X
}
// the braces below enclose a variable update and
// rebuild_event statement in a single block