Re: format statement: Expanding a string
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


comp.lang.tcl archive

Re: format statement: Expanding a string

From: suchenwi <richard.suchenwirth-bauersachs@siemens.com>
Date: Thu Mar 02 2006 - 10:41:04 CET

Ralf Fassel schrieb:

> * "Scott Brown" <None@invensys.com>
> | Thanks to all. Your advice worked. I will use this format:
> |
> | puts [eval format [list $myfmt] [split $pets]]
> |
> | just in case my "pets" variable contains any special characters.
>
> Keep in mind that if $pets contains too few fields for the format
> string, this will of course trigger the regular 'format' TCL-Error:
>
Also consider that [split] works on single whitespaces:
% split "Cats Dogs"
Cats {} Dogs
So in any case, the above pattern should only be used if $ptes is a
valid list.
Received on Sun Apr 30 02:20:23 2006