EasyManua.ls Logo

AMX NETLINX PROGRAMMING LANGUAGE - Switch; System_Call; System_Number; Time

AMX NETLINX PROGRAMMING LANGUAGE
246 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
Reserved Identifiers
153
NetLinx Programming Language Reference Guide
Keywords & Run-Time Library Functions (Cont.)
SWITCH...CASE This keyword statement provides a programming construct for selective execu-
tion of code blocks based on the evaluation of a single condition.
SWITCH (var)
{
CASE 1:
{
IF(Var2=1)
{
BREAK // IF Var2=1 STOP EXECUTION
}
(statements go here if Var2 < > 1)
}
CASE 3:
{
(statements go here)
}
CASE 5:
{
(statements go here)
}
DEFAULT:
{
(statements go here)
}
}
SYSTEM_CALL This keyword is similar to CALL except that the subroutine invoked using the
SYSTEM_CALL keyword resides in a special file called a library file. When this
keyword is used, the compiler generates a call to the subroutine in the library
file and automatically includes the library file for compilation.
SYSTEM_NUMBER This keyword defines an unsigned 16-bit integer system constant that contains
the system number.
TIME This keyword holds the current time as a string in the form "hh:mm:ss". The
time is represented in 24-hour format.
IF (TIME = '23:59:59')
{
}
TIME_TO_HOUR This function returns an integer representing the hour portion of a time string.
SINTEGER TIME_TO_HOUR (CHAR TimeStr[ ])
Parameters:
TimeStr: Input string containing the time in hh:mm:ss format.
If successful, this function returns an integer (0-23) representing the hour por-
tion of the time string. The specified time is invalid, this function returns -1.
CHAR TimeStr[ ] = '9:30:08'
SINTEGER nHour
nHour = TIME_TO_HOUR (TimeStr) // nHour = 9
TIME_TO_MINUTE This function returns an integer representing the minute portion of a time string.
SINTEGER TIME_TO_MINUTE (CHAR TimeStr[ ])
Parameters:
TimeStr: Input string containing the time in hh:mm:ss format.
If successful, this function returns an integer (0-59) representing the minute
portion of the time string. If the specified time is invalid, this function returns -1.
CHAR TimeStr[ ] = '9:30:08'
SINTEGER nMinute
nMinute = TIME_TO_MINUTE (TimeStr) // nMinute = 30

Table of Contents

Related product manuals