Left_String; Length_Array - AMX NETLINX PROGRAMMING LANGUAGE Manual

Programming language
Table of Contents

Advertisement

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

LEFT_STRING

LENGTH_ARRAY

138
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'
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 = LENGTH_ARRAY(Array2)
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.
NetLinx Programming Language Reference Guide
// Len = 5
// Len = 2

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Netlinx studio 2

Table of Contents