
Reserved Identifiers
138
NetLinx Programming Language Reference Guide
Keywords & Run-Time Library Functions (Cont.)
LEFT_STRING
This function returns the specified number of characters from the beginning of
a string.
CHAR[ ] LEFT_STRING (CHAR STRING[ ], LONG Count)
WIDECHAR[ ] LEFT_STRING (WIDECHAR STRING[ ], LONG Count)
Parameters:
•
STRING
: The string from which to extract the characters.
•
Count
: The number of character to copy from the beginning of the string.
The result is a string containing a copy of the first
Count
characters from
STRING
.
STRING = 'ABCDEFG'Substr = LEFT_STRING(STRING, 3)
// Substr = 'ABC'
LENGTH_ARRAY
This function returns the effective length of a dimension of an array - implicitly
through array initialization or array manipulation operations (+ and -) or explic-
itly through a call to the function
SET_LENGTH_ARRAY
.
LONG LENGTH_ARRAY (<type> Array[ ])
Parameters:
•
<type>
: May be any intrinsic or user-defined data type
•
Array
: An array of any type.
The result is the effective (or working) length of the array.
INTEGER Len
INTEGER Array1[ ] = {3, 4, 5, 6, 7}
INTEGER Array2[ ] = {1, 2}
INTEGER My3DArray[5][3][4] =
{
{
{1,2,3,4},
{5,6,7,8},
{9,10,11}
}
{
{13,14}
}
}
Len = LENGTH_ARRAY(Array1) // Len = 5
Len = LENGTH_ARRAY(Array2) // Len = 2
Len = LENGTH_ARRAY(My3Darray)
(* Len = 2, the number of tables *)
Len = LENGTH_ARRAY(My3Darray[2])
(* Len = 1, the number of rows in table 2 *)
Len = LENGTH_ARRAY(My3Darray[1][3])
(* Len = 3, the number of columns in table 1, row 3 *)
See
SET_LENGTH_ARRAY
, on page 150, for more information.
Summary of Contents for NETLINX PROGRAMMING LANGUAGE
Page 15: ...Table of Contents xiii NetLinx Programming Language Reference Guide...
Page 16: ...xiv NetLinx Programming Language Reference Guide Table of Contents...
Page 18: ...Introduction 2 NetLinx Programming Language Reference Guide...
Page 76: ...Language Elements 60 NetLinx Programming Language Reference Guide...
Page 106: ...Combining Devices Levels and Channels 90 NetLinx Programming Language Reference Guide...
Page 112: ...Master To Master M2M 96 NetLinx Programming Language Reference Guide...
Page 182: ...Reserved Identifiers 166 NetLinx Programming Language Reference Guide...
Page 204: ...NetLinx UniCode Functions 188 NetLinx Programming Language Reference Guide...
Page 244: ...Appendix B Glossary 228 NetLinx Programming Language Reference Guide...
Page 245: ...Appendix B Glossary 229 NetLinx Programming Language Reference Guide...