Topic Options
#24709 - 02/04/10 03:21 PM Set Different Expression for Same Variable
TomK Offline
OL Newbie

Registered: 01/25/10
Posts: 17
I want to know if there is a way to set different expressions for the same variable but in different locations on a layout.

For example [zip] is in an address block should be = [zip] while onecode[zip] should be used just below the address block.

I have inserted two text variable boxes on my layout and embedded [zip] in both and have tried to set a different expression for both with no luck - if you change the [zip] expression in one text box it changes it automatically in the other text variable box.


#24710 - 02/05/10 04:02 AM Re: Set Different Expression for Same Variable
Sander vd Berg Offline
OL Expert

Registered: 06/10/08
Posts: 207
Loc: Objectif Lune NL
A variable can be reused across your document, but it will always have the same expression. If you want different expressions, you will need to use different variables. Variables are different if their names are different. You specify the name of a variable between the two @ delimiters in the content of your text box.

Suppose you have two text boxes, with the content of both boxes set to "@zip@". Double-click one of your text boxes and replace "@zip@" by "@onecode_zip@". When you click outside the box you will have two variables: "zip" (defined in the first text box) and "onecode_zip" (defined in the second text box), each with its own expression.