Numeric value into text field returns un-desired response
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
Numeric value into text field returns un-desired response
on closefield
put me
if me is an integer then
if me < 500 or me > 5000 then
put empty into me
answer "Please enter a value between 500 and 5000" with "OK then"
end if
end if
end closefield
My problem here is that I have to use the exit mouseUp handler and I am not allowed to since livecode returns a fault. Normally I could say exit mouseUp so that th emessage box does not appear with the number that I entered. But I get this:
field "pixels": compilation error at line 10 (exit: bad destination expression) near "mouseUp", char 1
put me
if me is an integer then
if me < 500 or me > 5000 then
put empty into me
answer "Please enter a value between 500 and 5000" with "OK then"
end if
end if
end closefield
My problem here is that I have to use the exit mouseUp handler and I am not allowed to since livecode returns a fault. Normally I could say exit mouseUp so that th emessage box does not appear with the number that I entered. But I get this:
field "pixels": compilation error at line 10 (exit: bad destination expression) near "mouseUp", char 1
Re: Numeric value into text field returns un-desired respons
Hi Chris,
Not following on this one.
What should it not do?
Simon
Not following on this one.
What should it not do?
Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!
Re: Numeric value into text field returns un-desired respons
Hi Chris,
I am also a bit clueless, but if you want to exit a "closefield" handler, just do so:
...
exit closefield
...
Syntax is:
exit (name of the current handler*** that you are currently in and want to leave)
*** Be it mouseup, mousedown, closefield, closestack, opencard, scrollbardrag, your_handler_name_here ...everything
Best
Klaus
I am also a bit clueless, but if you want to exit a "closefield" handler, just do so:
...
exit closefield
...
Syntax is:
exit (name of the current handler*** that you are currently in and want to leave)
*** Be it mouseup, mousedown, closefield, closestack, opencard, scrollbardrag, your_handler_name_here ...everything

Best
Klaus
Re: Numeric value into text field returns un-desired respons
Hi.
Did you try to put a line like:
exit mouseUp
in the middle of the closeField handler? Thinking that this is a way to exit that handler? In that case Klaus nailed it. But without the full text of the handler, this is all guesswork. And Klaus alluded to what you should have written, but we will wait to see what you post back.
Craig
Did you try to put a line like:
exit mouseUp
in the middle of the closeField handler? Thinking that this is a way to exit that handler? In that case Klaus nailed it. But without the full text of the handler, this is all guesswork. And Klaus alluded to what you should have written, but we will wait to see what you post back.
Craig
Re: Numeric value into text field returns un-desired respons
Hi, exiting the closefield handler was taking the user to the next step despite the code that declared that if the user typed in less than a certain integer an answer box appeared telling the user to type a number above a certain amount, after the answer box was declared the user was taken to the next step when he should not have been. This problem is now solved. Thankyou Klaus, and thankyou Simon. Thanks dunbarx. Simon kindly offered me this piece of code which solved the problem: focus on button "continue"
Re: Numeric value into text field returns un-desired respons
Hi Klaus, Craig,
Chris had written an "on closeField" handler that wasn't being triggered because the focus never left the field when clicking on a button. We just added a line to focus on something else.
After some more testing I realize now that it could have been fixed by selecting "Focus with keyboard" in the button inspector.
Simon
Chris had written an "on closeField" handler that wasn't being triggered because the focus never left the field when clicking on a button. We just added a line to focus on something else.
After some more testing I realize now that it could have been fixed by selecting "Focus with keyboard" in the button inspector.

Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!
Re: Numeric value into text field returns un-desired respons
Hi Simon,
Best
Klaus
AHA! Go figure!Simon wrote:Hi Klaus, Craig,
Chris had written an "on closeField" handler that wasn't being triggered because the focus never left the field when clicking on a button.

Best
Klaus