Contructor
Somewhere in the FAQ of this site was a method to return the same object no matter where the class was called from.
I have two dialogs and want to return the same set of values when they call this object and remmeber seeing this somewhere but cant remmeber how to do it :/
[281 byte] By [
polus] at [2007-11-19 14:02:08]

# 1 Re: Contructor
So if you have two different instances of a class you want to be able to call one method and have it return the same variables?
Make your class variables static variables. This makes them class variables meaning all instances of the class reffer back to a single instance of these variables.....
There is a trick here... in addition to defining them inside your class withe the static key word you also need to define them outside your class definition.. Check the help section with your compiler for syntax.
then you can just access the variables as normal and all class instances will point to the same set of these variable types..
This technique is extreamly useful when you want to track how many instances of an object is outstanding for initialization and destrction pu
JMS at 2007-11-11 0:00:46 >
