Repeat question

Roger.E.Eller at sealedair.com Roger.E.Eller at sealedair.com
Tue May 4 14:43:54 EDT 2010


On 05/04/2010 at 02:15 PM, Steve Jones wrote:
> An area I never mastered with SuperCard and still have
> trouble with in RR is using the repeat control structure...
> I want to check every field on a card before it closes
> to be sure none are EMPTY. I know the structure would be
>
> REPEAT for the number of fields on the card
>    if field 1 is empty
>       put up an alert
>    else
>       go to next field
>    end if
> end repeat
>
> or something similar.
> How do I refer to the fields?  Their IDs aren't sequential
> and there names aren't "numbered".
>
> Thanks!
>
> Steve

on mouseUp
   REPEAT with i = 1 to the number of fields of this card
      if field i is empty then
         answer "Field" && (the name of fld i) && "is empty!"
      end if
   end repeat
end mouseUp

~Roger Eller




More information about the Use-livecode mailing list