aommaster Posted January 3, 2009 Posted January 3, 2009 Hi guys Does Autoit support pointer variables, ie. variables that contain the memory location of other variables so that they can be used to pass arrays down to functions? I looked at the PTR function, but that doesn't seem to be what I am looking for. Thanks guys
GtaSpider Posted January 3, 2009 Posted January 3, 2009 Hi Sure it does. Look at DllStructCreate, DllStructSet/GetData and DllStructGetPtr Spider www.AutoIt.de - Moderator of the German AutoIt Forum
Zedna Posted January 3, 2009 Posted January 3, 2009 Directly something like PTR() no but look at DllStructCreate(), DllStructGetPtr() Resources UDF ResourcesEx UDF AutoIt Forum Search
monoceres Posted January 3, 2009 Posted January 3, 2009 Hi guys Does Autoit support pointer variables, ie. variables that contain the memory location of other variables so that they can be used to pass arrays down to functions? I looked at the PTR function, but that doesn't seem to be what I am looking for. Thanks guys Hi! In autoit you cannot access variables by their addresses, it's still easy to pass arrays to functions. Example: Local $arr[10 ^ 6] For $i = 0 To UBound($arr) - 1 $arr[$i] = $i Next $timer=TimerInit() SlowArray($arr) ConsoleWrite("Calling without ByRef took: "&@TAB&TimerDiff($timer)&" ms."&@CRLF) $timer=TimerInit() FastArray($arr) ConsoleWrite("Calling with ByRef took: "&@TAB&TimerDiff($timer)&" ms."&@CRLF) Func FastArray(ByRef $arr) EndFunc ;==>FastArray Func SlowArray($ArrCopy) EndFunc ;==>SlowArray ByRef in this case could be looked at as a pointer. Broken link? PM me and I'll send you the file!
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