Page 1 of 1 1
Topic Options
#146504 - 2005-08-26 10:12 PM script command line parameters
burnsc Offline
Starting to like KiXtart

Registered: 2004-04-14
Posts: 171
Is there a way to handle parameters to a script. Up to this point I have written entirely self contained scripts.

I need something to take parameters I feed with something like this (kix32.exe .kix ). I am wondering how would I access this data in my script.

Thanks

Top
#146505 - 2005-08-26 10:17 PM Re: script command line parameters
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
Yes, it is well explained in the manual.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#146506 - 2005-08-26 11:46 PM Re: script command line parameters
Witto Offline
MM club member
*****

Registered: 2004-09-29
Posts: 1828
Loc: Belgium
Page 13 of the kix2010.doc
Quote:


KiXtart also supports declaring variables at the command prompt, as demonstrated in the following example:

kix32 Demo.kix $Key=HKEY_LOCAL_MACHINE\Software




Top
#146507 - 2005-08-26 11:46 PM Re: script command line parameters
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
parameters can be passed as:
wkix32.exe script.kix $parameter1="my text param" $parameter2=4
_________________________
!

download KiXnet

Top
#146508 - 2005-08-26 11:47 PM Re: script command line parameters
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
damn, you got there first
_________________________
!

download KiXnet

Top
#146509 - 2005-08-26 11:48 PM Re: script command line parameters
Witto Offline
MM club member
*****

Registered: 2004-09-29
Posts: 1828
Loc: Belgium
Yep
Top
#146510 - 2005-08-29 02:07 PM Re: script command line parameters
burnsc Offline
Starting to like KiXtart

Registered: 2004-04-14
Posts: 171
Sorry, I did a manual 'search' using word. I guess I did not use the correct keyword.

I also did a very quick browse through, but I guess that was fettered due to the time I allotted it.

Thanks for all the help though.

Top
#146511 - 2006-02-24 04:38 PM Re: script command line parameters
euc Offline
Fresh Scripter

Registered: 2005-05-24
Posts: 6
How would you pass an multiple values to one parameter?

Would this work? wkix32.exe script.kix $machines="machine1;machine2;machine3"

Top
#146512 - 2006-02-24 04:56 PM Re: script command line parameters
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
Yup that would work, then you can just split them out in your script:

Code:

break on

$machines = split($machines,";")

for each $machine in $machines
?"machine=" $machine
next

exit 0



-Shawn

Top
#146513 - 2006-02-24 06:41 PM Re: script command line parameters
euc Offline
Fresh Scripter

Registered: 2005-05-24
Posts: 6
Cool!

Thanks

Top
Page 1 of 1 1


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

Who's Online
0 registered and 895 anonymous users online.
Newest Members
batdk82, StuTheCoder, M_Moore, BeeEm, min_seow
17885 Registered Users

Generated in 0.06 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