newbie script question re Find command
Joe Lewis Wilkins
pepetoo at cox.net
Tue Mar 22 17:57:31 EDT 2011
I would start with a repeat that would go through all of your cards;
When you are on a card put the field in question into a cdVar;
parse the cdVar, finding the first instance of the string; put that instance into a var; delete the part of the cdVar through that point;
find another, etc., etc. once the cdVar is empty go to the next card and repeat the whole thing over again.
Just start writing, you'll get the idea as you complete the script
Hope this helps. I don't believe in writing the script for you. That's how you'll learn.
Joe Lewis Wilkins
Architect & Director of Product Development for GSI
On Mar 22, 2011, at 2:31 PM, Timothy Miller wrote:
> I guess I never tried to write a script like this before. Thought it would be simple... Well, it is simple, probably, just not simple in a way that I actually understand.
> How do I find multiple instances of a string in a given field of a given card and record each foundchunk in a variable, and then stop repeating the find command when the last instance is found?
> I want to do this in the context of a repeat loop that goes to all the cards in the stack in sequence.
> Sooo, I also need to know... How do I tell the repeat loop to move on to the next card:
> - if no instance of the string is found on the card
> - and
> - after the last instance of the string is found on the card
> Hope that's clear.
> I understand I'll probably want to nest a repeat loop using the find command on each card, with exits when certain conditions are met. I'm choking on the details.
> I don't need a complete and accurate script. Just the general idea.
> Thanks in advance.
> Tim (the world's oldest newbie)
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
More information about the Use-livecode