Public variables and Class

A

Aidy

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
 
P

Peter Hewett

Hi Aidy

Declare your class instance as Public (in a standard module of course) and then
instantiate it. This way you have only once instance of your logging class.

HTH + Cheers - Peter


(e-mail address removed) (Aidy), said:
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top