Page 1 of 1 1
Topic Options
#33159 - 2002-11-21 10:02 AM Command parameters
jersey12345 Offline
Lurker

Registered: 2002-11-21
Posts: 1
How do I read the command parameters that a user enters when he/she runs the program. For Example:

kix32 somescript.kix /help

How would I retrieve the /help parameter?

Top
#33160 - 2002-11-21 10:54 AM Re: Command parameters
Richard H. Administrator Offline
Administrator
*****

Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
The easiest way to pass a parameter is to assign it to a variable, e.g.
code:
kix32 somescript.kix $sP1="help"

In the script you can now reference the "$sP1" variable directly.

Top
#33161 - 2002-11-21 11:41 PM Re: Command parameters
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
Anything else will not be processed anyway, so the '/help' won't do anything.
_________________________
There are two types of vessels, submarines and targets.

Top
#33162 - 2002-11-21 11:43 PM Re: Command parameters
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
jersey, if there is a user for whom you are writing and who does not know kix, you can put a check if any input was given, if not, show help
_________________________
!

download KiXnet

Top
#33163 - 2002-12-08 11:17 PM Re: Command parameters
MCA Offline
KiX Supporter
*****

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

To catch this information by f.e. a new @commandline macro is
something on the suggestion forum.
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
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 1452 anonymous users online.
Newest Members
Viginette, ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder
17888 Registered Users

Generated in 0.124 seconds in which 0.097 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