2 Replies Latest reply on Dec 7, 2008 11:16 AM by DrDave

    Global Variables



      Global Variables


      I created a script called zStartUpScript and put the following code in it.

      If [ $$TheOS = 1 ] 

      Set Variable [ $$FolderPath; Value:"/Drive-1/Users/MyName/MyData/DataOut" ] 

      Else If [ $$TheOS = -2 ] 

      Set Variable [ $$FolderPath; Value:"filewin:/c:/DataOut" ] 

      End If 

      Under File-Options, I then specified this script as the start-up script.
      I expected $$FolderPath to be available when I run all my other scripts, but they are not. Is my expectation incorrect? 

        • 1. Re: Global Variables
          Jens Teich
             I suspect $$TheOS is not yet set or contains the wrong value. Possible is also a typo in the variable name of $$TheOS.

          With Advanced version of FM you can easliy check its value with script debugger and data viewer. With Pro version use a custom dialog to check the value of $$TheOS.


          • 2. Re: Global Variables

            Good catch! Thank you. 


            I modified the code to the following and that worked perfectly. 


            Set Variable [ $$TheOS; Value:Get ( SystemPlatform ) ] 

            If [ $$TheOS = 1 ] 

            Set Variable [ $$FolderPath; Value:"/Drive-1/Users/MyName/MyData/DataOut" ] 

            Else If [ $$TheOS = -2 ] 

            Set Variable [ $$FolderPath; Value:"filewin:/c:/DataOut" ] 

            End If