
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
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...