Printing question 
Author Message
 Printing question

CAn anybody translate this function so I can use it with fpc?
I'm not familiar with asembler soo...please help.
I found this function somewhere on swag long time ago and I've use
it with TP.Now I want to use it with FPC but..it wont compile...

tnx

tsts results: 0 = Printer OK
              1 = Printer Busy
              2 = Printer not OK

function  Tsts:byte;
label     Ret;
var dreg: registers;
begin
  with DReg do
  begin
    Ax:=$0200;
    Dx:=0;
    intr($17,DReg);
    if (hi(Ax) and 1)<>0 then begin Tsts:=1;goto Ret;end;
    if (hi(Ax) and 8)<>0 then begin Tsts:=2;goto Ret;end;
  end; (* with *)
  Tsts:=0;
Ret:
end; (* TSTS *)

end.



Wed, 30 Jul 2003 21:16:53 GMT  
 Printing question

Quote:

>CAn anybody translate this function so I can use it with fpc?
>I'm not familiar with asembler soo...please help.
>I found this function somewhere on swag long time ago and I've use
>it with TP.Now I want to use it with FPC but..it wont compile...

>tnx

>tsts results: 0 = Printer OK
>              1 = Printer Busy
>              2 = Printer not OK

>function  Tsts:byte;
>label     Ret;
>var dreg: registers;
>begin
>  with DReg do
>  begin
>    Ax:=$0200;
>    Dx:=0;
>    intr($17,DReg);
>    if (hi(Ax) and 1)<>0 then begin Tsts:=1;goto Ret;end;
>    if (hi(Ax) and 8)<>0 then begin Tsts:=2;goto Ret;end;
>  end; (* with *)
>  Tsts:=0;
>Ret:
>end; (* TSTS *)

>end.

I can't test at the moment, but the function looks like it should work.
Provided that:
- You use the dos version of FPC (go32v2). The Win32 target can't access
dos functions
- You include (USES) unit DOS
- You specify -Sg on the commandline to allow goto.


Wed, 30 Jul 2003 22:15:23 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. D1: TDBGrid Printing Question

2. Printing Question

3. Printing - question

4. Delphi Printing Question

5. Printing database question

6. newbie question: printing tables

7. Easy Question--About Printing?

8. ReportSmith - question on defining records for printing

9. Question About Printing.

10. Question Dos Printing in Win95

11. Question: Printing a Query

12. How to print to Novell print queue?

 

 
Powered by phpBB® Forum Software