slang-users mailing list

[2001 Date Index] [2001 Thread Index] [Other years]
[Thread Prev] [Thread Next]      [Date Prev] [Date Next]

Re: while()


thanks John....
in C or any other language I know (PHP,Java,etc)...the while uses the value
handle that was set by the getnextresult()...
I use it alot to be honest...but okay...
maybe a nice feature for later ? :-)

Richard van Zon.

----- Original Message -----
From: "John E. Davis" <davis@xxxxxxxxxxxxx>
To: <rvanzon@xxxxxxxxxxxx>; <slang-workers@xxxxxxxxxxxxxxxxxxxxxxxxxx>
Sent: Thursday, April 26, 2001 4:27 AM
Subject: Re: while()


> Richard van Zon <rvanzon@xxxxxxxxxxxx> wrote:
> >Hi,
> >
> >Am I right that this little piece of code doesn't work ?
> >I get an stack underflow with it :
> >
> >while((handle=getnextresult())!=NULL)
> >{
> >  ...
> >}
>
> Assigment expressions do not return a value.  Hence, you are comparing
> NOTHING to NULL.  You can use the comma operator:
>
>    while (handle = getnextresult (), handle != NULL)
>      {
>         .
> .
>      }
>
> --John
>
>


[2001 date index] [2001 thread index]
[Thread Prev] [Thread Next]      [Date Prev] [Date Next]