From vdergachev at rcgardis.com  Wed May 23 01:37:40 2007
From: vdergachev at rcgardis.com (Vladimir Dergachev)
Date: Tue, 22 May 2007 19:37:40 -0400
Subject: [Rd] Quoting
In-Reply-To: <46537752.6020003@biostat.ku.dk>
References: <46532F64.9030203@ebi.ac.uk>
	<200705221742.13361.vdergachev@rcgardis.com>
	<46537752.6020003@biostat.ku.dk>
Message-ID: <200705221937.40176.vdergachev@rcgardis.com>

On Tuesday 22 May 2007 7:05 pm, Peter Dalgaard wrote:
> Vladimir Dergachev wrote:
> >> I think DTL's suggestion would be most useful when putting a lot of code
> >> in a string, where the escapes make the code harder to read.  For
> >> example, just about any function using a complicated regular expression.
> >
> > Also anything using .Tcl(). Quotes in data frame definition are useful
> > because they could be employed to delimit text fields with spaces in
> > them.
>
> .Tcl() is usually the wrong solution anyway, you really should use tcl()
> unless absolutely necessary.
>

Actually I could not figure out how to use tcl() - it seems to work only to 
call a single Tcl/Tk command.

I mostly use .Tcl() to create guis along the lines of

foreach {control  desc var value} {
	label "Just a description" title1 0
	entry "Edit some text" text_var {Hello there}
	} {
	switch -exact -- $control {
		label { 
			label .l$var -text $desc
			grid .l$var - -sticky news
			}
		entry {
			label .l$var -text $desc
			entry .e$var -variable $var
			grid .l$var .e$var -sticky news
			global $var
			set $var $value
			}
	# other control types follow
		}
	}

this can get pretty versatile and works for plots and other things..

                          best

                              Vladimir Dergachev



[Rd] Quoting
Vladimir Dergachev