General information
Category:
Coding, syntax & commands
A property of a class is not shared by all the objects/instances of that class. It's true that all instances have that property, but the value of the property may be different for each instance.
A static property in a C++ class is a property that is available to all instances of the class AND it has the same value for all instances. Ie: If the property is modified in one instances, than its new value is available to all instances.
Vlad
>Yes, a property of a class is shared with other instances, but in most cases this is OK. It's been my experience that statics are used mainly as counters, so, in the class set the property to 0 then use it in each instance. The fact that each instance gets this property should not cause a problem.
>
>>>Static variables doesn't exist in VFP. You'll have to declare the variable elsewhere (maybe in a class property) to make it available each time the method is called.
>How do I set a 'static' variable in VF, just as I do it in C/C++?Originally the lift time of local variable is only within that procedure or function, how can I get it back as I come in afterwards?
>>
>>That wouldn't be adequate. A static variable of a class is shared across all instances of the class.
Previous
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only