Solved

Static attributes in delphi ?

Posted on 1997-06-02
2
213 Views
Last Modified: 2013-11-23
Hello
I am a c++ programmer currently working with delphi 2.0.

Is it possible to create a variable in an object that keeps the same value in each  instance of the object, so if you modified the value in one instance the new value would be seen in all of the other instances?

0
Comment
Question by:essbb
2 Comments
 
LVL 4

Accepted Solution

by:
StevenB earned 80 total points
ID: 1336737
 If you declare a variable within an objects unit, not within the object declaration itself, simply within the Interface section then that variable will be global across all objects of that type. The variable will not be a property of the objects in quetion, but you can set up a 'proper' property of the objects and then set the read and write methods of that property to access the global variable.
  If you want any of these points explaining more fully, or some source code then leave a comment to that effect and I'll get back on the case.

  Steven.
0
 

Author Comment

by:essbb
ID: 1336738
Thanks, that is a great idea.
0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question