search a date
rcozens at pon.net
Sun Aug 4 13:04:01 CDT 2002
>can someone help me to write a function.
The first solution posted on the List should work for you, as I
assume you know in advance that all dates are valid.
The solution using "if ... is a date" is not reliable if you have
lines of whole numbers because any integer is a date (in seconds).
If you wish to incorporate Serendipity Library into your application you could:
start using stack "Serendipity Library.rev"
put empty into dateList
repeat for each line textLine in textToSearch
if validDate(textLine) then put textLine&return after dateList
One warning: if the dates are generated with a different system date
format, validDate will reject them; so this solution only works if
you know that the dates in textToSearch are in the same format as is
set in the computer when the handler is run.
If you want to store dates in a stack, text file, (or SDB Database),
and be able to display or manipulate them correctly when the system
date format changes, they should be stored in seconds or dateItems
format and converted to short dates for display only.
CCW, Serendipity Software Company
"And I, which was two fooles, do so grow three;
Who are a little wise, the best fooles bee."
from "The Triple Foole" by John Donne (1572-1631)
More information about the use-livecode