From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stan Shebs To: jtc@redback.com Cc: gdb@cygnus.com Subject: Re: problem with chained if statements? Date: Thu, 01 Apr 1999 00:00:00 -0000 Message-id: <199903170011.QAA07805@andros.cygnus.com> References: <5mhfrl3v6e.fsf@jtc.redbacknetworks.com> X-SW-Source: 1999-q1/msg00129.html From: jtc@redback.com (J.T. Conklin) Date: 16 Mar 1999 14:51:21 -0800 I'm trying to write some user-defined commands to traverse and/or pretty-print some of the internal data structures used in our SW. In the absense of a `switch' statement, I am using a chain of if .. else if ... else if ... else ... end statements. Unfortunately it doesn't seem to work. Try: if ($status == $TASK_READY) printf "READY " else if ($status == $TASK_DELAY) printf "DELAY " else if ($status == ($TASK_DELAY | $TASK_SUSPEND)) printf "DELAY+S " I think the else and the if each need to be on their own lines. Stan