[Gambas-user] Arrays

Steven Lobbezoo steven at ...1652...
Fri Apr 20 23:21:34 CEST 2007


Maybe it's better make it more clear with an example :

I declare in the OOffice module :
PUBLIC Docs_t AS Object[] = [["terrain", "fiche", "fiche_bien_terrain.odt"],
                   ["terrain", "vitrine_horizon", "vitrine_bien_terrain.odt"],
                   ["appartement", "fiche", "fiche_appart.odt"],
                   ["batiment", "fiche", "fiche_bien_batiment.odt"]]

than, in an other module / form i do

Dim tmp[2]

    tmp[0] = "terrain"
    tmp[1] = "fiche"
    hInt = OOffice.Docs_t.Find(tmp)

And I want the index of the Objects array back in hInt
where the first 2 fields are as above.

Actually it allways returns -1. Even if I feed it all tree fields.

Steven



Le vendredi 20 avril 2007 23:01, nando a écrit :
> I do something similar..
>
> I declare the arrays as a global arrays
> then I use _new() to load them.
>
> If I require to load them from files or a db,
> then I can add code to do that instead.
>
> 1.0.17
> -Fernando
>
>
> ---------- Original Message -----------
> From: Steven Lobbezoo <steven at ...1652...>
> To: mailing list for gambas users <gambas-user at lists.sourceforge.net>
> Sent: Thu, 19 Apr 2007 22:31:05 +0200
> Subject: Re: [Gambas-user] Arrays
>
> > Wow, it does .... :-) :-)
> >
> > I new there was some simple way.
> >
> > Thanks
> >
> > Le jeudi 19 avril 2007 22:23, Benoit Minisini a écrit :
> > > On jeudi 19 avril 2007, Steven Lobbezoo wrote:
> > > > Hi,
> > > >
> > > > I need to work with an array that i want to declare directly in my
> > > > program. (outside from a sub or a function)
> > > > i did :
> > > > PUBLIC Docs AS Array[] = [["Terrain", "fb",
> > > > "fiche_bien_terrain.odt"], ["Batiment", "fb",
> > > > "fiche_bien_batiment.odt"]] which does not work, but illustrates the
> > > > principe.
> > >
> > > If you replace Array[] by Object[], it should work.
> >
> > -------------------------------------------------------------------------
> > This SF.net email is sponsored by DB2 Express
> > Download DB2 Express C - the FREE version of DB2 express and take
> > control of your XML. No limits. Just data. Click to get it now.
> > http://sourceforge.net/powerbar/db2/
> > _______________________________________________
> > Gambas-user mailing list
> > Gambas-user at lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/gambas-user
>
> ------- End of Original Message -------
>
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by DB2 Express
> Download DB2 Express C - the FREE version of DB2 express and take
> control of your XML. No limits. Just data. Click to get it now.
> http://sourceforge.net/powerbar/db2/
> _______________________________________________
> 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