>and to check it i typed GetDayOfWeek(3) into the message window but a
>"Handler not defined" error was coming
>Can anybody tell me what is the problem ?

Your handler is good, maybe you have line breaks in there or 
something like that. Here's your script as it was in my movie:

on GetDayOfWeek(whichDay)

 
daysofWeek=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]
   if((whichDay>count(daysofWeek)) OR (whichDay<1)) then
     alert "Index out of range:"&&whichDay&".Please enter a number from 1 to 7"
     halt
   else
     days=daysOfWeek[whichDay]
   end if
   return days
end


I fixed the spelling for Thursday, but otherwise it's like yours, 
with any extra returns removed first.

You could shorten the routine a bit:

on GetDayOfWeek whichDay
   if whichDay < 1 or whichDay > 7 then
     alert "Index out of range:"&&whichDay&". Please enter a number from 1 to 7"
     halt
   else
     return item whichDay of 
"Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday"
   end if
end

-- 

[To remove yourself from this list, or to change to digest mode, go to
http://www.penworks.com/LUJ/lingo-l.cgi  To post messages to the list,
email [EMAIL PROTECTED]  (Problems, email [EMAIL PROTECTED])
Lingo-L is for learning and helping with programming Lingo.  Thanks!]

Reply via email to