Topic: Changes to Date() command (1 of 27), Read 39 times
Conf: VEDIT Macro Library
From: Ted Green
Date: Friday, June 19, 2009 04:46 PM

I was updating some internal macros that use the Date() command and was unhappy with what I discovered. Currently in the Windows version:

Date() outputs the date according to the Country code - e.g. 06/19/2009 in the US and presumable 19-06-2009 in Europe.

That is fine in some cases, but nearly useless in macros which parse the output of the Date command, because a macro that works in the US will fail in Europe and vice versa.

Date(NORMAL) outputs as 06-19-2009 which is very STRANGE as no one uses the format of month, dash, day, dash, year.

Therefore, I am thinking of changing Date(NORMAL) to either output as 19-06-2009 or as 06/19/2009. I prefer 06/19/2009 as VEDIT is a US program and that is normal in the US. :-)

I realize that 06/19/2009 can be output by Date(NORMAL+VALUE,'/'), but that is very complex.

I could implement e.g. Date(LEFT) to output the day on the left side, e.g. 19-06-2009.

I could also implement internal values:

Date_Day - returns the day
Date_Month - returns the month
Date_Year - returns the year

Also, poorly documented is the existing Jdate():

JDate() - Return Julian date for current date
JDate("06/19/2009") date) Return Julian date for mm/dd/yyyy
JDate("19-06-2009") date) Return Julian date for dd-mm-yyyy

VEDIT's Julian date is the number of days since 01-01-0001, calculating leap years depending upon whether the year is divisible by 4,100 or 400. (It does not account for the calendar change of 1582 which dropped 10 days, but that was to compensate for the previous incorrect leap years.)

Ted.

 


Topic: Changes to Date() command (2 of 27), Read 24 times
Conf: VEDIT Macro Library
From: Ian Binnie
Date: Friday, June 19, 2009 09:28 PM

On 6/19/2009 4:46:53 PM, Ted Green wrote:
>I was updating some internal
>macros that use the Date()
>command and was unhappy with
>what I discovered. Currently
>in the Windows version:
>
>Date() outputs the date
>according to the Country code
>- e.g. 06/19/2009 in the US
>and presumable 19-06-2009 in
>Europe.

Date() here (Australia) produces 20-06-2009, which is wrong '-' should be '/'
Date(LOCAL) produces 06/20/2009, which is also wrong (month/day reversed)
I never use Date(NORMAL)

In fact I normally use ISO-8601 dates in programming etc, and Vedit does this nicely
Date(REVERSE) 2009-06-20

I remind you of the currently undocumented Num_Eval_Date(REVERSE), which I find useful.

>That is fine in some cases,
>but nearly useless in macros
>which parse the output of the
>Date command, because a macro
>that works in the US will fail
>in Europe and vice versa.

Which is why I use ISO-8601 dates, which are unambiguous. See http://www.esperanto.uklinux.net/iso8601/iso8601.php

>I could also implement
>internal values:
>
>Date_Day - returns the day
>Date_Month - returns the month
>Date_Year - returns the year

These could be handy, but better if they could work on a date value.

 


Topic: Re: Changes to Date() command (3 of 27), Read 24 times
Conf: VEDIT Macro Library
From: Christian Ziemski
Date: Sunday, June 21, 2009 04:03 PM

On 20.06.2009 03:29 vedit-macros Listmanager wrote:
> From: Ian Binnie
>
> On 6/19/2009 4:46:53 PM, Ted Green wrote:
>> I was updating some internal
>> macros that use the Date()
>> command and was unhappy with
>> what I discovered. Currently
>> in the Windows version:
>>
>> Date() outputs the date
>> according to the Country code
>> - e.g. 06/19/2009 in the US
>> and presumable 19-06-2009 in
>> Europe.
>
> Date() here (Australia) produces 20-06-2009,
> which is wrong '-' should be '/'
> Date(LOCAL) produces 06/20/2009,
> which is also wrong (month/day reversed)


These are the results running on a German Windows:

// date()
Date: 21.06.2009

// date(local)
Date: 21.06.2009

// date(normal)
Date: 06-21-2009

// date(reverse)
Date: 2009-06-21

// date(begin)
Date: 21-06-2009

They are correct.


The configuration is standard:

Config( U_DATE_FORM, "Date format (0=Locale,1-3)", 0 )
Config( U_DATE_SEP, "Date separator (0=None,30-255)", 45 )


Christian

 


Topic: Re: Changes to Date() command (4 of 27), Read 25 times
Conf: VEDIT Macro Library
From: Pauli Lindgren
Date: Tuesday, June 23, 2009 05:48 AM

On 6/21/2009 4:03:10 PM, Christian Ziemski wrote:
>
>
>Config( U_DATE_FORM, "Date format(0=Locale,1-3)", 0 )
>Config( U_DATE_SEP, "Date separator(0=None,30-255)", 45 )

Using the default configuration above, I get the following:

date()
Date: 06/23/2009

date(local)
Date: 06/23/2009

These are both wrong. The "Regional and language options" in Windows has been set to "Finnish". The date format displayed in Windows is "23.06.2009", which is what Vedit should display, too.

That is why I normally use date format 2 and date separator 46 in Vedit configuration.

Switching the language from task bar (EN / FI) has no effect.

I have English language Windows. Maybe Vedit uses the Windows language instead of the regional settings?

Or maybe Vedit uses the "Language for non-Unicode programs" setting which affects the code pages? (I can not test this just now since it requires booting the computer.)

--
Pauli

 


Topic: Re: Changes to Date() command (6 of 27), Read 23 times
Conf: VEDIT Macro Library
From: Christian Ziemski
Date: Tuesday, June 23, 2009 08:17 AM

On 6/23/2009 5:48:49 AM, Pauli Lindgren wrote:
>
>Or maybe Vedit uses the "Language for
>non-Unicode programs" setting which
>affects the code pages? (I can not test
>this just now since it requires booting
>the computer.)

I didn't know about that "non-Unicode programs" setting.

So I checked it here.
It is set to German/Germany like the normal locale setting.

I tried to change both.

The normal locale setting doesn't change VEDIT's behaviour,
but the "non-Unicode" setting does.


Christian

 


Topic: Re: Changes to Date() command (8 of 27), Read 22 times
Conf: VEDIT Macro Library
From: Ted Green
Date: Tuesday, June 23, 2009 10:02 AM

At 08:17 AM 6/23/2009, you wrote:

>The normal locale setting doesn't change VEDIT's behaviour,
>but the "non-Unicode" setting does.

Thank you for checking that. Us "ugly" Americans don't even know where to find those settings for "foreigners". :-))

In that case, I will leave the Date() command Country checking alone.

Ted.

 


Topic: Re: Changes to Date() command (9 of 27), Read 21 times
Conf: VEDIT Macro Library
From: Christian Ziemski
Date: Tuesday, June 23, 2009 02:13 PM

on 23.06.2009 16:04 vedit-macros Listmanager wrote:
> From: "Ted Green"
>
> At 08:17 AM 6/23/2009, you wrote:
>
>> The normal locale setting doesn't change VEDIT's behaviour,
>> but the "non-Unicode" setting does.
>
> Thank you for checking that. Us "ugly" Americans don't even know
> where to find those settings for "foreigners". :-))
>
> In that case, I will leave the Date() command Country checking alone.

Additionally I tested it on Windows 2000 now.

There seems to be no setting for "non-Unicode programs",
only the standard one (or I didn't find it).

And so VEDIT's date() without options or with LOCAL option seems to be
fixed to German on a German Windows, regardless of Windows' locale settings.

Interesting difference between Win2000 and XP.
Just for your info.


Christian

 


Topic: Re: Changes to Date() command (10 of 27), Read 22 times
Conf: VEDIT Macro Library
From: Ian Binnie
Date: Tuesday, June 23, 2009 10:36 PM

On 6/23/2009 2:13:26 PM, Christian Ziemski wrote:
>on 23.06.2009 16:04 vedit-macros
>Listmanager wrote:
>> From: "Ted Green"
>>
>> At 08:17 AM 6/23/2009, you wrote:
>>
>>> The normal locale setting doesn't change VEDIT's behaviour,
>>> but the "non-Unicode" setting does.
>>
>> Thank you for checking that. Us "ugly" Americans don't even know
>> where to find those settings for "foreigners". :-))
>>
>> In that case, I will leave the Date() command Country checking alone.
>
>Additionally I tested it on Windows 2000
>now.
>
>There seems to be no setting for
>"non-Unicode programs",
>only the standard one (or I didn't find
>it).

It does exist in W2K, although it isn't obvious (the Help does describe it).

Regional Options/General/Set Default is the corresponding setting, and requires re-boot.
The "Your Locale" pulldown is different and can be changed without re-boot.

The language icon on the task bar is different again, and affects the "Input Locale".

You can set System Locale / Language for non-Unicode Programs which determine OEM/ANSI Code Pages and fonts independently of other Regional Settings, which control date etc. This applies to both XP/2K.

I have Language for non-Unicode Programs set to "English (United States)" - which gives me OEM CP 437 ANSI CP 1252,
although my Regional Options are set to "English (Australia)"

I believe these settings were only introduced in W2K.

I had thought that this setting only affected console programs (which I use in both Unicode & ANSI).

It is possible vedit is using the wrong indicator to determine date format.

 


Topic: Re: Changes to Date() command (19 of 27), Read 13 times
Conf: VEDIT Macro Library
From: Ted Green
Date: Monday, July 13, 2009 05:23 PM

At 09:29 PM 6/19/2009, you wrote:
>From: Ian Binnie
>
>Date() here (Australia) produces 20-06-2009, which is wrong '-' should be '/'
>Date(LOCAL) produces 06/20/2009, which is also wrong (month/day reversed)
>I never use Date(NORMAL)

Since mm/dd/yyyy is the common format in the US, the English/Australian dd/mm/yyyy format would cause a lot of confusion. I realize that Australia is the "cooler" country and all, but there are bloody more Americans, AND other than the Japanese, most of the world would agree that you drive on the wrong side of the road. ;-)

Actually I don't know why Date(LOCAL) does not give the format you want. However, I am not going to create a documented option to create dd/mm/yyyy in VEDIT, although you could create it with the configuration date format and separator.

>In fact I normally use ISO-8601 dates in programming etc, and Vedit does this nicely
>Date(REVERSE) 2009-06-20

Great; no confusion there at atll.

>I remind you of the currently undocumented Num_Eval_Date(REVERSE), which I find useful.

Thank you. I added it to my master files today (both old style .hlp and HTML):

Num_Eval_Date(REVERSE) Evaluate a date yyyy/mm/dd or yy/mm/dd.

Here is the source code doco:

;
; Num_Eval_Date() - Return quasi Julian date for 'mm.dd.yyyy'. (ARG_O)
; Num_Eval_Date(BEGIN) - Return date for 'dd.mm.yyyy'.
; Num_Eval_Date(EXTRA) - Treat 'dd.mm.yy' as 'dd.mm.19yy'.
; Num_Eval_Date(REVERSE) - Canonical form: '[yy]yy.dd.mm'.
; Num_Eval_Date(ADVANCE) - Advance EDTPTR past expression.
; Evaluate text at EDTPTR.
; Accept any unique separator.
; Set Chars_Matched.
;
; Note: Date computed from A.D. 1 - Upto 13 days off for early centuries.
; First date is 01-01-01.
;
; N.B. Every 4th year is a leap year except when evenly divisible by
; 100 except when evenly divisible by 400.
; I.e., 1900 was not a leap year but 2000 was.

Ted.





>>That is fine in some cases,
>>but nearly useless in macros
>>which parse the output of the
>>Date command, because a macro
>>that works in the US will fail
>>in Europe and vice versa.
>
>Which is why I use ISO-8601 dates, which are unambiguous. See http://www.esperanto.uklinux.net/iso8601/iso8601.php
>
>>I could also implement
>>internal values:
>>
>>Date_Day - returns the day
>>Date_Month - returns the month
>>Date_Year - returns the year
>
>These could be handy, but better if they could work on a date value.
>
>
>
>To reply: mailto:vedit-macros.58379@webboard....
>To start a new topic: mailto:vedit-macros@webboard....
>To login: http://webboard....
>To (un)subscribe: mailto: vedit-macros.list-request@webboard....

 


Topic: Re: Changes to Date() command (21 of 27), Read 11 times
Conf: VEDIT Macro Library
From: Pauli Lindgren
Date: Tuesday, July 14, 2009 07:29 AM

On 7/13/2009 5:23:25 PM, Ted Green wrote:
>>From: Ian Binnie
>>
>>Date() here (Australia) produces 20-06-2009, which is wrong '-' should be '/'
>>Date(LOCAL) produces 06/20/2009, which is also wrong (month/day reversed)
>
>Actually I don't know why
>Date(LOCAL) does not give the
>format you want. However, I am
>not going to create a
>documented option to create
>dd/mm/yyyy in VEDIT, although
>you could create it with the
>configuration date format and
>separator.

The reason why Date(LOCAL) does not give correct format is that it uses "Language for non-Unicode Programs" setting instead of the "Standards and Formats" setting in "Regional Options" tab.

(According to Windows Help, the purpose of "Language for non-Unicode Programs" is to allow menus etc. to be displayed with correct national character set.)

Here in Finland, most people (and especially companies) use English language version of Windows. This means that "Language for non-Unicode Programs" is English by default, and Date(LOCAL) gives wrong date format.

As for the "dd/mm/yyyy" date format, there is definitely no need to have shortcut for producing that. You can always set the date separator in configuration, or use Date(BEGIN+VALUE,'/').

--
Pauli

 


Topic: Re: Changes to Date() command (22 of 27), Read 14 times
Conf: VEDIT Macro Library
From: Ted Green
Date: Tuesday, July 14, 2009 10:30 AM

At 07:30 AM 7/14/2009, you wrote:

>The reason why Date(LOCAL) does not give correct format is that it uses "Language for non-Unicode Programs" setting instead of the "Standards and Formats" setting in "Regional Options" tab.

Yes, after I wrote that I figured that out after re-reading the previous messages.

>As for the "dd/mm/yyyy" date format, there is definitely no need to have shortcut for producing that. You can always set the date separator in configuration, or use Date(BEGIN+VALUE,'/').

Agreed.

Ted.

 


Topic: Changes to Date() command (5 of 27), Read 27 times
Conf: VEDIT Macro Library
From: Pauli Lindgren
Date: Tuesday, June 23, 2009 07:37 AM

On 6/19/2009 4:46:53 PM, Ted Green wrote:
>
> Date() outputs the date
> according to the Country code
> - e.g. 06/19/2009 in the US
> and presumable 19-06-2009 in Europe.

No. In Europe, the date format is either 19.06.2009 or 19/06/2009, depending on the country. (The latter should be avoided since it causes confusion with the US format.)

The date separator '-' should be reserved for ISO date format: 2009-06-19.

>
> That is fine in some cases,
> but nearly useless in macros
> which parse the output of the
> Date command, because a macro
> that works in the US will fail
> in Europe and vice versa.

That is why the date format should always be explicitly specified in the macro, if the macro is going to parse the date string.

>
> Date(NORMAL) outputs as
> 06-19-2009 which is very
> STRANGE as no one uses the
> format of month, dash, day, dash, year.

Date(NORMAL) uses whatever date separator has been specified in the configuration.

I believe the default date separator after installing Vedit is '-'.
Maybe the default should be changed to '/'.
But of course the user can change it.

>
> Therefore, I am thinking of
> changing Date(NORMAL) to
> either output as 19-06-2009 or
> as 06/19/2009. I prefer
> 06/19/2009 as VEDIT is a US
> program and that is normal in
> the US. :-)

There is no need to change that. I think it is logical that if the macro command does not specify date separator, the configured date separator will be used.

>
> I could implement e.g.
> Date(LEFT) to output the day
> on the left side, e.g.
> 19-06-2009.

That is already implemented: Date(BEGIN)

>
> I could also implement
> internal values:
>
> Date_Day - returns the day
> Date_Month - returns the month
> Date_Year - returns the year

Those would be useful to simplify things (although you can always parse the date string with macro commands. It is more important to implement features that can not be done with macro language.)

>
> Also, poorly documented is the existing Jdate():
>
> JDate() - Return Julian date for current date
> JDate("06/19/2009") date)
> Return Julian date for mm/dd/yyyy
> JDate("19-06-2009") date)
> Return Julian date for dd-mm-yyyy

JDate("06/19/2009") works, but JDate("19-06-2009") gives error "Bad parameter".
The correct syntax seems to be:

JDate("06/19/2009")
JDate("19.06.2009", BEGIN)
JDate("2009-06-19", REVERSE)

(The separator character can be anything, it is ignored.)

Hopefully these and the other non-documented commands will be added to documentation. I would have needed these a few times. The only Julian date I found was in the command File_Stamp_Date().

>
> VEDIT's Julian date is the
> number of days since
> 01-01-0001, calculating leap
> years depending upon whether
> the year is divisible by 4,100
> or 400. (It does not account
> for the calendar change of
> 1582 which dropped 10 days,
> but that was to compensate for
> the previous incorrect leap
> years.)

And, if I am not wrong, you can get weekday with
JDate() % 7
The returned value is weekday number, 0 = Sunday. So no need to use Zeller's congruence any more!

--
Pauli

 


Topic: Re: Changes to Date() command (7 of 27), Read 25 times
Conf: VEDIT Macro Library
From: Ted Green
Date: Tuesday, June 23, 2009 09:59 AM

At 07:37 AM 6/23/2009, you wrote:
>No. In Europe, the date format is either 19.06.2009 or 19/06/2009, depending on the country. (The latter should be avoided since it causes confusion with the US format.)

Yes, "19/06/2009" should not be the Date(NORMAL) format.

>The date separator '-' should be reserved for ISO date format: 2009-06-19.

I disagree as many engineers in the US use 19-06-2009 to indicate day-month-year.

>That is why the date format should always be explicitly specified in the macro, if the macro is going to parse the date string.

Agreed, therefore I will change Date(NORMAL) to always output as 06/19/2009.
Other options can be used to output in other formats, as before.

I will implement these to make it less necessary to even use the Date() command:

Date_Day - returns the day
Date_Month - returns the month
Date_Year - returns the year

I will see if the simple Date() command can be changed to output according to the Country code setting instead of the Windows language version setting.

Ted.

 


Topic: Re: Changes to Date() command (11 of 27), Read 20 times
Conf: VEDIT Macro Library
From: Pauli Lindgren
Date: Thursday, June 25, 2009 03:32 AM

On 6/23/2009 9:59:32 AM, Ted Green wrote:
>
>I disagree as many engineers
>in the US use 19-06-2009 to
>indicate day-month-year.

They should not do that, since it is wrong. It is a mistake, just like a spelling error.
Luckily I have never met engineers who do that mistake deliberately, even if I do communicate with engineers all over the world every day.

Different date formats cause enough confusion even if you do not deliberately cause that by using wrong separators. You definitely should not encourage such behavior.

>
>Agreed, therefore I will
>change Date(NORMAL) to always
>output as 06/19/2009.

What about Date(BEGIN) and Date(REVERSE)?
I guess those will use '/', too?
The Date separator config setting will then be used only with plain Date() command?

I wonder if it would be possible to change the syntax so that you could just enter Date(REVERSE, '-') instead of Date(REVERSE+VALUE, '-')?

--
Pauli

 


Topic: Re: Changes to Date() command (12 of 27), Read 17 times
Conf: VEDIT Macro Library
From: Ted Green
Date: Thursday, June 25, 2009 09:57 AM

At 03:32 AM 6/25/2009, vedit-macros Listmanager wrote:
>From: "Pauli Lindgren"
>
>On 6/23/2009 9:59:32 AM, Ted Green wrote:
>>
>>I disagree as many engineers
>>in the US use 19-06-2009 to
>>indicate day-month-year.
>
>They should not do that, since it is wrong. It is a mistake, just like a spelling error.

I never consider a notation, grammar or spelling that millions of people use as "wrong", just different. Even spelling changes over time, especially when the original spelling appears to have been "wrong".

>Different date formats cause enough confusion even if you do not deliberately cause that by using wrong separators. You definitely should not encourage such behavior.

I do agree with you here about date format confusion!
OK, so I will change it to:

Date(NORMAL) outputs 06/19/2009
Date(BEGIN) outputs 19.06.2009
Date(REVERSE) outputs 2009-06-09

For other formats, the separator can be changed.

In that case I should change default separator Config(U_DATE_SEP) from '-' to '/'.
Not sure it is used in the Windows version, but it is used in the DOS version.

Thank you for all your feedback on this; despite the "excited" responses, I am glad I asked so that it will be improved in future versions.

Ted.

 


Topic: Re: Changes to Date() command (13 of 27), Read 17 times
Conf: VEDIT Macro Library
From: Ted Green
Date: Thursday, July 02, 2009 05:12 PM

At 09:58 AM 6/25/2009, vedit-macros Listmanager wrote:
>From: "Ted Green"
>
>I do agree with you here about date format confusion!
>OK, so I will change it to:
>
>Date(NORMAL) outputs 06/19/2009
>Date(BEGIN) outputs 19.06.2009
>Date(REVERSE) outputs 2009-06-09

OK, this has been implemented. This change also affects the Dir_Date(), File_Stamp_String(), and Num_Ins_Date() commands.

Date(LOCAL) outputs in the "locale" format, same as before; I did not change which Windows config value it checks.

A simple Date() depends upon the value of Config(U_DATE_FORM) which defaults to "0=Locale" format. Other values set DMY, MDY or YMD format with Config(U_DATE_SEP) specifying the separator. When Config(U_DATE_FORM) is set to 0, Config(U_DATE_SEP) is ignored.

Also, in the DOS version, Date(LOCAL) is now the same as Date(NORMAL).
In the DOS version, a simple Date() previously output as dd-mm-yyyy, it now outputs as mm/dd/yyyy, same as the default Windows version when running in the US.
(I know the DOS version is rarely used now, but might be the basis for the future Linux version.)

The new code is available at:

http://www..../download/vpw.exe

The new on-line help is available at:

http://www..../download/veditpw.hlp

As this has taken nearly two full days to implement and document, I'm not keen to make any other changes to it.
(I have to update two version of the code, and three versions of the on-line help.)
Actually the doco takes longer than the coding - I will of course fix any real bugs.

Ted.

 


Topic: Re: Changes to Date() command (14 of 27), Read 17 times
Conf: VEDIT Macro Library
From: Ted Green
Date: Thursday, July 02, 2009 05:24 PM

At 05:13 PM 7/2/2009, you wrote:
>From: "Ted Green"
>>Date(NORMAL) outputs 06/19/2009
>>Date(BEGIN) outputs 19.06.2009
>>Date(REVERSE) outputs 2009-06-09
>
>OK, this has been implemented. This change also affects the Dir_Date(), File_Stamp_String(), and Num_Ins_Date() commands.

Just a reminder that any macros which use these commands should be checked. I would highly suggest using Date(NORMAL) or Date(BEGIN) if the date is parsed by the macro so that it will work in different languages and countries.

Ted.

 


Topic: Re: Changes to Date() command (15 of 27), Read 15 times
Conf: VEDIT Macro Library
From: Ian Binnie
Date: Friday, July 03, 2009 12:55 AM

On 7/2/2009 5:12:11 PM, Ted Green wrote:
>>I do agree with you here about date format confusion!
>>OK, so I will change it to:
>>
>>Date(NORMAL) outputs 06/19/2009
>>Date(BEGIN) outputs 19.06.2009
>>Date(REVERSE) outputs 2009-06-09
>
>OK, this has been implemented.
>This change also affects the
>Dir_Date(),
>File_Stamp_String(), and
>Num_Ins_Date() commands.
>
>Date(LOCAL) outputs in the
>"locale" format, same as
>before; I did not change which
>Windows config value it
>checks.
>
>A simple Date() depends upon
>the value of
>Config(U_DATE_FORM) which
>defaults to "0=Locale" format.
>Other values set DMY, MDY or
>YMD format with
>Config(U_DATE_SEP) specifying
>the separator. When
>Config(U_DATE_FORM) is set to
>0, Config(U_DATE_SEP) is
>ignored.


>As this has taken nearly two
>full days to implement and
>document, I'm not keen to make
>any other changes to it.
>(I have to update two version
>of the code, and three
>versions of the on-line help.)
>Actually the doco takes longer
>than the coding - I will of
>course fix any real bugs.

The only change I see is Date(BEGIN). Date(LOCAL) is still wrong (you stated that this had not changed).

A couple of other observations:-

Num_Eval_Date(REVERSE), Num_Ins_Date(REVERSE), JDate() are still undocumented.

There is a superfluous "@" character in the following:-
"Date(NOCR) Omit the following CR+LF newline. @"

I guess this is an error in the help rtf file.
That reminds me - are you contemplating a change from .hlp format?

"Date(NORMAL) Display the current system date as mm/dd/yyyy (US standard)" is technically incorrect.
The US has adopted the ISO-8601 Standard, although I agree this is the common usage.

Date_Day etc do not work, and I guess they didn't make it into the release.

 


Topic: Re: Changes to Date() command (17 of 27), Read 14 times
Conf: VEDIT Macro Library
From: Ted Green
Date: Friday, July 03, 2009 10:08 AM

At 12:56 AM 7/3/2009, you wrote:
>From: Ian Binnie
>
>The only change I see is Date(BEGIN).

That is the most obvious change. Due to the configuration overrides and command options overrides, there are many possible combinations. I think they all work as documented now in both the Windows and DOS code.

> Date(LOCAL) is still wrong (you stated that this had not changed).

I can still look into that.

>A couple of other observations:-
>
>Num_Eval_Date(REVERSE), Num_Ins_Date(REVERSE), JDate() are still undocumented.

OK, I will add that to the doco.

>There is a superfluous "@" character in the following:-
>"Date(NOCR) Omit the following CR+LF newline. @"

OK, I will fix that.

>I guess this is an error in the help rtf file.
>That reminds me - are you contemplating a change from .hlp format?

Yes, one of my programmer's "completed" it, but I have not yet thoroughly checked it, nor implemented the context sensitive entry points. I thought I posted a preliminary one here several months ago, but perhaps I just emailed it to Pauli and Christian. I have been updating the source to this help too. I will definitely switch to this help system soon.

>"Date(NORMAL) Display the current system date as mm/dd/yyyy (US standard)" is technically incorrect.
>The US has adopted the ISO-8601 Standard, although I agree this is the common usage.

OK, I will call it "US common". :-)

>Date_Day etc do not work, and I guess they didn't make it into the release.

Correct, it is not yet implemented.

Thank you for your feedback.

Ted.

 


Topic: Re: Changes to Date() command (18 of 27), Read 14 times
Conf: VEDIT Macro Library
From: Ian Binnie
Date: Friday, July 03, 2009 10:33 PM

On 7/3/2009 10:08:34 AM, Ted Green wrote:
>At 12:56 AM 7/3/2009, you
>wrote:
>>From: Ian Binnie
>>
>>The only change I see is Date(BEGIN).
>
>That is the most obvious
>change. Due to the
>configuration overrides and
>command options overrides,
>there are many possible
>combinations. I think they all
>work as documented now in both
>the Windows and DOS code.
>
>> Date(LOCAL) is still wrong (you stated that this had not changed).
>
>I can still look into that.

Ted,

Please do not change this on my account, I reported this just as an observation.
You had stated "Date(LOCAL) outputs in the "locale" format, same as before; I did not change which Windows config value it checks".

I have Language for non-Unicode Programs set to "English (United States)" - which gives me OEM CP 437 ANSI CP 1252,
although my Regional Options are set to "English (Australia)" which would normally use OEM CP 850.

To fix this problem, you would have to change the Windows config value Vedit checks, and this would have to be different for 9x and NT+.

As I don't actually use Date(LOCAL), and very few users would change Language for non-Unicode Programs from the install setup this is not going to be a major problem.

Just for the record, I use OEM CP 437, because I write console programs - Vedit OEM font displays only OEM CP 437.
These days I mainly use OEM only for testing, and write Unicode to the console, and use an appropriate font, usually Lucida Console.
This allows me to display both ANSI & OEM, in all of the most common code pages.

 


Topic: Re: Changes to Date() command (20 of 27), Read 12 times
Conf: VEDIT Macro Library
From: Ted Green
Date: Monday, July 13, 2009 06:41 PM


>At 12:56 AM 7/3/2009, you wrote:
>From: Ian Binnie
>
>Num_Eval_Date(REVERSE), Num_Ins_Date(REVERSE), JDate() are still undocumented.

I added those to the online help master files.

Jdate (Win32 only) Return the Julian date number of
the current date, which in VEDIT is the number
of days since 01-01-0001, assuming the
Gregorian calendar and leap years.

Jdate(date) Return the Julian date number of the date
string specified in mm/dd/yyyy format, allowing
any separator character.

Jdate(date,BEGIN) Assume a date string in dd.mm.yyyy format,
allowing any separator character.

Jdate(date,REVERSE) Assume a date string in yyyy-mm-dd format,
allowing any separator character.

Notes: While the "standard" Julian date starts at
January 1, 4713 BC, in VEDIT it starts at
January 1, 0001. The Julian date on other
systems starts at January 1, 1900 or even 1980.

Every 4th year is a leap year except when
evenly divisible by 100; however, years evenly
divisible by 400 are leap years. Therefore,
1900 is not a leap year, but 2000 is.

Subtract 693596 to determine the number of days
since Jan. 01, 1900.

 


Topic: Re: Changes to Date() command (23 of 27), Read 12 times
Conf: VEDIT Macro Library
From: Ian Binnie
Date: Wednesday, August 19, 2009 08:58 PM

I was just debugging one of my macros, which stopped working.
This turned out to be due to the change to Num_Ins_Date(n,BEGIN) which now outputs '.'

I changed this to:-
Num_Ins_Date(#31,BEGIN|NOCR|VALUE,'/') // 2009-08-20 change to vedit 6.15.4

This option is not mentioned in the Help file.

 


Topic: Re: Changes to Date() command (24 of 27), Read 12 times
Conf: VEDIT Macro Library
From: Christian Ziemski
Date: Thursday, August 20, 2009 02:19 PM

On 20.08.2009 02:58 in vedit-macros Ian Binnie wrote:
>
> This turned out to be due to the change to
> Num_Ins_Date(n,BEGIN) which now outputs '.'
>
> I changed this to:-
> Num_Ins_Date(#31,BEGIN|NOCR|VALUE,'/')
> // 2009-08-20 change to vedit 6.15.4
>
> This option is not mentioned in the Help file.

As far as I know there is no help file for 6.15.4 yet?!?

The last Ted wrote about it was on 13.07.2009 23:24:
>
> Here is the source code doco:
> ;
> ; Num_Eval_Date() - Return quasi Julian date for 'mm.dd.yyyy'.
> ; Num_Eval_Date(BEGIN) - Return date for 'dd.mm.yyyy'.
> ; Num_Eval_Date(EXTRA) - Treat 'dd.mm.yy' as 'dd.mm.19yy'.

Or did I miss the real help file for 6.15.4?


Christian

 


Topic: Re: Changes to Date() command (25 of 27), Read 10 times
Conf: VEDIT Macro Library
From: Ted Green
Date: Monday, August 24, 2009 10:39 AM

At 08:58 PM 8/19/2009, you wrote:
>From: Ian Binnie I was just debugging one of my macros, which stopped working.
>This turned out to be due to the change to Num_Ins_Date(n,BEGIN) which now outputs '.'
>
>I changed this to:-
>Num_Ins_Date(#31,BEGIN|NOCR|VALUE,'/')// 2009-08-20 change to vedit 6.15.4
>
>This option is not mentioned in the Help file.

I just double checked my help file sources and it is correctly documented.
Also the new veditpw.hlp file documents it correctly:

http://www..../download/veditpw.hlp

As I mentioned before, I do not plan on directly supporting the Australian dd/mm/yyyy format; the only way to create it is as you have done with the explicit VALUE option.

Ted.

 


Topic: Re: Changes to Date() command (26 of 27), Read 10 times
Conf: VEDIT Macro Library
From: Pauli Lindgren
Date: Tuesday, August 25, 2009 04:05 AM

On 8/24/2009 10:39:51 AM, Ted Green wrote:
> From: Ian Binnie
>> I was just debugging one of my macros, which stopped working.
>> This turned out to be due to the change to
>> Num_Ins_Date(n,BEGIN) which now outputs '.'
>>
>> I changed this to:-
>> Num_Ins_Date(#31,BEGIN|NOCR|VALUE,'/')// 2009-08-20 change to vedit 6.15.4
>>
>> This option is not mentioned in the Help file.
>
> I just double checked my help
> file sources and it is
> correctly documented.
> Also the new veditpw.hlp file
> documents it correctly:
>
> http://www..../download/veditpw.hlp

I don't know which option Ian means.
BEGIN, NOCR and VALUE are all documented even in the old help file.
However, the REVERSE option is still missing from the help for Num_Ins_Date().

And I did not find JDate() in the updated help file.

--
Pauli

 


Topic: Re: Changes to Date() command (27 of 27), Read 11 times
Conf: VEDIT Macro Library
From: Ted Green
Date: Tuesday, August 25, 2009 10:04 AM

At 04:05 AM 8/25/2009, you wrote:
>BEGIN, NOCR and VALUE are all documented even in the old help file.
>However, the REVERSE option is still missing from the help for Num_Ins_Date().
>
>And I did not find JDate() in the updated help file.

I updated the help sources with these based on earlier feedback, but didn't create a new .hlp file yet.

Also, the doco for Num_Ins_Date() reads "The date has the same format and options as the Date( ) command. The most common ones are:"
And all the options are not documented, but perhaps I should do that. Bytes are almost free now. :-)

Ted.

 


Topic: Re: Changes to Date() command (16 of 27), Read 19 times
Conf: VEDIT Macro Library
From: Christian Ziemski
Date: Friday, July 03, 2009 03:20 AM


Here a 6.15.2/6.15.4 comparison on a German Windows:




=============================================================================================
VEDIT Pro (64-Bit) Ver. 6.15.2 02/04/08
Windows-Version: 501
Country setting: German/Germany

Config(U_DATE_FORM): 0 # (0=country-specific ; 1=mm-dd-yyyy ; 2=dd-mm-yyyy ; 3=yyyy-mm-dd)
Config(U_DATE_SEP): 45 # ('-')

command ; result ; expected: ; honors Config(U_DATE_SEP) ;
--------------;-------------;---------------;-----------------------------;
Date() ; 03.07.2009 ; like LOCAL ; if Config(U_DATE_FORM) > 0 ;
; ; ; ;
Date(LOCAL) ; 03.07.2009 ; dd.mm.yyyy ; no ;
; ; ; ;
Date(NORMAL) ; 07-03-2009 ; mm-dd-yyyy ; yes ;
Date(BEGIN) ; 03-07-2009 ; dd-mm-yyyy ; yes ;
Date(REVERSE) ; 2009-07-03 ; yyyy-mm-dd ; yes ;



=============================================================================================
VEDIT (32-Bit) Ver. 6.15.4 07/02/09
Windows-Version: 501
Country setting: German/Germany

Config(U_DATE_FORM): 0 # (0=country-specific ; 1=mm-dd-yyyy ; 2=dd-mm-yyyy ; 3=yyyy-mm-dd)
Config(U_DATE_SEP): 45 # ('-')

command ; result ; expected: ; honors Config(U_DATE_SEP) ;
--------------;-------------;---------------;-----------------------------;
Date() ; 03.07.2009 ; like LOCAL ; if Config(U_DATE_FORM) > 0 ;
; ; ; ;
Date(LOCAL) ; 03.07.2009 ; dd.mm.yyyy ; no ;
; ; ; ;
Date(NORMAL) ; 07/03/2009 ; mm/dd/yyyy ; no ;
Date(BEGIN) ; 03.07.2009 ; dd.mm.yyyy ; no ;
Date(REVERSE) ; 2009-07-03 ; yyyy-mm-dd ; no ;



It's o.k. for me.


Ted, you wrote:

> A simple Date() depends upon the value of Config(U_DATE_FORM) which defaults to "0=Locale" format.
> Other values set DMY, MDY or YMD format with Config(U_DATE_SEP) specifying the separator.
> When Config(U_DATE_FORM) is set to 0, Config(U_DATE_SEP) is ignored.

The last sentence should be mentioned in the online help.

Christian