1 Reply Latest reply: Dec 23, 2010 10:42 AM by Neil Miller RSS

    Create a variable containing text & a field reference


      I'm trying to set a variable containing the following:

      vDim = 'Dimension_' & Axis

      Where Axis refers to a field value either X or Y.

      I can think of 3 options to create the variable with the assigned value:

      1- In the script using the LET command

      2- Directly in the variables overview window

      3- Through a Set variable action in a button

      The problem I have is that options 1 and 3 will store the result of the expression 'Dimension_' & Axis in the variable. Option 2 allows me to create the variable but I would have to re-create it every time the script is reloaded.


      Any ideas of how to create the variable maintaining the expression and not the resulting value of the expression?


        • Create a variable containing text & a field reference
          Neil Miller

          If you don't want the expression to be evaluated on the load, you can replace the ampersand with the Chr() function equavilent and the resulting variable will contain the ampersand.


          Let vDim = Chr(39) & 'Dimension_' & Chr(39) & Chr(38) & 'Axis';

          The Chr(39)s will put single quotes around Dimension_ and the Chr(38) will add the ampersand between them. The result of that expression should be:


          You could also force spaces around the ampersand, but I don't think it is necessary.