[DUG] Variable in String
Jeremy North
jeremy.north at gmail.com
Thu Jun 23 11:52:16 NZST 2011
The easiest way to test this is whatever string you come up with copy it to
the clipboard and paste in into the RUN prompt. If it doesn't run there, it
won't run within your application.
Don't use the command prompt (for testing), as it treats spaces differently.
How are you actually executing the generated command prompt?
I have a unit that creates processes. I pass the program name as a parameter
and then a stringlist for all other parameters. The method then double
quotes the program name and then each of the parameters as the command line
is generated. Perhaps something like this would help clean up the code
On Thu, Jun 23, 2011 at 8:30 AM, Bob Pawley <rjpawley at shaw.ca> wrote:
> Hi
>
> I’m having trouble with using a variable in a string path.
>
> When I use the variable FW_Path := ‘C:\Program Files (x86)’ with two single
> quotes, the following works well and ShowMessage(ProgramName); displayed the
> full path .
>
> When I reference FW_Path to a variable X I get an error returned “Can Not
> run....” The variable X is returned as C:\Program Files (x86) without
> quotes.
>
> I attempted Quote String and got the following ‘C:\Program Files (x86) with
> one single quote.
>
> Both cases return the same error - and in both cases
> ShowMessage(ProgramName); displayed none of the path after C:\Program Files
> (x86).
>
> Help would be appreciated.
>
> Bob
>
> FW_Path := QuoteStr(X);
> DXF := openDialog1.FileName;
> ProgramName :=FW_Path+'\FWTools2.4.7\bin\ogr2ogr "-f" "PostgreSQL"
> PG:"host=192........ user=postgres dbname=E5R password=........" "'+ DXF +'"
> -nln Import_Process';
> ShowMessage(ProgramName);
>
> _______________________________________________
> NZ Borland Developers Group - Delphi mailing list
> Post: delphi at delphi.org.nz
> Admin: http://delphi.org.nz/mailman/listinfo/delphi
> Unsubscribe: send an email to delphi-request at delphi.org.nz with Subject:
> unsubscribe
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://listserver.123.net.nz/pipermail/delphi/attachments/20110623/74ddd64e/attachment.html
More information about the Delphi
mailing list