RegistryItem.Delete why are you so awkward?

  1. last week

    Julian S

    Mar 20 Pre-Release Testers, Xojo Pro UK
    Edited last week by Julian S

    Has anyone got a working example of RegistryItem.Delete?

    I've tried every permutation I can think of to remove a key (an empty folder, not a name:value pair) and it just does nothing while reporting no errors.

    The documentation doesn't help either.

    RegistryItem.Delete ( Name as String )
    Deletes the passed RegistryItem.

    So it deleted the passed RegistryItem you say? I say nope.
    What exactly is Name? Is that the name of the Key ? Does it need to be a full path or a sub path? Do you need a \ before it or after it?

    dim tmp As New RegistryItem("HKEY_LOCAL_MACHINE\SOFTWARE\Classes\blah\wibble", False)
    tmp.Delete("")

    Nope

    dim tmp As New RegistryItem("HKEY_LOCAL_MACHINE\SOFTWARE\Classes\blah", False)
    tmp.Delete("wibble")

    Nope

    I've tried:
    wibble
    \wibble
    \wibble\
    HKEY_LOCAL_MACHINE\SOFTWARE\Classes\blah\wibble
    HKEY_LOCAL_MACHINE\SOFTWARE\Classes\blah\wibble\

    The only example on the forum is here , its no use because its wrong (I know you were writing it from memory Wayne, I'm not having a go :) ) Name is a String, so it cant have a RegistryItem passed to it.

    This is driving me crazy, something seemingly so simple, yet I'm stumped by the documentation :(

    Thanks in advance

    Great, Delete doesn't throw an error if it doesn't have permission to delete the entry.

    ARGH, thats 30 mins I wont get back.

    Oh FYI if you need to know how to do it:

    dim tmp As New RegistryItem("HKEY_LOCAL_MACHINE\SOFTWARE\Classes\blah", False)
    tmp.Delete("wibble")
  2. Julian S

    Mar 20 Pre-Release Testers, Xojo Pro Answer UK
    Edited last week by Julian S

    Great, Delete doesn't throw an error if it doesn't have permission to delete the entry.

    ARGH, thats 30 mins I wont get back.

    Oh FYI if you need to know how to do it:

    dim tmp As New RegistryItem("HKEY_LOCAL_MACHINE\SOFTWARE\Classes\blah", False)
    tmp.Delete("wibble")
  3. Michel B

    Mar 20 Pre-Release Testers, Xojo Pro

    What is "whibble" ? A token of sort ?

  4. Greg O

    Mar 20 Xojo Inc Somewhere near Raleigh, NC
    Edited last week by Greg O

    Try this...

    dim tmp As New RegistryItem("HKEY_LOCAL_MACHINE\SOFTWARE\Classes\blah\wibble", False)
    tmp.Parent.Delete("wibble")

    That should throw an exception if the key doesn't exist or you don't have permission to get to it.

    FYI - NOT in front of my computer... it's 4:44 am.

  5. Julian S

    Mar 20 Pre-Release Testers, Xojo Pro UK
    Edited last week by Julian S

    @Michel B What is "whibble" ? A token of sort ?

    :)

    wibble is just a filler word for a simulated piece of text, much like blah

    https://youtu.be/G2DCExerOsA

    33 seconds onwards :)

    I have a whole dictionary full of daft words, blah, moo, wibble etc. ;) It saves me spending time thinking of a temporary word.

  6. Julian S

    Mar 20 Pre-Release Testers, Xojo Pro UK
    Edited last week by Julian S

    Thanks Greg, I got there in the end, however its not throwing that error (it would have been a lot quicker of a puzzle if it had), I'm in the middle of writing a feedback about it, I'll try it on a previous version first though, I'm using a beta version.

    Feedback Case #47410

or Sign Up to reply!