Page 1 of 1 1
Topic Options
#97372 - 2002-12-30 09:29 PM Variable with a space
GRF Offline
Fresh Scripter

Registered: 2002-02-15
Posts: 45
Loc: Ohio
I am trying to pass a variable that may contain a space into a batch job. I've enclosed it in "". Once in the batch job I'm trying to feed it to kix32.exe by
code:
@call kix32.exe mailbox.kix $1="%1"  

It works fine with a variable with no spaces, but won't work with spaces. Any thoughts?

Thanks,
_________________________
GF

Top
#97373 - 2002-12-30 09:42 PM Re: Variable with a space
Radimus Moderator Offline
Moderator
*****

Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
triple the quotes

"""hello, what is your name"""
_________________________
How to ask questions the smart way <-----------> Before you ask

Top
#97374 - 2002-12-30 09:50 PM Re: Variable with a space
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
This has been covered in a FAQ.

Topic: Quote (") characters on the command line.

I suggest you check out the FAQs.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#97375 - 2002-12-30 10:05 PM Re: Variable with a space
GRF Offline
Fresh Scripter

Registered: 2002-02-15
Posts: 45
Loc: Ohio
Thanks for the quick reply! That worked, but it brought along the "s. How can I get the space without the quotes?

Thanks,
_________________________
GF

Top
#97376 - 2002-12-30 10:09 PM Re: Variable with a space
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
You could L/RTrim() them off. Split() should do it too.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

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 400 anonymous users online.
Newest Members
batdk82, StuTheCoder, M_Moore, BeeEm, min_seow
17885 Registered Users

Generated in 0.053 seconds in which 0.023 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