FE Output template & TCL variable
QuyNguyenDai
Altair Community Member
Hi,
I'm looking a way to get the value of TCL variable from FE Output template.
In fact I would like to control template by using TCL variable, so my template has something like:
*if([VALUE == 1]) ... *endif() *if([VALUE != 1]) ... *endif()
Where 'VALUE' comes from TCL variable.
Any idea?
TIA,
0
Answers
-
Hi. The way I prefer to do is to put template codes in a tcl variable and use string map to change it, like this
set TplCodes {your codes}
set TplCodes [string map
- $TplCodes]
0 -
Sorry I could not type it on phone
set TplCodes {
*if([VALUE == 1]) ... *endif() *if([VALUE != 1]) ... *endif()
}
set TplCodes1 [string map
- $TplCodes]
set TplCodes2 [string map
- $TplCodes]
...
0 -
Thanks. I'll test that.
0 -
I could not type the code correctly. don't know reason
format it by 'codes' is OK:
set TplCodes { *if([VALUE == 1]) ... *endif() *if([VALUE != 1]) ... *endif() } set TplCodes1 [string map [list VALUE $value1] $TplCodes] set TplCodes2 [string map [list VALUE $value2] $TplCodes]
0 -
Thanks
0