import statement used on empty (zero-byte) file

kmorrogh

New Member
Environment:progress 8.3c and 9.1 running under Windows NT.

It appears that an unformatted import from a file containing no records, i.e., a zero-byte file, is not being handled properly. A procedure will exit on any import or set statement where input is from an empty file. See following code.


def var f1 as character.

os-delete "c:\temp\NullFile".
output to c:\temp\NullFile.
output close.

file-info:file-name = "c:\temp\NullFile".
display file-info:file-name format "x(40)"
file-info:file-type format "x(40)"
with frame fileframe 1 col side-labels.
input from c:\temp\NullFile no-echo.

Pause message " Before Import Statement ".

/******* This Works ************/
/*import unformatted /*f1*/ no-error.*/

/******* This Doesn't Work ****/
import unformatted f1 no-error.

display error-status:error
error-status:num-messages
with frame errframe 1 col side-labels.

Does anyone know of a workaround for this. I cn't seem to find a bug report at the Progress site.

Ken
 
Top