Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Best way to print a stand-alone text file from Fox?
Message
From
07/10/2009 09:25:37
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
 
 
To
07/10/2009 09:14:48
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP
Miscellaneous
Thread ID:
01428034
Message ID:
01428037
Views:
63
>Other than the Type command, is there a better way to print a stand-alone text file from Fox?
>
>TIA!

I am not sure what is the BEST option; here are some alternatives; most alternatives require the printer to have text capabilities. The GDI printers (cheap printers) don't have those.

  • In the past, I have used the COPY command. I am not sure whether that still works in a Windows environment.
  • The "???" command definitely works. See sample code 1, below.
  • You can of course generate your text in a variable in the first place, and send to the printer with "???".
  • If you produce data programmatically, I suggest you take a look at some reporting class to assist you. One of them is my download #9991.
    * Sample code 1
    * Assuming the text is in file "report.txt"
    * Printer setup codes are optional, but they will ensure the printer is reset to some standard state; also,
    * you can define a font, for example, 17 DPI for narrow print.
    ??? lcPrinterSetupCodes + FileToStr("report.txt")
    Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
  • Previous
    Reply
    Map
    View

    Click here to load this message in the networking platform