[Gambas-user] Direct assignment to arrays of inherited classes does not work

Julio Sanchez jusabejusabe at ...626...
Mon Sep 22 10:08:16 CEST 2014


Direct assignment to arrays of inherited classes does not work

We have a class that inherits from the integer class [], we call
SuperInteger, this is your code:
Inherits Integer []

Public function  higher() as integer
dim itemt as integer
dim ihigher as integer

for each element in me
ihigher = max (ihigher, item)
next

return ihigher

end


When I make an instance of the new :

dim test as new SuperInteger


It does not work this assignment:
test = [86, 16, 212, 1, 43, 18]

gambas3 says it's not the same type.
Should I working? Right?


Regards

Julio



More information about the User mailing list