setRegistry...

Ben Rubinstein benr_mc at cogapp.com
Mon Dec 20 04:39:20 EST 2004


on 20/12/04 4:31 am, Ken Ray wrote

>>  setRegistry( 
>>  "HKEY_CLASSES_ROOT\BioArchimed\shell\open\command\",
>> quote & "C:\Ba\Ba.exe" & quote && quote & "-E"& quote && quote & "%1"&quote
>> )
> 
> That's why I like the q() function, it makes it so much easier (I use it so
> much, it's in my "standard library"):
> 
> setRegistry("HKEY_CLASSES_ROOT\BioArchimed\shell\open\command\",
> q("C:\Ba\Ba.exe") && q("-E") && q("%1"))
> 
> function q pWhat
> return quote & pWhat & quote
> end q
> 


Also worth remembering, if speed is not critical (ie this is not inside your
most nested loop) is format.

    setRegistry("HKEY_CLASSES_ROOT\BioArchimed\shell\open\command\",
                    format("\"C:\Ba\Ba.exe\" \"-E\" \"%1\"")

Even more convenient if you find yourself also making up strings including
returns (but remember a Transcript return is \n, not \r).
 
  Ben Rubinstein               |  Email: benr_mc at cogapp.com
  Cognitive Applications Ltd   |  Phone: +44 (0)1273-821600
  http://www.cogapp.com        |  Fax  : +44 (0)1273-728866




More information about the use-livecode mailing list