Max_Length_String; Medium_While; Mid_String; Min_Value - AMX NETLINX PROGRAMMING LANGUAGE Manual

Programming language
Table of Contents

Advertisement

Keywords & Run-Time Library Functions (Cont.)

MAX_LENGTH_STRING

MEDIUM_WHILE

MID_STRING

MIN_VALUE

MIN_TO

NetLinx Programming Language Reference Guide
This function returns the dimensioned length of a CHAR or WIDECHAR string.
This function is retained for compatibility with previous versions of Axcess. It
provides the same information as MAX_LENGTH_ARRAY.
LONG MAX_LENGTH_STRING (CHAR STRING[ ])
LONG MAX_LENGTH_STRING (WIDECHAR STRING[ ])
Parameters:
• STRING: The input character string.
Result:
The dimensioned length of STRING.
MaxLen = MAX_LENGTH_STRING(STRING)
Len = LENGTH_STRING(STRING)
IF (MaxLen > Len)
{
// append character to STRING
}
This keyword is obsolete in the new NetLinx system. The compiler will treat it
as a WHILE keyword. See the Language Elements section on pages 31 for
information on programming loop constructs.
This function returns the specified number of characters, starting at the speci-
fied location in the source string.
CHAR[ ] MID_STRING (CHAR STRING, LONG Start, LONG Count)
WIDECHAR[ ] MID_STRING (WIDECHAR STRING, LONG Start, LONG
Count)
Parameters:
• STRING: The input character string.
• Start: Starting location in the string.
• Count: Number of characters to extract.
The result is a character string containing the specified characters.
STRING = 'ABCDEFGHIJK'
Substr = MID_STRING(STRING, 5, 4)
(* Substr = 'EFGH' *)
Provides the value of the lowest of two variables. It will take any intrinsic vari-
able type and return the same type of the lowest variable.
MinVal MIN_VALUE (Var1,Var2)
DEFINE_VARIABLE
SLONG Var1, Var2, VarMin
DEFINE_START
Var1 = 100
Var2 = 200
DEFINE_PROGRAM
VarMin = MIN_VALUE (Var1,Var2)
This keyword operates just like the TO keyword, except that the specified chan-
nel or variable stays on for a minimum length of time, even if the corresponding
channel is released. The minimum length of time is set by SET_PULSE_TIME.
MIN_TO follows the same conditions of operation as the TO keyword.
See SET_PULSE_TIME, on page 150, for more information.
Reserved Identifiers
// VarMin = 100
141

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Netlinx studio 2

Table of Contents