so I just realized pb has extending, which is nice, however I wonder, is it possible to have something like
Code: Select all
Structure State
Name$
Update.i
Enter.i
Exit.i
OnFocus.i
OnUnfocus.i
OnEscape.i
EndStructure
Structure Zift Extends State
Meow$
EndStructure
Procedure Testing()
thing.State
test.Zift
test\Name$ = "this will totally not work I am sure"
thing = test
EndProcedure
this obviously doesn't compile, but I'm wondering if there's some way to make it work? I would have done interfaces, but interfaces only support functions, not properties.
I am aware of the pure basic's community's dislike of object oriented programming, which is why I was plesently surprised when I realized extend exists, though the final step will be this one

basically, what I'm trying to do is to have a general State structure, those things like update etc are sorta like methods but done through pointers, I think it will work? Not sure, but every different state will be able to extend the main state, put it's own variables, then I'll make a small function for each structure that gives the pointers for each one etc
is this possible?
also random curiosity, does extend also give the extended structure the interface declaration if one was done? Like through the data section, or does that need to be done seperately?