Re: Record/List Coercion
Re: Record/List Coercion
- Subject: Re: Record/List Coercion
- From: "Mark J. Reed" <email@hidden>
- Date: Tue, 29 Apr 2008 21:01:20 -0400
Once more, with feeling: Records are not associative arrays.
They're records. Like the kind you get Pascal/Modula/Ada "record"
keyword. Like C "structs". You'll note that those languages don't
have any kind of "loop through a record" construct either. The labels
are strictly a compile-time thing, not runtime "keys" used too look
the values up. You, the programmer, are expected to know, when you
write the program, exactly what fields the record has, which makes
introspection of the sort under discussion unnecessary.
If you simply must loop through a list of values, you can construct
the list manually:
tell myRecord to set myList to { myField1, myField2, myField3, .... }
and then you get the fields in whatever order you choose.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden