Indigo Rose Software

Professional Software Development Tools

 
Results 1 to 12 of 12
  1. #1
    Join Date
    Feb 2005
    Location
    Mn
    Posts
    770

    Add input to line

    I have and I want to take the registry from the input and add it to the line on the Software\\registry but not sure how to do the replace?
    Must be something simple. lol
    Code:
    registry = Input.GetText("Input1");
    all_names = Registry.GetKeyNames (HKEY_LOCAL_MACHINE, "Software\\registry");
    Thanks for the help.

  2. #2
    Join Date
    Aug 2004
    Location
    Somewhere in Texas, USA
    Posts
    417
    Code:
    registry = Input.GetText("Input1");
    all_names = Registry.GetKeyNames(HKEY_LOCAL_MACHINE, "Software\\"..registry.."");

  3. #3
    Join Date
    Feb 2005
    Location
    Mn
    Posts
    770
    Thank you . I'm trying to add the output to a Paragraph but I get this error?
    Code:
    Error
    ---------------------------
    Page1 -> Button1 -> On Click, Line 3: Argument 2 must be of type string.
    ---------------------------
    OK
    Code:
    registry = Input.GetText("Input1");
    all_names = Registry.GetKeyNames(HKEY_LOCAL_MACHINE, "Software\\"..registry.."");
    Paragraph.SetText("Paragraph1", all_names);

  4. #4
    Join Date
    Feb 2001
    Location
    Indigo Rose Software
    Posts
    2,728
    Registry.GetKeyNames returns a table, not a string.
    --[[ Indigo Rose Software Developer ]]

  5. #5
    Join Date
    Aug 2004
    Location
    Somewhere in Texas, USA
    Posts
    417
    Try this

    Code:
    registry = Input.GetText("Input1");
    
    is_there = Registry.DoesKeyExist (HKEY_LOCAL_MACHINE, "Software\\"..registry.."");
    
    if is_there == true then 
           all_names = Registry.GetKeyNames (HKEY_LOCAL_MACHINE, "Software\\"..registry.."");   
        	-- Initialize sInputContents to ""
    	   sParagraphContents = "";
    	   -- Concat table and add line numbers
       if all_names ~= nil then
         	for LineNumber, LineContents in all_names do
    	    	if LineContents ~= "\r\n" then
    		    	sParagraphContents = sParagraphContents .. LineNumber .. ":  " .. LineContents .. "\r\n";
    	    	else
    		    	sParagraphContents = sParagraphContents .. LineNumber .. ": " .. "\r\n";
    		   end
    	    end
    	
        	-- Change the table into a string to load into the input object
        	--sParagraphContents = Table.Concat(tFileContents, "\r\n", 1, TABLE_ALL);
    
        	-- Set the input text
        	Paragraph.SetText("Paragraph", sParagraphContents);
        else
            Dialog.Message("Notice", "There are no subkeys for that key! Please choose a different key.", MB_OK, MB_ICONINFORMATION, MB_DEFBUTTON1);
        end
    else
            Dialog.Message("Notice", "That key does not exist! Check your spelling or choose a different key.", MB_OK, MB_ICONINFORMATION, MB_DEFBUTTON1);
    end

  6. #6
    Join Date
    Feb 2005
    Location
    Mn
    Posts
    770
    Thank you for the help. I will play with it more. and maybe get back for more questions.

  7. #7
    Join Date
    Aug 2004
    Location
    Somewhere in Texas, USA
    Posts
    417
    Try this instead. I cleaned the code up a little and changed a few concats.

    Code:
    registry = Input.GetText("Input1");
    
    is_there = Registry.DoesKeyExist (HKEY_LOCAL_MACHINE, "Software\\"..registry);
    
    if is_there == true then 
       all_names = Registry.GetKeyNames (HKEY_LOCAL_MACHINE, "Software\\"..registry);   
       sParagraphContents = "";
       -- Concat table and add line numbers
         if all_names ~= nil then
         	for LineNumber, LineContents in all_names do
    	    	 if LineContents ~= "\r\n" then
    		    	sParagraphContents = sParagraphContents .. LineNumber .. ":  " .. LineContents .. "\r\n";
    	    	 else
    		    	sParagraphContents = sParagraphContents .. LineNumber .. ": " .. "\r\n";
    		     end
    	    end
         	Paragraph.SetText("Paragraph", sParagraphContents);
         else
            Dialog.Message("Notice", "There are no subkeys for that key! Please choose a different key.", MB_OK, MB_ICONINFORMATION, MB_DEFBUTTON1);
         end
    else
            Dialog.Message("Notice", "That key does not exist! Check your spelling or choose a different key.", MB_OK, MB_ICONINFORMATION, MB_DEFBUTTON1);
    end

  8. #8
    Join Date
    Mar 2006
    Location
    Corpus Christi, Texas
    Posts
    132
    I'm new at this 1 year running
    This worked for me.

    registry = Input.GetText("Input1");
    all_names = "Registry.GetKeyNames (HKEY_LOCAL_MACHINE, *Software\\\\"..registry.."*);";
    all_names = String.Replace(all_names, "*", "''", false);
    Paragraph.SetText("Paragraph1", all_names);
    If you need to add to the paragraph just ask if you need help and i will do it..

    Jean
    Last edited by jfxwave; 01-05-2007 at 06:49 PM.

  9. #9
    Join Date
    Feb 2005
    Location
    Mn
    Posts
    770
    Whatever name you add to the input it just prints that out to the Paragraph1.
    Even if is not in the registry.

  10. #10
    Join Date
    Mar 2006
    Location
    Corpus Christi, Texas
    Posts
    132
    I'm sorry i thought thats what you wanted.

    So the whole line of the registry will be in the input box and you want to change it in-side the input box and click the button to add it to the paragraph?

    If so how is the reg string getting in the input box?

    If not i don't understand ( sorry ) please explan more.

  11. #11
    Join Date
    Feb 2005
    Location
    Mn
    Posts
    770
    What I'm trying to do is enter a name of a program and seach the registry for it and show the keys for it.
    Then I can make a backup of the key.

  12. #12
    Join Date
    Mar 2006
    Location
    Corpus Christi, Texas
    Posts
    132
    I think i know what your talking about. Maybe this will help.
    Attached Files

Similar Threads

  1. Any way to have mulitple line user input boxes?
    By cap808 in forum Setup Factory 7.0
    Replies: 2
    Last Post: 12-01-2006, 08:49 AM
  2. Input Box Wierdness
    By Roboblue in forum AutoPlay Media Studio 6.0
    Replies: 9
    Last Post: 11-18-2005, 01:20 PM
  3. Lorne’s two great input validation scripts
    By csd214 in forum AutoPlay Media Studio 5.0
    Replies: 2
    Last Post: 06-09-2004, 09:13 AM
  4. HOWTO: Build a Setup from the Command Line
    By Support in forum Setup Factory 5.0
    Replies: 0
    Last Post: 10-08-2002, 01:43 PM
  5. Add a line to system.ini
    By vc820 in forum Setup Factory 6.0
    Replies: 3
    Last Post: 05-15-2002, 12:25 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts