EasyManua.ls Logo

AMX NETLINX PROGRAMMING LANGUAGE - Date; Day; Date_To_Day; Date_To_Month

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

Table of Contents

Related product manuals