Award
Congratulations ptp, for answering the question and has received an EZ-Credit award! Share what you have learned and create a tutorial to help others by clicking here.

Missing ")" In Expression When Using "exec" In Script

Assistance Requested

Help Aerius with their question and receive $10 of EZ-Credit to get more robots and parts from our store. The following information was provided about their previous efforts searching tutorials for a resolution.

Aerius claims to have checked these sources:
 
#1

Exec("C:\Program Files (x86)\RoboRealm\RoboRealm.exe")

generates an error : missing ")" in expression.

I suppose the (x86) within the command generate the problem.

Any suggestion to work around this problem?


User-inserted image

I have found a few conversations, tutorials and activities that may help with your question. Take a look at these links. I've sorted them by what I believe to be most relevant but that is not always the case as I'm still learning.


Also, consider reviewing the Learn section for informative lessons and activities. Check it out!


#2

The issue is with the (x86) in the command. I built a link and call that link instead of the direct exe. The link would point to the exe. The link is stored in a directory that is simple like "C:\DirectoryWithoutSpacesOrSpecialCharacters\".

just a work around and someone else may have a solution.

#3

can you try the following:

1)

Code:


Exec("""C:\Program Files (x86)\RoboRealm\RoboRealm.exe""")



or

2)

Code:


Exec("\"C:\Program Files (x86)\RoboRealm\RoboRealm.exe\"")

#4

I have tried using escape characters and haven't gotten it to work. I dont know that I tried those sequences though.

#5

is a guess,

it will depend first how the EZB engine parses and handle escape characters (if it supports)

secondly it depends how the shell command is executed, i'm guessing the string is being passed directly to the shell versus a detailed call (working directory, program path, arguments)

#6

try this:

Code:


Exec("C:\progra~2\RoboRealm\RoboRealm.exe")



basically you replaced the long name with a DOS (yes before windows) path name (8 characters):

to obtain DOS PATHs run:

Code:

dir /x



in the parent directory for each sub-directory.


cheers

#7

The last command did work.

Exec("C:\progra~2\RoboRealm\RoboRealm.exe"Winky

Tanks to you both

#8

Glad you got it working. I think you can also call the roborealm file directly if you are using multiple of them. It has been so long since I did this but it is either possible to call the robo file directly or pass it in as a parameter. I cant remember which.

#9

did both options generated errors in EZB ?

I had faith that the first option could work too..

#10

@ ptp
option 1 & 2 where giving the error message.
As mention the "~2" did the magic.
by the way what is the #2 for?

@ david

You're right, we can start the SW with the data file directly in the same command.

EX: Exec("C:\progra~2\RoboRealm\RoboRealm.exe","C:\Users\gilles\AVM\face_rec.robo"Winky