Table of Contents Previous Section

Variables and Scope: a Summary

The following table summarizes the different types of variables in WebScript:
Variable TypeWhere It's DeclaredWhere It's VisibleHow Long It Lives
LocalInside a method in either an application or a component scriptOnly inside the method in which it's declaredFor the duration of the method
ComponentOutside a method in a component scriptInside the script in which it's declaredFor the duration of a component, which is determined by the application's page-cache size
SessionOutside a method in a session scriptComponent 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
ApplicationOutside a method in an application scriptIn 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

Table of Contents Next Section