[Gambas-user] Some new features in Gambas 3

Benoît Minisini gambas at ...1...
Sat Nov 27 15:02:02 CET 2010


> Hi,
> 
> Here is just a few words about recently added features in Gambas 3, for
> those who didn't see them.
> 
> ...

I forgot:

5) Now the interpreter does an automatic conversion between all array classes 
(except embedded arrays that are not real arrays).

So now you can write:

	Dim MyArray As Byte[] = [ 0, 1, 2 ]

Whereas you had to write that before:

	Dim MyArray As Byte[] = [ CByte(0), CByte(1), CByte(2) ]

You can do that too:

	Dim MyArray As Integer[] = [ "1", Pi,  Now ]

The conversion is done too when passing arguments to functions.

At the moment, only native classes can implement a specific conversion 
routines. 

It will be now possible to add an automatic conversion from Collection to a 
Variant[] (for example).

Maybe in the future I will allow that for Gambas classes, but I am not sure it 
is a good idea. As conversion is done automatically under the hood, I prefer 
that feature to be clearly defined and limited.

Regards,

-- 
Benoît Minisini




More information about the User mailing list