|
-
October 11th, 1999, 10:22 AM
#1
Visual Basic
Why a class module cannot have a static variable as a data member ? Should it not work in a similar way as a static member declared in a c++ class ?
AtulK
-
October 11th, 1999, 10:30 AM
#2
Re: Visual Basic
the documentation says "Static is unnecessary at module level, since all module-levelvariables are static. "
Well, you can't have a Static variable outside a function or sub. That's even true with non-class modules (so called standard modules).
Even if it "should...work in a similar way...", it doesn't.
-
October 11th, 1999, 10:59 AM
#3
Re: Visual Basic
Dear Lothar,
I have already tried the declarion of Static members in a class module which does not work. I thank you for your advice/suggession any way.
I also thought of the same thing. But further the problem is that, if I don't have provision of declaring static members in a class, I cannot implement something like keeping track of instances of my class. Thanx for replying !
AtulK
-
October 11th, 1999, 11:02 AM
#4
Re: Visual Basic
>I cannot implement something like keeping track of instances of my class.
This is not true.
By creating an ActiveX exe and specifying SingleUse as instancing property of your public class modules you can quite well keep track of instances of your class.
Simply use a Class-global variable.
-
October 11th, 1999, 11:07 AM
#5
Re: Visual Basic
Yeh !! You are right man !!
Still, I have to switch to from standard.exe project for that. ( I simply love this coversation !!!)
AtulK
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|