Eviltwin,
Textstream is fairly simple, it’s commonly used to write to a file but it can also be used to write directly to a port, such as your lpt printer port. Writestring writes a string and WriteLine writes a string with a carriage at the end of it, writeline is pretty much all I use. The idea for printing labels with a text stream is you want to create a table with the desired data then do a scan through the data and send the appropriate data to the textStream adding blank lines for a header and filling in blank lines after the data to complete the label. I really think this is the only way to go for printing to a dot matrix printer, the windows GUI interface has never worked with dot matrix printers, it’s frustrating and slow at best. The textStream method can work really well, I use it in an office envroment across a network with a windows 2000 server printing on multiple machines with local/shared printers on individual workstations with no problems other than an occasional mapping problem that is unrelated to Paradox. I even use virtual ports such as lpt4-9 for my network printers giving me great flexibility.
Here is some sample code
method pushButton(var eventInfo Event)
var
ts textstream
tc tcursor
headerLines, textLines, labelLength number
endvar
ts.open("C:\\a.txt","nw"

tc.open("

riv:answer"
headerLines = 4 ; number of blank lines to be fed before printing begins
textLines = 3 ; number of lines of text to be printed
labelLength = 19 ; label length in lines should be around 19 for a 3" label
scan tc:
ts.writeLine(fill("\n",headerLines)) ; just printing carriage returns for the header
ts.writeLine(tc.firstName"+" "+tc.lastName)
ts.writeLine(tc.address)
ts.writeLine(tc.city+", "+tc.state +" "+tc.zip)
ts.writeLine(fill("\n",labelLength - headerLines - textLines)) ; prints carriage returns to fill in the label length
endscan
ts.close()
tc.close()
endMethod
This code is fairly simple and you should add some error hanlding, you may also have a variable nuber of lines in the address and you will have to adjust the textLines variable to accomidate things like a second address line or a country line. You will also have to limit the length of the lines of text to keep them from rinning off the label or wrap them if necessary. Let me know how this works and if you have any problems please let me know and I’ll help you through them.
Perrin