[Gambas-user] multidimensional array of integers

nando nando_f at ...951...
Tue Jan 15 01:16:37 CET 2008


I use arrays heavily, both static and dynamic, both global and local

example:
at the top of .class before any subs or functions:

PRIVATE xyz[13] AS Integer 'xyz[0] ... xyz[12]  are global to this .class
PRIVATE abc[10,10] AS Integer  '2-D array 


---------- Original Message -----------
From: gaupe <hennie at ...1826...>
To: gambas-user at lists.sourceforge.net
Sent: Mon, 14 Jan 2008 07:10:56 -0800 (PST)
Subject: [Gambas-user]  multidimensional array of integers

> In some way i am not able to get how a multidimensional array in gambas works
> I have tried this in a hundred ways
> it seems something soooo simple but i cant work it out....
> 
> What i want is
> 
> dim a as new integer[]
> or .... dim a as new integer[1,2]     [0,0] doesnt seem to be allowed)
> 
> then insert elements
> 
> like a.add([1,5])   (but that does not function in this case....)
> 
> fill dynamic an array with an array of two integers
> 
> like
> 
> 1   5             ( this is the first element so print a[0,0],a[0,1]  gives
> 1 5
> 2   4
> 3   2
> 4   6
> 5   3
> 6   1
> 
> then i want to sort the array so the second vertical row gets sorted and the
> first row comes with
> after the sort then the array looks like this
> 
> 6  1
> 3  2
> 5  3
> 2  4
> 1  5
> 4  6
> -- 
> View this message in context: http://www.nabble.com/multidimensional-array-of-
> integers-tp14803157p14803157.html Sent from the gambas-user mailing list archive 
> at Nabble.com.
> 
> -------------------------------------------------------------------------
> Check out the new SourceForge.net Marketplace.
> It's the best place to buy or sell services for
> just about anything Open Source.
> http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
> _______________________________________________
> Gambas-user mailing list
> Gambas-user at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-user
------- End of Original Message -------





More information about the User mailing list