Day

lord_icon

Member
O E 10 (Windows),
I can not remember is there a Progress quick way of finding the day (string) from an integer. Eg 5 = Friday, I know you can do the reverse simply enough, do I have to do this long hand. Eg Substring a csv, or case the value.
TIA
 
I don't know if this way is very useful, but I like to do this with a simple array:

Code:
DEFINE VARIABLE cDay AS CHARACTER EXTENT 7 
        INIT ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday",  "Friday", "Saturday"] NO-UNDO.
 
DISPLAY cDay[WEEKDAY(TODAY)].

Tho in this example Friday has the value 6, as stated in the WEEKDAY function documentation.

Greetings
Mav
 
There's no function.

Use an array.

DEF VAR day-name AS CHAR NO-UNDO INIT "Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday".


There is a program in src/samples which returns the weekday (string form) for a given date: dayname.p

Lee
 
Back
Top