How to run program with variable command line arguments?

I have the following script:

For $alpha = 1 to 10
 For $beta = 1 to 10
  Run('"C:\Users\MyProg.exe ' & alpha/10 & ' ' & beta/10 & ' 200 2 0.5'
  ;some other actions follow
 Next
Next

I have checked many times that the string is well-formed, thus I have no idea why the script wouldn't run the program. Could you help me please?

Upvotes: 0

Views: 1394

Answers (1)

Samoth
Samoth

Reputation: 1707

Just replace the ending ' with "') and use proper variable names including the $... like $alpha instead of just alpha. Your syntax check in SciTE should have told you.

For $alpha = 1 to 10
    For $beta = 1 to 10
        Run('"C:\Users\MyProg.exe ' & $alpha/10 & ' ' & $beta/10 & ' 200 2 0.5"')
        ;some other actions follow
    Next
Next

Upvotes: 1

Related Questions