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

Gareth Bult gareth at ...560...
Mon Jan 12 20:10:15 CET 2009


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.


----- Original Message -----
From: "Gareth Bult" <gareth at ...560...>
To: "mailing list for gambas developers" <gambas-devel at lists.sourceforge.net>
Sent: Monday, 12 January, 2009 6:32:49 PM GMT +00:00 GMT Britain, Ireland, Portugal
Subject: Re: [Gambas-devel] Returning a reference to an array ...

Ok,

Now working with a little tweaking .. essentially I needed to change;

GB_METHOD("audio_devices",NULL ,CCONNECTION_audio_devices,NULL),

to

GB_METHOD("audio_devices","IAX2Device[]" ,CCONNECTION_audio_devices,NULL),

:)

Getting there ...

Gareth.


----- Original Message -----
From: "Benoit Minisini" <gambas at ...1...>
To: "mailing list for gambas developers" <gambas-devel at lists.sourceforge.net>
Sent: Monday, 12 January, 2009 6:14:01 PM GMT +00:00 GMT Britain, Ireland, Portugal
Subject: Re: [Gambas-devel] Returning a reference to an array ...

On lundi 12 janvier 2009, Gareth Bult wrote:
> I think my main problem here is the lack of a working example to reference
> .. For example, I can't find an instance of GB.Array.New that uses
> (GB_TYPE)GB.FindClass anywhere in the Gambas source tree ....
>
> Gareth.
>

Yep. You will be the first one. :-)

But if you are afraid, just use GB_T_OBJECT instead.

-- 
Benoit Minisini

------------------------------------------------------------------------------
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword
_______________________________________________
Gambas-devel mailing list
Gambas-devel at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-devel

-- 
Managing Director, Encryptec Limited
Tel: 0845 5082719, Mob: 0785 3305393
Email: gareth at ...560... 
Statements made are at all times subject to Encryptec's Terms and Conditions of Business, which are available upon request.

------------------------------------------------------------------------------
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword
_______________________________________________
Gambas-devel mailing list
Gambas-devel at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-devel

-- 
Managing Director, Encryptec Limited
Tel: 0845 5082719, Mob: 0785 3305393
Email: gareth at ...560... 
Statements made are at all times subject to Encryptec's Terms and Conditions of Business, which are available upon request.




More information about the Devel mailing list