error 200 on blockread (w/ patched tpl files) 
Author Message
 error 200 on blockread (w/ patched tpl files)

Please forgive if this is dumb, but I don't do Pascal, so I am a fish
out of water.

I am tweaking an old program (Turbo Pascal 7.0) to read data in from
binary files instead of from an instrument so I can compare the
results with the new c++ version I'm working on, and I am getting
error 200 on the blockread.  This _shouldn't_ be from the crt/200
problem as we are using a fix, and the original program runs fine.

Any ideas?  I hope I am just doing something wrong.

     {initialize filecount to name files to read into test}
     fcount := 1500;
     {$I-}
     assign(dFile,DataDirectory + 'filename.bi');
     reset(dFile,0);
     {$I+}
     If IOResult <> 0 then
      begin
       MessageBox('Error: File does not exist.', nil,
mfError+mfOKButton);
      end;

    {stops with error here ->} BlockRead(dFile,BCODE,fcount,len);

     close(dFile);

The keyboard is imprinted on my face at this point, hair torn out,
white coats at the ready.

Thanks,
Carol G



Wed, 27 Apr 2005 05:13:24 GMT  
 error 200 on blockread (w/ patched tpl files)

Quote:

> Please forgive if this is dumb, but I don't do Pascal, so I am a fish
> out of water.
> results with the new c++ version I'm working on, and I am getting
> error 200 on the blockread.  This _shouldn't_ be from the crt/200
> problem as we are using a fix, and the original program runs fine.

> Any ideas?  I hope I am just doing something wrong.

>      {initialize filecount to name files to read into test}
>      fcount := 1500;
>      {$I-}
>      assign(dFile,DataDirectory + 'filename.bi');
>      reset(dFile,0);

What does the above line mean?

Quote:
>      {$I+}
>      If IOResult <> 0 then
>       begin
>        MessageBox('Error: File does not exist.', nil,
> mfError+mfOKButton);
>       end;
>     {stops with error here ->} BlockRead(dFile,BCODE,fcount,len);

>      close(dFile);

> The keyboard is imprinted on my face at this point, hair torn out,
> white coats at the ready.

The second parameter of the reset line is the record size. Blockread calculates
the number of bytes to read by multiplying with that number (and possibly
divides somewhere or calcs a modulo).

It probably should be reset(dfile,1);



Wed, 27 Apr 2005 05:27:54 GMT  
 error 200 on blockread (w/ patched tpl files)

Quote:
>Please forgive if this is dumb, but I don't do Pascal, so I am a fish
>out of water.

>I am tweaking an old program (Turbo Pascal 7.0) to read data in from
>binary files instead of from an instrument so I can compare the
>results with the new c++ version I'm working on, and I am getting
>error 200 on the blockread.  This _shouldn't_ be from the crt/200
>problem as we are using a fix, and the original program runs fine.

>Any ideas?  I hope I am just doing something wrong.

>     {initialize filecount to name files to read into test}
>     fcount := 1500;
>     {$I-}
>     assign(dFile,DataDirectory + 'filename.bi');
>     reset(dFile,0);

Reset (..,0)??? 0 byte length records? Well that has to give a
"division by zero error"!!!
Ok, there is probably no real division, but it could be possible that
the blockread code uses the same error message number to show such an
error...

Ralf



Thu, 28 Apr 2005 04:21:58 GMT  
 error 200 on blockread (w/ patched tpl files)

Quote:
> Reset (..,0)??? 0 byte length records? Well that has to give a
> "division by zero error"!!!
> Ok, there is probably no real division, but it could be possible that
> the blockread code uses the same error message number to show such an
> error...

> Ralf

Ralf and Marco,
Aha, I was doing something dumb! Thanks much!
Carol G.


Fri, 29 Apr 2005 22:45:23 GMT  
 error 200 on blockread (w/ patched tpl files)

Quote:
>> Reset (..,0)??? 0 byte length records? Well that has to give a
>> "division by zero error"!!!
>> Ok, there is probably no real division, but it could be possible that
>> the blockread code uses the same error message number to show such an
>> error...

>> Ralf

>Ralf and Marco,
>Aha, I was doing something dumb! Thanks much!
>Carol G.

No problem..;-)))

I know that this is the kind of bug you keep looking yourself at over
and over again and won't see it until someone tells you....

Welcome to the wonderful world of programming.... ;-)))

take care,

Ralf



Sat, 30 Apr 2005 01:45:45 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. Patch for LFN and error 200

2. Error 200: Division by zero PATCH / FIX

3. Runtime error 200 - patch

4. PASCAL - RUNTIME ERROR 200 - DIVID BY ZERO - PATCH

5. Error 200 Division by Zero patches

6. >200 MHZ, 200 error continued ...

7. Ann: Patch for Crt's 200 MHz bug available

8. ERROR 200:Div. by zero

9. Object Pro Opcrt unit runtime error 200

10. runtime error 200

11. Error 200

12. Runtime Error 200 with new computer

 

 
Powered by phpBB® Forum Software