[Gambas-user] Super quickie - array equality

Fabien Bodard gambas.fr at ...626...
Thu Oct 22 18:27:22 CEST 2015


2015-10-22 15:48 GMT+02:00 Jussi Lahtinen <jussi.lahtinen at ...626...>:
> Maybe you could use Point datatype, it does use compare method.
>
> So you can compare them like this:
>
> If hFirstPoint = hSecondPoint Then
>
>
>
> Jussi

Jussi is true, for your idea it's maybe better than an array.

>
> On Thu, Oct 22, 2015 at 6:41 AM, adamnt42 at ...626... <adamnt42 at ...626...>
> wrote:
>
>> 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)>
>>
>>
>> ------------------------------------------------------------------------------
>> _______________________________________________
>> Gambas-user mailing list
>> Gambas-user at lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/gambas-user
>>
> ------------------------------------------------------------------------------
> _______________________________________________
> Gambas-user mailing list
> Gambas-user at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-user



-- 
Fabien Bodard




More information about the User mailing list