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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Another printing problem

Status
Not open for further replies.

merlin511

Programmer
Mar 27, 2002
36
US
Look like we all have printing problems. Anyway here's the situation. A biiigggg clipper 5.3 application call dos command via the SwpRunCmd() function. The command is : "net Use lpt1 \\MASTER\HP4MV /DELETE /YES". The application is in text mode. The problem is : after the call the whole screen is scroll 1 line up. I can set the scoll lock to .T. but i also need to cancel the success message from the network to show on screen. Can't find how . Thank you.

 
Hi,

I use 5.2 with Clipper Tools and would open a new window before the call to NET and close it afterwards.

Does 5.3 have windowing functions?

If not, could you..
save the screen
save the cursor position
position the cursor top left to stop the scrolling
call NET command
restore the screen
reposition the cursor

I've not checked any of this, but I think the logic is there :)

HotEye
 
This is exactly what i did. But Still, if i use the net command call, the screen will scroll upward. I'm looking for a way to call a "Net" command without a confirmation from the net 0/S. In clipper tools there's a command "NETREDIR()" that does the job. ie make the connectiont to a printer without cofirmation from the o/s. I will use that function for now but how about the others net, O/S or else commands.

 
Hi Merlin,

One thing I would look into is where is the printer turned off and the console turned on in your program. This must be done before the screen is restored ( in case ? is at the bottom of the screen), also clear the keyboard buffer. Make sure the DOS window being opened does not have more screen lines than your program window. ie: if your program is 25x80 then your DOS box should also be 25x80 or your screen will scroll.

Regards,
David Tracy.
 
Hi,

Have you tried appending "> nul" to the command?

net Use lpt1 \\MASTER\HP4MV /DELETE /YES > nul

When typed at the DOS command, it leaves a single blank line and returns to the prompt. No other output is produced.

I think that most DOS commands will accept the > nul to supress output.

It should be possible to shell out of your program to DOS, run anything and return, try it from the debugger.

I've just tried this: (added an option from my main menu)

wopen(0,0,maxrow(),maxcol())
clear screen
SWPRUNCMD('command.com', 0)
wclose()
myinkey(30)

...and the screen is restored OK as it waits for a key press.

Hope that helps.

 
Hi,

Have you tried appending "> nul" to the command?

net Use lpt1 \\MASTER\HP4MV /DELETE /YES > nul

When typed at the DOS command, it leaves a single blank line and returns to the prompt. No other output is produced.

I think that most DOS commands will accept the > nul to supress output.

It should be possible to shell out of your program to DOS, run anything and return, try it from the debugger.

I've just tried this: (added an option from my main menu)

wopen(0,0,maxrow(),maxcol())
clear screen
SWPRUNCMD('command.com', 0)
wclose()
myinkey(30)

...and the screen is restored OK as it waits for a key press, even after XTREE.

Hope that helps.

 
Hi Guys,
I use clipper 5.2 and have problem with printing the reports through USB port printer. Does Clipper 5.2 have a function that recognizing the USB port ?
Thanks,
 
Having checked in Microsoft Support, article Q259939 says

...
When you print from a command prompt or lpt1.dos, the port is not supported.
...


So it looks like the only way is to access Windows printer queues. I have found that AbeeLabs PageScript allows this, but you do need to recode your print routines.

Hope that helps.
 
My solution was to share the port (\\computer\printer),
open a filehandle to this file,
ignoring any read-errors from this 'file' in errorsys.prg, then writing my print data to this file.
I already had all my printing going through a print_line() function, so only had to change in a few places ;-)

HTH, TonHu
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top