Hi!
I always used following approach:
SET PRINTER TO MyFile.txt
SET PRINTER ON
** Do checks
? 'Error message'
SET PRINTER OFF
SET PRINTER TO
In addition, SET CONSOLE OFF can cause the problem. Usually, to make a log file, I do the fopen()/fclose() and a function called 'WriteToLog' do the real writing. Or just collect all in the VFP string than StrToFile it when finished.
HTH.
>Problem: I want to run some checks and print errors to text file.
>Code:
>
>SET CONSOLE OFF
>SET ALTERNATE TO SomeFile
>** Do checks
>? 'Error message'
>SET ALTERNATE TO
>
>'Error message' appears on screen.
>Fox creates file 'SomeFile' but it is empty.
>
>What I have missed?
>
>Thans
Vlad Grynchyshyn, Project Manager, MCP
vgryn@yahoo.comICQ #10709245
The professional level of programmer could be determined by level of stupidity of his/her bugs
It is not appropriate to say that question is "foolish". There could be only foolish answers. Everybody passed period of time when knows nothing about something.