Alpha DevCon 2018
Page 2 of 2 FirstFirst 12
Results 31 to 49 of 49

Thread: Clean the registry

  1. #31
    "Certified" Alphaholic DaveM's Avatar
    Real Name
    Dave Mason
    Join Date
    Jul 2000
    Location
    Hudson, FL
    Posts
    5,873

    Default Re: Clean the registry

    I made it simple and copied the functions into function exactly as directed and they do everything asked in v12 and win10. I call each function from the autoexec in order at app startup.
    They work as advertised.
    Dave Mason
    dave@aldaweb.com

    Skype is dave.mason46

  2. #32
    "Certified" Alphaholic
    Real Name
    Ronald Anusiewicz
    Join Date
    Oct 2000
    Location
    Southampton, MA
    Posts
    1,484

    Default Re: Clean the registry

    Martin,

    I just started getting an error when running the Clean_Indexes() in my autoexec().

    "An unhandled exception (c0000005) was generated"

    I traced this error to the line 15:

    Code:
    :registry.load_settings("INDX",User_Data)
    If I skip this line, will the function still do what it was created to do?

    Thank you
    Alpha Anywhere v3.5
    Version 12.3, Build 2999
    MySql56 & DBF's

    Alpha 4, 5, Anywhere

    Ron Anusiewicz

  3. #33
    VAR
    Real Name
    Martin W. Cole
    Join Date
    Apr 2000
    Location
    Terrell, Texas (near Dallas)
    Posts
    5,912

    Default Re: Clean the registry

    Ron, I am using them in 10,11,and 12 ok
    Stan Mathews wrote this for me, and I have an idea he will respond
    Cole Custom Programming - Terrell, Texas
    972 524 8714
    martin_w_cole@msn.com

    ____________________
    "A young man who is not liberal has no heart, but an old man who is not conservative has no mind." GB Shaw

  4. #34
    "Certified" Alphaholic Stan Mathews's Avatar
    Real Name
    Stan Mathews
    Join Date
    Apr 2000
    Location
    Bowling Green, KY
    Posts
    24,953

    Default Re: Clean the registry

    The functions won't work without that line. That is what creates the list of items to check for removal. I can't imagine how it could error.

    userdata.png
    There can be only one.

  5. #35
    "Certified" Alphaholic
    Real Name
    Ronald Anusiewicz
    Join Date
    Oct 2000
    Location
    Southampton, MA
    Posts
    1,484

    Default Re: Clean the registry

    Not sure what happened, but it's working OK now using version 12.
    Still getting an error in version 11.

    error.PNG
    Alpha Anywhere v3.5
    Version 12.3, Build 2999
    MySql56 & DBF's

    Alpha 4, 5, Anywhere

    Ron Anusiewicz

  6. #36
    "Certified" Alphaholic Stan Mathews's Avatar
    Real Name
    Stan Mathews
    Join Date
    Apr 2000
    Location
    Bowling Green, KY
    Posts
    24,953

    Default Re: Clean the registry

    Try the example from the docs for Registry.sys_get(). Maybe there is some permissions issue going on?

    Code:
    ui_msg_box("", "" + system_root())
    FUNCTION system_root as C ()
        system_root = Registry.sys_get("HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\SystemRoot")
        IF (system_root = "") then
           system_root = Registry.sys_get("HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\SystemRoot")
        END IF
    END FUNCTION
    or try a different key

    Code:
    User_Data.foo = ""
    :registry.load_settings("init\DataEntry", User_Data)
    ? user_data.mode
    = "Modeless"
    There can be only one.

  7. #37
    "Certified" Alphaholic
    Real Name
    Ronald Anusiewicz
    Join Date
    Oct 2000
    Location
    Southampton, MA
    Posts
    1,484

    Default Re: Clean the registry

    The function returns c:\WINDOWS
    The code returns "modeless"

    Is there something missing in the Registry?

    Just looked in the registry under the version 11.0 INDX.
    It's loaded with stuff. Version 12.0 INDX is almost empty.

    Maybe too much?
    Last edited by Ronald Anusiewicz; 03-01-2018 at 11:48 AM. Reason: Looked in the registry
    Alpha Anywhere v3.5
    Version 12.3, Build 2999
    MySql56 & DBF's

    Alpha 4, 5, Anywhere

    Ron Anusiewicz

  8. #38
    "Certified" Alphaholic Stan Mathews's Avatar
    Real Name
    Stan Mathews
    Join Date
    Apr 2000
    Location
    Bowling Green, KY
    Posts
    24,953

    Default Re: Clean the registry

    I just suggested those snippets to see Alpha could read the registry at all.

    You can manually select the INDX key and delete it. That is essentially what the code does.
    There can be only one.

  9. #39
    "Certified" Alphaholic
    Real Name
    Ronald Anusiewicz
    Join Date
    Oct 2000
    Location
    Southampton, MA
    Posts
    1,484

    Default Re: Clean the registry

    Thanks Stan.
    Went into the registry and deleted the INDX folder under Alpha Software 11.0 and now all is well.
    My guess is the data returned was too large creating a memory error.
    Alpha Anywhere v3.5
    Version 12.3, Build 2999
    MySql56 & DBF's

    Alpha 4, 5, Anywhere

    Ron Anusiewicz

  10. #40
    "Certified" Alphaholic Stan Mathews's Avatar
    Real Name
    Stan Mathews
    Join Date
    Apr 2000
    Location
    Bowling Green, KY
    Posts
    24,953

    Default Re: Clean the registry

    Glad to help and glad it now works for you.
    There can be only one.

  11. #41
    "Certified" Alphaholic MoGrace's Avatar
    Real Name
    Robin
    Join Date
    Mar 2006
    Location
    Los Angeles
    Posts
    3,376

    Default Re: Clean the registry

    Are these functions still valid for Win 10? When I look in the registry at the the files under INDX there is no substring "<DBF"
    Robin

    Discernment is not needed in things that differ, but in those things that appear to be the same. - Miles Sanford

  12. #42
    VAR
    Real Name
    Martin W. Cole
    Join Date
    Apr 2000
    Location
    Terrell, Texas (near Dallas)
    Posts
    5,912

    Default Re: Clean the registry

    I don't know; I am still using W7. Ask Stan Mathews; he wrote it for me originally.
    Cole Custom Programming - Terrell, Texas
    972 524 8714
    martin_w_cole@msn.com

    ____________________
    "A young man who is not liberal has no heart, but an old man who is not conservative has no mind." GB Shaw

  13. #43
    "Certified" Alphaholic MoGrace's Avatar
    Real Name
    Robin
    Join Date
    Mar 2006
    Location
    Los Angeles
    Posts
    3,376

    Default Re: Clean the registry

    Thanks, will wait for Stan...
    Robin

    Discernment is not needed in things that differ, but in those things that appear to be the same. - Miles Sanford

  14. #44
    "Certified" Alphaholic Stan Mathews's Avatar
    Real Name
    Stan Mathews
    Join Date
    Apr 2000
    Location
    Bowling Green, KY
    Posts
    24,953

    Default Re: Clean the registry

    I think it should.

    "<DBF" is not what you see in the regedit registry view. It is what you see when the registry settings are loaded into the variable.

    Works for me With A5V12 under Win 10.
    Last edited by Stan Mathews; 04-23-2018 at 10:30 AM.
    There can be only one.

  15. #45
    "Certified" Alphaholic MoGrace's Avatar
    Real Name
    Robin
    Join Date
    Mar 2006
    Location
    Los Angeles
    Posts
    3,376

    Default Re: Clean the registry

    Clean_Indexes() returns .T. for me but does nothing - the folder is still there in the registry. Clean_Tables() returns 1 table in the IW - but it didn't remove any of them either.

    Have you modified the functions at all?
    Robin

    Discernment is not needed in things that differ, but in those things that appear to be the same. - Miles Sanford

  16. #46
    "Certified" Alphaholic Stan Mathews's Avatar
    Real Name
    Stan Mathews
    Join Date
    Apr 2000
    Location
    Bowling Green, KY
    Posts
    24,953

    Default Re: Clean the registry

    No changes, I actually copy-pasted the code from this thread to a Win 10 machine where I had never used those functions.

    If you want to try and diagnose your issue you might add a line to write the registry strings to a text file and see what you find.

    After

    cont = property_to_string(user_data)

    add

    save_to_file(cont,"C:\temp\index registry.txt",.F.) 'or table registry.txt as appropriate.

    You should find something like this in the output file.

    <foo="">
    <FFFF01D5-DMGRECL<DBF;1<contents_c="TYPE=6">
    <contents_m="FILE=~C:\Alpha\privpath\$$1D3801.MPX~ DESC=~Temporary Query~">
    >
    <DBF;2<contents_c="TYPE=6">
    <contents_m="FILE=~C:\Alpha\privpath\$$140601.MPX~ DESC=~Temporary Query~">
    >
    <DBF;3<contents_c="TYPE=6">
    <contents_m="FILE=~C:\Alpha\privpath\$$1B1601.MPX~ DESC=~Temporary Query~">
    >
    <DBF;4<contents_c="TYPE=6">
    <contents_m="FILE=~C:\Alpha\privpath\$$120C01.MPX~ DESC=~Temporary Query~">
    >
    >
    <FFFF0225-PPMASTER<DBF;1<contents_c="TYPE=6">
    <contents_m="FILE=~C:\Alpha\privpath\$$203100.MPX~ DESC=~Record-number;IS_RECNO_IN("1443 ")~">
    >
    <DBF;2<contents_c="TYPE=6">
    <contents_m="FILE=~C:\Alpha\privpath\$$1E0A00.MPX~ DESC=~Record-number;VAL(WORD(DESCRIPTIO,1," ")) <> P~">
    >
    <DBF;3<contents_c="TYPE=6">
    <contents_m="FILE=~C:\Alpha\privpath\$$392300.MPX~ DESC=~Descriptio~">
    >
    Last edited by Stan Mathews; 04-24-2018 at 09:55 AM.
    There can be only one.

  17. #47
    "Certified" Alphaholic MoGrace's Avatar
    Real Name
    Robin
    Join Date
    Mar 2006
    Location
    Los Angeles
    Posts
    3,376

    Default Re: Clean the registry

    Thanks Stan, I'll try that...
    Robin

    Discernment is not needed in things that differ, but in those things that appear to be the same. - Miles Sanford

  18. #48
    "Certified" Alphaholic Stan Mathews's Avatar
    Real Name
    Stan Mathews
    Join Date
    Apr 2000
    Location
    Bowling Green, KY
    Posts
    24,953

    Default Re: Clean the registry

    I looked over the code and am suggesting an alteration. The dummy variable fooc is used in the for each...next construct. Within that I think the proper usage should be to check the .value property of fooc rather than fooc itself.

    For example, intsead of

    CASE "<DBF" $ fooc

    it should be

    CASE "<DBF" $ fooc.value

    clean_indexes.txt
    clean_tables.txt
    Last edited by Stan Mathews; 04-24-2018 at 10:13 AM.
    There can be only one.

  19. #49
    "Certified" Alphaholic MoGrace's Avatar
    Real Name
    Robin
    Join Date
    Mar 2006
    Location
    Los Angeles
    Posts
    3,376

    Default Re: Clean the registry

    That worked - just have to fix the path for the save_to_file() on line 14. Thank You!

    My change:

    dim vfile as c
    vfile = a5.Get_Private_Path()+chr(92)+"index registry.txt"
    save_to_file(cont,vfile,.F.)
    Last edited by MoGrace; 04-24-2018 at 12:41 PM.
    Robin

    Discernment is not needed in things that differ, but in those things that appear to be the same. - Miles Sanford

Similar Threads

  1. Clean Webroot
    By steinmanal in forum Application Server Version 9 - Web/Browser Applications
    Replies: 4
    Last Post: 06-20-2009, 05:27 PM
  2. Clean Startup How?
    By Claudio Pilustrelli in forum Alpha Five Version 5
    Replies: 5
    Last Post: 12-05-2003, 11:09 AM
  3. Clean Up Registry
    By scottly in forum Alpha Five Version 5
    Replies: 6
    Last Post: 11-02-2003, 03:27 AM
  4. How to get a clean screen
    By Greg Fong in forum Alpha Five Version 4
    Replies: 6
    Last Post: 11-29-2001, 11:46 PM
  5. SEM How do you Clean Up?
    By Bonnie Jacques in forum Alpha Five Version 1
    Replies: 1
    Last Post: 06-15-2000, 09:06 AM

Bookmarks

Posting Permissions

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