Dear,

The error code means 2 (= the system cannot find the file specified)
and 0 (= the operation completed successfully).

We have result the script a little.
With IF/ENDIF we are suppressing unwanted error status codes.
We also skip directories.

code:
 $directory="C:\novellclient\"
$filename = Dir($directory+"*.*")
IF (Len($filename) <> 0)
WHILE ($filename <> "") AND (@error = 0)
IF GetFileAttr($directory+$filename) & 16
IF ($filename <> ".") AND ($filename <> "..")
? "entry skipped. '"+LCASE($directory+$filename)+"' is directory"
ENDIF
ELSE
IF (Open(1,$directory+$filename) = 0)
FOR $i=1 TO 3
$line=readline(1)
NEXT
IF Close(1)
ENDIF
? "file '"+LCASE($directory+$filename)+"' -> "+$line
ENDIF
ENDIF
$filename=Dir() ; retrieve next file
LOOP
ELSE
? "no files found"
ENDIF

greetings.
_________________________
email scripting@wanadoo.nl homepage scripting@wanadoo.nl | Links | Summary of Site Site KiXforms FAQ kixtart.org library collection mirror MCA | FAQ & UDF help file UDF kixtart.org library collection mirror MCA | mirror USA | mirror europe UDF scriptlogic library collection UDFs | mirror MCA