[Gambas-user] Returning an integer from an external function broken? Gambas 2.1.0 and 2.2.0

Benoit Minisini gambas at ...1...
Sun Feb 24 09:16:13 CET 2008


On dimanche 24 février 2008, Audiossis wrote:
> Hi all,
>         Sorry to report that in Gambas 2.1.0 and 2.2.0 (Fedora 7),
> returning an
> integer from an external function appears to be broken.
>
> I updated from Gambas 2.0.0 where my code (see below) worked fine, to
> Gambas
> 2.1.0 where it no longer works, and then subsequently to Gambas 2.2.0
> where
> it still doesn't work.
>
> Snippet......
>
>
>
>
> PUBLIC rInit AS Integer
> LIBRARY "libusb-0.1"
>
> PRIVATE EXTERN usb_init() AS Integer
>
> PUBLIC FUNCTION init()
>
>   rInit = usb_init()
>
> END
>
>
>
>
>
> In versions previous to Gambas 2.1.0 the external function returns an
> integer
> to the rInit variable, letting me know of the success or failure of the
> libusb init routine.
>
> In Gambas 2.1.0 and above, this code returns the error "Type mismatch:
> Wanted
> Integer, got Function instead."
>
> This error is not related to the particular function being called and
> happens
> with ALL external functions I am calling from the libusb library. I
> even
> regressed back to Gambas 2.0.0 just to verify that I hadn't
> accidentally
> screwed up my code and sure enough the program started working again.
>
> Is this a bug with the new version? or has the syntax for returning an
> integer/string/variant from an external function changed?
>
> Any help would be appreciated!
>
> Thanks in advance,
>
> Ben

This is a bug. What a shame if was not detected before...

-- 
Benoit Minisini




More information about the User mailing list