• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag
 

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Making sure the input field returns integer
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Prev by Date: Re: Perl or AppleScript ?
  • Next by Date: Get ID of items Modified with 1 month
  • Previous by thread: Re: Making sure the input field returns integer
  • Next by thread: Rick W Dawson/US/DNY is out of the office.
  • Index(es):
    • Date
    • Thread