• 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: Help with validating a date input to a dialog
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Help with validating a date input to a dialog


  • Subject: Re: Help with validating a date input to a dialog
  • From: "Arthur J Knapp" <email@hidden>
  • Date: Sat, 31 Mar 2001 11:54:55 -0500

> Subject: Help with validating a date input to a dialog
> Date: Fri, 30 Mar 2001 16:54:54 -0800
> From: Michelle Steiner <email@hidden>

> display dialog (my setthedate("Please enter the date in format
> "mm/dd/yyyy"."))
>
> on setthedate(prompt)
> set DateToSend to (text returned of (display dialog prompt default
> answer ""))
> try
> date DateToSend
> on error
> my setthedate("Please us the correct format "mm/dd/yyyy"")

For the above, you want to say "return my setthedate...", otherwise,
the recursive call will be made to setthedate, then the script resumes
execution after the try block:

> end try
> return DateToSend

DateToSend is still "aaa"

> end setthedate

> Why is "aaa" being returned instead of "01/01/2001"?



Arthur J. Knapp
http://www.stellarvisions.com
mailto:email@hidden

Hey, check out:
http://www.AppleScriptSourceBook.com


  • Prev by Date: Re: OS X command line?
  • Next by Date: Re: is it possible to load a script library with a creation handler
  • Previous by thread: Re: Help with validating a date input to a dialog
  • Next by thread: Re: Help with validating a date input to a dialog
  • Index(es):
    • Date
    • Thread