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

Printing using @say... or print txt 2

Status
Not open for further replies.

konLao

Programmer
Mar 10, 2003
61
US
Dear all FoxPro programmers,
I'm Win2k and XP user. I have two questions?
1. I try to generate an output to printer using @say ...
Here's my sample code...

Set device to printer
@1,1 say 'This is a test'
@10,1 say 'I can print this'
@11,1 say chr(12) && for form feed
set device to screen

It's spooling to the printer but never print the output.

2. How can I print a txt file to the printer? Let's say I have "Test.txt" on my default folder.

Thank you,
konLao
 
Don't use @say... on W2K and XP mashines. You are not allowed to write to port directly.
Try to use old dos command for printing files: "copy"
For instance: copy temp.txt to lpt1
 
murisa,
I tried..

copy "tryme.txt" to lpt1 and
copy tryme.txt to lpt1

none of them worked. It seems like it doesn't reconize 'lpt1'
 
It's spooling to the printer but never print the output.
That's half the battle.
Now try this. Issue:

@11,1 say chr(12) && for form feed
SET PRINT TO
SET PRINT TO &&... yes, twice
SET PRINT OFF

set device to screen


Dave S.
[cheers]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top