#196891 - 2009-11-30 08:52 PM
adding quotes to the filepath
|
morpheus_exegis
Fresh Scripter
Registered: 2009-09-11
Posts: 9
Loc: Ontario, Canada
|
Hello,
I am a fresh scripter for Kix. Just discovered it a few days ago when an unusual request came through. I work with Bat files frequently and someone asked me to make a GUI forntend for it. Kix works great and KixForms is an excellent piece of software. So the problem is probably the way i am thinking about this problem.
I need to pass parameters to another program in cmd it is easy and goes something like this
compress Source Destination FLAGS
I have the KixForm application getting the filepath and passing it onto the appropriate variable. so essentially what i have is :
SHELL 'M:\fullpath\Compress '+ $Source + $Dest +' FLAGS FLAGS FLAGS'
the program runs as expected but since the file path has spaces it breaks the source address into pieces whereever the space is encountered. FOr Example : c:\Documents and Settings\username gives me 'Settings\username' is an invalid parameter.
Usually quotes around the path resolve this issue. I have tried ', '', ", "" and several other variation of quotes but all to no avail. I just need to know how to manipulate strings in a very basic fashion by adding quotes around all of it so that it can be passed as one string per parameter.
My Strings are already variables.
Thanks to anyone and everyone who helps me out with this.
_________________________
-------------------------------------------- Morpheus Exegis SAND TEK
|
Top
|
|
|
|
#196907 - 2009-12-01 04:26 PM
Re: adding quotes to the filepath
[Re: morpheus_exegis]
|
morpheus_exegis
Fresh Scripter
Registered: 2009-09-11
Posts: 9
Loc: Ontario, Canada
|
Glenn's suggestion worked great. I had only tried doubling the quotes not different types of quotes. Thank youvery much Glenn.
Within the same project i have a few more questions If this post is unsuitable here i can start a new thread. the problems are as follows:
1) @crlf macro doesnt seem to add a new line to a textbox.text field. Related to kix forms. The result of my current attempts is as follows:
$Textbox.text=$Textbox.text+@CRLF+$message+@CRLF+$Form.OpenFileDialog.Filename results in boxes instead of the carriage return and the line feed chars
2) how can i read a simple text file into a textbox.text field. Preferably appended to whatever i have there now.
3) How can i package external exe dll and other files including kix scripts to one neat exe application. I dont want users to have any chance of poking their noses in the sensitive data file and key for the compressor program.
4) a way to edit / concatenate strings. i want to be able to trim the last three characters of the string and add new ones. I can successfully add but i didnt see any String manipulation so far in Kix.
Thanks
Edited by morpheus_exegis (2009-12-01 06:45 PM) Edit Reason: readded questions
_________________________
-------------------------------------------- Morpheus Exegis SAND TEK
|
Top
|
|
|
|
#196913 - 2009-12-01 05:12 PM
Re: adding quotes to the filepath
[Re: Allen]
|
morpheus_exegis
Fresh Scripter
Registered: 2009-09-11
Posts: 9
Loc: Ontario, Canada
|
I was moving my post when it got answered by Richard. if it is not resolved i will post in a new thread otherwise i will repost the questions here for other to see.
kix2exe is a nice tool but i was unable to package other exe dlls etc with my script. I will search google for similiar posts.
In response to Richards post how do i implement a UDF and specific instructions. I know Glenn's site probably has them.
Sorry new scripter so i am very out of the loop here.
Thanks Morpheus
_________________________
-------------------------------------------- Morpheus Exegis SAND TEK
|
Top
|
|
|
|
#196920 - 2009-12-01 06:43 PM
Re: adding quotes to the filepath
[Re: Allen]
|
morpheus_exegis
Fresh Scripter
Registered: 2009-09-11
Posts: 9
Loc: Ontario, Canada
|
What i get is :
ERROR : undefined variable [sid]! Script: C:\WINDOWS\TEMP\kix2exe~50421\kix2exe.dat Line : 30
Single kix file packaging is simple and easy. but as soon as i include the files it get this message.
_________________________
-------------------------------------------- Morpheus Exegis SAND TEK
|
Top
|
|
|
|
#196984 - 2009-12-03 08:56 PM
Re: adding quotes to the filepath
[Re: morpheus_exegis]
|
Senser
Fresh Scripter
Registered: 2005-05-26
Posts: 32
Loc: The Netherlands
|
This looks like a bug in Kix2Exe. Including other files into the package should not be a problem at all.
What version of Kix2Exe are you using?
|
Top
|
|
|
|
#196996 - 2009-12-04 09:49 PM
Re: adding quotes to the filepath
[Re: Richard H.]
|
morpheus_exegis
Fresh Scripter
Registered: 2009-09-11
Posts: 9
Loc: Ontario, Canada
|
Sorry i was working on a few other things that took precedence for the last two days. I am back on this project.
Richard, There is no sid variable in my entire program. the error only occurs if i include dll's i have successfully added the exe's and other files.
Update: KIX just fails at creating the file
Error: Failed creating package C:\Documents and Settings\Syeshi.PDC-MILTON\Desktop\Scripts\Business\Final\Util.exe
Packaging aborted!
the SID was caused by an extra + sign at the end of one of the strin concats
Edited by morpheus_exegis (2009-12-04 10:32 PM)
_________________________
-------------------------------------------- Morpheus Exegis SAND TEK
|
Top
|
|
|
|
#196997 - 2009-12-04 10:03 PM
Re: adding quotes to the filepath
[Re: Richard H.]
|
morpheus_exegis
Fresh Scripter
Registered: 2009-09-11
Posts: 9
Loc: Ontario, Canada
|
How can i split an array to String? how do i traverse an array?
nvm - figured it out. Also figured out how to use the udf.
Edited by morpheus_exegis (2009-12-04 10:29 PM) Edit Reason: Update:
_________________________
-------------------------------------------- Morpheus Exegis SAND TEK
|
Top
|
|
|
|
Moderator: Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart
|
1 registered
(Allen)
and 466 anonymous users online.
|
|
|