Page 1 of 1 1
Topic Options
#61571 - 2001-12-20 03:39 PM RedirectOutput function syntax ?
Woody53OZ Offline
Fresh Scripter

Registered: 2001-12-13
Posts: 5
Loc: Brisbane, Australia
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

Top
#61572 - 2001-12-20 03:44 PM Re: RedirectOutput function syntax ?
Kdyer Offline
KiX Supporter
*****

Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
Woody53OZ,

Try changing the following...

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

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

HTH,

- Kent

_________________________
Utilize these resources:
UDFs (Full List)
KiXtart FAQ & How to's

Top
#61573 - 2001-12-21 04:54 AM Re: RedirectOutput function syntax ?
Woody53OZ Offline
Fresh Scripter

Registered: 2001-12-13
Posts: 5
Loc: Brisbane, Australia
Tried that to no avail......
Top
#61574 - 2001-12-21 06:10 AM Re: RedirectOutput function syntax ?
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
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 ]

Top
#61575 - 2001-12-21 06:18 AM Re: RedirectOutput function syntax ?
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
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?

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

Top
#61576 - 2001-12-21 07:06 AM Re: RedirectOutput function syntax ?
MCA Offline
KiX Supporter
*****

Registered: 2000-04-28
Posts: 5152
Loc: Netherlands, EU
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.

_________________________
email scripting@wanadoo.nl homepage scripting@wanadoo.nl | Links | Summary of Site Site KiXforms FAQ kixtart.org library collection mirror MCA | FAQ & UDF help file UDF kixtart.org library collection mirror MCA | mirror USA | mirror europe UDF scriptlogic library collection UDFs | mirror MCA

Top
#61577 - 2001-12-21 11:25 AM Re: RedirectOutput function syntax ?
Woody53OZ Offline
Fresh Scripter

Registered: 2001-12-13
Posts: 5
Loc: Brisbane, Australia
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

Top
#61578 - 2001-12-22 02:52 AM Re: RedirectOutput function syntax ?
MCA Offline
KiX Supporter
*****

Registered: 2000-04-28
Posts: 5152
Loc: Netherlands, EU
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.

_________________________
email scripting@wanadoo.nl homepage scripting@wanadoo.nl | Links | Summary of Site Site KiXforms FAQ kixtart.org library collection mirror MCA | FAQ & UDF help file UDF kixtart.org library collection mirror MCA | mirror USA | mirror europe UDF scriptlogic library collection UDFs | mirror MCA

Top
Page 1 of 1 1


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

Who's Online
1 registered (Allen) and 466 anonymous users online.
Newest Members
gespanntleuchten, DaveatAdvanced, Paulo_Alves, UsTaaa, xxJJxx
17864 Registered Users

Generated in 0.058 seconds in which 0.026 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