• 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
Translate a code of 2 characters to a text
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Translate a code of 2 characters to a text


  • Subject: Translate a code of 2 characters to a text
  • From: Olivier Berquin <email@hidden>
  • Date: Tue, 07 May 2002 09:29:04 +0200

Hi all,

I will receive a database wich contains about 9 fields. In one of these
fields, I have a 'code', like this:
CD, DVD, VHS, ...
I have about 80 'codes'. I must 'translate' this code in text like this:
CD = COMPACT DISC,
DVD = DIGITAL VERSATILE DISC
...

How can I 'translate' this code.
I wrote this (with 6 codes):

--
property ListOfMedia : {{"CD", "COMPACT DISC"}, ,
{"SA", "SUPER AUDIO"}, ,
{"MD", "MINI DISC"}, ,
{"MC", "MUSICASSETTE"}, ,
{"VH", "VIDEO"},,
{"DV", "DIGITAL VERSATILE DISC"}}

repeat with TheCounter from 1 to 6
if TheTypeOfMedia = item 1 of item TheCounter of ListOfMedia then
set TheTypeOfMedia to item 2 of item TheCounter of ListOfMedia
exit repeat
end if
end repeat
--

Is this the better way, and the fastest way ?


TIA


Olivier.
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: Translate a code of 2 characters to a text
      • From: Malcolm Fitzgerald <email@hidden>
  • Prev by Date: Re: More newbie queries: paths
  • Next by Date: Re: What happened to "file"?
  • Previous by thread: Re: Setting Default Browser in OS X
  • Next by thread: Re: Translate a code of 2 characters to a text
  • Index(es):
    • Date
    • Thread