>I am trying to print to a file and embed printer control codes in the file. Whenver I try to do something like ???chr(15), I get the printer not ready error message. It appears to me that the program is trying to send the control code to the printer (the printer that is returned by set('print',3) )rather than the file. Set('print',1) is my file name, set('print',2) is the default windows printer and set('print',3) is my regular VFP printer. Is there a way around this? I must confess that this printing setup is very confusing to me. My ultimate aim is to use rawprint to print. Any help will be greatly appreciated.
??? means send to printer. That's why it's sending it to the printer. You should be using either ? (which starts by sending a carriage return, then sends your output) or ?? (which sends your output with no carriage return).
Of course before using ? and ?? to send the output to a file you need SET ALTERNATE TO and SET ALTERNATE ON, and when you're done you need SET ALTERNATE OFF. Or you need SET PRINTER TO < file >, SET PRINTER ON, and SET PRINTER OFF. You also probably want SET CONSOLE OFF while this is going on, but maybe not.
HTH,
Rich.
Rich Addison, Micro Vane, Inc., Kalamazoo, MI
Relax, don't worry, have a homebrew.
- Charlie Papazian, The New Complete Joy of Home Brewing