AutoHotkey Community

It is currently May 27th, 2012, 6:16 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 4 posts ] 
Author Message
PostPosted: December 6th, 2005, 5:54 pm 
Offline

Joined: July 12th, 2005, 1:21 pm
Posts: 633
I am not shure what's wrong but the Registry-Loop always reads from the bottom to the top! (beginning with the last subkey-folder and in there beginning with the last regentry)

Code:
Loop, HKEY_LOCAL_MACHINE, MyProgramm, 1, 1


The problem is:
I write each entry into an ini-file for comparing-purposes.
Sometimes the software (not from me, but from my company) does something wrong in registry and I have to do a backup from my inifile.

Because the entrys are written in forward-way, but saved the other way my next backup-file is nearly completely different then my original (the subkeys are switched: the first has got the last and reverse).

So I have to write my backup, create a backup-file, write another time the registry (from recently made backup-file) and create a new file.

Couldn't the routine start above in registry?

I will write a little programm which switches my keys, but maybe someone in the future?

I hope you can reproduce it!

Thx in advance!
Thalon

_________________
AHK-Icon-Changer
AHK-IRC
deutsches Forum


Report this post
Top
 Profile  
Reply with quote  
PostPosted: December 6th, 2005, 8:22 pm 
Offline

Joined: November 8th, 2004, 12:46 am
Posts: 1271
Thalon wrote:
I am not shure what's wrong but the Registry-Loop always reads from the bottom to the top!

I've noticed this behaviour too (running 2k sp4, ahk 1.0.40.08), and would prefer it if it would default to reading from top to bottom.

_________________
"Anything worth doing is worth doing slowly." - Mae West
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 7th, 2005, 1:47 pm 
Offline

Joined: March 2nd, 2004, 3:36 pm
Posts: 10720
It reads from the bottom to the top so that RegDelete can be used inside the loop without disrupting the loop (this is due to the behavior of the API's functions RegEnumValue and RegEnumKeyEx).

Since changing this behavior would break existing scripts, a new option could be added to retrieve the keys in top-to-bottom order. However, the drawbacks are:
1) It would have to be documented that RegDelete can't be used inside such a loop.
2) It would add quite a bit of code, which might be unjustified given how rarely scripts use registry loops, much less ones that prefer top-to-bottom order.

Further comments are welcome (in the meantime I've documented this behavior).


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 7th, 2005, 5:22 pm 
Offline

Joined: July 12th, 2005, 1:21 pm
Posts: 633
I think a comment in description is enough for me.
I have a (more or less working) workaround for my special purpose.

The scripts which may use this functionality (reg-loop) are really rare as you say and which will need a workaround because a difference between the behavior should be very few.

From my point of view it is done...
I make a little "x" in my list from bugs I did not find (because they are well argumented handlings) :wink:

Thalon

_________________
AHK-Icon-Changer
AHK-IRC
deutsches Forum


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 2 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group