Jump to content



Welcome to KnowledgeSutra - Dear Guest , Please Register here to get Your own website. - Ask a Question / Express Opinion / Reply w/o Sign-Up!
- - - - -

Test Print Is Online


2 replies to this topic

#1 /]/]@t

    Newbie

  • Kontributors
  • Pip
  • 1 posts

Posted 23 October 2006 - 11:51 AM

Test print is OnLine

Function PrinterOnLine : Boolean;
Const PrnStInt : Byte = $17;
	  StRq : Byte = $02;
	  PrnNum : Word = 0; { 0 para LPT1, 1 para LPT2, etc. }
Var   nResult : byte;

Begin (* PrinterOnLine*)

Asm
  mov ah,StRq;

  mov dx,PrnNum;

  Int $17;

  mov nResult,ah;
end;

  PrinterOnLine := (nResult and $80) = $80;

End;

Error:

[Warning] Funcoes.pas(204): Unsafe code 'ASM'


#2 Saint_Michael

    $p4m 0n j00 $h4m3 m3 0nc3 $p4m 0n m3 $h4m3 m3 7\/\/1c3

  • [MODERATOR]
  • PipPipPipPipPipPipPipPipPipPipPipPipPipPipPipPipPipPipPipPipPip
  • 7,459 posts
  • Gender:Male
  • Location:9r33|\| 399$ 4|\|D 5P4/\/\
  • Interests:$p4m 0n j00 $h4m3 m3 0nc3 $p4m 0n m3 $h4m3 m3 7\/\/1c3
  • myCENT:71.24

Posted 23 October 2006 - 09:10 PM

Although I don't know this type of programming it would help to know what this is used for and what not. Just posting code doesn't help any members who might have questions about what your post is about or what problems you might have with it.

#3 osknockout

    Super Member

  • Kontributors
  • PipPipPipPipPipPipPipPipPip
  • 399 posts
  • Location:Elysium
  • Interests:quantum mechanics, war, history, epidemiology, virology,mathematics, programming, D&amp;D/NetHack<br />...old skool :)

Posted 24 October 2006 - 10:22 PM

Quote

Although I don't know this type of programming it would help to know what this is used for and what not. Just posting code doesn't help any members who might have questions about what your post is about or what problems you might have with it.
Actually, St. Michael, it isn't really that arcane.

Ok, /]/]@t, from the looks of it, your program should work fine.
- Checks printer status, right? -

It's just that your compiler/assembler
either a)doesn't like asm or b)is paranoid.
Probably because you left nResult as a variable.
In either case, turning warnings off should solve the problem.

And I hate to say it, but Saint_Michael's right. Specify your post next time.
Don't expect someone like me to come by and say. *Oh! That's obvious.* :lol:

Btw. what compiler/assembler are you using there?




Reply to this topic


This post will need approval from a moderator before this post is shown.

  


1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users