On 12/28/2008 6:08:09 AM, Christian Ziemski wrote:
>On 28.12.2008 06:07 vtech-keystroke
>Listmanager wrote:
>> From: "Peter Rejto"
>> Sys(`|@(106) "|@(121)"`,SUPPRESS+SIMPLE+NOWAIT) //Open file in appl
>>
>Yes, it sends the string
>cmd /C "C:\some path with or without
>spaces\a file to open.txt"
>to Windows.
>The last part of the string needs to be
>in double quotes because of
>optional spaces within the path or
>filename.
>
>The first part doesn't have such spaces.
>
>The handling of spaces in path/filenames
>in Windows is horrible and
>trying to manage all cases makes some
>VEDIT macros a bit complicated.
>You will find several Sys(), File_Open()
>etc. commands with stacked
>single and double quotes.
>
>It's far beyond my time to explain in
>detail here. Sorry.
>
>Rule of thumb:
>If there are spaces in path/filename:
>Use double quotes around the
>path/filename.
>Use different quotes around the complete
>string in Vedit then.
>
>Christian
Thanks Christian,
Now I understand why did you put double quotes outside the content of the second text register, but not the first one.
I like very much your idea of using double quotes outside the content of a text register and not using it inside.
It reduces the level of the stacking of the double quotes. Since this stacking is horrible I am grateful for any help that I can get in reducing it!
In fact, I already have used your idea to diagnose my aspell.exe installation. Here I ended up using two text registers for the argument of my System( ) command together with some text. This worked like a charm. More specifically, I did succeed in printing a help file for this program. Here are the details:
\\
Reg_Set(106, "cmd %comspec% /k ")
Reg_Set(107, "c:\program files (x86)\aspell\bin\aspell.exe")
System(`|@(106),"|@(107)" >aspell.tpl`)
OK
\\
I also like your idea of using two text registers as an argument for the System( ) macro command. So, I thought to put my text into a text register and generalize your idea from two to three. To my great surprise I did not succeed.
I find it hard to believe that I can use two text registers as an argument for System( ), but I can not use three. I am attaching the details:
Reg_Set(106, "cmd %comspec% /k ")
Reg_Set(107, "c:\program files (x86)\aspell\bin\aspell.exe")
Reg_Set(108," >aspell.tpl ")
System(`|@(106),"|@(107)",|@(108)`)
Error from cmd.exe: Unknown Action.
In fact, I am at a loss of interpreting the error message Unknown Action, which came from cmd.exe. It seems to me that Vedit did her job and transmitted the content of those three text registers to cmd.exe. To my untrained eyes the content of the arguments of those two System( ) are the same. Of course, it is also possible that I made a typo somewhere ?
Thanks as always,
-peter.
|
|