Table of Contents Previous Section
The following table summarizes the different types of variables in WebScript:
Variable Type | Where It's Declared | Where It's Visible | How Long It Lives |
---|---|---|---|
Local | Inside a method in either an application or a component script | Only inside the method in which it's declared | For the duration of the method |
Component | Outside a method in a component script | Inside the script in which it's declared | For the duration of a component, which is determined by the application's page-cache size |
Session | Outside a method in a session script | Component scripts can access session variables by sending accessor messages to the WOSession object. Every session has its own version of a session variable. | For the duration of the session |
Application | Outside a method in an application script | In the application script. Component scripts can access application variables by sending accessor messages to the WOApplication object. Every session sees application variables with the same value. | For the duration of the application |