I'd like to check the number entered into a text field is less than 32 on loosing focus of the field.
I've tested the below code with <> and it pops my message up correctly. I can't get < to work though and I've tried everything. I can't believe I've spent 2 hours on this!
on closeField -- make sure the user has entered a valid date
put field "dinm" into dm
if dm < 32 then
beep
answer "Maximum Days in Month is 31."
select text of me
end if
end closeField
checking text field is less than a number
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
-
- Posts: 2
- Joined: Thu Nov 29, 2012 10:01 pm
-
- Posts: 2
- Joined: Thu Nov 29, 2012 10:01 pm
Re: checking text field is less than a number
Sorry, think I'm just tired. Fixed it now without doing much different:
on closeField -- make sure the user has entered a valid date
put field "dinm" into dm
if dm > 31 then
beep
answer "Maximum Days in Month is 31."
select text of me
end if
end closeField
on closeField -- make sure the user has entered a valid date
put field "dinm" into dm
if dm > 31 then
beep
answer "Maximum Days in Month is 31."
select text of me
end if
end closeField
Re: checking text field is less than a number
Ah, the best way to learn. Sweat.
But "...without doing much different"?
Although little was changed in terms of typing, the two scripts are not at all the same in functionality. The first one was one of those forehead slappers.
Sometimes the sweat comes from simple logical or mental lapses, rather than code, syntax and vocabulary struggles. Good work. Keep at it.
Craig Newman
But "...without doing much different"?
Although little was changed in terms of typing, the two scripts are not at all the same in functionality. The first one was one of those forehead slappers.
Sometimes the sweat comes from simple logical or mental lapses, rather than code, syntax and vocabulary struggles. Good work. Keep at it.
Craig Newman