<pre>function theDate prompt,current,default,notBefore,notAfter  repeat    get current    if it is empty then get default    ask prompt with it    if the result is "Cancel" then exit to hypercard    else if first char of it is "+" then      delete first char of it      get the seconds + it * (24*60*60)      convert it to short date      exit repeat    else if first char of it is "-" then      delete first char of it      get the seconds - it * (24*60*60)      convert it to short date      exit repeat    else if it is a number or it is not a date then      answer it && "is not a valid date!" with "Ok"    else if it < notBefore then      answer it && "is before" && notBefore && "!" with "Ok"    else if it > notAfter then      answer it && "is after" && notAfter && "!" with "Ok"    else      exit repeat    end if  end repeat  return itend theDate</pre>