[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:
kix32.exe myscript.kix $sString=elephant
When your script executes, it will start with the variable $sString containing the word elephant.
What if there are spaces in the string? Well that's easy:
code:
kix32.exe myscript.kix $sString="He said elephant"
The variable now contains the sentence "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:
kix32.exe myscript.kix $sString='He said "elephant"'
Well, you'd be wrong. It doesn't work.
The answer it turns out, is to treble the " character, so your line becomes:
code:
kix32.exe myscript.kix $sString="He said """elephant""""
I've done some testing and it seems to work consistantly.
[ 21. December 2002, 18:34: Message edited by: LLigetfa ]