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.
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.
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:
If I skip this line, will the function still do what it was created to do?Code::registry.load_settings("INDX",User_Data)
Thank you
Alpha Anywhere v3.5
Version 12.3, Build 2999
MySql56 & DBF's
Alpha 4, 5, Anywhere
Ron Anusiewicz
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
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.
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
Try the example from the docs for Registry.sys_get(). Maybe there is some permissions issue going on?
or try a different keyCode: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
Code:User_Data.foo = "" :registry.load_settings("init\DataEntry", User_Data) ? user_data.mode = "Modeless"
There can be only one.
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 12:48 PM. Reason: Looked in the registry
Alpha Anywhere v3.5
Version 12.3, Build 2999
MySql56 & DBF's
Alpha 4, 5, Anywhere
Ron Anusiewicz
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.
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
Glad to help and glad it now works for you.
There can be only one.
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
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
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
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 11:30 AM.
There can be only one.
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
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 10:55 AM.
There can be only one.
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
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 11:13 AM.
There can be only one.
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 01:41 PM.
Robin
Discernment is not needed in things that differ, but in those things that appear to be the same. - Miles Sanford
I want to move a local app to the server - will these functions still work on the local pc registry? IOW or does Alpha write to the registry on the server where the data files are?
Robin
Discernment is not needed in things that differ, but in those things that appear to be the same. - Miles Sanford
Bookmarks