> -----Original Message----- > From: [email protected] [mailto:owner-u2- > [email protected]] On Behalf Of Allen Egerton > Sent: Friday, February 27, 2009 11:37 AM > To: [email protected] > Subject: Re: [U2] Strange happening... > > While the code itself is less than elegant, I strongly suspect that the > exiting lies in what's being done in the GOSUB. Perhaps it's doing a > SELECT or a CLEARSELECT, or something else that corrupts the active > select list.
The subroutine uses a bunch of IF-THENS, but nothing that would effect the selectlist nor does any file IO. Even if something in the subroutine trashed the selected list or corrupted the variable in the Do/While expression, it shouldn't drop out of the loop until it comes back around to the Do/While check? Or is that incorrect? As for the LOOP WHILE READNEXT ID, I've used this, and have not had issues. Thanks George > > I recently saw a piece of code where the active select list was trashed > because the code opened a file, then executed a create-file on the > opened file... Took us a while to figure that one out. > > 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 ------- u2-users mailing list [email protected] To unsubscribe please visit http://listserver.u2ug.org/
