Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

saving several settings

Posted on 2000-04-10
4
Medium Priority
?
134 Views
Last Modified: 2010-04-04
(sorry if this has been asked before..)
I want to save several usersettings to registry. I've created a form with edtiboxes on a pagecontrol and a function to save a setting to the registry. This works fine, but I want to automate the function so that it scrolls trough the pages and save every editbox text property in the Reg. using the editbox name property. (This seems an easy way to store mult. settings; any suggestion is welcome!)
0
Comment
Question by:Diggie
[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
4 Comments
 
LVL 13

Expert Comment

by:Epsylon
ID: 2702100
You can do something like this

  for i := 0 to ComponentCount - 1 do
    if (Components[i].Parent = Pagecontrol1) and (Components[i] is TEdit) then
      with (Components[i] as TEdit) do
        ToRegistry(Name, Text);


Not sure if this is what you're looking for...
0
 
LVL 13

Accepted Solution

by:
Epsylon earned 300 total points
ID: 2702153
This is a more worked-out solution:

var p, c: Integer;
begin
  for p := 0 to PageControl1.PageCount - 1 do
    for c := 0 to PageControl1.Pages[p].ControlCount - 1 do
      if PageControl1.Pages[p].Controls[c] is TEdit then
        with PageControl1.Pages[p].Controls[c] as TEdit do
          ToRegistry(Name, Text);
end;


Regards,

Epsylon.
0
 
LVL 2

Expert Comment

by:mullet_attack
ID: 2702175
Hi Diggie,

Have a look at this article/component from Delphi Informant magazine.

http://www.delphizine.com/features/1997/10/di199710rv_f/di199710rv_d.asp

it can save virtually any aspect of a form to the registry

Mark
0
 
LVL 3

Author Comment

by:Diggie
ID: 2702253
Damn! (Sorry for my language!)
This was my own solution for the problem (although I didn't work out the complete code...). I just wondered if this is the way professional programmers store their settings, or that I was barking at the wrong tree...
Anyway, thank you for your reply (and for showing me i'm not an idiot)
0

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

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…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
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…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
Suggested Courses

704 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