Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Why does this cause an error?

Posted on 2003-12-07
3
Medium Priority
?
208 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 200 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

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Question has a verified solution.

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

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 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…
this video summaries big data hadoop online training demo (http://onlineitguru.com/big-data-hadoop-online-training-placement.html) , and covers basics in big data hadoop .
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
Suggested Courses

773 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