AutoHotkey Community

It is currently May 27th, 2012, 11:35 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: August 23rd, 2005, 7:16 pm 
Offline

Joined: August 23rd, 2005, 4:13 pm
Posts: 6
The following code snip will cause a hard crash of AHK.

The problem is using the same variable to call two ByRef function parameters. This, of course, should not be done in the first place, but
it would be a lot easier to track down the error if with help from the interpreter.

ColorParts(Color, ByRef Blue, ByRef Green, ByRef Red)
{
Red := Mod(Color,256)
Color := Floor(Color/256)
Green := Mod(Color,256)
Blue := Floor(Color/256)

}


; Notice the same variable is used for two by ref parameters...

ColorParts(0x010101,B1,G1,G1)


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 23rd, 2005, 9:06 pm 
Offline

Joined: March 2nd, 2004, 3:36 pm
Posts: 10720
Although it wouldn't be a big surprise to me if there's a bug in this area of the program, I haven't been able to reproduce it yet. I ran the following script, both in debug mode (which often reveals more bugs) and in normal mode:
Code:
B1 = 100
G1 = 100
ColorParts(0x010101,B1,G1,G1)
MsgBox

ColorParts(Color, ByRef Blue, ByRef Green, ByRef Red)
{
   Red := Mod(Color,256)
   Color := Floor(Color/256)
   Green := Mod(Color,256)
   Blue := Floor(Color/256)
}

Does this script crash exactly as written above? What version of AutoHotkey are you using?

If anyone else can reproduce this problem, that would make it a certainty that this is a bug. Thanks.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 24th, 2005, 12:07 pm 
Offline

Joined: August 23rd, 2005, 4:13 pm
Posts: 6
I'm not sure what version I was using when the error occured because I upgraded to the latest version shortly after posting the message.

I have confirmed that it does not occur in the latest version.


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 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