[Gambas-user] Super quickie - array equality

adamnt42 at ...626... adamnt42 at ...626...
Thu Oct 22 05:41:43 CEST 2015


On Wed, 21 Oct 2015 22:54:48 +0300
Jussi Lahtinen <jussi.lahtinen at ...626...> wrote:

> Your original question hinted at 2D arrays, but [0, 0] is one dimensional
> array with two values.
> So, in other words you would like quick way to check first two values of
> the array?

and that its length is 2.

> 
> I think this is the simplest:
> 
> If myArray[0] = 0 And If myArray[1] = 0 Then

so
If myArray.Count=2 And If myArray[0] = 0 And If myArray[1] = 0 Then

> 
> However, why you need an array for only two values?
It's just for simplicity of passing the two numbers around as parameters...
The actual use is a layout for tiling, i.e. x tiles wide by y tiles tall.
I could have of course used LayoutX and LayoutY but as the pair is used in may parts of this app and passed as a parameter to many functions it is easier to use an array. 
(The app is a design tool for a "client" (my sister) who is a mosaic artist and the layout is for the repeating tiles of a design pattern. It was supposed to be a quicky to solve a "simple" problem she had. As ever - simple, hah!)
> 
> 
> Jussi
> 
> 

regards
bruce

-- 
B Bruen <adamnt42 at ...3379... (sort of)>




More information about the User mailing list