Solved

Runtime persistent change of Label Captions

Posted on 2001-06-28
7
352 Views
Last Modified: 2010-04-06
I have a label on a form. What I want to do is edit the caption of the label. I know this can do it.

Label1.Caption := 'whatever';

Real problem is I want to change this caption in such a way that when the program restarts I want the label to have the changed caption. I want to do it without using files or registry to save the changed text.

Anybody got any ideas?
0
Comment
Question by:drnadeem
7 Comments
 
LVL 44

Expert Comment

by:CrazyOne
ID: 6236872
It has got to be stored some where either in the registry or a file or a database. What did you have in mind?


The Crazy One
0
 
LVL 13

Expert Comment

by:Epsylon
ID: 6236938
Store it in the Drives volume label  :o)

Use SetVolumeLabel and GetVolumeInformation
0
 
LVL 4

Expert Comment

by:jsweby
ID: 6237094
CrazyOne is right, persistence comes from storing the changes somewhere, you can't write back the changes anywhere else so that they will be there next time, you'll have to have an ini file or registry key.

J.
0
Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

 
LVL 9

Expert Comment

by:ITugay
ID: 6237271
Hi drnadeem,

Delphi help:
"resourcestring" - Resource strings are stored as resources and linked into the executable or library so that they can be modified without recompiling the program. For more information, see Internationalization and localization and the topics that follow it.
----

But you can't modify application's resource while application is running.

-----
Igor.
0
 
LVL 1

Expert Comment

by:OryxConLara
ID: 6657841
dmadeem--

I assume that when you say "without files" you mean that you want the app as one .EXE (nad perhaps some DLLs) without external data files.

If you're changing the texts because of language (Italian, English) you might try using the ITE introduced in Delphi-5. This allows you to manage sets of resource DLLs, containing strings and other stuff usually written to the .RES file.

0
 
LVL 26

Expert Comment

by:Russell Libby
ID: 8691034
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

To be PAQ/Refund

Please leave any comments here within the next seven days.
 
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
 
Thank you,
Russell

EE Cleanup Volunteer
0
 

Accepted Solution

by:
PashaMod earned 0 total points
ID: 8816208
PAQ and no refund
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say 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

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

792 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