[Gambas-devel] Returning a reference to an array ...

Benoit Minisini gambas at ...1...
Mon Jan 12 21:11:45 CET 2009


On lundi 12 janvier 2009, Gareth Bult wrote:
> Ok,
>
> My array seems to work fine .. but now I'm adding;
>
> (ndevs=15)
>
> >>GB.Array.New(&THIS->devices, (GB_TYPE)GB.FindClass("IAX2Device"), ndevs);
>
> ++printf("Devices=%d (%d)\n",GB.Count(THIS->devices),ndevs);
>
> I was sort of expecting this to print;
>
> Devices=15 (15)
>
> But it prints;
>
> Devices=1308438512 (15)
>
> Am I making an obvious mistake, or is GB.Count not working ?
>
> Gareth.
>
>

GB.Count() if for arrays created with GB.NewArray(). For Gambas arrays, use 
GB.Array.Count().

Regards,

-- 
Benoit Minisini




More information about the Devel mailing list