Page 1 of 1 1
Topic Options
#16633 - 2002-01-25 01:48 PM Calling kix scripts from within kix scripts
resadd Offline
Lurker

Registered: 2002-01-25
Posts: 3
I have a kix script that deletes temp files in the users area on our cad server. The script is quite long and I don't want to include it in the main kix script all users run on startup.

I issue the command
call cleanup.kix
from the main kix script but all I get is
Script error : Error in expression. !

I've also tried the following
call "cleanup.kix"
call \\servername\netlogon\cleanup.kix
call "\\servername\netlogon\cleanup.kix"
call %0\..\cleanup.kix
call "%0\..\cleanup.kix"

What is it I'm missing here?

Thanks.

Top
#16634 - 2002-01-25 01:58 PM Re: Calling kix scripts from within kix scripts
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
Error in expression seems to be a problem somewhere else in either the calling or the called script; the syntax for calling scripts is :

call "[path] Scriptname"

and seems to be correctly used in your case ...


To get closer to a fix I recommend using MCAs kixstrip utility here

_________________________



Top
#16635 - 2002-01-25 01:59 PM Re: Calling kix scripts from within kix scripts
Darren_W Offline
Hey THIS is FUN
*****

Registered: 2001-10-10
Posts: 208
Loc: Bristol, England
Hi,

Try using somthing like this

Call ("@ScriptDir\Outlook.kix")

I have not looked at what @ScriptDir is but I assume it is your netlogon directory.

Bye

Darren

_________________________
I want to share something with you - the three sentences that will get you through life.
Number 1, 'cover for me.'
Number 2, 'oh, good idea, boss.'
Number 3, 'it was like that when I got here'.

Top
#16636 - 2002-01-25 02:20 PM Re: Calling kix scripts from within kix scripts
resadd Offline
Lurker

Registered: 2002-01-25
Posts: 3
Thanks,
But how do you use kixstrip?

Top
#16637 - 2002-01-25 02:48 PM Re: Calling kix scripts from within kix scripts
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
uh ... well ,

dl the exe that fits your version 3.6x or 4.x,
the best results i got by copying the script in question to the folder kixstrip resides, open a DoS box cd to the dir kixstrip resides and type something like :
kixstrip400 yourscript.kix outputfile.ext /debug

hth

J.

_________________________



Top
#16638 - 2002-01-25 03:04 PM Re: Calling kix scripts from within kix scripts
resadd Offline
Lurker

Registered: 2002-01-25
Posts: 3
Thanks.
I've run that.
No errors found.
Thanks anyway.

Top
#16639 - 2002-01-25 11:34 PM Re: Calling kix scripts from within kix scripts
bleonard Offline
Seasoned Scripter
*****

Registered: 2001-01-19
Posts: 581
Loc: Chicago, IL
resadd -
Here is some code I use for set a call drive variable. I set a variable value within my login script batch file (login.bat, TmpKixVar) to '1'. In this way, my script can differentiate if called from the login batch file, or a command prompt for testing.

In this example, the call drive is the server netlogon share.

I use this so if changing directories to call KiX scripts from (primarily during testing), only 1 place in my script to change versus every CALL command.

This code is for KiX 3.63.

Bill

code:

Batch process to set variable:

SET TmpKixVar=1
%WinDir%\Kix32.exe %0\..\login.kix
SET TmpKixVar=
EXIT


KiX script to use variable and set CALL dir:

SELECT ; REM ** Variable set/removed from batch file 'login.bat'
CASE (%TmpKixVar% = 1) AND (@INWIN = 1) $CallDrv = (SUBSTR (@LDRIVE, 1, LEN (@LDRIVE)-1)) ; REM ** Removes trailing '\'.
CASE (%TmpKixVar% = 1) $CallDrv = @LDRIVE
CASE (1) $CallDrv = @CURDIR ; REM ** Script started from command prompt
ENDSELECT

; REM ** Set where all scripts are called from (REGULAR or TEST directories)
$CallKix = "$CallDrv\Regular"


Using CALL command within script:

CALL "$CallKix\kixscript.kix"


[ 25 January 2002: Message edited by: bleonard ]

Top
#16640 - 2002-01-27 06:11 AM Re: Calling kix scripts from within kix scripts
MCA Offline
KiX Supporter
*****

Registered: 2000-04-28
Posts: 5152
Loc: Netherlands, EU
Dear Resadd,

Kixstrip has a lot of possibilities.

Simple calling: kixstrip
returns date and time information.

Calling: kixstrip ?
returns help information.

Calling: kixstrip input.kix output.kix /block_check
will verify your kixtart code.

Calling: kixstrip input.kix output.kix /debug
will insert additional debugging code to your script which will show
- which lines were executed.
- what was the time of execution.
- what was the error status of previous line.

Calling: kixstrip input.kix output.kix /performance
shows which part of your script consumes most of your time.

For additional information see our site:
symbol on our homepage has been linked to related http://kixtart.org topic.

greetings.

btw: the message "script error: in expression!" has nothing to do with your call.
you will not get an error even when specified script doesn't exist.
also the message should be something like "script error: unknown command.".

btw: a way to find your problem during execution is using our kixstrip
tool with the option /DEBUG. during execution it will show you exactly what
the last line of execution was.

btw: can you put your code on the board or send us a copy of it.

_________________________
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:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 1821 anonymous users online.
Newest Members
ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder, M_Moore
17887 Registered Users

Generated in 0.073 seconds in which 0.037 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