Xandy Posted January 29, 2013 Posted January 29, 2013 (edited) I'm trying to contain these arrays as properties within the object. I'm not sure how to create an array property with AutoItObject. and I have no idea how to access the elements of the array property. This example isn't meant to run. func tilewindowobject(byref $sourcetile, $sourcetiles, $w, $h, byref $_tilepagerect, byref $_tilepagerects, byref $tileperpage, $iStartup = False) local $oObj = _AutoItObject_Create() _AutoItObject_AddProperty($oObj, "win", $ELSCOPE_Public, windowobject()) _AutoItObject_AddProperty($oObj, "page", $ELSCOPE_Public, 0) _AutoItObject_AddProperty($oObj, "update", $ELSCOPE_Public, 0) _AutoItObject_AddProperty($oObj, "tiles", $ELSCOPE_Public, $sourcetiles) _AutoItObject_AddProperty($oObj, "tilecur", $ELSCOPE_Public, 0) ; =====================================================================; create array property ? local $arect[$tileperpagemax];200 random size tiles per page $arect[0]= rectobject(100, 200, 300, 400); some values x, y, w, h for $i= 1 to $tileperpagemax-1 $arect[$i]= _AutoItObject_Create($arect[0]) next _AutoItObject_AddProperty($oObj, "tilerect", $ELSCOPE_Public, $arect) ; ===================================================================== _AutoItObject_AddMethod($oObj, "make", "tilewindowo_make") _AutoItObject_AddMethod($oObj, "drawtiles", "tilewindowo_drawtiles") _AutoItObject_AddMethod($oObj, "listen", "tilewindowo_listen") _AutoItObject_AddMethod($oObj, "calctiles", "tilewindowo_calctiles") $oObj.make($sourcetile, $w, $h, $_tilepagerect, $_tilepagerects, $tileperpage) if $iStartup then $oObj.Startup return $oObj EndFunc;tilewindowobject() $tilewindow= $tilewindowobject($tile, $tiles, 200, 200, $tilepagerect, $tilepagerects, $tileperpage);No error consolewrite("test element member "&$oObj.tilerect[0].x);syntax error Can anyone show me the syntax for AutoItObject array properties? Just a array property create phase and query or assignment Edited January 29, 2013 by Xandy Human Male Programmer (-_-) Xandy About (^o^) Discord - Xandy Programmer MapIt (Tile world editor, Image Tile Extractor, and Game Maker)
trancexx Posted January 29, 2013 Posted January 29, 2013 Newer versions of AutoIt allow for syntax like that. Eh, I'm really sorry that I can't do anything to make it available to you. Try using temporary variable to save the object from the array to and dot-access that. Xandy 1 ♡♡♡ . eMyvnE
Xandy Posted January 29, 2013 Author Posted January 29, 2013 I'll pair-up arrays for each case of tilewindowobject. Not too dirty. Thank you, I can let it go now. Human Male Programmer (-_-) Xandy About (^o^) Discord - Xandy Programmer MapIt (Tile world editor, Image Tile Extractor, and Game Maker)
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