Solved

Why does this cause an error?

Posted on 2003-12-07
3
196 Views
Last Modified: 2010-04-05
In the on form create, why does this cause and error and how do I make this work, I want it to be on the form create paragraph.

  with TRegistry.Create do
      begin
        rootkey := HKEY_LOCAL_MACHINE;
        if OpenKey('Software\Microsoft', False) then
          begin
            StringKeys := Tstringlist.create;

            Getkeynames(StringKeys);
            For j := 0 to (StringValues.Count - 1) do  ** ERROR OCCURS HERE ON STRINGVALUES
              Begin
                    //Why does it give me the error and whats the best way around it if I want to
                    //run this in the form create paragraph?  
              End;
0
Comment
Question by:jexd99
3 Comments
 
LVL 5

Accepted Solution

by:
arjanh earned 50 total points
ID: 9892992
You are mixing up StringKeys and StringValues:

Getkeynames(StringKeys);
For j := 0 to (StringValues.Count - 1) do


Change it to something like

GetKeynames(StringKeys);
For j := 0 to (StringKeys.Count - 1) do
   val := ReadString( StringKeys[j] );
0
 
LVL 24

Expert Comment

by:shivsa
ID: 9892994
u have to get the StringValues before using them.

       StringValues := Tstringlist.create;
       Getvaluenames (StringValues);            {get all value names}
       
0
 

Author Comment

by:jexd99
ID: 9893238
Thanks, I got a little confused to say the least :)
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
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…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

746 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

13 Experts available now in Live!

Get 1:1 Help Now