1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2004
    Rep Power

    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);
  2. #2
  3. Banned ;)
    Devshed Supreme Being (6500+ posts)

    Join Date
    Nov 2001
    Woodland Hills, Los Angeles County, California, USA
    Rep Power
    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

IMN logo majestic logo threadwatch logo seochat tools logo