do
>
>
>
> -- Original Message ---
> From: Rolf-Werner Eilert
> To: mailing list for gambas users
> Sent: Wed, 22 Feb 2012 17:41:53 +0100
> Subject: [Gambas-user] String array empty after SUB (Gambas 2)
>
>> Now, this is a strange one :-) and I really have no idea
-- Original Message ---
From: Rolf-Werner Eilert
To: mailing list for gambas users
Sent: Wed, 22 Feb 2012 17:41:53 +0100
Subject: [Gambas-user] String array empty after SUB (Gambas 2)
> Now, this is a strange one :-) and I really have no idea what goes wrong
> here.
>
> I
The problem is not that feld.copy does not copy the array or something like
that, it really returns a NEW deep copy of the array, i.e. a new object.
When you call the function by executing
ldsv.ListeKundeFelder(schlyssel[ls.Index], felder)
you pass the reference to a String[] you want to populate
On Thu, 2012-02-23 at 09:09 +0100, Rolf-Werner Eilert wrote:
> That was it, Jussi, thanks a lot!
>
> Here we can see what it is good for to know about OOP :-)
>
> Regards
>
> Rolf
>
> Am 22.02.2012 18:49, schrieb Jussi Lahtinen:
> > Just quick thought... maybe this "felder = feld.Copy()" gives
Am 22.02.2012 20:26, schrieb GMail:
> On Wed, 2012-02-22 at 19:49 +0200, Jussi Lahtinen wrote:
>> Just quick thought... maybe this "felder = feld.Copy()" gives new object
>> reference feld to felder.
>> And because feld is declared locally, the it is null after the sub and so
>> is also felder.
>>
That was it, Jussi, thanks a lot!
Here we can see what it is good for to know about OOP :-)
Regards
Rolf
Am 22.02.2012 18:49, schrieb Jussi Lahtinen:
> Just quick thought... maybe this "felder = feld.Copy()" gives new object
> reference feld to felder.
> And because feld is declared locally, th
On Wed, 2012-02-22 at 19:49 +0200, Jussi Lahtinen wrote:
> Just quick thought... maybe this "felder = feld.Copy()" gives new object
> reference feld to felder.
> And because feld is declared locally, the it is null after the sub and so
> is also felder.
>
> Perhaps you need to do "felder = feld.Co
Just quick thought... maybe this "felder = feld.Copy()" gives new object
reference feld to felder.
And because feld is declared locally, the it is null after the sub and so
is also felder.
Perhaps you need to do "felder = feld.Copy()" manually with for each...
Jussi
On Wed, Feb 22, 2012 at 18
Now, this is a strange one :-) and I really have no idea what goes wrong
here.
I've got a dialog which loads a list of names. I'm keeping such SUBs
that deal with files in a module called ldsv (brief for load-save).
The dialog's part is simple, "ls" is the listbox:
PRIVATE felder AS NEW String