Re: Making sure the input field returns integer
Re: Making sure the input field returns integer
- Subject: Re: Making sure the input field returns integer
- From: "Marc K. Myers" <email@hidden>
- Date: Mon, 17 Mar 2003 17:54:22 -0500
Date: Mon, 17 Mar 2003 11:44:39 -0800
Subject: Making sure the input field returns integer
From: email@hidden (Guillaume Iacino)
To: <email@hidden>
Hi,
Does someone has an example of an input field that only accepts
integer (no
string or decimal number).
display dialog "Please enter number" default button "OK"
set NumberResult to (text returned of result)
Thank you in advance for your help.
Guillaume
How about this?
repeat
set theRslt to text returned of (display dialog "Enter an integer:"
default answer "0")
try
set theNbr to (theRslt as integer)
exit repeat
on error
display dialog "That wasn't an integer!"
end try
end repeat
display dialog "The integer is " & (theNbr as text)
Marc [03/17/03 5:54:03 PM]
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.