junkew Posted February 20, 2018 Share Posted February 20, 2018 Out of curiosity no real issue to fix. Can I do recursion with the ?: operators? in combination with eval, assign, execute functions Example 3 breaks whereas 1 and 2 are fine Global $j=3 ;~ Example 1 Global $trick="$j<10 ? 4 : 5" Global $j=execute($trick) consolewrite($j & @crlf) ;~ Example 2 Global $a="$j+2" Global $trick="eval(""j"")<10 ? execute(eval(""a"")) : (execute(eval(""a"")) * 5)" $j=execute($trick) consolewrite($j & @crlf) consolewrite($trick & @crlf) ;~ Example 3 Global $a="$j+2" Global $trick="eval(""j"")<10 ? (execute(eval(""a"")) + (execute(eval(""trick""))*0) ) : (execute(eval(""a"")) * 5)" $j=execute($trick) consolewrite($j & @crlf) ;~ consolewrite($x & @crlf) consolewrite($trick & @crlf) Exit Wondering if you can do something like this (pseudocode) $trick="($j=<10) ? $j=j+1 + (consolewrite($j) & @CRLF ) + execute($trick) : (consolewrite("end" & @CRLF)) I can imagine then I have to use more functions like assign, execute, eval etc. $trick="($j=<10) ? assign(""j"",execute(""j+1"")) + (consolewrite($j) & @CRLF ) + execute($trick) : (consolewrite("end" & @CRLF)) FAQ 31 How to click some elements, FAQ 40 Test automation with AutoIt, Multithreading CLR .NET Powershell CMDLets Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now