Re: Strange behaviour of case
Posted in 2004
Michael Krzepkowski wrote: > To eliminate any possible issues with the select statements > here is a much simpler version: > >> MAIN >> case lib() >> when '1' >> display 'one' >> when '2' >> display 'two' >> when '3' >> display 'three' >> when '9' >> display 'error' >> otherwise >> display 'other' >> end case >> END MAIN >> FUNCTION lib() >> define ret_val char(1) >> let ret_val = '3' return >> ret_val END >> FUNCTION > > > I always get "other" displayed. One of my colleagues has confirmed the problem on Linux; I don't have the bug number yet, but it is *now* a known bug. Suggestion: MAIN DEFINE rv CHAR(1) LET rv = lib() CASE rv ... That's untested - but a semi-plausible guess. Not completely plausible, but semi-plausible. I don't pretend this is anything other than a nasty hack workaround. -- Jonathan Leffler #include <disclaimer.h> Email: jleffler@earthlink.net, jleffler@us.ibm.com Guardian of DBD::Informix v2003.04 -- http://dbi.perl.org/