[Moderator's (LLigetfa) note: This topic originally started and continues HERE.]
Here's something that may be useful in the FAQ section. I consider myself to be an old hand at the command line, but this has had me going for an hour or two.
This isn't strictly KiXtart, as it appears to happen to any binary which gets command line parameters, including a simple C program I coded up.
Note, this has been tested on Win'95, as that is the lowest OS that KiXtart now supports. I'd be interested to hear if it applies to other members of the Windows family.
When passing variables to a KiXtart script you use the form:
code:When your script executes, it will start with the variable $sString containing the word elephant.
kix32.exe myscript.kix $sString=elephant
What if there are spaces in the string? Well that's easy:
code:The variable now contains the sentence "He said elephant".
kix32.exe myscript.kix $sString="He said elephant"
It get's tricky now. Suppose you want to use the " character in the string yourself. Being a veteran KiXtart scripter you might think that you could do:
code:Well, you'd be wrong. It doesn't work.
kix32.exe myscript.kix $sString='He said "elephant"'
The answer it turns out, is to treble the " character, so your line becomes:
code:I've done some testing and it seems to work consistantly.
kix32.exe myscript.kix $sString="He said """elephant""""
[ 21. December 2002, 18:34: Message edited by: LLigetfa ]