>Oh - that reminds me of something else I'd call a bug. It might well have been 
>fixed by now (I met it in 9.6) but you couldn't safely use a file variable in 
>an IF statement. Can't remember the details, but it was something like


>FVAR = ""
>some conditional code
>OPEN FILE TO FVAR
>more code
>IF FVAR EQ "" THEN
>oh the file isn't open, so do whatever

If your file is opened, then comparing it to an empty string is what will cause 
an invalid data type error.   You want to do instead:

IF FILEINFO(FVAR,0) = 0 THEN

Or:

OPEN FILE TO FVAR THEN FLAG.OPEN = 1 ELSE FLAG.OPEN = 0
IF FLAG.OPEN THEN

One error I've seen:

READ CUSTOMER FROM CUSTOMER THEN...

The record item that is being read is the same name as the opened file 
variable... ouch !


      
_______________________________________________
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users

Reply via email to