|Home » Technical Support » Elevate Web Builder Technical Support » Support Forums » Elevate Web Builder General » View Thread|
|Messages 1 to 3 of 3 total|
|Diff between global,local,session variables|
|Thu, Apr 21 2016 4:55 AM||Permanent Link|
I just need some clarification.
I have a number of screens and wish to SHARE data values using variables across the screens.
1. I can have global variables declared (eg in public ) on a screen form but any other screen would need to reference it to use..
2. I can have local storage.
3. I can have session storage.
a. So whats the main differences between them all ? dont they all do the same thing ?
b. How best to manage this bearing in mind usage across multiple screens.?
c. I looked at the examples but could not find one that illustrates the usage ?
Any help here appreciated.
|Thu, Apr 21 2016 6:51 AM||Permanent Link|
> I have a number of screens and wish to SHARE data values using
> variables across the screens.
Create a unit called "Globals" or similar. Put in there anything that
really must be global. Ideally via an object that can validate or
whatever, but however makes sense. Each Form can then "use" that and
refer to the relevant data.
> 1. I can have global variables declared (eg in public ) on a screen
> form but any other screen would need to reference it to use..
> 2. I can have local storage.
> 3. I can have session storage.
> a. So whats the main differences between them all ? dont they all do
> the same thing ?
A global variable exists for the life of your application in the
browser. If you hit F5, it is wiped and gone.
Session storage will, I think, be kept past that browser session, but
the browser will kill it at some suitable point. You could search for
LocalStorage will be around for a good while - next week or next year,
subject to the browser choosing to keep it, and the user not clearing
settings. So if you hit F5, the Localstorage is still around. I tend to
use it for storing things I really want permanent, but in a combined
serialised object (JSON), rather than individual items.
|Thu, Apr 21 2016 7:49 AM||Permanent Link|
Thanks for the clarification.