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

Line Wrapping at 50 when PRINTER set to file

Status
Not open for further replies.

RW Hirn

Programmer
May 20, 2024
4
US
I have a VFP9 program which is long running and while it runs I log messages to the screen using "?" output. I also wanted to keep a record of the messages so I used
Code:
SET PRINTER TO LOGFILE.LOG ADDITIVE
SET PRINTER ON
in order to output everything to a file. Been running this way for years.

When looking through this log file I often noticed that sometimes it would record a line just fine and sometimes it would start "wrapping" all lines over a certain, very small, length.
Sometimes in the middle of a series of messages it would start wrapping and continue that way to the end.
Here's an example of the same message type one day fine and another day wrapped.
Code:
AAA AAAA Order #: 2770730386 UPS Tracking #: 1Z0V36E90341443786 AAA Order #: 590114 COULD NOT BE UPDATED! Shipping notification email has already been sent for this receipt.
Code:
AAA AAAA Order #: 2799032209 UPS Tracking #:
1Z19EY030340824261 AAA Order #: 592945 COULD NOT
BE UPDATED! Shipping notification email has
already been sent for this receipt.

You can see that this is not even 80 characters, which I would have expected an old time Foxpro "default" width to be set at, but looks to be 50.
I have searched through here (and any other Google responses) and I cannot find any way to set the character width of the "default" printer and certainly not when using SET PRINTER TO filename.

Anyone have any ideas what a solution might be?
 
Hi,

Did you read topic "SET MEMOWIDTH Command" in VFP Help?



mJindrova
 
To create text files with fixed width columns you have other options, too.

An SDF type ouput is like that, and can be done with a tble or cursor, well, in short a workarea as source with COPY TO.

Chriss
 
@mJindrova No I did not. Was not aware MEMOWIDTH affected PRINT TO FILE output.

@Chris Miller Thanks, good "outside the box" idea.
 
What about using ALTERNATE instead?

SET ALTERNATE TO 'FILENAME.LOG'
SET ALTERNATE ON

* Run program

SET ALTERNATE OFF
SET ALTERNATE TO
 
By the way, you missed the code tags just by one on the icon bar, you can edit your code and replace the word spoiler with code to get it as intended.

Chriss
 
@Dan Olsson Thanks. I forgot about that (at least I think I knew it once!).
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top