April 2nd, 2004, 03:00 AM
combining strings to one.
Hi, i cant figure out how to combine strings to 1, for example this is what i have, it works but buggy.
bfvf : string = '\bfvietnam.exe +restart 1'; // Executable
bfvc : string = ''//Command Line Options // doesnt work!
bfvd : string = 'C:\Program Files\EA GAMES\Battlefield Vietnam'; //Directory
Then to execute:
CreateProcess(nil, PChar(bfvd+bfvf+bfvc), nil, nil,False,
nil, nil, StartInfo, ProcInfo);
April 2nd, 2004, 03:00 PM
It's not the string concatenation that is not working, but rather how you're calling CreateProcess. Consult your help docs for CreateProcess or read the documentation here:
You need to enclose path names in double quotes, so that it doesn't mistake them for separate arguments (e.g.)
bfvd : string = '"C:\Program Files\EA GAMES\Battlefield Vietnam"'; //Directory
Up the Irons
What Would Jimi Do? Smash amps. Burn guitar. Take the groupies home.
"Death Before Dishonour, my Friends!!" - Bruce D ickinson, Iron Maiden Aug 20, 2005 @ OzzFest
Down with Sharon Osbourne
"I wouldn't hire a butcher to fix my car. I also wouldn't hire a marketing firm to build my website." - Nilpo