From: Michael R. <re...@eu...> - 2007-01-21 06:37:03
|
Hi there, I just added a new, probably handy function to the evaluator: decode(index, ...) it takes a variable number of parameters, at least 2. the first one is interpreted as an index, and the function returns the n'th parameter. some examples: decode(-1,'a','b') => '' (empty) decode(0,'a','b') => 'a' decode(1,'a','b') => 'b' decode(2,'a','b') => '' (empty) decode(3, 'a','b','c','d','e','f') => 'd' It may be used to reduce nested '?' operators I've got two questions here: - is 'decode' the right name for it (there's a similar function in Oracle's PL/SQL) - is 'plugin_math' the right place for it? enjoy, Michael -- Michael Reinelt <re...@eu...> http://home.pages.at/reinelt GPG-Key 0xDF13BA50 ICQ #288386781 |