Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 3 of 3 total
Thread Diff between global,local,session variables
Thu, Apr 21 2016 4:55 AMPermanent Link

kamran

Hi

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.

Regards

Kamran
Thu, Apr 21 2016 6:51 AMPermanent Link

Matthew Jones

kamran wrote:

> 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
that - it will be properly documented somewhere for Javascript
generally.

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.


--

Matthew Jones
Thu, Apr 21 2016 7:49 AMPermanent Link

kamran

Hi Matthew

Thanks for the clarification.

Kamran
Image