Call 47: retrieve day of week string, Call 48: retrieve day of week numeric – Rockwell Automation 1771-DB BASIC MODULE User Manual
Page 233

Chapter
Call Routines 0–68
12
12 -43
Use CALL 47 to retrieve the current day of week as a three character
string.
Input and Output Arguments
This routine has one input argument and no output arguments. The input
argument is the number of the string to receive the day of week. You must
use the STRING statement (see page 11 -37) to allocate a minimum of 3
characters/string. Strings returned are SUN, MON, TUE, WED, THU,
FRI, SAT.
Syntax
PUSH
number of string to receive the day of the week
CALL 47
Example
>10 STRING 100,3
>20 PUSH 0 : CALL 47
>30 PRINT “Today is ”,$(0)
>RUN
Today is THU
Use CALL 48 to retrieve the current day of week on the argument stack as
a number.
Input and Output Arguments
This routine has no input arguments and one output argument. The output
argument is the day of the week as a number:
G
1 = Sunday
G
5 = Thursday
G
2 = Monday
G
6 = Friday
G
3 = Tuesday
G
7 = Saturday
G
4 = Wednesday
Syntax
CALL 48
POP
day of the week (1–7)
Example
>10 REM DAY OF WEEK RETRIEVE - NUMERIC EX
>20 CALL 48: REM INVOKE UTILITY TO GET D.O.W.
>30 POP D
CALL 47: Retrieve Day of
Week String
CALL 48: Retrieve Day of
Week Numeric