Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Public variables and Class
I've got a logit function in a class
<snip Write #FileNumber, lLogNum, sLogText <snip lLogNum is a number that increments every time the method is called oLog.Log "Test" lLogNum has a scope of Public Now in the log file I get 1. test 2. test However when I instantiate the class in a new module, lLogNume resets itself, and I get 1. test 2. test When what I need is 3. test 4. test Any ideas? Cheers Aidy |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Public variables and Class
Instantiating a class creates a new instance of that object, so in effect
you have a new iLogNum. What you need to do is to declare iLogNum as a public variable in a standard code module. -- HTH Bob Phillips ... looking out across Poole Harbour to the Purbecks (remove nothere from the email address if mailing direct) "Aidy" wrote in message om... I've got a logit function in a class <snip Write #FileNumber, lLogNum, sLogText <snip lLogNum is a number that increments every time the method is called oLog.Log "Test" lLogNum has a scope of Public Now in the log file I get 1. test 2. test However when I instantiate the class in a new module, lLogNume resets itself, and I get 1. test 2. test When what I need is 3. test 4. test Any ideas? Cheers Aidy |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Declare and Set Public variables | Excel Discussion (Misc queries) | |||
public variables | Excel Discussion (Misc queries) | |||
Public variables | Excel Discussion (Misc queries) | |||
Public Variables | Excel Discussion (Misc queries) | |||
Public Variables with UserForms | Excel Programming |