More about @For loops

I can’t get several features to work inside loops - help!

Something as simple as REM.

Outside the loop, REM works …

FIELD rs:=rs;

REM {@Setfield(“rs”;@Deletefield)};

@For(n := 1;

n <= @Elements(rs);

n := n + 1;

@StatusBar(@Text(n))

)

but put the REM inside the loop (before the @StatusBar line), and you’ll get a compiler error “missing semicolon REM”.

Also - @MailSend doesn’t work inside the same loop.

Please help - I’m hoping for much better results from R6!

Subject: more about @For loops

WRT {REM} you can’t put a Rem inside a function. putting the Rem inside an @For loop would be like trying to put a Rem inside an @SetField, or @dialogbox etc.

WRT {@MailSend} I have not tried to run @mailSend inside a loop, but I can understand why you would want to do it. I can only recommend using LS instead.

Subject: RE: more about @For loops

Your comment about REM is very clever - I would never have thought of it that way, but of course you’re 100% correct. Pity, though. It makes constructing and debugging loops much harder!

About the @MailSend - it’s indeed a very sad thing if this can’t work - would be a strong tool.

Subject: RE: more about @For loops

late response … who needs a REM anyway?

try putting this in a button:

@For( i:=1; i<5; i:=i+1;

“for documenting your code, you can always put any comments in quotes that you want”;

@Prompt([Ok]; @Text(i); @Text(i))

)