Reserved Identifiers
112
NetLinx Programming Language Reference Guide
Keywords & Run-Time Library Functions (Cont.)
DATE
The system variable
DATE
returns the current date in (mm/dd/yy) string format.
The wildcard character "?" is not allowed for string comparisons because the
actual date is needed.
IF (DATE = '12/25/00')
{
}
You can replace the wildcard feature by using the
COMPARE_STRING
function.
DAY
The system variable
DAY
returns the current day of the week as one of the fol-
lowing strings:
'MON'
,
'TUE'
, '
WED'
,
'THU'
,
'FRI'
,
'SAT'
or '
SUN'
.
IF (DAY = 'SUN')
{
}
DATE_TO_DAY
This function returns an sinteger representing the day portion of a date string.
The
S
in
SINTEGER
allows a negative value to be returned.
SINTEGER DATE_TO_DAY (CHAR LDATE[ ])
Parameters:
•
LDATE
: [Input] string containing the date in mm/dd/yyyy format.
If successful, this function returns an integer (1-31) representing the day portion
of the date string. If the specified date is invalid, this function returns -1.
SINTEGER nDaynDay = DATE_TO_DAY ('2/9/1999') // nDay = 9
DATE_TO_MONTH
This function returns an sinteger representing the month portion of a date string.
SINTEGER DATE_TO_MONTH (CHAR LDATE[ ])
Parameters:
•
LDATE
: [Input] string containing the date in mm/dd/yyyy format.
If successful, this function returns an integer (1-12) representing the month por-
tion of the date string. If the specified date is invalid, this function returns -1.
SINTEGER nMonthNMonth = DATE_TO_MONTH ('2/9/1999')
// nMonth = 2
DATE_TO_YEAR
This function returns an sinteger representing the year portion of a date string.
SINTEGER DATE_TO_YEAR (CHAR LDATE[ ])
Parameters:
•
LDATE
: [Input] string containing the date in mm/dd/yyyy format.
If successful, this function returns a 4-digit integer representing the year portion
of the date string. If the specified date is invalid, this function returns -1.
SINTEGER nYearnYear = DATE_TO_YEAR ('2/9/1999')
// nYear = 1999
DAY_OF_WEEK
This function returns the day of the week for the specified date.
SINTEGER DAY_OF_WEEK (CHAR LDATE[ ])
Parameters:
•
LDATE
: String containing the date in mm/dd/yyyy format.
This function returns an sinteger representing the day of the week (1 = Sunday,
2 = Monday, etc.).
SINTEGER nDay = DAY_OF_WEEK ('2/13/1999')
// nDay = 7 (Saturday)
DEFAULT
This keyword specifies the default case in a
SWITCH…CASE
statement.
See SWITCH...CASE on page 153.
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...