From: Keith on 9 Apr 2010 10:02 ttk::button $t.h.0 -text "Programming Locations Manual Web Page" -command \ {eval exec $browser \ "http://web.com/Programming?sortcol=table\x3Bup=\x23Programming_general_locations" \ &} I have tried the above command also with: "http://web.com/Programming?sortcol=table\;up=\#Programming_general_locations" but each time tcl reads the ; and creates an error. var $browser can change with each users prefernces so I can't change that in the command. How do I get tcl to eval the command without interpreting the ; and creating the error? TIA, Keith -- Best Regards, Keith http://home.comcast.net/~kilowattradio/ I'm Your Huckle Berry http://www.youtube.com/watch?v=KfbAFgD2mLo
From: pmarin on 9 Apr 2010 11:03 On Apr 9, 4:02 pm, Keith <kilowattra...(a)use-reply-to.invalid> wrote: > ttk::button $t.h.0 -text "Programming Locations Manual Web Page" > -command \ > {eval exec $browser \ > "http://web.com/Programming?sortcol=table\x3Bup=\x23Programming_general_locations" > \ > &} > > I have tried the above command also with: > "http://web.com/Programming?sortcol=table\;up=\#Programming_general_locations" > > but each time tcl reads the ; and creates an error. var $browser can > change with each users prefernces so I can't change that in the command. > > How do I get tcl to eval the command without interpreting the ; and > creating the error? > > TIA, > > Keith > > -- > Best Regards, Keithhttp://home.comcast.net/~kilowattradio/ > I'm Your Huckle Berryhttp://www.youtube.com/watch?v=KfbAFgD2mLo ttk::button $t.h.0 -text "Programming Locations Manual Web Page" -command \ {eval exec $browser \ "http://web.com/Programming?sortcol=table\x3Bup= \x23Programming_general_locations" \ &} Use brackets for eval: ttk::button $t.h.0 -text "Programming Locations Manual Web Page" -command \ {eval {exec $browser \ "http://web.com/Programming?sortcol=table\x3Bup= \x23Programming_general_locations"} &}
From: Andreas Leitgeb on 9 Apr 2010 11:11 Keith <kilowattradio(a)use-reply-to.invalid> wrote: > ttk::button $t.h.0 -text "Programming Locations Manual Web Page" > -command \ > {eval exec $browser \ > "http://web.com/Programming?sortcol=table\x3Bup=\x23Programming_general_locations" \ > &} If you use tcl8.5 or higher, use: {exec {*}$browser "http://web.com/Pr...?sortcol=table;up=#Pr..." &} No need for eval here, unless the contents of $browser really need another round of full substitution... If you're bound to <=8.4, or if $browser has $'s or []'s inside that need to be substed, too, then try this: {eval exec $browser [list "http://web.com/Pr...?sortcol=table;up=#Pr..."] &} In none of these two approaches do you need to backslash-escape the semicolons individually. Just for completeness sake, there is another one: {eval exec $browser "http://web.com/Pr...?sortcol=table\\;up=#Pr..." &} This fixes the semicolon such that eval will not treat it specially. (no need to fix the hash as it doesn't show up where a command is expected) I strongly discourage this third one, as you may easily forget to correctly escape further semicola or specific other meta-characters added lateron during maintenance.
From: Keith on 9 Apr 2010 12:02 On 09 Apr 2010 15:11:27 GMT, Andreas Leitgeb <avl(a)gamma.logic.tuwien.ac.at> wrote in [ comp.lang.tcl ]: > If you use tcl8.5 or higher, use: > {exec {*}$browser "http://web.com/Pr...?sortcol=table;up=#Pr..." &} > No need for eval here, unless the contents of $browser really need > another round of full substitution... Ok what does the {*} do in eval? -- Best Regards, Keith http://home.comcast.net/~kilowattradio/ I'm Your Huckle Berry http://www.youtube.com/watch?v=KfbAFgD2mLo
From: Keith on 9 Apr 2010 12:06 On Fri, 09 Apr 2010 09:02:07 -0700, Keith <kilowattradio(a)use-reply-to.invalid> wrote in [ comp.lang.tcl ]: > On 09 Apr 2010 15:11:27 GMT, Andreas Leitgeb > <avl(a)gamma.logic.tuwien.ac.at> wrote in > [ comp.lang.tcl ]: > > > If you use tcl8.5 or higher, use: > > {exec {*}$browser "http://web.com/Pr...?sortcol=table;up=#Pr..." &} > > No need for eval here, unless the contents of $browser really need > > another round of full substitution... > > > Ok what does the {*} do in eval? I mean in exec. -- Best Regards, Keith http://home.comcast.net/~kilowattradio/ I'm Your Huckle Berry http://www.youtube.com/watch?v=KfbAFgD2mLo
|
Next
|
Last
Pages: 1 2 3 Prev: How to change the font of an entire application? Next: tcl for tomtom?? |