Is it possible to have a while loop with the or (||) comparison.
I've been trying while (x != 1 || 2) and variations such as while (x != 1 || x != 2).
When I have just one statement the loop performs as normally, but when I add the second argument it seems to become an infinite loop, I've tested to make sure the variable is updating so I'm pretty sure the problem lies in my loop statement.
I'm pretty sure any valid boolean expression can be used in a while loop, and I don't see anything wrong using with your second version (x != 1 || x != 2). However I don't think that with that statement any value of x will allow the OR statement to evaluate to false, so the loop will continue forever:
x=0 = ( true || true ) = result true
x=1 = ( false || true ) = result true
x=2 = ( true || false ) = result true
x=3 = ( true || true ) = result true
Perhaps you mean to use the AND operator && which would mean the loop would break if x was either 1 or 2.
whenever ive tried to use the && operator it generates the following error:
XML parsing error: not well-formed (invalid token) (error code 4), line 59, column 23 of file.
This is a sample of the loop ive been trying to use:
OK, just checked on app.response and it's an Acrobat scripting method I wasn't familiar with. I assume that the code you have is for calling it in Acrobat scripting, as you wouldn't call it with an object which has certain properties like that in Designer.
>var Temp = 1;
>while (Temp != 2 && Temp != 3)
>Temp = app.response("Enter Temp","Testing:","");
>TextField1.rawValue = Temp;
Thanks for the help, the code is called from a button click event.
I tried out both sets of code you posted and both generate the same error I have been receiving. The line mentioned in the error is the while statement. There seems to be something about the && operator that my copy of LiveCycle doesnt like.
If you navigate to the exact Line/Column indicated by the error message, is it actually the & character there, or something else?
Yes it is the & symbol.