Pick up a specified text on several card?

Sarah sarahr at genesearch.com.au
Mon May 20 05:40:08 EDT 2002


It may be that the find command is doing something weird. Try using 
lineOffset instead.
on mouseUp
   put field "date" into thisDate --here I specifies which text to look 
for
   repeat for the number of cards
     put lineOffset(thisDate, field "sessions" into lineNum
       put (line lineNum of fld "sessions") & return after thisLine
     go to next card
     if the ID of this card is 1040 then exit repeat
   end repeat
     go to card "search"
     put thisLine into field "result"
end mouseUp

BTW, this scripts will only collect data from cards between the starting 
card & card ID 1040. It might be better to specify a starting card.

Cheers,
Sarah


On Sunday, May 19, 2002, at 08:26  PM, Magnus von Brömsen wrote:

> Hi
>
> I want to collect some pecified lines of text from a field on a unknown 
> number of cards. And put that text in another field on another card.
>
> So, with this script I manage to get all the text from all the cards:
>
> on mouseUp
>   repeat for the number of cards
>     put field "sessions" after tempText
>     go to next card
>     if cardIDs is 1040 then exit repeat --this is the card there all 
> text is placed
>   end repeat
>   put tempText into field "result"
> end mouseUp
>
> If I want to specified which lines to get something goes wrong:
>
> 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
>       find thisDate
>       put the value of foundline() & return after thisLine
>     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
>
> The error is that the founded lines is repeated several times in the 
> field "result" ?? (Maybe something with the "repeat for the number of 
> cards" because the same text is repeated sometimes twice and sometimes 
> three times.) But I can't figure out the pattern.
>
> Can anyone give me a hint where to look...
>
> magnus
>
>
> --------------------------------------------------------------------------------
> "Jag lägger mig tidigt - för att snabbt få gå till jobbet. Igen."
> --------------------------------------------------------------------------------
> Studio Alice
> Magnus von Brömsen
> 0702-212 495
> 0322-633 833
> www.studioalice.se
>
> _______________________________________________
> 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