Re: Help with validating a date input to a dialog
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