RE: Coercion of a string to a record label?
RE: Coercion of a string to a record label?
- Subject: RE: Coercion of a string to a record label?
- From: Robert Kiolbassa <email@hidden>
- Date: Mon, 8 Oct 2001 16:49:56 -0500
On Mon, 8 Oct 2001 22:24:02 +0200 email@hidden asked:
>
>Consider this:
>
>set myRecord to {EU:"123", US:"789"}
>
>EU of myRecord
>
>--> "123"
>
>That's easy, but I want "EU" to come from a string variable, like:
>
>set aRegion to "EU"
>
>However, I can obviously not do:
>
>aRegion of myRecord
>
>so I figured there ought to be some kind of:
>
>(aRegion as ...) of myRecord
>
>How should I accomplish what I want?
>
--heb
>
>
I think...
set myRecord to {EU:"123", US:"789"}
set aRegion to (EU of myRecord)
gives me "123"
Bob Kiolbassa
(amazed I might know an answer)