As a rule of thumb, one shouldn't use a string as a boolean unless it's 
intended to be a boolean like a 0 or a 1.  I've encountered many bugs because a 
test would do:

IF VARIABLE THEN

Instead of:

IF VARIABLE NE ""   THEN ...

or IF LEN(VARIABLE) > 0



----- Original Message ----
From: Timothy Snyder <tsnyd...@us.ibm.com>
To: u2-users@listserver.u2ug.org
Sent: Monday, March 2, 2009 2:38:33 PM
Subject: Re: [U2] Strange happening...

> If, as stated in another response to this thread, the poster doesn't
> want the record that has a null-id to be processed, then I'd probably do
> something like this:
> 
> SELECT FILENAME
> LOOP WHILE READNEXT ID
>   IF (ID) THEN
>     CODE
>     CODE
>     CODE with GOSUB
>     CODE
>     CODE
>   END ELSE
>     Error handling code
>   END
> REPEAT

Be careful with that!  If there's a valid ID of "0" or "000" or 
"00000000000000000" it would hit the error-handling code.  I suggest 
checking ID against an empty string, since that's the actual error 
condition..

Tim Snyder
Consulting I/T Specialist
U2 Lab Services
Information Management, IBM Software Group
-------
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/
-------
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/

Reply via email to