Repeat for each assistance.

Dan Friedman dan at clearvisiontech.com
Sun Aug 3 11:22:00 EDT 2003


Andy,

Just insert your own counter:

on checkItemCount
  put 0 into tCounter
  repeat for each line gameLine in fld "gamelist"
    add 1 to tCounter
    if the number of items in gameLine <> 5 then
      answer (something)
      set the hilitedLines of field "gameList" to tCounter
      exit checkItemCount
    end if
  end repeat
end checkItemCount

Hope that helps.


> Message: 10
> From: "fatal error" <foxcat at comcast.net>
> To: <use-revolution at lists.runrev.com>
> Subject: Repeat for each assistance.
> Date: Sat, 2 Aug 2003 15:06:26 -0400
> Reply-To: use-revolution at lists.runrev.com
> 
> I have the following loop statement:
> 
> repeat for each line gameLine in fld "gamelist"
> 
> I need to obtain the line number for the current iteration. I'm error
> checking for the number of items in gameLine and if it isn't equal to 5, I
> want to raise an answer dialog and stop the script, then hilight that line
> in fld "gameList".
> 
> It has only been two days of my trial.
> 
> What can I query to get the iteration number of this loop?
> 
> Perhaps I'd be better off using a different repeat construct?
> 
> Thanks,
> 
> Andy




More information about the use-livecode mailing list