#81863 - 2003-09-24 09:44 AM
How about a new day numbering function?
|
Sigurd Erland
Lurker
Registered: 2003-09-24
Posts: 2
|
What I would like to see, is a function somewhat like @YDAYNO, that instead of counting the days from January 1 the same year, counts the days from some fixed date in the past, like e.g. 1900/01/01, or whatever day sufficiently far away in the past.
My problem right now is that I need to compare two dates, and if one date is more than a specific number of days later than the other, I should execute some command. Right now I compare each part of the date, using a lot of if's and then's, but it would have been much easier if I could use a function, call it XYZ, doing something like this:
if XYZ($date1) - XYZ($date2) > "number of days" "do some stuff" endif
|
|
Top
|
|
|
|
#81867 - 2003-09-24 04:24 PM
Re: How about a new day numbering function?
|
Richard H.
Administrator
   
Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
|
quote: I even lost count on the amount of date/time related UDFs.
Yeah, there are quite a few.
As it's such a useful facility, maybe it's about time it became an intrinsic function?
Hang on - we've gone full circle
|
|
Top
|
|
|
|
#81873 - 2003-09-25 10:28 AM
Re: How about a new day numbering function?
|
Richard H.
Administrator
   
Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
|
We didn't need Ascan(), multi-dimension arrays, IIF(), the C* functions, doubles or even user defined functions as there has always been non-intrinsic ways of achieving the same thing (except doubles ), and these are even less appropriate for a lean mean login processor.
The ability to convert a date (and/or time) to a consistent internal format and back again is extremely useful. The popularity of the request in suggestions, the number of UDFs to do it and the high ranking of the date functions on the ScriptLogic site demonstrate this.
It's basic functionality that I'd like to see built-in, which is why it gets my vote.
Les, I do agree with you about bloat. I think that KiXtart is already far too large.
I don't know what can be done about the size - running "strip" against the code reduces it by about 3K, which isn't all that significant.
Perhaps we need a lightweight "runtime" version which can only run pre-parsed (tokenised) code, or maybe unload some of the more esoteric functionality into modules which are only loaded if needed. Need a new discussion thread for this methinks as it is starting to veer OT.
|
|
Top
|
|
|
|
Moderator: Lonkero, ShaneEP, Jochen, Radimus, Glenn Barnas, Allen, Ruud van Velsen, Mart
|
0 registered
and 1024 anonymous users online.
|
|
|