Event Parameters - AMX NETLINX PROGRAMMING LANGUAGE Manual

Programming language
Table of Contents

Advertisement

Event Handlers
If the event handler is specified using an array for
can determine which index in the array caused the event to run.

Event Parameters

It has already been stated that
access to code that must be executed when an event is received. The event table keeps a list of all events
in a sorted order to more quickly determine which code needs to be accessed for a giving incoming
event. The event table is built before
result, there are certain rules that must be applied to the parameters used in
Since the event table is built before
information prior to
compile time. In addition, many parameter "shortcuts" to help fulfill this requirement.
Using
BUTTON_EVENT
reference. In the following example:
Example 1:
DEFINE_DEVICE
dvTp
DEFINE_EVENT
BUTTON_EVENT[dvTp,1]
{
PUSH:
Send_String 0,'Button 1 of dvTp was pushed'
}
The device,
initialized variable of type
these value were defined at compile time, the event is entered into the event table correctly. Let's take
another example:
Example 2:
DEFINE_DEVICE
dvTp
DEFINE_VARIABLE
Integer nMyChannel
DEFINE_START
nMyChannel = 1
DEFINE_EVENT
BUTTON_EVENT[dvTp,nMyChannel]
{
PUSH:
Send_String 0,"'Button ',ITOA(nMyChannel),' of dvTp was pushed'"
}
68
DEFINE_EVENT
DEFINE_START
DEFINE_START
. This requires that all
DEFINE_START
as an example, the simplest version of event parameters is a device and channel
= 128:1:0
, was defined in the
dvTp
DEFINE_DEVICE
, and the channel number was a hard-coded value of 1. Since both of
DEV
= 128:1:0
DEV, INTEGER
, or a
DEVCHAN
handlers are stored in an event table providing quick
runs and it not changed anytime after that. As a
DEFINE_EVENT
, all event parameters must contain the correct
parameters must be defined at
EVENT
section, which has the effect of making it an
NetLinx Programming Language Reference Guide
array,
GET_LAST
s.

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Netlinx studio 2

Table of Contents