Woody53OZ
(Fresh Scripter)
2001-12-20 03:39 PM
RedirectOutput function syntax ?

Ive tried the following function within a script, but always comes up with invalid function, what is wrong ?

IF RedirectOutput("C:\idktemp\logon.txt") = 0
?
? " Welcome to XYZ Company: " + @FULLNAME ?
?
? " Date & Time : " + @mdayno + " " + @month + " " + @year + " " + @time ?
?
? " Logged on as : " + @userid ?
?
? " Authenticated by : " + @lserver ?
?
ENDIF


Thanx in Advance,
Woody53Oz

Kdyer
(KiX Supporter)
2001-12-20 03:44 PM
Re: RedirectOutput function syntax ?

Woody53OZ,

Try changing the following...

From - IF RedirectOutput("C:\idktemp\logon.txt") = 0

To - IF RedirectOutput("C:\idktemp\logon.txt",0)

HTH,

- Kent

Woody53OZ
(Fresh Scripter)
2001-12-21 04:54 AM
Re: RedirectOutput function syntax ?

Tried that to no avail......

ShawnAdministrator
(KiX Supporter)
2001-12-21 06:10 AM
Re: RedirectOutput function syntax ?

Hey Woody

What happens if you try this:

break on

IF RedirectOutput("C:\logon.txt") = 0
?
? " Welcome to XYZ Company: " + @FULLNAME ?
?
? " Date & Time : " + @mdayno + " " + @month + " " + @year + " " + @time ?
?
? " Logged on as : " + @userid ?
?
? " Authenticated by : " + @lserver ?
?
ELSE
?"@ERROR: @SERROR"
ENDIF

One of these paths has to get executed - and either one will tell you something interesting ...

-Shawn

[ 21 December 2001: Message edited by: Shawn ]

Les
(KiX Master)
2001-12-21 06:18 AM
Re: RedirectOutput function syntax ?

Woody,
How about some background. You script works for me as is on Win2k KiX 4.01 as long as the folder "C:\idktemp\" exists.

What OS? What KiX version?

MCA
(KiX Supporter)
2001-12-21 07:06 AM
Re: RedirectOutput function syntax ?

Dear,

We look at your code and even with little changes we can't reproduce
your error messages.
The only things are:
- you are using an extremly old kixtart version. RedirectOutput was
introduced at release 3.20
- previous code in your script is initiating that error message.
Question:
- which kixtart version?
- are the kixtart binaries from the same release?
- can you put a part of previous lines of your code on the board?
greetings.

Woody53OZ
(Fresh Scripter)
2001-12-21 11:25 AM
Re: RedirectOutput function syntax ?

Preceeding part of script prior to RedirectOutput is ;

IF @PRODUCTTYPE = "Windows 2000 Professional" or @PRODUCTTYPE = "Windows NT Workstation" or @PRODUCTTYPE = "Windows 2000 Server"
or @PRODUCTTYPE = "Windows 2000 Domain Controller" or @PRODUCTTYPE = "Windows XP Professional" or @PRODUCTTYPE = "Windows NT Domain Controller"
COPY @LDRIVE + "\market*.lnk" "C:\documents and settings\" + @USERID + "\desktop"
ENDIF

COPY @LDRIVE + "\*.tpx" "C:\progra~1\century\tinyterm"
COPY @LDRIVE + "\keyboard.dat" "C:\progra~1\century\tinyterm"

COPY @LDRIVE + "\*.ico "C:\idktemp"


IF REDIRECTOUTPUT("C:\Idktemp\logon.txt",0)
?
? " Welcome to XYZ Company: " + @FULLNAME ?
?
? " Date & Time : " + @mdayno + " " + @month + " " + @year + " " + @time ?
?
? " Logged on as : " + @userid ?
?
? " Authenticated by : " + @lserver ?
?
? " Your Home Server is : " $HomeServer ?
?
? " Your operating system is : " @PRODUCTTYPE ?
?
ENDIF

MCA
(KiX Supporter)
2001-12-22 02:52 AM
Re: RedirectOutput function syntax ?

Dear,

In your line COPY @ldrive + "\*.ico "C:\idktemp" you are missing a
double quotation. The correct line can be:
COPY @ldrive+"\*.ico" "c:\idktemp"

You can verify your code with our tool kix400strip.exe which you
can find on our site http://home.wanadoo.nl/scripting .
After running:
kix400strip input.kix output.kix /block_check /show_structure
the output of your code "output.kix" will be:

code:

IF @producttype = "Windows 2000 Professional" OR
@producttype = "Windows NT Workstation" OR
@producttype = "Windows 2000 Server" OR
@producttype = "Windows 2000 Domain Controller" OR
@producttype = "Windows XP Professional" OR
@producttype = "Windows NT Domain Controller"
COPY @ldrive + "\market*.lnk" "C:\documents and settings\" + @userid + "\desktop"
ENDIF
COPY @ldrive + "\*.tpx" "C:\progra~1\century\tinyterm"
COPY @ldrive + "\keyboard.dat" "C:\progra~1\century\tinyterm"
COPY @ldrive + "\*.ico "C:\idktemp"

IF REDIRECTOUTPUT("C:\Idktemp\logon.txt",0)
?
? " Welcome to XYZ Company: " + @fullname ?
?
? " Date & Time : " + @mdayno + " " + @month + " " + @year + " " + @time ?
?
? " Logged on as : " + @userid ?
?
? " Authenticated by : " + @lserver ?
?
? " Your Home Server is : " $homeserver ?
?
? " Your operating system is : " @producttype ?
?
ENDIF

;($begin)
;
; fri 21-dec-2001 22:38:56 (kix 4.00 vs 2.33e)
;
;Summary KIXSTRIP: block structures
; - do:until [0:0]
; - for|each:in|to:step|next [0|0:0|0:0|0]
; - function:endfunction [0:0]
; - if:else:endif [2:0:2]
; - select:case:endselect [0:0:0]
; - while:loop [0:0]
;Warning KIXSTRIP: 1 line is incompleted.
; rerun program with option "/block_check /show_errors".
;Warning KIXSTRIP: some lines contains errors or possible errors.
; 1 line incomplete "double quotation".
; 1 line incompleted.
;Informative KIXSTRIP: 2 block_structures found.
;Informative KIXSTRIP: no UDF's found.
;Informative KIXSTRIP: no labels found.
;Summary KIXSTRIP: BREAK CALL DEBUG DISPLAY ENDFUNCTION EXECUTE EXIT FUNCTION GET GETS GOSUB GOTO OLExxx PLAY QUIT RETURN RUN SHELL SLEEP THEN USE
;
;($end)
;($begin)
;
;Warning KIXSTRIP: 11 line incomplete "double quotation".
;Warning KIXSTRIP: 11 line incompleted.
;
;($end)



greetings.


btw: symbol on our homepage has been linked to related http://kixtart.org topic.