Globals are emply from script but have a values at CL

Hello, I have sopent almost a day finding out why my Global variables have values in one scripts and are empty at other.

For instance i have a :global URL “http://google.com”;
In the command line and in the script i have creacted it, the $URL has a value = http://google.com
But in one of the scripts it is empty.
Policy for all scripts are correct.

Really something strange. Even my functions (globals) are emply.
They are visible on scripts they were created and in CL, but not from any other script!

In the beginning of each script you need to define the variables (even the global ones) you are using. You just need to do:

:global URL;
  • so it’s not changing the value, the variable is all the time there, it just makes the global variable “visible” from the “scope” of the script. You need to do the same for all global variables (and the functions) you will be using inside the script. You can compare it to old programming languages (like C) when you needed to declare the variables you’ll be using :slight_smile:.

Oh, You are the real Man :sunglasses: ! Thank l you!
I have only a rude words regarding myself, as seems i have missed that in the wiki. As i have a quite lot scripts, i have moved all Global variables to a file (glob.rsc) and simply make an import of it after each reboot, to be sure that all my variables and functions are present.
And you can just imagen, i have started to to add all globals with their values to scripts :open_mouth: :laughing: