Re: [Gambas-user] Arrays of Structs

2016-11-30 Thread Cam Era
On Wed, Nov 30, 2016 at 5:27 PM, wrote: > I use structs to write binary to a file in struct order. > Nice and easy. > Not so easy with a class. > > Your example is possible. I have done similar. > > The STRUCT only defines the structure...it doesn't create the memory > allocation. > Static Priva

Re: [Gambas-user] Arrays of Structs

2016-11-30 Thread Rolf-Werner Eilert
t. >>> >>> -Fernando >>> >>> -- >>> Open WebMail Project (http://openwebmail.org) >>> >>> >>> -- Original Message --- >>> From: Tony Morehen >>> To: gambas-user@lists.sourceforge.net >>

Re: [Gambas-user] Arrays of Structs

2016-11-30 Thread Fabien Bodard
x >> Loop y >> [x][y] = new MapObject 'the new actually creates a memory allocation >> for it. >> >> -Fernando >> >> -- >> Open WebMail Project (http://openwebmail.org) >> >> >> -- Original Message --- >> From

Re: [Gambas-user] Arrays of Structs

2016-11-30 Thread Rolf-Werner Eilert
ebMail Project (http://openwebmail.org) > > > -- Original Message --- > From: Tony Morehen > To: gambas-user@lists.sourceforge.net > Sent: Tue, 29 Nov 2016 15:29:03 -0500 > Subject: Re: [Gambas-user] Arrays of Structs > >> I may just be responding to a typo but y

Re: [Gambas-user] Arrays of Structs

2016-11-29 Thread nando_f
al Message --- From: Tony Morehen To: gambas-user@lists.sourceforge.net Sent: Tue, 29 Nov 2016 15:29:03 -0500 Subject: Re: [Gambas-user] Arrays of Structs > I may just be responding to a typo but your struct is named MapObjec > while the code using it refers to MapObject. > > On 28/1

Re: [Gambas-user] Arrays of Structs

2016-11-29 Thread Tony Morehen
I may just be responding to a typo but your struct is named MapObjec while the code using it refers to MapObject. On 28/11/16 10:40 PM, Cam Era wrote: > I expect I'm trying to do something that's not possible with Gambas, but > I'll ask this anyway. > > I'm trying to create an n x n array of a S

Re: [Gambas-user] Arrays of Structs

2016-11-29 Thread Gianluigi
Hello Christof, I do not use structures and would not recommend using them. I have only mentioned a file that could satisfy the curiosity of Cam. In this regard I point to my example DynamicMatrixExample of Software farm. Regards Gianluigi 2016-11-29 19:17 GMT+01:00 Christof Thalhofer : > Am 29

Re: [Gambas-user] Arrays of Structs

2016-11-29 Thread Christof Thalhofer
Am 29.11.2016 um 05:38 schrieb Cam Era: >> By the way, I strongly suggest not to use Struct, but normal objects. >> Struct were mainly made to interface with C libraries. > > I'll do exactly that from now on. For object-oriented programming in Gambas a struct can be replaced with a class. When I

Re: [Gambas-user] Arrays of Structs

2016-11-29 Thread Gianluigi
Out of curiosity you may have a look here [0], and more precisely to MyStruct-DB. Regards Gianluigi [0] http://gambas.8142.n7.nabble.com/Random-access-files-with-fixed-length-string-td50880.html 2016-11-29 5:38 GMT+01:00 Cam Era : > On Tue, Nov 29, 2016 at 3:11 PM, Benoît Minisini < > gam...@use

Re: [Gambas-user] Arrays of Structs

2016-11-28 Thread Cam Era
On Tue, Nov 29, 2016 at 3:11 PM, Benoît Minisini < gam...@users.sourceforge.net> wrote: > ... > --> This creates an inner array of 50 MapObject NULL references. > > Try that: MapObjects[50] As Struct MapObject > > By the way, I strongly suggest not to use Struct, but normal objects. > Struct were

Re: [Gambas-user] Arrays of Structs

2016-11-28 Thread Benoît Minisini
Le 29/11/2016 à 04:40, Cam Era a écrit : > I expect I'm trying to do something that's not possible with Gambas, but > I'll ask this anyway. > > I'm trying to create an n x n array of a STRUCT which itself contains an > array of type STRUCT. > > I have this declaration: > > Public Struct MapObje

Re: [Gambas-user] Arrays of Structs

2016-11-28 Thread Cam Era
On Tue, Nov 29, 2016 at 3:05 PM, Jussi Lahtinen wrote: > Seems that the arrays remain uninitialized... I'm not sure why. > Do you really need embedded arrays and structs? They are mainly for > interacting with libraries written in C, and using Pictures inside of the > struct kind of contradicts t

Re: [Gambas-user] Arrays of Structs

2016-11-28 Thread Jussi Lahtinen
Seems that the arrays remain uninitialized... I'm not sure why. Do you really need embedded arrays and structs? They are mainly for interacting with libraries written in C, and using Pictures inside of the struct kind of contradicts that. I'm mean that all works if you do it with classes and initi

Re: [Gambas-user] Arrays of Structs

2016-11-28 Thread Cam Era
On Tue, Nov 29, 2016 at 2:40 PM, Cam Era wrote: > I expect I'm trying to do something that's not possible with Gambas, but > I'll ask this anyway. > > I'm trying to create an n x n array of a STRUCT which itself contains an > array of type STRUCT. > > I have this declaration: > > Public Struc

[Gambas-user] Arrays of Structs

2016-11-28 Thread Cam Era
I expect I'm trying to do something that's not possible with Gambas, but I'll ask this anyway. I'm trying to create an n x n array of a STRUCT which itself contains an array of type STRUCT. I have this declaration: Public Struct MapObjec xPos As Integer yPos As Integer Obje