Topic: Display Dates with day of week (1 of 3), Read 27 times
Conf: VEDIT Macro Language Support
From: Ted Green
Date: Monday, May 23, 2005 07:05 PM

The following macro will display the current date with the day of week ("Monday", "Tuesday", etc.)

//
// Macro to display current date as e.g:
//
// Monday, 05/23/2005
//

Out_Reg(9) Date(NOMSG+NOCR) Out_Reg(0) //Get date string into @9
#9 = Jdate(@9) //Convert date to Julian date

if (#9%7==0) { Message("Sunday") }
if (#9%7==1) { Message("Monday") }
if (#9%7==2) { Message("Tuesday") }
if (#9%7==3) { Message("Wedsday") }
if (#9%7==4) { Message("Thursday") }
if (#9%7==5) { Message("Firday") }
if (#9%7==6) { Message("Saturday") }

Message(", ")
Reg_Type(9)

------------------------------------------------------------

The Jdate() command does not appear to be documented:

JDate() - Return Julian date for current date.
JDate(date) - Return date for "mm.dd.yyyy".
Accept any unique separator.
JDate(date,BEGIN) - Return date for "dd.mm.yyyy".

Ted.

 


Topic: Re: Display Dates with day of week (2 of 3), Read 29 times
Conf: VEDIT Macro Language Support
From: Christian Ziemski
Date: Tuesday, May 24, 2005 04:06 AM

On Mon, 23 May 2005 19:05:00 -0400, Ted Green wrote:

>The following macro will display the current date with the day of week
>("Monday", "Tuesday", etc.)
>...
>Out_Reg(9) Date(NOMSG+NOCR) Out_Reg(0) //Get date string into @9
>...

IMHO it would be better to change the above line to:

>Out_Reg(9) Date(NORMAL+NOMSG+NOCR) Out_Reg(0) //Get date string in US format into @9

This way it doesn't matter which local format the user has set in his
configuration for dates.
Otherwise JDate() may complain about a wrong format ("BAD PARAMETER").


Christian

 


Topic: Re: Display Dates with day of week (3 of 3), Read 29 times
Conf: VEDIT Macro Language Support
From: Fritz Heberlein
Date: Tuesday, May 24, 2005 05:56 AM

Thanks Christian! I tried it five minutes ago, and indeed, it complained
...