Forums / Setup & design / Problem with the switch command / Comment20861
Betsy Gamrat
Monday 20 March 2006 9:56:28 am
What about an array that maps the indexes to the correct values?
For example:
{def $mapper=hash( 0, '00', 1, '10', 2, '20', 4 ,'30' , 5, '40' ... )}
{set $num=$mapper[$id]}
where $id is the data stored in the attributes of the object.
It might be worth redefining that attribute so the ids match the names better.