search a date

Dan Shafer dan at danshafer.com
Sat Aug 3 13:49:01 EDT 2002


>Hi,
>
>can someone help me to write a function.
>
>I have a text in a variable : textToSearch
>
>each line of the text contains text and numbers
>some lines of the text contains a date in the systemFormat
>(for me in French format : DD/MM/YY)
>I'd like to extract only the dates
>
>the function should return :
>12/12/00
>25/01/01
>30/03/01
>15/06/01...
>
>and this dates are extract from my text
>
>Note : where a line contains a date, this line contains only a date 
>and no ohter data

Just use the "is a" operator. Read a line of text inside the loop and 
find out if it is a date. If so, add it to your list. Something like:

repeat for i = 1 to the number of lines in foo
   if line i of foo is a date then
     -- add it to your list
   end if
end repeat

>Thanks.
>--
>Greetings.
>
>Yves COPPE
>
>Email : yvescoppe at skynet.be
>_______________________________________________
>use-revolution mailing list
>use-revolution at lists.runrev.com
>http://lists.runrev.com/mailman/listinfo/use-revolution


-- 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Dan Shafer
Writer, Spiritual Student and Teacher
Founder, Fellowship of One Mind, Monterey, CA
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~



More information about the Use-livecode mailing list