Cómo saber si una impresora paralelo está lista
Código Delphi
[-]
AssignFile(IMpresora,'lpt1'); {$I-}
Rewrite(Impresora);
{$I+}
if ioresult<>0 then ERROR
otra forma usando ensamblador
function IsPrinter : Boolean;
Const
PrnStInt : Byte = $17;
StRq : Byte = $02;
PrnNum : Word = 0;
Var
nResult : byte;
Begin
Asm
mov ah,StRq;
mov dx,PrnNum;
Int $17;
mov nResult,ah;
end;
IsPrinter := (nResult and $80) = $80;
End;