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

Programming language
Table of Contents

Advertisement

Reserved Identifiers
Keywords & Run-Time Library Functions (Cont.)

DATE

DAY

DATE_TO_DAY

DATE_TO_MONTH

DATE_TO_YEAR

DAY_OF_WEEK

DEFAULT

112
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.
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')
{
}
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')
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
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
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)
This keyword specifies the default case in a SWITCH...CASE statement.
See SWITCH...CASE on page 153.
NetLinx Programming Language Reference Guide
// nDay = 9

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Netlinx studio 2

Table of Contents