[FMPP] Is there a more efficient way to look up a list?
Brought to you by:
ddekany
|
From: Bruce P. <bpe...@ya...> - 2006-05-16 15:27:31
|
Hello. I hope that I explain this clearly enough.
Let's say I have the code 'BBB' stored in 'myCode' and the following list:
options=
[code:AAA,description:A1,text:A2,
code:BBB,description:B1,text:B2,
code:CCC,description:C1,text:C2,
code:DDD,description:D1,text:D2]
I need to display the description of the code value that I have. What I currently do is the following:
<#list options as x>
<#if (x.code?trim==mycode)>
${x.description?trim}
</#if>
</#list>
It seems to work. But is there a more efficient way to do this?
Thanks.
---------------------------------
Love cheap thrills? Enjoy PC-to-Phone calls to 30+ countries for just 2¢/min with Yahoo! Messenger with Voice. |