Get_Last - AMX NETLINX PROGRAMMING LANGUAGE Manual

Programming language
Table of Contents

Advertisement

Reserved Identifiers
Keywords & Run-Time Library Functions (Cont.)
GET_IP_ADDRESS (Cont.)

GET_LAST

130
The Flags member is a bit field that may be used for several different purposes.
Each bit is defined below:
Differing configuration parameters may be obtained, depending upon the con-
figuration of the network DHCP server. It is possible that the DHCP server will
provide the host name, IP address, subnet mask, gateway, and even DNS infor-
mation. In a minimal configuration, the DHCP server will only supply the IP
address and subnet mask.
IP_ADDRESS_STRUCT IPAddressResult =
GET_IP_ADDRESS(0:0:0,IPAddress)
Note: For NetLinx Central Controllers, the "Host Name" can only consist of
alphanumeric characters.
This function returns the index of the array element that most recently caused
an event handler to be triggered.
DEFINE_VARIABLE
DEVCHAN dcMyDCSet[] = { {TP,5}, {TP,4}, {TP,3}, {TP,2},
{TP,1}}
INTEGER Index
BUTTON_EVENT[dcMyDCSet]
{
PUSH:
{
Index = GET_LAST(dcMyDCSet)
Switch (Index)
{
Case 1: {} (* Button 5 was pressed *)
Case 2: {} (* Button 4 was pressed *)
Case 3: {} (* Button 3 was pressed *)
Case 4: {} (* Button 2 was pressed *)
Case 5: {} (* Button 1 was pressed *)
}
}
}
Result:
• 0: No Event was triggered using this array.
• >0: The index that causes an event to be triggered.
Since the PUSH and RELEASE keywords can be written using DEVCHAN arrays,
this function can also be used to determine which element causes a push or
release to be triggered. The function can be called anywhere in code but is usu-
ally called from within an event handler. A classic application of this function is
to determine the keypad number pressed when the channel codes for the key-
pad are out of order, which they typically are for a wireless transmitter.
Note: GET_LAST works with BUTTON_EVENTS and CHANNEL_EVENTS, but not
with LEVEL_EVENTS.
NetLinx Programming Language Reference Guide

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Netlinx studio 2

Table of Contents