steve8tch Posted November 13, 2006 Posted November 13, 2006 If a handle is declared locally - should it be destroyed when that particular fuction call ends. I have posted code here to illustrate the issue. ;open handles - local scope $counter = 0 ProgressOn("OpenHandleInLocalScope test","Number of handles open ", $counter, -1,-1,16) While 1 $counter += 1 ProgressSet(0,$counter) OpenHandleInLocalScope() sleep(50) WEnd Func OpenHandleInLocalScope() local $h_x = FileOpen("C:\OpenHandleInLocalScope.txt",1) EndFunc At present the handle does NOT get destroyed on function exit, but should it?
Valik Posted November 13, 2006 Posted November 13, 2006 It would be a lot of work because it would require making a new "type" inside the Variant. Also, AutoIt isn't an object-oriented language so I'm not so sure how an RAII concept would fit.
jpm Posted November 13, 2006 Posted November 13, 2006 It would be a lot of work because it would require making a new "type" inside the Variant. Also, AutoIt isn't an object-oriented language so I'm not so sure how an RAII concept would fit.Just curiosity what is RAII?
Valik Posted November 13, 2006 Posted November 13, 2006 http://en.wikipedia.org/wiki/Resource_Acqu..._Initialization
Richard Robertson Posted November 13, 2006 Posted November 13, 2006 That does seem complicated. I'm still working on figuring out how to manage variables for global and local calls. Declaring and referencing variables by string name is quite complicated to figure out for one's self.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now