Re: variable substitution within quotes in braces



On May 4, 8:43 am, abhilasha21 <abhilasha21.gu...@xxxxxxxxx> wrote:
Hi All ,

I have been trying to find a way to substitute a variable within
quotes within braces..
eg : i need to pass following string as an argument to a procedure.

{<ab:max><ab:mid="xyz:abc...@xxxxxxxx"/></wyty:ert>}

I want to assign ' xyz:abc...@xxxxxxxx' to a variable say abhi.

so my string should look like :
{<ab:max><ab:mid="$abhi"/></wyty:ert>} .

Can anyone please help me to solve this trick in TCl..?

Thanks in advance ...
Abhilasha


Does this answer your question?

% set x xyz:abc123@xxxxxxxx
xyz:abc123@xxxxxxxx
% set y {<ab:max><ab:mid="$x"/></wyty:ert>}
<ab:max><ab:mid="$x"/></wyty:ert>
% set z [subst -nocommands $y]
<ab:max><ab:mid="xyz:abc123@xxxxxxxx"/></wyty:ert>

If not, maybe the following does:

% set y {{<ab:max><ab:mid="$x"/></wyty:ert>}}
{<ab:max><ab:mid="$x"/></wyty:ert>}
% set z [subst -nocommands $y]
{<ab:max><ab:mid="xyz:abc123@xxxxxxxx"/></wyty:ert>}

.