Hi Frank.
Edited! I was wrong in a few places!
There are a few issues here.
Code
www: = word (length (RECStr));
If you are using block write you need to include the length byte of the string, so
Code
www: = word (length (RECStr)) + 1;
Code
ptr: = @EmpfStr;
Inc (ptr);
This does not look right at all. Should it not be
?
or maybe
Code
ptr: = @RecStr;
inc (ptr);
Code
F16_BlockWrite (F, ptr, www, res);
Repeat
nop;
until res = www;
if www<>res first time this will always fail because nowhere can either www or res change! In any event it will write garbage at the end of the line because www measures the length of RecStr but you are writing EmpfStr
but without the length byte. So even if your write is successful it will be unreadable. But as long as you are writing less than 512 bytes (which you always will be) it will either succeed or fail. Hence you can use the boolean result to determine that. If it fails then it will always fail and there is no point in waiting for the record count to match.
So just
Code
if F16_BlockWrite(F, ptr, www, Res) then
if Res = www then
SendeStr:= 'ok'; Sende_an_Host;
else
// whatever
endif;
else
SendeStr:= 'fail'; Sende_an_Host;
endif;
Regards
Merlin