Jump to content
Sign in to follow this  
Xandy

AutoItObject array as property

Recommended Posts

Xandy

I'd like to add an undo array to this object, but I do not know how to access the array indexes.

func sourceobject($iStartup = False)
local $oObj = _AutoItObject_Create()
_AutoItObject_AddProperty($oObj, "surf", $ELSCOPE_Public, 0)
_AutoItObject_AddProperty($oObj, "w", $ELSCOPE_Public, 0)
_AutoItObject_AddProperty($oObj, "h", $ELSCOPE_Public, 0)
_AutoItObject_AddProperty($oObj, "filew", $ELSCOPE_Public, 0)
_AutoItObject_AddProperty($oObj, "fileh", $ELSCOPE_Public, 0)
_AutoItObject_AddProperty($oObj, "filepath", $ELSCOPE_Public, 0)
_AutoItObject_AddProperty($oObj, "scale", $ELSCOPE_Public, 1)
_AutoItObject_AddProperty($oObj, "fromx", $ELSCOPE_Public, -100)
_AutoItObject_AddProperty($oObj, "fromy", $ELSCOPE_Public, -100)
_AutoItObject_AddProperty($oObj, "fromsource", $ELSCOPE_Public, -1)
_AutoItObject_AddProperty($oObj, "alpha", $ELSCOPE_Public, 255)
_AutoItObject_AddProperty($oObj, "colorkey", $ELSCOPE_Public, 0)
_AutoItObject_AddProperty($oObj, "colorkeyuse", $ELSCOPE_Public, 0)
_AutoItObject_AddProperty($oObj, "nameid", $ELSCOPE_Public, 0)
_AutoItObject_AddProperty($oObj, "rotateangle", $ELSCOPE_Public, 0)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; $window inherit windowobject - works
$window= windowobject()
_AutoItObject_AddProperty($oObj, "win", $ELSCOPE_Public, $window)
;; define a array
$undosurfmax= 10
dim $undosurf[$undosurfmax]
_AutoItObject_AddProperty($oObj, "undosurf", $ELSCOPE_Public, $undosurf)
;; I don't know if I added the array correctly, I probably just don't know how to access it.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;_AutoItObject_AddProperty($oObj, "undocur", $ELSCOPE_Public, 0)
_AutoItObject_AddMethod($oObj, "load", "sourceo_load")
_AutoItObject_AddMethod($oObj, "zoom", "sourceo_zoom")
_AutoItObject_AddMethod($oObj, "savesurf", "sourceo_savesurf")
_AutoItObject_AddMethod($oObj, "freesource", "sourceo_freesource")
_AutoItObject_AddMethod($oObj, "changeangle", "sourceo_changeangle")
_AutoItObject_AddMethod($oObj, "flip", "sourceo_flip")
_AutoItObject_AddMethod($oObj, "fileload", "sourceo_fileload")
_AutoItObject_AddMethod($oObj, "filesave", "sourceo_saveload")
_AutoItObject_AddMethod($oObj, "colorkeyalpha", "sourceo_colorkeyalpha")
if $iStartup then $oObj.Startup
return $oObj
EndFunc

I can't access the array like this

$source[0].undosurf[0]= 10

good old 'syntax error' the very first error I ever encountered back before I knew what 'syntax' ment

Edited by Xandy

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×