I would like to write one line of text to a file each time an event
occurs and just keep appending the text. I have tried the set device
to file but each time I write to the file it just keeps overwriting
the file. I have tried the append but it appears I do not know what I
am doing. Can someone give me a hand??
TonySper

Re: Audit trail by Grenkor

Grenkor
Wed Jan 12 23:28:45 CST 2005

Try this :

set alternate to "yourFileNm.txt" ADDITIVE
set alternate on

? " your log file content here.... "

set alternate to
set alternate off


"TonySper" <tsperduti@bellsouth.net> wrote in message
news:lqlFd.25734$zy6.1023@bignews5.bellsouth.net...
>I would like to write one line of text to a file each time an event
> occurs and just keep appending the text. I have tried the set device
> to file but each time I write to the file it just keeps overwriting
> the file. I have tried the append but it appears I do not know what I
> am doing. Can someone give me a hand??
> TonySper
>
>



Re: Audit trail by TonySper

TonySper
Thu Jan 13 09:00:11 CST 2005

Grenkor,
Thank you. Works great. Why is something so simple so hard to figure
out by yourself??? I was using the set device and never gave set
alternate a thought. Hard to get an old guy like me to learn
something.
Thanks a bunch.
TonySper

"Grenkor Den" <someone@microsoft.com> wrote in message
news:OuFsODT%23EHA.3416@TK2MSFTNGP09.phx.gbl...
Try this :

set alternate to "yourFileNm.txt" ADDITIVE
set alternate on

? " your log file content here.... "

set alternate to
set alternate off


"TonySper" <tsperduti@bellsouth.net> wrote in message
news:lqlFd.25734$zy6.1023@bignews5.bellsouth.net...
>I would like to write one line of text to a file each time an event
> occurs and just keep appending the text. I have tried the set device
> to file but each time I write to the file it just keeps overwriting
> the file. I have tried the append but it appears I do not know what
> I
> am doing. Can someone give me a hand??
> TonySper
>
>




Re: Audit trail by Dan

Dan
Thu Jan 13 11:40:58 CST 2005

It's actually easier than that.

lcText = "Your line of text here"
StrtoFile(lcText,"file.txt",.t.)

No need to SET ... ON or OFF.

Dan

TonySper wrote:
> Grenkor,
> Thank you. Works great. Why is something so simple so hard to figure
> out by yourself??? I was using the set device and never gave set
> alternate a thought. Hard to get an old guy like me to learn
> something.
> Thanks a bunch.
> TonySper
>
> "Grenkor Den" <someone@microsoft.com> wrote in message
> news:OuFsODT%23EHA.3416@TK2MSFTNGP09.phx.gbl...
> Try this :
>
> set alternate to "yourFileNm.txt" ADDITIVE
> set alternate on
>
> ? " your log file content here.... "
>
> set alternate to
> set alternate off
>
>
> "TonySper" <tsperduti@bellsouth.net> wrote in message
> news:lqlFd.25734$zy6.1023@bignews5.bellsouth.net...
>> I would like to write one line of text to a file each time an event
>> occurs and just keep appending the text. I have tried the set device
>> to file but each time I write to the file it just keeps overwriting
>> the file. I have tried the append but it appears I do not know what
>> I
>> am doing. Can someone give me a hand??
>> TonySper



Re: Audit trail by TonySper

TonySper
Thu Jan 13 15:54:14 CST 2005

Dan,
That works to but the text runs to the end of line no carriage
returns. Is there a way to put each text I send on the next line??
TonySper

"Dan Freeman" <spam@microsoft.com> wrote in message
news:OHe4LcZ%23EHA.3236@TK2MSFTNGP15.phx.gbl...
It's actually easier than that.

lcText = "Your line of text here"
StrtoFile(lcText,"file.txt",.t.)

No need to SET ... ON or OFF.

Dan

TonySper wrote:
> Grenkor,
> Thank you. Works great. Why is something so simple so hard to figure
> out by yourself??? I was using the set device and never gave set
> alternate a thought. Hard to get an old guy like me to learn
> something.
> Thanks a bunch.
> TonySper
>
> "Grenkor Den" <someone@microsoft.com> wrote in message
> news:OuFsODT%23EHA.3416@TK2MSFTNGP09.phx.gbl...
> Try this :
>
> set alternate to "yourFileNm.txt" ADDITIVE
> set alternate on
>
> ? " your log file content here.... "
>
> set alternate to
> set alternate off
>
>
> "TonySper" <tsperduti@bellsouth.net> wrote in message
> news:lqlFd.25734$zy6.1023@bignews5.bellsouth.net...
>> I would like to write one line of text to a file each time an event
>> occurs and just keep appending the text. I have tried the set
>> device
>> to file but each time I write to the file it just keeps overwriting
>> the file. I have tried the append but it appears I do not know what
>> I
>> am doing. Can someone give me a hand??
>> TonySper




Re: Audit trail by TonySper

TonySper
Thu Jan 13 15:59:35 CST 2005

Dan,
How lazy can I get. I put the +chr(13) after the LcText line and it
gives me the carriage return fine. Thanks for the help.
TonySper

"Dan Freeman" <spam@microsoft.com> wrote in message
news:OHe4LcZ%23EHA.3236@TK2MSFTNGP15.phx.gbl...
It's actually easier than that.

lcText = "Your line of text here"
StrtoFile(lcText,"file.txt",.t.)

No need to SET ... ON or OFF.

Dan

TonySper wrote:
> Grenkor,
> Thank you. Works great. Why is something so simple so hard to figure
> out by yourself??? I was using the set device and never gave set
> alternate a thought. Hard to get an old guy like me to learn
> something.
> Thanks a bunch.
> TonySper
>
> "Grenkor Den" <someone@microsoft.com> wrote in message
> news:OuFsODT%23EHA.3416@TK2MSFTNGP09.phx.gbl...
> Try this :
>
> set alternate to "yourFileNm.txt" ADDITIVE
> set alternate on
>
> ? " your log file content here.... "
>
> set alternate to
> set alternate off
>
>
> "TonySper" <tsperduti@bellsouth.net> wrote in message
> news:lqlFd.25734$zy6.1023@bignews5.bellsouth.net...
>> I would like to write one line of text to a file each time an event
>> occurs and just keep appending the text. I have tried the set
>> device
>> to file but each time I write to the file it just keeps overwriting
>> the file. I have tried the append but it appears I do not know what
>> I
>> am doing. Can someone give me a hand??
>> TonySper




Re: Audit trail by Fred

Fred
Thu Jan 13 16:48:52 CST 2005

Add a CHR(13)+CHR(10) to the beginning of the line you're trying to output:

lcText = CHR(13)+CHR(10)+"Your line of text here"
StrtoFile(lcText,"file.txt",.t.)


--
Fred
Microsoft Visual FoxPro MVP


"TonySper" <tsperduti@bellsouth.net> wrote in message
news:a6CFd.3456$Zv5.2179@bignews1.bellsouth.net...
> Dan,
> That works to but the text runs to the end of line no carriage
> returns. Is there a way to put each text I send on the next line??
> TonySper
>
> "Dan Freeman" <spam@microsoft.com> wrote in message
> news:OHe4LcZ%23EHA.3236@TK2MSFTNGP15.phx.gbl...
> It's actually easier than that.
>
> lcText = "Your line of text here"
> StrtoFile(lcText,"file.txt",.t.)
>
> No need to SET ... ON or OFF.
>
> Dan
>
> TonySper wrote:
>> Grenkor,
>> Thank you. Works great. Why is something so simple so hard to figure
>> out by yourself??? I was using the set device and never gave set
>> alternate a thought. Hard to get an old guy like me to learn
>> something.
>> Thanks a bunch.
>> TonySper
>>
>> "Grenkor Den" <someone@microsoft.com> wrote in message
>> news:OuFsODT%23EHA.3416@TK2MSFTNGP09.phx.gbl...
>> Try this :
>>
>> set alternate to "yourFileNm.txt" ADDITIVE
>> set alternate on
>>
>> ? " your log file content here.... "
>>
>> set alternate to
>> set alternate off
>>
>>
>> "TonySper" <tsperduti@bellsouth.net> wrote in message
>> news:lqlFd.25734$zy6.1023@bignews5.bellsouth.net...
>>> I would like to write one line of text to a file each time an event
>>> occurs and just keep appending the text. I have tried the set
>>> device
>>> to file but each time I write to the file it just keeps overwriting
>>> the file. I have tried the append but it appears I do not know what
>>> I
>>> am doing. Can someone give me a hand??
>>> TonySper
>
>
>