[Gambas-user] difference ME and SUPER with inherit

Mayost Sharon sharon at 455.co.il
Thu Mar 9 19:24:18 CET 2023


Hello

I try to run your example (the example file is attached) and it gives me errors
If possible you can attach an example file that works well

Many thanks

---------- Original Message -----------
From: BB <adamnt42 at gmail.com>
To: Gambas Mailing List <user at lists.gambas-basic.org>
Sent: Fri, 10 Mar 2023 03:39:05 +1030
Subject: Re: [Gambas-user] difference ME and SUPER with inherit

> *ClassA*
> 
> Public Function  DoThis(X as integer) as Integer
> 
>      Return X/2
> 
> End
> 
> *ClassB*
> 
> Public Function DoThis(Y as Integer) as Integer
> 
>      If "IsOdd"(Y) then
> 
>          Return Super.DoThis(Y-1)
> 
>      Else
> 
>          Return(X*2)
> 
> End
> 
> Public Sub Main
> 
> Dim I as Integer
> 
>      For I = 1 to 10
> 
>          Print DoThis(I)
> 
>      End
> 
> End
------- End of Original Message -------

-------------- next part --------------
A non-text attachment was scrubbed...
Name: super3.tar.xz
Type: application/x-xz
Size: 12432 bytes
Desc: not available
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20230309/a01394ae/attachment.xz>


More information about the User mailing list