Solved

Static attributes in delphi ?

Posted on 1997-06-02
2
233 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
When I am typing into a TEdit last word repeats 7 161
find a node in VST 2 79
enhance the following code 3 42
Delphi android app hide keyboard 3 45
A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

733 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