Hi,
I am starting to get the hang of types and have had partial success in using them.
My question is probably something that has been mentioned again and again but, what is the best way of specifying an unspecified number of a particular type within a type structure.
I am making a kind of GUI and have declared a parent type structure as below.
;----Type declerations----------
Type GADGET
Field GID% ; Gadget ID
Field GIMAGE$ ; Image
Field GX% ; X Pos
Field GY% ; Y Pos
Field GW% ; Gadget Width
Field GH% ; Gadget Height
End Type
I then pass values to this parent type structure using the function and function call as below,
;CreateGadget(0,"mp3player1.bmp",100,100,300,200)
;Function CreateGadget(GID%,GIMAGE$,GX%,GY%,GW%,GH%) ;Create a Gadget
;G.GADGET = New GADGET
; G\GID% = GID%
; G\GIMAGE = LoadImage(GIMAGE$)
; G\GX% = GX%
; G\GY% = GY%
; G\GW% = GW%
; G\GH% = GH%
;Return True
;End Function
What I would now like to do is create an unspecified number of child types within the parent type above and be able to pass values to it using a similar function. The child types would have to be an unspecified number of.
Sorry if this is unclear as sometimes I find it difficult to state the details...
I am starting to get the hang of types and have had partial success in using them.
My question is probably something that has been mentioned again and again but, what is the best way of specifying an unspecified number of a particular type within a type structure.
I am making a kind of GUI and have declared a parent type structure as below.
;----Type declerations----------
Type GADGET
Field GID% ; Gadget ID
Field GIMAGE$ ; Image
Field GX% ; X Pos
Field GY% ; Y Pos
Field GW% ; Gadget Width
Field GH% ; Gadget Height
End Type
I then pass values to this parent type structure using the function and function call as below,
;CreateGadget(0,"mp3player1.bmp",100,100,300,200)
;Function CreateGadget(GID%,GIMAGE$,GX%,GY%,GW%,GH%) ;Create a Gadget
;G.GADGET = New GADGET
; G\GID% = GID%
; G\GIMAGE = LoadImage(GIMAGE$)
; G\GX% = GX%
; G\GY% = GY%
; G\GW% = GW%
; G\GH% = GH%
;Return True
;End Function
What I would now like to do is create an unspecified number of child types within the parent type above and be able to pass values to it using a similar function. The child types would have to be an unspecified number of.
Sorry if this is unclear as sometimes I find it difficult to state the details...