Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Printing to a File??
Message
 
À
18/02/1999 14:38:49
Calvin Smith
Wayne Reaves Computer Systems
Macon, Georgie, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00188515
Message ID:
00189024
Vues:
14
>worse yet- if I write something like
>use cust
>set print off
>set print to myfile.txt
>set console off
>go top
>scan
>?cust.cusname
>???chr(10)
>endscan
>set console on
>set print to
>
>the file will have nothing in it except 1 chr(10). What's going on??? If I take the ???chr(10) out the file is OK.

This makes sense, now. In the sample code above, your problem is that you set print off and never set it back on. SET PRINT TO < file > does not do an implicit SET PRINT ON, if you thought it did. If PRINT is OFF, ? and ?? won't go to the printer. But ??? sends output to the current printer, regardless of SET PRINT ON/OFF, so the chr(10) is going there.

What you want is either to SET PRINT ON and use ? and/or ??, or ignore PRINT ON/OFF setting and only use ???.

Or you might consider using SET ALTERNATE instead of SET PRINT, although you still have to give SET ALTERNATE ON after SET ALTERNATE TO < file >.

Cheers,
Rich.
Rich Addison, Micro Vane, Inc., Kalamazoo, MI
Relax, don't worry, have a homebrew.
- Charlie Papazian, The New Complete Joy of Home Brewing
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform