AutoIt simulate new script line

Posted by Renato Böhler on Stack Overflow See other posts from Stack Overflow or by Renato Böhler
Published on 2012-08-31T21:28:04Z Indexed on 2012/08/31 21:38 UTC
Read the original article Hit count: 238

Filed under:
|
|
|

I need some way to loop in a single line.

Is there a way to simulate new lines in AutoIt? Because if I try

While 1 MsgBox (0,1,2) Wend

It will not work. So I was wondering if there is a way to simulate a new line, something like

While 1 - MsgBox (0,1,2) - Wend

Or some function to do this. I also already tried to make this:

Func repeat($func, $limit)
    $i = 0
    While $i <= $limit
            Execute($func)
            $i = $i + 1
    WEnd
EndFunc

But it only executes Execute($func) once, even if I change While $i <= $limit for While 1.


I have tried

Execute("While $i <= 5" & @LF & "MsgBox(0, 1, 24)" & @LF & "$i = $i + 1" & @LF & "WEnd")

too, it doesn't work even if I change @LF for @CRLF, @CR, Chr(13), \n, \r...


Any ideas?

© Stack Overflow or respective owner

Related posts about function

Related posts about loops