🎉Community Raffle - Win $25

An exclusive raffle opportunity for active members like you! Complete your profile, answer questions and get your first accepted badge to enter the raffle.
Join and Win

FE Output template & TCL variable

User: "QuyNguyenDai"
Altair Community Member
Updated by QuyNguyenDai

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,

 

 

Find more posts tagged with

Sort by:
1 - 5 of 51
    User: "tinh"
    Altair Community Member
    Updated by tinh

    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

    1. $TplCodes]
    User: "tinh"
    Altair Community Member
    Updated by tinh

    Sorry I could not type it on phone

    set TplCodes {

         *if([VALUE == 1]) ... *endif() *if([VALUE != 1]) ... *endif()

    }

    set TplCodes1 [string map

    1.   $TplCodes]

    set TplCodes2 [string map

    1.   $TplCodes]

    ...

    User: "QuyNguyenDai"
    Altair Community Member
    OP
    Updated by QuyNguyenDai

    Thanks. I'll test that.

    User: "tinh"
    Altair Community Member
    Updated by tinh

    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]

     

    User: "QuyNguyenDai"
    Altair Community Member
    OP
    Updated by QuyNguyenDai

    Thanks