4 Replies Latest reply on Aug 19, 2013 2:34 PM by jthulin

    Double dollar symbol in calculations

    jthulin

      Title

      Double dollar symbol in calculations

      Post

           I trust this will be an easy one. What is the functionality of "$$" at the beginning of a calulation, e.g., "$$CURRENT_CUSTOMER_ID"? I cannot find this in any of the printed help documents. Assuming this is an operator of some sort, do you know of a complete listing of the use of such symbols? Thanks in advance.

        • 1. Re: Double dollar symbol in calculations
          philmodjunk

               It identifies a global variable. Global variables retain a value local to the current user that is accessible from any any script and layout in your file.

               Use a single dollar sign and you have a script variable. It presists only as long as the script that created it is executing and is not accessible from another script.

          • 2. Re: Double dollar symbol in calculations
            jthulin

                 Thanks Phil. I found that about 10 minutes after I posted. I don't fully understand the situations in which you'd choose a local or global variable. Is the global used for unique identifiers such as a customer ID?

            • 3. Re: Double dollar symbol in calculations
              philmodjunk

                   Not particularly.

                   You'd use global values when you need a value to stick around while you perform other scripts and do other things where you'd use a script variable for a value that you only need while the script is being performed.

                   Here's a case where I use a global variable. Scripts that change layouts, open new windows, etc. can trip a lot of script triggers while doing so and these can slow down script execution and interfere with the results that I want. I use a global variable as a way to keep such scripts from being performed when I don't want them to.

                   I enclose each Trigger controlled script in this If block:

                   If [Not $$TriggersOff ]
                      Put rest of script here
                   End If

                   Then, in a script that is going to change layouts, I do something like this:

                   Set Variable [$$TriggersOff ; Value: True ]
                   Go to Layout [
                   Set Variable [$$TriggersOff ; Value: False ]