[sr-dev] Problem with switch() when evaluating a function rather than $rc

Iñaki Baz Castillo ibc at aliax.net
Thu Apr 28 15:13:14 CEST 2011


Hi, I've coded a function that returns 1, 2, 3 or -1. It does it
correctly, however when evaluating the result of such function in a
switch() it fails:

  switch(my_function("lalala")) {
    case 1:
       [...]

The way it works is:

  my_function("lalala");
  switch(my_function($rc)) {
    case 1:
       [...]

Is it the expected behavior?


-- 
Iñaki Baz Castillo
<ibc at aliax.net>



More information about the sr-dev mailing list