[Gambas-user] About help and arrays and variables

Benoît Minisini gambas at ...1...
Wed Nov 17 12:49:47 CET 2010


> in http://gambasdoc.org/help/lang/arraydecl?show
> 
> the syntax for Embedded arrays is
> 
> [ STATIC ] { PUBLIC | PRIVATE } Identifier [ Array dimensions ... ] AS
> Native Datatype
> 
> but i could use also the NEW keyword
> 
> For example
> 
> PUBLIC aNames AS NEW String[2, 2]

That is a different thing.

	PUBLIC aNames AS New String[2, 2]

Is the same thing as:

	PUBLIC aNames As String[]
	aNames = New String[2, 2]

Where as:

	PUBLIC aNames[2, 2] As String

Is an embedded array.

"Normal" arrays are true Gambas objects, whereas embedded arrays are just a 
way to access a part of a Gambas object as an array. The array contents is 
stored in the memory slot allocated to the Gambas object where it is declared.

Regards,

-- 
Benoît Minisini




More information about the User mailing list