My blindness or php bug

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Bob Stearns

    My blindness or php bug

    The problem is that some functioning (I thought) code has stopped working:

    $n = @odbc_num_rows( $res);
    $debug .= "<br>isset( n) " . $code . "=" . isset($n) . ";<br>";
    $debug .= "<br>ncode " . $code . "=$ncode;<b r>";
    $debug .= "<br>n " . $code . "=$n;<br>";
    switch ($ncode) {
    case -2: /* 0 or 1 */
    if(!isset($n) || (($n!=0) && ($n!=1))) {
    $debug .= "<br>-2 " . $code . "=-2;<br>";
    $myerr = TRUE;
    $mymsg .= $code . " " . $msg . "<br><br>";
    }
    break;
    case -1: break; /* don't care */
    case 0: /* exactly 0 *\
    if(!isset($n) || ($n!=0)) {
    $debug .= "<br>0 " . $code . "=0;<br>";
    $myerr = TRUE;
    $mymsg .= $code . " " . $msg . "<br><br>";
    }
    break;
    case 1: /* exactly one */
    if(!isset($n) || ($n!=1)) {
    $debug .= "<br>1 " . $code . "=1;<br>";
    $myerr = TRUE;
    $mymsg .= $code . " " . $msg . "<br><br>";
    }
    break;
    case 2: /* at least one */
    if(!isset($n) || ($n<1)) {
    $debug .= "<br>2 " . $code . "=2;<br>";
    $myerr = TRUE;
    $mymsg .= $code . " " . $msg . "<br><br>";
    }
    break;
    }

    gives the following output:

    isset(n) V ID=1;

    ncode V ID=0;

    n V ID=0;

    1 V ID=1;

    myerr=1; mymsg=V ID res-03 is already known id

    which indicates case 1 was executed when case 0 was called for.
  • Paul Herber

    #2
    Re: My blindness or php bug

    On Mon, 26 Sep 2005 15:11:10 -0400, Bob Stearns
    <rstearns1241@c harter.net> wrote:
    [color=blue]
    > The problem is that some functioning (I thought) code has stopped working:[/color]
    [color=blue]
    > case 0: /* exactly 0 *\[/color]
    [color=blue]
    >which indicates case 1 was executed when case 0 was called for.[/color]

    incorrect end of comment

    --
    Regards, Paul Herber, Sandrila Ltd. http://www.pherber.com/
    SanDriLa - SDL/MSC/TTCN/UML2 application for Visio http://www.sandrila.co.uk/

    Comment

    • Bob Stearns

      #3
      Re: My blindness or php bug

      Paul Herber wrote:[color=blue]
      > On Mon, 26 Sep 2005 15:11:10 -0400, Bob Stearns
      > <rstearns1241@c harter.net> wrote:
      >
      >[color=green]
      >> The problem is that some functioning (I thought) code has stopped working:[/color]
      >
      >[color=green]
      >> case 0: /* exactly 0 *\[/color]
      >
      >[color=green]
      >>which indicates case 1 was executed when case 0 was called for.[/color]
      >
      >
      > incorrect end of comment
      >[/color]
      Thank you! I thought it was something of that order, but I couldn't see
      it. Occasionally fresh eyes are necessary.

      Comment

      • Michael Vilain

        #4
        Re: My blindness or php bug

        In article <8kYZe.10249$eH 2.7678@fe02.lga >,
        Bob Stearns <rstearns1241@c harter.net> wrote:
        [color=blue]
        > Paul Herber wrote:[color=green]
        > > On Mon, 26 Sep 2005 15:11:10 -0400, Bob Stearns
        > > <rstearns1241@c harter.net> wrote:
        > >
        > >[color=darkred]
        > >> The problem is that some functioning (I thought) code has stopped working:[/color]
        > >
        > >[color=darkred]
        > >> case 0: /* exactly 0 *\[/color]
        > >
        > >[color=darkred]
        > >>which indicates case 1 was executed when case 0 was called for.[/color]
        > >
        > >
        > > incorrect end of comment
        > >[/color]
        > Thank you! I thought it was something of that order, but I couldn't see
        > it. Occasionally fresh eyes are necessary.[/color]

        A color coding editor has be come quite a comfort to me in my old age.
        You might try vim in php mode. I don't know if emacs also does color
        coding. Or the Zend editor.

        --
        DeeDee, don't press that button! DeeDee! NO! Dee...



        Comment

        Working...