Right. The readnext id is against the open file - you're not reading the
actual item (that's in the "CODE"). If you're not doing it this way, compare
a benchmark for this with whatever you're using. I think you'll see that
this construct uses many fewer system calls, reads, and cpu cycles.

I remember who told me about it - Mark Baldridge. 

<plug>Who, btw, also wrote a series on programming & tuning for performance
(which includes setting up benchmarks) in UniVerse, available for
downloading on the IBM developerworks site.

First installment here:

http://www.ibm.com/developerworks/edu/dm-dw-dm-0512baldridge-i.html

</plug>


-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of George Gallen
Sent: Monday, March 02, 2009 1:02 PM
To: [email protected]
Subject: RE: [U2] Strange happening...

It shouldn't, at least not to a empty ID because the
condition test is on the READNEXT, not the ID.

However, it will pass an empty ID to the coding, which
could be worse, if there aren't constraint checks on
the ID.

George

> -----Original Message-----
> From: [email protected] [mailto:owner-u2-
> [email protected]] On Behalf Of Eric Armstrong
> Sent: Monday, March 02, 2009 11:28 AM
> To: [email protected]
> Subject: RE: [U2] Strange happening...
>
> Allen,
> Regarding your loop structure below. What happens if the ID is empty
> string?
> Won't it bail out before all the ids are read!
>
> Eric Armstrong
> Lobel Financial
> IT Dept
>
>
> -----Original Message-----
> From: Allen Egerton [mailto:[email protected]]
> Sent: Friday, February 27, 2009 8:37 AM
> To: [email protected]
> Subject: Re: [U2] Strange happening...
>
> As for the loop structure, I tend to like this:
> SELECT FILENAME
> LOOP WHILE READNEXT ID
>   CODE
>   CODE
>   CODE with GOSUB
>   CODE
>   CODE
> REPEAT
>
> It's clean, it's concise, it's easy to read...  And I wish I could
> remember who taught me that you could combine the LOOP and READNEXT in
> that manner...
>
> --
> Allen Egerton
> aegerton at pobox dot com
> PGP Key ID 0x8EA57261
-------
u2-users mailing list
[email protected]
To unsubscribe please visit http://listserver.u2ug.org/
-------
u2-users mailing list
[email protected]
To unsubscribe please visit http://listserver.u2ug.org/

Reply via email to