Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

static variable at class level (example?)

Status
Not open for further replies.

Han777

Programmer
Dec 12, 2007
19
In Delphi, could someone give me an example of what is meant by variables that are "static at the class level.
 
while I don't have a specific answer for your question, here is a link to OOP in Delphi that I found extremely helpful in grasping some of the more advanced topics of OOP.


I think however that a static class variable is one that is available to all instances of a class.

As opposed to an instance variable: each instance of the class creates its own copy of the variable.


Leslie

In an open world there's no need for windows and gates
 
Thanks Les Paul for the good suggestion. I often consult delphiabout.com. I've been told by a programming associate that a variable that is static at the class level is coded like this (Quotes are his):

type
TMyClass = class
A: longint; static;
end;

In this case, a becomes essentially a global variable.

 
This doosent seem to work in Delphi 7.
and there are no references to a 'Static' keyword in the help either.

There is a way to fix a variable at a pecified memory location, cant find or remember it though!


type
TMyClass = class
A: longint; static;
end;




Steve: N.M.N.F.
Playing the blues isn't about feeling better. It's about making other people feel worse.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top