search a date
yvescoppe at skynet.be
Sat Aug 3 14:51:01 EDT 2002
>>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 :
>>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
>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
As I wrote in a previous mail, this returns some errors :
some lines are in the result of the function but they are not a date.
See the function I wrote with the help of Björnke
This function works fine.
Björnke has based his code on the matchtext function.
Thank you for your help, Dan.
Email : yvescoppe at skynet.be
More information about the Use-livecode