use framework "Foundation"
property Codes : {"9420", "94ae", "94d0", "942f", "942C", "9470"}
property Mnemonics : {"RCL", "ENM", "ReW", "EOC", "EDM", "RfW"}
property codesAndMnemonics : missing value -- will hold dictionary
-- create dictionary early in your code
set codesAndMnemonics to current application's NSDictionary's dictionaryWithObjects:Mnemonics forKeys:Codes
MnemonicOf("9470") --> "RfW"
on MnemonicOf(aCode)
set returnResult to codesAndMnemonics's objectForKey:aCode
if returnResult = missing value then
-- whatever
return false
else
return returnResult as text
end if
end MnemonicOf