• 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: Accessing a Record by variable--the solutions
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Accessing a Record by variable--the solutions


  • Subject: Re: Accessing a Record by variable--the solutions
  • From: Nigel Garvey <email@hidden>
  • Date: Fri, 16 Feb 2001 09:46:07 +0000

"Arthur J Knapp" wrote on Thu, 15 Feb 2001 12:52:31 -0500:

>> Subject: Re: Accessing a Record by variable--the solutions
>> Date: Wed, 14 Feb 2001 21:38:25 +0000
>> From: Nigel Garvey <email@hidden>

>> property kStrMonths : "DumJanFebMarAprMayJunJulAugSepOctNovDec"
>
> Darn, I know this trick too. :)
>
>> on monthIndex(mon) -- Note, mon must be case-sensitive
>> return (offset of mon in kStrMonths) div 3
>> end monthIndex
>>
>> set theMonth to "Feb"
>> monthIndex(theMonth)
>>
>> ... and (for form's sake) kStrMonths would ideally be set as a local
>> variable within the handler.
>
> Now, who can modify this basic technique just enough to work with
>the slightly less case-sensitive string:
>
> property kStrMonths :
>"...JanjanFebfebMarmarApraprMaymayJunjunJuljulAugaugSepsepOctoctNovnovDecdec
>"
>
> or something like it?

property kStrMonths : "umanebarprayunulugepctovec"

on monthIndex(mon) -- Note, text 2 thru 3 of mon must be lower case
return (offset of (text 2 thru 3 of mon) in kStrMonths) div 2
end monthIndex

set theMonth to "Feb" -- or "feb" or "February", etc....
monthIndex(theMonth)

NG


  • Prev by Date: RE: WHEN WILL THE LIST SERVER BE FIXED?
  • Next by Date: Re: OSAX correcting my script
  • Previous by thread: Re: Accessing a Record by variable--the solutions
  • Next by thread: Re: Accessing a Record by variable--the solutions
  • Index(es):
    • Date
    • Thread