Page 1 of 1 1
Topic Options
#206840 - 2013-03-01 04:27 PM Super noob question!
Bengaul Offline
Just in Town

Registered: 2013-02-21
Posts: 4
Loc: UK
I have been searching on how I might create a simple .txt file at logon, but I am unable to see. So here I am asking the Noob question of death. Come on and do you worst. But give me the answer too!

Cheers,

Soon to be told to google,

Ben

Top
#206843 - 2013-03-01 04:38 PM Re: Super noob question! [Re: Bengaul]
Glenn Barnas Administrator Offline
KiX Supporter
*****

Registered: 2003-01-28
Posts: 4403
Loc: New Jersey
Google! (there - it's been said) \:D

Glengle Result:
 Code:
$Rc = RedirectOutput('path\to\file.txt')
"message" ?
$Rc = RedirectOutput('')
The RedirectOutput function sends all output that follows to the specified file. Running it again with an empty filespec turns off the redirection.

Simple!

Glenn
_________________________
Actually I am a Rocket Scientist! \:D

Top
#206846 - 2013-03-01 06:01 PM Re: Super noob question! [Re: Glenn Barnas]
Bengaul Offline
Just in Town

Registered: 2013-02-21
Posts: 4
Loc: UK
OK, I see. I was looking for something like Makefile or Touch, or echo "text" >> file.txt. Certainly not redirectoutput!

Many thanks!

Ben

Top
#206847 - 2013-03-01 06:17 PM Re: Super noob question! [Re: Bengaul]
Glenn Barnas Administrator Offline
KiX Supporter
*****

Registered: 2003-01-28
Posts: 4403
Loc: New Jersey
Well, RedirectOutput is the easiest and most direct method to send output to a file. Note that it ALWAYS APPENDS, so you may want to start by deleting the file if it exists.

The more complicated method would involve Open, WriteLine, and Close operations.

Glenn
_________________________
Actually I am a Rocket Scientist! \:D

Top
#206848 - 2013-03-01 06:57 PM Re: Super noob question! [Re: Glenn Barnas]
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
does not always append!
 Code:
 
REDIRECTOUTPUT

Action

Redirects all screen output to a file.

 

Syntax

REDIRECTOUTPUT ("file name", overwrite)

 

Parameters

File name

A string naming the file to which output should be redirected. If this parameter is an empty string (""), output is redirected to the screen. Note that output can also be redirected to the CON or NUL device.

Overwrite

Optional numeric value indicating whether to clear the output file before writing any data to it. This parameter can have the following values:

 

0
	

New output data appended to the existing contents of file.

1
	

All data in file overwritten when the output is redirected to the file.

_________________________
!

download KiXnet

Top
#206854 - 2013-03-02 03:24 PM Re: Super noob question! [Re: Lonkero]
Glenn Barnas Administrator Offline
KiX Supporter
*****

Registered: 2003-01-28
Posts: 4403
Loc: New Jersey
Wow - I guess I need to update the in-memory copy of the Kix manual!

G-
_________________________
Actually I am a Rocket Scientist! \:D

Top
#206859 - 2013-03-04 11:57 AM Re: Super noob question! [Re: Bengaul]
Mart Moderator Offline
KiX Supporter
*****

Registered: 2002-03-27
Posts: 4673
Loc: The Netherlands
 Originally Posted By: Bengaul
OK, I see. I was looking for something like Makefile or Touch, or echo "text" >> file.txt. Certainly not redirectoutput!

Many thanks!

Ben


I've been using the UDF linked below for several years. Not sure where it came from, who made it and why it was not posted in the UDF section so I posted it now.

UDF Library » CreateFile() - Creates the specified file and if needed the path
_________________________
Mart

- Chuck Norris once sold ebay to ebay on ebay.

Top
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 2312 anonymous users online.
Newest Members
fgarcia, Viginette, ManuvdWielNL, Sir_Barrington, batdk82
17889 Registered Users

Generated in 0.198 seconds in which 0.164 seconds were spent on a total of 13 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org