Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Line feed and reverse line feed under XP

Status
Not open for further replies.

rianeiromiron

Programmer
Jul 1, 2001
151
0
0
GT
I need users of an application to "see" the invoice number they are going to print, that is, they must "see" the number printed in the paper invoice and then type it so the invoice number used is the correct one. Under Win98 or WinMe I used to type a file containing several blank lines so the carriage would advance say 5 times (this way the number was visible), and then, I typed another another file containing 5 reverse line feed commands. The code is like this

TYPE_=11
MYCOMMAND='ADVANCE.BAT'
=WinExec(MYCOMMAND,TYPE_)
=messagebox('Look invoice number')
MYCOMMAND='RETURNCR.BAT'
=WinExec(MYCOMMAND,TYPE_)

ADVANCE.BAT has the following command

type LINES>prn:



And the contents of LINES is just 5 LF commands


RETURNCR.BAT has the following command

type retro>prn:


And the contents of RETRO is 5 reverse line commands




When I "winEXECUTE" the command, the printer just won't advance.

Any ideas on how to work this around?


Thank you all for your help
 
I think, Print Manager perform your both LF and RF,
and result = no motion.
Better idea is display invoice number in screen.
(I hope, accountant has PC,
not crib number manually to book...)
Tesar
 
Depending on your setup you may be able to issue commands like:

STORE whatever the 'advance' control codes are TO pAdvanceCmd
STORE whatever the 'reverse' control codes are TO pReverseCmd

??? pAdvanceCmd
??? pAdvanceCmd
??? pAdvanceCmd
??? pAdvanceCmd
??? pAdvanceCmd
SET PRINTER TO
SET PRINTER OFF
SET DEVICE TO SCREEN
MESSAGEBOX('Look at invoice number')

??? pReverseCmd
??? pReverseCmd
??? pReverseCmd
??? pReverseCmd
??? pReverseCmd
SET PRINTER TO
SET PRINTER OFF
SET DEVICE TO SCREEN

Dave S.
 
To Dave:

Thank you Dave. That was the answer, it worked just great.



To Alias:

Thank you anyway. WinExecute is an API call for executing external commands.



To Tesar:

Thank you. The idea was to "force" users to look for the invoice number.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top