run time error when compiled 
Author Message
 run time error when compiled

I've been writing a program the requires checking the printer status( i.e on
line, out of paper) and found the solution in FAQPAS1.TXT question #15. I
used a slightly modified version of solution A2 that will return values
representing on line, off line, and out of paper. My problem is the solution
works just fine when run from the editor, but when the program is compiled,
I get a run time error of 160 and the program terminates. Since I have no
book and only the 'net for references I would like to be pointed in the
right directing to solve this problem. For what it's worth, the machine
being used is an HP Vectra 166MHz PI running DOS 6.22 and the printer
(temporarily) is a Cannon BJ200 ink jet. This printer will be replaced with
an dot matrix at a later date. I can be contacted via email at



Tue, 11 Mar 2003 11:08:08 GMT  
 run time error when compiled
Could you post your source (copy-and-paste, plz not attach!) and tell us
your TP version?



Quote:
> I've been writing a program the requires checking the printer status( i.e
on
> line, out of paper) and found the solution in FAQPAS1.TXT question #15. I
> used a slightly modified version of solution A2 that will return values
> representing on line, off line, and out of paper. My problem is the
solution
> works just fine when run from the editor, but when the program is
compiled,
> I get a run time error of 160 and the program terminates. Since I have no
> book and only the 'net for references I would like to be pointed in the
> right directing to solve this problem. For what it's worth, the machine
> being used is an HP Vectra 166MHz PI running DOS 6.22 and the printer
> (temporarily) is a Cannon BJ200 ink jet. This printer will be replaced
with
> an dot matrix at a later date. I can be contacted via email at




Wed, 18 Jun 1902 08:00:00 GMT  
 run time error when compiled
I use the following function :

function Tlpt.TxRdy:boolean;
var
  p:word;
begin
  p:=port;
  asm
    mov ah,2
    mov dx,p
    int $17 {Returns AH: $90=OK ;  $18=Off Line or Paper Out  ;
$C8=printer off}
    and ah,$98
    cmp ah,$90

    xor al,al


    mov [bp-1],al
  end;
end;

Quote:

> I've been writing a program the requires checking the printer status( i.e on
> line, out of paper) and found the solution in FAQPAS1.TXT question #15. I
> used a slightly modified version of solution A2 that will return values
> representing on line, off line, and out of paper. My problem is the solution
> works just fine when run from the editor, but when the program is compiled,
> I get a run time error of 160 and the program terminates. Since I have no
> book and only the 'net for references I would like to be pointed in the
> right directing to solve this problem. For what it's worth, the machine
> being used is an HP Vectra 166MHz PI running DOS 6.22 and the printer
> (temporarily) is a Cannon BJ200 ink jet. This printer will be replaced with
> an dot matrix at a later date. I can be contacted via email at




Wed, 18 Jun 1902 08:00:00 GMT  
 run time error when compiled
Thanks all, but found the problem. If you run across this, it turns out that
I was opening the printer file twice with the same label. DUH. I also had a
second prob in that the MSDOS regs values are different when running from
the editor and when compiled. Again, thanks.

Quote:
> I've been writing a program the requires checking the printer status( i.e
on
> line, out of paper) and found the solution in FAQPAS1.TXT question #15. I
> used a slightly modified version of solution A2 that will return values
> representing on line, off line, and out of paper. My problem is the
solution
> works just fine when run from the editor, but when the program is
compiled,
> I get a run time error of 160 and the program terminates. Since I have no
> book and only the 'net for references I would like to be pointed in the
> right directing to solve this problem. For what it's worth, the machine
> being used is an HP Vectra 166MHz PI running DOS 6.22 and the printer
> (temporarily) is a Cannon BJ200 ink jet. This printer will be replaced
with
> an dot matrix at a later date. I can be contacted via email at




Wed, 18 Jun 1902 08:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Run time error 200...all the time

2. Error 100 : Disk read error (Run-Time)

3. Error 100 : Disk read error (Run-Time)

4. Runtime error when running compiled program only

5. Reading Compile/run errors from outside TurboPascal

6. Freepascal run-time error

7. New run-time error at 500Mhz

8. Avoid run-time error 106 and the like?

9. Run-time error question

10. run time 200 errors

11. Run-time error 200

12. Run-time error 204???????

 

 
Powered by phpBB® Forum Software