[Gambas-user] Array example

Fabien Bodard gambas.fr at ...626...
Wed Jul 9 15:26:29 CEST 2014


Garrrgh

Dim Mycol as new collection

Mycol=[2:12,4:13,5:11,8:18]

Print mycol[4]
Le 9 juil. 2014 12:47, "wig" <wig at ...1809...> a écrit :

>
> Make one array arrNumbers with
>
> 2
> 4
> 5
> 8
>
>
> Make another array arrData with
>
> 12
> 13
> 11
> 18
>
>
> Then look up the value in the first array (seems to be sorted)
>  array count start at 0, so this is element number 1
>
> i = arrNumbers.Find(4)  ' find value 4
>
> print i
>
>  1
>
>  and use the found index to take the element from the second array.
>
> print arrData[i]
>
>   13
>
>
> Hope that helps somehow.
>
> WiG.
>
>
> On Wednesday 09 July 2014 01:33:16 abbat81 wrote:
> > Hi
> >
> > help me with an array, please
> >
> > I heve a 2 column of data
> >
> > 2 - 12
> > 4 - 13
> > 5 - 11
> > 8 - 18
> >
> > How to use array.
> >
> > I need use For each in array to use:
> >
> > IF i = array[x, ?]  THEN Print array[?, x] ' If I get 4 then print 13,
> if I
> > get 2 - print 12 .....
> >
> > Thanks in advance...
> >
> >
> >
> >
> > --
> > View this message in context:
> > http://gambas.8142.n7.nabble.com/Array-example-tp47347.html Sent
> from the
> > gambas-user mailing list archive at Nabble.com.
> >
> >
> ----------------------------------------------------------------------------
> > -- Open source business process management suite built on Java and
> Eclipse
> > Turn processes into business applications with Bonita BPM
> Community Edition
> > Quickly connect people, data, and systems into organized workflows
> Winner
> > of BOSSIE, CODIE, OW2 and Gartner awards
> > http://p.sf.net/sfu/Bonitasoft
> > _______________________________________________
> > Gambas-user mailing list
> > Gambas-user at lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/gambas-user
>
>
> ------------------------------------------------------------------------------
> Open source business process management suite built on Java and Eclipse
> Turn processes into business applications with Bonita BPM Community Edition
> Quickly connect people, data, and systems into organized workflows
> Winner of BOSSIE, CODIE, OW2 and Gartner awards
> http://p.sf.net/sfu/Bonitasoft
> _______________________________________________
> Gambas-user mailing list
> Gambas-user at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-user
>



More information about the User mailing list