Solved

Static attributes in delphi ?

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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…

690 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