Solved

Static attributes in delphi ?

Posted on 1997-06-02
2
194 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

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
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…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

708 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now