Hyderabad Jobs Book Website FREE PowerBuilder Training I Love Hyderabad Hyderabad Colleges
Home Business Emails Hyderabad Classifieds Contact Us
7 Wonders of Hyderabad Web Hosting Yellow Pages Our Network

 
Webpowerbuilder.hyderabad-colleges.com

Advanced PowerBuilder

HomePrevious Lesson: Global Variables
Next Lesson: Instance Variables

Shared Variables

Shared variables are stored in an object's definition and are available for all instances of the object. The first instance of the variable is initialized, when an object that has the shared variable is opened, and exists until the close of the application. The value of the variable persists even if the object is closed.

One example of how you could use this type of variable is when you want to count the number of times an object has been opened in an application. For each instance that is opened, the shared variable is incremented by one and the destruction of the instance has no effect on the value or on the existence of the variable itself.

  • If you open multiple instances of an object, the same value is used by all instances.
  • If the value of the variable is changed in one instance, the change will be reflected in all other instances of the object.
  • The value of the variable persists, even after all instances of the object are closed.

Shared variables can be declared for an application, menu, window and user objects. Shared variables are declared in the same way as Global variables, but you need to select 'Shared Variables' instead of 'Global Variables' option.
HomePrevious Lesson: Global Variables
Next Lesson: Instance Variables

Copyright © 1996 - 2006 HamaraShehar.com Pvt. Ltd. All Rights Reserved.
Domain Registration, Website Design, Website Hosting by HamaraShehar.com