MrTAToad,
Thank you!

It works very nice and now I don't have to rely on GLOBAL variables!
The GLBasic documentation is not up to date and if you read it it doesn't tells you how to return TYPES. I thought the same way that OCEAN said
Posted by: Ocean
« on: Today at 10:48 am » Insert Quote
do you really need to return 'v1', as such objects are passed by reference anyway?
It took me a while to find out that I could do classes using TYPES and functions inside TYPES.
More over I did not know the existence of
self. inside a Function and neither that we could declare the return type on the function signature like you did.
FUNCTION subv2 AS TObject:
This definitely will help me to use the inheritance and make my code cleaner.
I can contribute and help the GLBasic team updating for instance the documentation on the TYPE topic.
Let me know if you do.