Re: Printing to a file using question marks

Author: Peter Cushing

Posted: 2014-04-02 at 10:17:55

Wes Wilson wrote:

> How do I print to a file using question marks?

>

> example: I want the following to put:

>

> this is my first line

>

> this is my last line

>

> in a file.

>

> ?

> ?

> ? 'this is my first line'

> ?

> ? 'this is my last line'

>

> I can do this if I set device to printer but that results in a page eject.

>

> Did it years ago but lost the source.

>

>

You can do this with

SET PRINTER TO test.txt

SET PRINTER on

? 'line 1'

? 'line 2'

SET PRINTER off

SET PRINTER to

but if you have Visual foxpro you can do it directly with

STRTOFILE('This is line 3','test.txt',.t.)

You will need to add carriage returns/line feeds to the string

Peter

----------------------------------------------------------------

Rajan Imports has changed - we are now Whispering Smith Ltd. For more information see our website at www.whisperingsmith.com

Please update your address book with my new email address: pcushing@whisperingsmith.com

.

This communication is intended for the person or organisation to whom it is addressed. The contents are confidential and may be protected in law. Unauthorised use, copying or

disclosure of any of it may be unlawful. If you have received this message in error, please notify us immediately by telephone or email.

www.whisperingsmith.com

Whispering Smith Ltd

Head Office:61 Great Ducie Street, Manchester M3 1RR. Tel:0161 831 3700 Fax:0161 831 3715

London Office:17-19 Foley Street, London W1W 6DW Tel:0207 299 7960

_______________________________________________

Post Messages to: ProFox@leafe.com

Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox

OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech

Searchable Archive: http://leafe.com/archives/search/profox

This message: http://leafe.com/archives/byMID/profox/533C2A23.3060209@whisperingsmith.com

** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.

©2014 Peter Cushing