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

word wrapping when printing?? 2

Status
Not open for further replies.

EzLogic

Programmer
Aug 21, 2001
1,230
US
In my POS application, we use thermal receipt printers, and we mostly use the Generic/Text Only driver.

at the bottom of the receipt, we print the return policy etc..

the receipt column width is 40 characters max.

currently, the return policy is stored in a memo field.

what i want to do is allow the user to be able to edit that in an editbox and have it format correctly and autowrap to 40char max in the edit box.

any suggestions?

Ali Koumaiha
TeknoSoft Inc.
Michigan
 
Make the edit box have a fixed font (like courier) at (say) 9 or 8 pt, then adjust the width of the edit box on the form so that only 40 characters are allowed.

At a push you could even process the memo field before saving, using MLINE() and SET MEMOWIDTH TO 40 to extract the lines and
force a CrLf on the end of each one... overkill really

Regards

Griff
Keep [Smile]ing

There are 10 kinds of people in the world, those who understand binary and those who don't.
 
Hi Ali,

How are you sending the text to the printer?

If you are using the "?" command, then don't worry about the width of the edit box, and forget about wrapping the text. Just SET MEMOWIDTH TO 40, and VFP will automatically wrap the text for you.

But, as Griff says, you will need to use a fixed-pitch font if you want to be sure you are using the full width of the receipt.

If you are using the report designer to create the receipt, the same principle applies. Set the width of the return policy area within the report to the required width. This is the actual width in inches or centimetres, not the number of characters.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips, training, consultancy
 
Thanks Griff & Mike,

i will try to use the set memowidth to 40.

Mike, yes, i am using the ? command.

Ali Koumaiha
TeknoSoft Inc.
Michigan
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top