Page 1 of 1 1
Topic Options
#40981 - 2003-06-03 06:28 PM RedirectOutput Question
Josh R Offline
Fresh Scripter
****

Registered: 2003-05-07
Posts: 49
When I use this command I keep getting a "0" in the first cell in my excel document. How do I get rid of this!?
Top
#40982 - 2003-06-03 06:30 PM Re: RedirectOutput Question
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
Please take a look at the FAQ Forum under Why does the console display zeros and ones (amongst others)?
_________________________
There are two types of vessels, submarines and targets.

Top
#40983 - 2003-06-03 06:41 PM Re: RedirectOutput Question
Josh R Offline
Fresh Scripter
****

Registered: 2003-05-07
Posts: 49
That really doesn't answer my question. I need to know how to stop it. I am new to using kixtart.
Top
#40984 - 2003-06-03 06:43 PM Re: RedirectOutput Question
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
As the author of that FAQ, I have to disagree. What part of the FAQ do you not understand?
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#40985 - 2003-06-03 06:47 PM Re: RedirectOutput Question
Josh R Offline
Fresh Scripter
****

Registered: 2003-05-07
Posts: 49
I have output going to a CSV file. The first thing that shows up is a 0. I could care less about a command box. I need to know how to stop the zero. I have no idea how to do that.
Top
#40986 - 2003-06-03 06:50 PM Re: RedirectOutput Question
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
WTF are you talking about? There is no reference to any command box. Just read the FAQ.

quote:
The likely answer is that they are the return codes from functions
code:
Examples:
$ReturnCode = AddKey("HKEY_CURRENT_USER\EZReg")

$RC=BackupEventLog("Application","C:\eventbackups\application.evt")

_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#40987 - 2003-06-03 06:52 PM Re: RedirectOutput Question
Josh R Offline
Fresh Scripter
****

Registered: 2003-05-07
Posts: 49
WTF does that code have to do with what I am asking!??

RedirectOutput ("\\AFNBLFSRV1\INVLOG\@HOSTNAME.CSV") = 1
?","
"Computer Name,"
"OS,"
"Service Pack,"
"SID,"
"DATE,"
"MAC,"
"IP,"
?","
"@HOSTNAME,"
"@PRODUCTTYPE,"
"@CSD,"
"@SID,"
"@DATE,"
"@ADDRESS,"
"@IPADDRESS0,"
?" "
?"APPS"

Where is the zero coming from!?!!?!?

Top
#40988 - 2003-06-03 06:53 PM Re: RedirectOutput Question
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
ou may also want to look at the FAQ
Topic: File Input/Output Primer
There I have an example of how the return code from RedirectOutput() is handled.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#40989 - 2003-06-03 06:54 PM Re: RedirectOutput Question
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
Josh, first of all we're trying to help you without even seeing the code you're using. That doesn't make it particular easy for us.

Secondly, the answer you are looking for is most likely in the referenced FAQ as you are redirecting your output from the console to a CSV file.

Have you even treid to implement the recommendation the the FAQ or compared your code with what is demonstrated in the FAQ?

We are willing to help you, however, we expect that you do your homework, too. That includes reading what the different forums are about so that you don't cross-post or post in inappropriate forums, and for example reading referenced threads and especially the FAQ forum.

BTW, a CSV file is not an Excel file as Excel is using a proprietary file format that KiXtart cannot write to directly. A CSV file is a plain-text file with standardized formatting, namely comma-separated-value formatting.
_________________________
There are two types of vessels, submarines and targets.

Top
#40990 - 2003-06-03 06:57 PM Re: RedirectOutput Question
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
The '0' is coming from
code:
RedirectOutput ("\\AFNBLFSRV1\INVLOG\@HOSTNAME.CSV") = 1

, thus the initially referenced FAQ still applies. Additionally, this behavior is also documented in the KiXtart Manual, page 25-26 in the v4.21 edition.
_________________________
There are two types of vessels, submarines and targets.

Top
#40991 - 2003-06-03 06:59 PM Re: RedirectOutput Question
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
Josh,
I have been more than patient with you.

First off, your syntax is wrong.
RedirectOutput ("\\AFNBLFSRV1\INVLOG\@HOSTNAME.CSV") = 1

You cannot assign a '= 1' to the end of a function!

As mentioned already in the FAQ and reiterated for your benefit, the zero is coming from your RedirectOutput().

You can silence it as per my examples:

$RC=RedirectOutput ("\\AFNBLFSRV1\INVLOG\@HOSTNAME.CSV")
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#40992 - 2003-06-03 07:16 PM Re: RedirectOutput Question
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
Actually,
code:
RedirectOutput ("\\AFNBLFSRV1\INVLOG\@HOSTNAME.CSV") = 1

can be done if one wants to check whether the returncode of REDIRECTOUTPUT equals 0. It's basiclaly comparing two values. The result for this comparison will then printed.

However, Les is right, when he says that one cannot set a function to a value.
_________________________
There are two types of vessels, submarines and targets.

Top
#40993 - 2003-06-03 07:39 PM Re: RedirectOutput Question
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
hey!
WTF-police here...
keep your language clean or I'll jump in and everyone knows that will get messy [Wink]

[ 03. June 2003, 19:40: Message edited by: Lonkero ]
_________________________
!

download KiXnet

Top
#40994 - 2003-06-03 08:54 PM Re: RedirectOutput Question
Josh R Offline
Fresh Scripter
****

Registered: 2003-05-07
Posts: 49
Ok obviously I do not understand where this is supposed to go. I did not mean to have the = 1 on the end. When I cut and pasted it I copied the wrong thing. My code does not have the = 1 on it. Where am I supposed to put the:

$RC=RedirectOutput ("\\AFNBLFSRV1\INVLOG\@HOSTNAME.CSV")

Top
#40995 - 2003-06-03 08:57 PM Re: RedirectOutput Question
Radimus Moderator Offline
Moderator
*****

Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
[Eek!] [Eek!] [Eek!]

I would like to applaud Les on his efforts to help the original poster here.

He has shown exceptional 'customer service skills' here, especially considering his typical reactions...

[Big Grin]
_________________________
How to ask questions the smart way <-----------> Before you ask

Top
#40996 - 2003-06-03 09:00 PM Re: RedirectOutput Question
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
code:
$RC=RedirectOutput('\\AFNBLFSRV1\INVLOG\@HOSTNAME.CSV') 

will go to the line of code from where on you want to redirect console output to the specified file.
_________________________
There are two types of vessels, submarines and targets.

Top
#40997 - 2003-06-03 09:03 PM Re: RedirectOutput Question
Josh R Offline
Fresh Scripter
****

Registered: 2003-05-07
Posts: 49
THANK YOU!!!!
THANK YOU!!!!
THANK YOU!!!!
THANK YOU!!!!
THANK YOU!!!!
THANK YOU!!!!
THANK YOU!!!!

Top
#40998 - 2003-06-03 09:06 PM Re: RedirectOutput Question
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
Please don't shout. One 'Thank You!' would be enough.
_________________________
There are two types of vessels, submarines and targets.

Top
#40999 - 2003-06-03 09:09 PM Re: RedirectOutput Question
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
I love happy endings.
Top
#41000 - 2003-06-03 09:32 PM Re: RedirectOutput Question
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
mm...
my quess is that we will see lot more shouting later...

josh, every time you have specific problem, search the manual first for explanation.
then, doing a search on faq-forum will answer many more questions.
if you still have a problem, post it in descriptive manner.

and once you get answered, try to understand the answer.
if you can't understand, type: "could you explain little more this and this"

simple yelling and frustration does not cut it.

I bet we all know what it is to not to get something but we have no way of helping if you are not fully "there" to be helped.

cheers.

ps. shawn, I'm not so sure I do [Wink]
_________________________
!

download KiXnet

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 765 anonymous users online.
Newest Members
batdk82, StuTheCoder, M_Moore, BeeEm, min_seow
17885 Registered Users

Generated in 0.074 seconds in which 0.027 seconds were spent on a total of 12 queries. Zlib compression enabled.

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