Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Directing text to a .txt file
Message
 
 
À
30/03/2011 10:39:29
Joseph Smith
The Ohio State University
Columbus, Ohio, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Network:
Windows 2000 Server
Divers
Thread ID:
01505516
Message ID:
01505525
Vues:
63
STRTOFILE() is much better in this case. You can also write a small wrapper function Write2Log around it to handle repeating pieces.
lcLogFile = app_dir + 'auto_launch_' + DTOC(DATE(),1) + '.txt'
lcCrLf = CHR(13) + CHR(10)

...
log_file_entry = TIME()+'   '+DTOC(DATE())+'   '+process_to_run
STRTOFILE(log_file_entry + lcCrLf, lcLogFile, 1)
...
>Attempting to create and maintain a log file (.txt) and am using the following commands with code:
>
>SET ALTERNATE ON
>SET ALTERNATE TO
>SET ALTERNATE TO '&app_dir'+'auto_launch_'+CHRTRAN(DTOC(DATE()),'/','')+'.txt' ADDITIVE
>
>then
>
> tasks(lp_cntr,10) = DATE()
> log_file_entry = SPACE(200)
> log_file_entry = TIME()+' '+DTOC(DATE())+' '+process_to_run
> ? '&log_file_entry'
>
>The desired text is displayed on the Foxpro window and not written to file.
>
>
--sb--
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform