Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Multiple config option in one var.?

1 view
Skip to first unread message

Paul Grizzaffi

unread,
Mar 27, 1995, 8:27:05 AM3/27/95
to
I would like to do something like this:

set a "-geometry 20x20 -relief sunken"
listbox .q $a

However, I can't seem to find the correct syntax.

Anyone out there know how to do something like that?

Tim Jackson
tjac...@bnr.ca fiz...@ibm.net
--
Disclaimer: My views in no way reflect the views of my employer or
anyone else for that matter.

John Talintyre

unread,
Mar 31, 1995, 3:00:00 AM3/31/95
to
In article <3l6ef9$s...@crchh336.bnr.ca>, tjac...@bnr.ca (Paul Grizzaffi) writes:
|> I would like to do something like this:
|>
|> set a "-geometry 20x20 -relief sunken"
|> listbox .q $a

In the above example $a appears as one parameter to listbox.
Use of eval will cause another level of parsing which will deal with this i.e.

eval listbox .q $a

|>
|> However, I can't seem to find the correct syntax.
|>
|> Anyone out there know how to do something like that?
|>
|> Tim Jackson
|> tjac...@bnr.ca fiz...@ibm.net
|> --
|> Disclaimer: My views in no way reflect the views of my employer or
|> anyone else for that matter.

Cheers, John
--
-----------------------------------------------------------------------------
| John Talintyre |
| Speech Technology Unit j...@saltfarm.bt.co.uk |
| BT Labs |
-----------------------------------------------------------------------------

Martin Kerharo

unread,
Apr 6, 1995, 3:00:00 AM4/6/95
to
In article <3lgaen$r...@bull.saltfarm.bt.co.uk> John Talintyre,

j...@mround.bt.co.uk writes:
>In article <3l6ef9$s...@crchh336.bnr.ca>, tjac...@bnr.ca (Paul
Grizzaffi) writes:
>|> I would like to do something like this:
>|>
>|> set a "-geometry 20x20 -relief sunken"
>|> listbox .q $a
>
>In the above example $a appears as one parameter to listbox.
>Use of eval will cause another level of parsing which will deal with
this i.e.
>
>eval listbox .q $a

Yes, but there's an hidden danger with this.
Suppose a is {-title "range [0-9]"} (I use accolades because of
brackets), then :

eval listbox .q $a

will be first parsed and become :

eval listbox -title "range [0-9]"

The "eval" executes and read successively "listbox", "-title", and
eventually "range [0-9]". But there are brackets ! Eval will see the
brackets, and try to execute them... And you'll get something like :

unknown command "0-9"...

So be careful with evals, don't feed them with unexpected special
characters !

Martin.

Hein Roehrig

unread,
Apr 8, 1995, 3:00:00 AM4/8/95
to
Paul Grizzaffi (tjac...@bnr.ca) wrote:
: I would like to do something like this:

: set a "-geometry 20x20 -relief sunken"
: listbox .q $a

how about:

eval listbox .q $a

Hein

0 new messages