Paramstr....

Can someone please help me?

I need paramstr to open a filename with spaces (in explorer)....HOW?!? I know i can use paramstr(1) to open the first word, but what if there is a space (" ") included in the filename/path??!?


URL:http://vegardk.cjb.net

Comments

  • : Can someone please help me?

    : I need paramstr to open a filename with spaces (in explorer)....HOW?!? I know i can use paramstr(1) to open the first word, but what if there is a space (" ") included in the filename/path??!?

    :



    THIS IS MY OWN LITTLE "KLUDGE" TO CONCATENATE

    ALL COMMAND-LINE ARGUMENTS INTO A SINGLE FILENAME.

    I'M SURE THERE'S A BETTER WAY, BUT THIS SHOULD

    WORK IN MOST CASES...



    function ParamConc:String;

    var i:integer;

    begin

    if (ParamCount=0) then

    Result:=''

    else Result:=ParamStr(1);

    for i:=2 to ParamCount do Result:=Result+' '+ParamStr(i);

    end;



    // Just call ParamConc instead of ParamStr(1)

    // This function doesn't work if you actually

    // have more than one argument, for instance:

    MyProg.EXE "C:Program FilesFileOne.TXT" "C:My DocumentsFileTwo.TXT"




Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories