Re: accessing a record by variable
Re: accessing a record by variable
- Subject: Re: accessing a record by variable
- From: Olof <email@hidden>
- Date: Tue, 13 Feb 2001 12:54:29 -0800
For the hardy hacker:
to getKeyFromRecord(aKeyString, aRecord)
try
(aRecord as text)
on error message
set recordText to text 12 thru -15 of message
end try
set keyPhrase to (aKeyString & " of " & recordText)
try
set sr to run script keyPhrase
on error
error ("Can't get " & keyPhrase)
end try
return sr
end getKeyFromRecord
set listOfMonths to {jan:1, feb:2, mar:3}
getKeyFromRecord("jan", listOfMonths)