Page 1 of 1 1
Topic Options
#81863 - 2003-09-24 09:44 AM How about a new day numbering function?
Sigurd Erland Offline
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
#81864 - 2003-09-24 09:47 AM Re: How about a new day numbering function?
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
there is UDF for this.
and there is no "then" in kixtart.

anyways, your suggestion is awesome.
it has been asked like zillion times from the times of... well, for long time.

I vote for it too.
_________________________
!

download KiXnet

Top
#81865 - 2003-09-24 03:28 PM Re: How about a new day numbering function?
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
I vote against. [Frown]
That is what we have datemath UDFs for.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#81866 - 2003-09-24 04:14 PM Re: How about a new day numbering function?
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
I even lost count on the amount of date/time related UDFs.

Maybe create a FAQ entry with a list of all date-time-math UDFs?
_________________________
There are two types of vessels, submarines and targets.

Top
#81867 - 2003-09-24 04:24 PM Re: How about a new day numbering function?
Richard H. Administrator Offline
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 [Razz]

Top
#81868 - 2003-09-24 07:53 PM Re: How about a new day numbering function?
Jack Lothian Offline
MM club member
*****

Registered: 1999-10-22
Posts: 1169
Loc: Ottawa,Ontario, Canada
Richard,

After Les' raspberry, I knew somone was going to say something like this. I should have quessed it would be you. [Wink]

[ 24. September 2003, 20:15: Message edited by: Jack Lothian ]
_________________________
Jack

Top
#81869 - 2003-09-24 10:49 PM Re: How about a new day numbering function?
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
I just read somewhere that we have around 400 UDFs in our library. WTF, why not include all of them in KiX? Wonder how big that would bloat the EXE?

I don't think this is something everyone would use. Why have bloatware when we have UDFs for the few that may use it? First and foremost, KiX is a logon script processor. It is not a Swiss Army Knife replacement for SMS. We've seen what all the code did to SMS (Slow Moving Software).

We need a lean, mean, scripting machine.

...my two cents anyway [Frown]
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#81870 - 2003-09-25 12:31 AM Re: How about a new day numbering function?
Jack Lothian Offline
MM club member
*****

Registered: 1999-10-22
Posts: 1169
Loc: Ottawa,Ontario, Canada
Les,

I agree with you but you had to know your emphatic point of view would generate a counter response. Richard couldn't resist rising to the bait. [Smile]
_________________________
Jack

Top
#81871 - 2003-09-25 12:35 AM Re: How about a new day numbering function?
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
Everyone's entitled to an opinion, as long as it's the same as mine. [Big Grin]
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#81872 - 2003-09-25 12:46 AM Re: How about a new day numbering function?
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
...and as long as they remember that the mine is the right one [Big Grin]
_________________________
!

download KiXnet

Top
#81873 - 2003-09-25 10:28 AM Re: How about a new day numbering function?
Richard H. Administrator Offline
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 [Wink] ), 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
#81874 - 2003-09-25 10:36 AM Re: How about a new day numbering function?
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
thanks rich.
I thought I was only one (suggestion poster not counted) for this...

[ 25. September 2003, 10:36: Message edited by: Lonkero ]
_________________________
!

download KiXnet

Top
Page 1 of 1 1


Moderator:  Lonkero, ShaneEP, Jochen, Radimus, Glenn Barnas, Allen, Ruud van Velsen, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 1114 anonymous users online.
Newest Members
Viginette, ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder
17888 Registered Users

Generated in 0.061 seconds in which 0.023 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org