Length_String; Length_Variable_To_String (Variable Encode); Length_Variable_To_Xml; Level_Event - AMX NETLINX PROGRAMMING LANGUAGE Manual

Programming language
Table of Contents

Advertisement

Keywords & Run-Time Library Functions (Cont.)

LENGTH_STRING

LENGTH_VARIABLE_TO_
STRING
(VARIABLE Encode)
LENGTH_VARIABLE_TO_
XML

LEVEL_EVENT

LOCAL_VAR

LONG

NetLinx Programming Language Reference Guide
This function returns the length of a CHAR or WIDECHAR string. This function is
retained for compatibility with previous versions of Axcess and provides the
same information as LENGTH_ARRAY.
LONG LENGTH_STRING (CHAR STRING[ ])
LONG LENGTH_STRING (WIDECHAR STRING[ ])
Parameters:
• STRING: The input character string.
The result is the length of STRING. The string length can be set implicitly
through a literal or variable string assignment or explicitly by calling
SET_LENGTH_STRING. For example:
IF (LENGTH_STRING(STRING) > 0)
{
// process string
}
This routine calculates how many bytes it takes to encode a variable.
LONG LENGTH_VARIABLE_TO_STRING (VARIABLE Encode)
Parameters:
• Encode: The variable (any type) to be encoded.
Result:
• >0: Number of bytes required to encode variable.
• 0: Encoded variable error, unrecognized type
CHAR LENGTH_VARIABLE_TO_XML(CONSTANT VARIANTARRAY A,
LONG B)
Where:
• A is the variable (any type) to be encoded.
• B is the encoding flag. These can be used together.
Value $01 is "Encode with Types". If the bit is set, types will be included for
every variable being encoded. The default is to not include types.
Value $10 is "Encoded CHAR arrays as using data list". See the Binary array
encoding section on pages 219.
Value $20 is "Array Encoding is Little-Ending".
The return is the length needed to encode the variable.
This keyword defines a level event handler and can only be used in the
DEFINE_EVENT section of the program. This type of handler is invoked when a
level change occurs on the specified device-channel. The level object is avail-
able to the level event handler as a local variable.
LEVEL_EVENT[DEVICE,LEVEL] or LEVEL_EVENT[([DEVLEV[ ])]
{
// level event handler
}
See the Event Handlers section on page 61 for more information.
This keyword specifies a variable that is static. To provide compatibility with the
Axcess language, local variables may be declared right before the opening
brace for DEFINE_CALL declarations only.
If neither the LOCAL_VAR nor the STACK_VAR keyword is specified,
STACK_VAR is assumed.
See the Variables section on page 11 for more information.
This keyword defines an intrinsic data type representing a 32-bit unsigned
value.
Reserved Identifiers
139

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Netlinx studio 2

Table of Contents