[Gambas-user] CLASS inherits from CLASS causes OUT OF BOUNDS (#22)

Bruce Steers bsteers4 at gmail.com
Tue Apr 18 01:31:18 CEST 2023


On Mon, 17 Apr 2023 at 15:45, Mayost Sharon <sharon at 455.co.il> wrote:

> Hello
>
> I am trying to create a class within a class that the second class
> inherits from the first class
>
> when i run
> The GAMBAS IDE comes out
> with an error
> OUT OF BOUNDS (#22)
>
> Is it my mistake?
>

Yep
your inherited class makes a New object of itself recursively because of
the inheritance.
Class2 inherits class1
and class1 has
Private $prop2 As New Class2
and Class2 inherits class1
and class1 has
Private $prop2 As New Class2
and Class2 inherits class1
and class1 has
Private $prop2 As New Class2
See where that's going.


> Attached is the code I tried to run


What exactly are you trying to do?

Thank you
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20230418/73d70ed2/attachment-0001.htm>


More information about the User mailing list