>Under 5.0, in the command window, when I issue x=FOPEN('mytable.dbf'), x becomes the file handle of the opened file. When I issue =FREAD(x,100) or FGETS(x,100), I get what I thought would be the first 100 bytes of the table -- the header and then some -- but I can't read it. Is there some trick to this and interpreting what's returned? I'm trying to evaluate the first byte in the header to know if I'm dealing with a usable/readable DBF. All I get is '0c' followed by a bunch of graphic characters, then eventually readable A-z, 0-9 readable text.
>
>Any direction greatly appreciated.
You did get the first 100 bytes, it's just binary data and is not human "readable". These are probably values that are out side the "readable" ascii range. Values less than 32 decimal or greater than 127 are still valid just not "readable". You'll need to examine each byte individually for it's value. You could use SUBSTR to extract each individual byte for it's value. nValue = SUBSTR(cFileString,nPosition,1) would return the byte value at nPosition from the data read from the file.