aldweb

Close I. aldweb

Close II. PC Freeware

Close III. Palm Freeware

Close IV. Palm Shareware

Close V. iziBasic Palm

Close VI. Palm Knowledge

Close VII. Pocket Computer

Close VIII. miniPortail

Special !



Mobile version of
the aldweb Site

m.aldweb.com


Neither French, nor English?

Try one of these flags then:
[de] [es] [it] [pt]
Search




Weather / Spam / www

Lyon Weather


aldweb against spam


Newsletter
To receive news about this website, consider subscribing to our Newsletter.
Subscribe
Unsubscribe
298 Subscribers
Family's web sites

Webmaster - Infos
Friends News
Visits

   visitors

   visitors online

Poll
What do you think of the new design of the aldweb Site?
 
Great !
Beautiful
Average
So ugly...
Results
forum.gifForum - iziBasic - Topic #994

Forum - Forum
iziBasic - iziBasic


Warning: A non-numeric value encountered in /web5/aldweb/www/aldweb_com/www/thread.php on line 257

active  Topic # 994  Date Comparison

24/11/2004 @ 22:22
by Mike Featherstone

Anonymous



Before I go and write an overly complex routine to do this (), does anyone know of a simple way of comparing a pair of iziBasic date strings and determining which is the earlier?

Thanks

Mike
  Post an answer  Top

[]   


Warning: A non-numeric value encountered in /web5/aldweb/www/aldweb_com/www/thread.php on line 497
Answer nฐ 1
--------
24/11/2004 @ 23:05
by aldweb

Anonymous

visitor
Hello Mike,

Nice to see you here

The easy way to compare two dates is to put them in this format:
YYYYMMDD (Year Month Day)
And if you want to compare time also:
YYYYMMDDHHmmss (Year Month Day Hour Minute Second)

Example:
' get 24/11/2004 today
D$­ญญญ=DATE$­ญญญ
' transform to 20041124
A$­ญญญ=RIGHT$­ญญญ(D$­ญญญ,4)+MID$­ญญญ(D$­ญญญ,4,2)+LEFT$­ญญญ(D$­ญญญ,2)


Now, you can compare it with any other date formated the same way.
Example:
B$­ญญญ="20041201"
IF A$­ ญญญ< B$­ญญญ THEN
PRINT "Normal!"
ELSE
PRINT "Strange..."
ENDIF


I hope my answer helps you

Cheers,

@+
aldweb
Write to aldweb   Post an answer  Top

Warning: A non-numeric value encountered in /web5/aldweb/www/aldweb_com/www/thread.php on line 497
Answer nฐ 2
--------
24/11/2004 @ 23:56
by Mike Featherstone

Anonymous

visitor
Thanks.

I thought that was the format to use but string manipulation has never been my strong point and I couldn't think my way through it.

I would have ended up with a series of integer conversions - doing things the *very* long way round.


Having written a review that said 'I have a use for iziBasic', I thought it time to go and use it for real!
  Post an answer  Top

Warning: A non-numeric value encountered in /web5/aldweb/www/aldweb_com/www/thread.php on line 497
Answer nฐ 3
--------
25/11/2004 @ 22:07
by aldweb

Anonymous

visitor
I think that it is worth writing it for our friendly iziBasic fellows, Mike's great review is here:
http://www.clieuk.co.uk/izibasic.shtml/

Thanks again Mike for this review. For me, this is a great reward to my work.

Cheers

@+
aldweb
Write to aldweb   Post an answer  Top

Warning: A non-numeric value encountered in /web5/aldweb/www/aldweb_com/www/thread.php on line 497
Answer nฐ 4
--------
26/11/2004 @ 05:20
by Chuck

Anonymous

visitor
I tried similar date manipulation and the MID$­­ function kept returning a null string. I worked around it by using LEFT$­­ to cut off the string on the right and then RIGHT$­­ to pick off the part I needed.
  Post an answer  Top

Warning: A non-numeric value encountered in /web5/aldweb/www/aldweb_com/www/thread.php on line 497
Answer nฐ 5
--------
26/11/2004 @ 21:50
by Mike Featherstone

Anonymous

visitor
You're right - 24/04/2004 is returning 200424 rather than 20040424. MID$­­ seems to be malfunctioning.
Write to Mike Featherstone   Post an answer  Top

Warning: A non-numeric value encountered in /web5/aldweb/www/aldweb_com/www/thread.php on line 497
Answer nฐ 6
--------
26/11/2004 @ 21:53
by aldweb

Anonymous

visitor
Thank you guys for the information.
I will check for the bug and work on a fix.

Cheers

@+
aldweb
Write to aldweb   Post an answer  Top

Warning: A non-numeric value encountered in /web5/aldweb/www/aldweb_com/www/thread.php on line 497
Answer nฐ 7
--------
26/11/2004 @ 23:19
by aldweb

Anonymous

visitor
MID$­ญญ is running fine.
It is just a misunderstanding and my own initial mistake given in my sample source code when answering to Mike.

Structure is:
MID$­ญญ(var$­ญญ,1st character,last character)
and not
MID$­ญญ(var$­ญญ,1st character,nb of characters)

So, my example becomes:
' get 24/11/2004 today
D$­ญญญญญญ=DATE$­
ญญญญญญ' transform to 20041124
A$­ญญญญญญ=RIGHT$­ญญญญญญ(D$­ญญญญญญ,4)+MID$­ญญญญญญ(D$­ญญญญญญ,4,5)+LEFT$­ญญญญญญ(D$­ญญญญญญ,2)


Sorry for the mistake.

@+
aldweb
Write to aldweb   Post an answer  Top

Warning: A non-numeric value encountered in /web5/aldweb/www/aldweb_com/www/thread.php on line 497
Answer nฐ 8
--------
26/11/2004 @ 23:32
by aldweb

Anonymous

visitor
Me again: I just checked and I can tell that last character is not BASIC's standard. I will change this to nb of characters in next release.

So, at the end, it's my mistake anyway

@+
aldweb
Write to aldweb   Post an answer  Top

Warning: A non-numeric value encountered in /web5/aldweb/www/aldweb_com/www/thread.php on line 497
Answer nฐ 9
--------
26/11/2004 @ 23:38
by Mike Featherstone

Anonymous

visitor
Thanks for the help. I'll use the iziBasic standard for now!
Write to Mike Featherstone   Post an answer  Top
active topic active   closed topic closed   Sticky Sticky   New New message   -   Correct Correct message   Close Close topic   Make sticky Make sticky
[]
Forum Topic  Forum 



 
^ Top ^