Pick up a specified text on several card?
Magnus von Brömsen
webmaster at studioalice.se
Wed May 22 01:37:01 EDT 2002
Sarah, Jim & John
I tried your tip Sarah, but that gave me some strange result. No line
was repeated but I got blank lines and not all the lines where founded
that should.
So, I went back to the part of the script that I know was working:
on mouseUp
put field "date" into thisDate
repeat for the number of cards
put field "sessions" after tempText
go to next card
if cardIDs is 1040 then exit repeat
end repeat
....
Allright, now I have all text from field "sessions" in the variable
tempText -- and added this script:
repeat for each line xLine in tempText
if thisDate is in xLine then --this one is new for me
put xLine & return after rightLine
end if
end repeat
put rightLine into field "result"
end mouseUp
And hold my breath.
Works great!
It was the first time I tried "if thisDate is in xLine then". Earlier I
have tried e.g "if word 1 is thisDate" - but I always got an error
"Double binary... something".
Jim, I'm a Newbie too, so your input about FIND was interesting for me.
I have bought some used books about HyperCard so I can learn to "think
HyperCard".
Thanks for all help.
Magnus
On Tuesday, May 21, 2002, at 07:33 , John Cuccio wrote:
>>
>
> -----------------
>
> on mouseUp
> put field "date" into thisDate --here I specifies which text to look
> for
> repeat for the number of cards
> put field "sessions" into tempText
>
> repeat for each line xLine in tempText
> if matchtext(xline,thisdate) = true then
> put xline & return after thisline
> end if
> end repeat
> go to next card
> if cardIDs is 1040 then exit repeat
> end repeat
> go to card "search"
> put thisLine into field "result"
> end mouseUp
>
> Since you are checking each line in your repeat loop then a matchtext
> does
> better. Foundline is better for founding items on multi card in a stack.
>
> Hope this helps.
>
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> http://lists.runrev.com/mailman/listinfo/use-revolution
>
More information about the use-livecode
mailing list