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!

Printing problems... 1

Status
Not open for further replies.

Vivianez

Programmer
Oct 10, 2001
25
BR
I have a RABBIT printer that has its own language.
I have to send the parameters and data to the printer in its own format.
For exemple:
set printer to LPT1
set device to FILE
@ 0,0 say chr(02) + "L" + chr(13)
@ 0,0 say chr(02) + "KI70" + chr(13)
@ 0,0 say "H12"
@ 0,0 say "CODE" + variable

and so on....
If I print the FILE in DOS (C:\print FILE) it works perfectly, but FOX prints exactly what is written "LKI70".
They told me to print with the generic / only text driver but no way...nothing happens so...
Then I tried :
run /n print FILE
but I thing it is not good....
Does anyone have a better idea???
Thanks,
Viviane
 
You could write a small DOS program to setup the printer.
You could run that program before your Foxpro report.
You could have another DOS program to reset the printer.

 
1- Write a small DOS program to setup the printer...
But the variables of the report are written in the FILE too...

2- run a program before your Foxpro report....
And where I would write the variables (data)?

3 - the same...

The problem is this, the data are togheter with the printer parameters....inside the configuration file....

Need more ideias...
Thanks for your help Cricket....

Viviane
 
Try ??? instead of @ x.x say..
Like this:

??? chr(02) + "L" + chr(13)
??? chr(02) + "KI70" + chr(13)
??? "H12"
??? "CODE" + variable


Rob.
 
Hi Rob444!
Thanks for your attention...
I tried what you´ve said but the printer only starts printing if I send a DOS command like print or type. Nothing happends if I only write @ say or ???.

Any other idea?
 
Vivianez,
your "print to file" and "copy file to printer" is good...
Only try instead "@" better "report form..",
and as first line report put myfunc() with your chars.
(Reserve "func" field sufficient length)

func myfunc
mychars = chr(02)+"L" + ...
retu mychars

(I use
!cmd /c copy myfile.txt /b lpt1)

Tesar
 
Your code is as follows
set printer to LPT1
set device to FILE
The second statement which redirects @SAY commands to a file instead of screen or printer, requires a filename. When you include the filename , say myfile.txt, you should be able print using DOS with a command such as :
RUN PRINT myfile.txt

Because you are redirecting output to a file, the printer will not print in Foxpro. Change the statement to
SET DEVICE TO PRINTER to get the printer to output your Foxpro @SAY statements
 
Hi cricket!
After I create the file, I direct it to the printer with SET DEVICE TO PRINTER, no problem. But the only way I could print is creating a file and then printing it with DOS commnad.
IF I place @ or ??? with set device to printer, nothing happends. But nothing happens because I use Generic / only text drive. If I change to the printer drive, it prints "LIK70..." Thats why I decided to create a file and then print it with DOS. The file is OK, because if I print directly in DOS, it woks ok.
They told my to use Generic/only text because of the printer language....
The only thing that is not good is the way that I found to print ( DOS COMMAND ):
run /N print file.txt
The screen gets all black, it´s terrible. And it takes 5 seconds to return to Windows screen.
Does anyone know why nothing gets printed with a generic/only text drive and with @ lin,col say command?
 
Hi,

Once your text file is created, try:

SET HEADING OFF
SET CONSOLE OFF
you could place some printer codes here with ???
TYPE yourfile.txt TO PRINTER
some more printer codes with ??? if you want
SET PRINTER TO
SET CONSOLE ON
SET HEADING ON

It works for me. Note TYPE is a Foxpro command.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top