toolbar.4d syntax

Any questions regarding the practice version are asked and answered here.
Post Reply
Phil Baird
Posts: 170
Joined: Tue Oct 11, 2005 1:32 pm

toolbar.4d syntax

Post by Phil Baird »

I was wondering if anyone can tell me how to use spaces in the createprocess command in the toolbars file.

Command "createprocess c:\program files\myprog.exe"

The above line does not work because of the space.

Thanks

Phil
Mark Clews
Posts: 388
Joined: Tue Mar 06, 2007 5:21 pm

Post by Mark Clews »

put it in inverted commas ie Command "macro -no_console -close_on_exit $LIB/Convert_poly_panel.4do"
M.Clews
CAD/12D Technical Manager
Phil Baird
Posts: 170
Joined: Tue Oct 11, 2005 1:32 pm

Post by Phil Baird »

Thanks Mark

My example has a space between program and files

If I use

Command "createprocess c:\program files\myprog.exe"
or
Command "createprocess "c:\program files\myprog.exe""

neither works
Sam Cech
Posts: 4156
Joined: Fri Oct 14, 2005 12:56 pm
Location: Silverdale, NZ
Contact:

Post by Sam Cech »

try

Command "createprocess \"c:/program files/myprog.exe\""
Phil Baird
Posts: 170
Joined: Tue Oct 11, 2005 1:32 pm

Post by Phil Baird »

Hi Sam

Your suggestion resulted in this

CreateProcess failed !

c:/program "files/internet" "explorer/iexplore.exe"

I know that the Createprocess command wants a single literal string but how can you have spaces in a single string without using "" these?
Sam Cech
Posts: 4156
Joined: Fri Oct 14, 2005 12:56 pm
Location: Silverdale, NZ
Contact:

Post by Sam Cech »

:( :shock:
Nathan Podlich
Posts: 6
Joined: Thu Apr 23, 2009 10:40 am

Post by Nathan Podlich »

Hi Phil,

In case you have not sorted the problem out - Sam had the right idea but the wrong slashes.

Code: Select all

Toolbar "Internet Explorer" {
Button "Internet Explorer" {
Command "createprocess \"C:\Program Files\Internet Explorer\iexplore.exe\""
Icon          "C:\WINDOWS\Coffee Bean.bmp"
}
}
An alternative method would be to add the location of the executable to the environment variable PATH in your login script or similar with the line

Code: Select all

PATH=%PATH%;C:\Program Files\Internet Explorer
You could then open iexplore no matter the working directory.

Hope this helps,
Nathan

Edit:
FYI - For an explanation of the slashes suggested by Sam, Wikipedia provides a sufficient explanation - http://en.wikipedia.org/wiki/Escape_character
Post Reply