Escaping Quotes?

Andre Garzia andre at andregarzia.com
Wed Mar 31 16:48:52 EDT 2010


Folks,

format() is your friend.

put format("\"C:\Program Files\Visual CUT 11\Visual CUT.exe\" -e
\"C:\Rev\FOM2\LeaseReports\All Leases\LeasePaymentsbyLeaseName.rpt\"
\"Parm1:2010\" ") into tCmd

format will accept quotes in it as long as they are escaped like \"

Cheers
andre

On Wed, Mar 31, 2010 at 4:25 PM, zryip theSlug <zryip.theslug at gmail.com>wrote:

> 2010/3/31 Andrew Kluthe <andrew at rjdfarm.com>:
> >
> > I tried what is recommended in this post
> >
> >
> http://n4.nabble.com/put-shell-and-escaping-quotes-how-to-do-this-td991042.html#a991074
> >
> > but the shell still ends up getting it with no quotes and effectively
> > breaking it.
> >
> > put quote & "C:\Program Files\Visual CUT 11\Visual CUT.exe" & quote & "
> -e"
> > into vcPath
> >
> > put quote & "C:\Rev\FOM2\Lease Reports\All
> > Leases\LeasePaymentsbyLeaseName.rpt" & quote into sReportName
> >
> > put quote & "Parm1:2010" & quote into sParams
> >
> > put "[[vcPath]] [[sReportName]] [[sParams]]" into sCommand
> > put shell( merge(sCommand) )
> >
> >
> > This outputs the same message from the console that I would get if I put
> it
> > straight in with no quotes:
> >
> > 'C:\Program' is not recognized as an internal or external command,
> > operable program or batch file.
> > --
>
> This code works fine for me to open a pdf with acrobat:
>
> put shell(quote&quote&"C:\Program Files\Adobe\Acrobat
> 5.0\Reader\AcroRd32.exe"
> &quote&&quote&"C:\Program Files\Revolution
> Enterprise\4.0.0-gm-1\Documentation
> \pdf\First Stack - Part One.pdf"&quote&quote)
>
> Note that I double the quote at start and end of the string.
>
> If I transpose this test to your case I obtain:
>
> put quote&"C:\Program Files\Visual CUT 11\Visual
> CUT.exe"&quote&&"-e"&&quote&"C:\Rev\FOM2\Lease
> Reports\All
> Leases\LeasePaymentsbyLeaseName.rpt"&quote&&quote&"Parm1:2010"&quote
> into sCommand
> put shell(quote&sCommand&quote)
>
> How this code works for you?
>
> For me it returns "The system cannot find the path specified.". Not
> really odds because Crystal Report is not installed on my PC. ;)
>
> Regards,
>
> --
> -Zryip TheSlug- wish you the best! 8)
> http://www.aslugontheroad.co.cc
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution
>



-- 
http://www.andregarzia.com All We Do Is Code.



More information about the use-livecode mailing list