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

How does ??? work in VFP6

Status
Not open for further replies.

benasumwa

Programmer
Oct 14, 2003
57
KE

Hi friends,

I was used to the following type of quick receipt print:

Code:
LOCAL cPrinter
cPrinter = GetPrinter()
SET PRINTER TO (cPrinter)
??? "Receipt No. "+TransForm(nReceNo)
??? "Customer    "+cCustName
...
SET PRINTER TO

This would work well in Fox 2.6Dos But when I try the
same in VFP6, nothing doing. May be I am missing something

Any ideas?


Time is the father of truth. Time will tell.
-------------------------------------------
Benson O. A. (Infinity Link Limited)
 

Hi Benson,

Try using a single ?. If you use ???, it will by-pass the printer driver, and might give unexpected results.

Also, try adding an EJECT at the end of the printing, in case the text is still in the printer's memory buffer. And if it's a network printer, you might need to issue a second SET PRINTER TO (or SET PRINTER OFF) at the end of the process -- this will force the print job to terminate.

Mike



__________________________________
Mike Lewis (Edinburgh, Scotland)

My Visual FoxPro site: www.ml-consult.co.uk
 
Hi MikeLewis,

Single ? posts the output to the screen. Nothing goes to the printer even with EJECT and SET PRINTER OFF.

yearwood said:
Why not use the report writer?

Thanks Mike but there are some situations where this
kind of doing it is better. But thanks nonetheless!
May be time to abandon the old school!


Time is the father of truth. Time will tell.
-------------------------------------------
Benson O. A. (Infinity Link Limited)
 
Benson,

Single ? posts the output to the screen. Nothing goes to the printer even with EJECT and SET PRINTER OFF.

It works for me.

Also, the Help for ? says "Evaluates expressions and sends the results to the main Visual FoxPro window, an active user-defined window, or the printer." (My emphasis).

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

My Visual FoxPro site: www.ml-consult.co.uk
 


MikeLewis/Dave

Your compined efforts have got me out of the
hole.

My new code:

Code:
LOCAL cPrinter
cPrinter = GetPrinter()
SET PRINTER TO (cPrinter)
SET PRINTER ON
??? "Receipt No. "+TransForm(nReceNo)
??? "Customer    "+cCustName
...
SET PRINTER TO

I realised without the SET PRINTER ON and the SET PRINTER TO
at the end of the code leaves the printer forever spooling.

Now I am home and dry.

Thanks men. You are great fellows to have arround!

Time is the father of truth. Time will tell.
-------------------------------------------
Benson O. A. (Infinity Link Limited)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top