• 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: "Arthur J Knapp" <email@hidden>
  • Date: 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>

>>1 Can one make any useful generalizations about the solutions

> Arthur's has my vote (without testing, that is). It uses a single string
> instead of a list (memory) and doesn't need a repeat (time). It could be
> simplied a little:
>
> 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?



> By the way, Arthur, does the 'k' stand for 'kNapp'?

I am just a scripter trying to get by in a programmer's world. ;-)

--
{
Arthur J Knapp, of STELLARViSIONs ;

http://www.STELLARViSIONs.com ;

mailto:email@hidden ;

how many?
zero.
are you sure?
i counted twice.
}


  • Prev by Date: Re: Choose from list change in AS 1.5.5
  • Next by Date: Re: Calling an Application - Again
  • 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