[Closed] variable arguments to a console application, can it be done ?
[size=3]can anyone help me out here Im a bit stuck, I need to send 4 arguments to a dos program and that I cna do fine, but I also want to have the script changing the value of the each argument,and I cant work out how to get that value over ??.
I may want to run
shellLaunch (“E:\Max9\Scripts\TEST.exe 1 1 1 2” “”)[size=1]
) [/size]
but next time want to run
shellLaunch (“E:\Max9\Scripts\TEST.exe 3 2 1 2” “”)
then next time something else
bellow is my script so far .
any help would be great thanks
[/size]
if scmod.state == 1 do ( Videomode = 0 )
if scmod.state == 2 do ( Videomode = 1 )
if scmod.state == 3 do ( Videomode = 2 )
if binnub.state == 1 do ( Binnumb = 0 )
if binnub.state == 2 do ( Binnumb = 1 )
if binnub.state == 3 do ( Binnumb = 2 )
if binnub.state == 4 do ( Binnumb = 3 )
if vidmo.state == 1 do ( Vsync = 0 )
if vidmo.state == 2 do ( Vsync = 1 )
Dlay = Bamount.value
shellLaunch ("E:\Max9\Scripts\TESTData\TEST.exe\" "Videomode" "Binnumb" "Vsync" "Dlay" )
case scmod.state of (
1: Videomode = 0
2: Videomode = 1
3: Videomode = 2
default: Videomode = 0
)
case binnub.state of (
1: Binnumb = 0
2: Binnumb = 1
3: Binnumb = 2
4: Binnumb = 3
default: Binnumb = 0
)
case vidmo.state of (
1: Vsync = 0
2: Vsync = 1
default: Vsync = 0
)
Dlay = Bamount.value
args = videomode + " " + Binnumb + " " + Vsync + " " + Dlay
shellLaunch "E:\Max9\Scripts\TESTData\TEST.exe\" args
You were trying to pass 4 separate arguments instead of one separated by spaces.
Try that out, see if it works.
-Colin
I get this
Syntax error: at bad, expected <keyword arg>
– In line: – shellLaunch “E:\M
I editted the line
shellLaunch (“E:\Max9\Scripts\TESTData\TEST.exe” args )
to this
shellLaunch (“E:\Max9\Scripts\TESTData\TEST.exe” args )
but then I get this
[size=1][color=#ff0000]Incompatible types: 0, and ” “
[color=#fffffe]
Im going to play around to see if I can sort it as Im sure it will be something silly , Thanks again
[/color][/color][/size]
I got it working with this
shellLaunch “E:\Max9\Scripts\SpectrumData\FFTMAX.exe “[size=2] args [/size]
[size=2]Thanks for the help dude
[/size]
updated with the correct working code no prob, I’ve never used shellLaunch before, handy stuff.