[Gambas-user] abs as external function

Demosthenes Koptsis demosthenesk at gmail.com
Mon Jun 11 05:52:20 CEST 2018


yes you are right, thank you!


On 06/11/2018 12:29 AM, vuott at tiscali.it wrote:
> When the identifier of an external function coincides with the 
> identifier of a Gambas function, it is necessary to change the name of 
> the external function and to use Exec.
>
> Ad exemplum:
>
> ' int abs (int number)
> Public Extern abs_C(number As Integer) As Integer Exec "abs"
>
> You use the name abs_C, but tell Gambas that it has to use the real 
> abs () function.
>
>
>
> Il 10.06.2018 21:59 Jussi Lahtinen ha scritto:
>
>> Gambas does the conversions for you, thus interger and long are just 
>> subsets of float. In C that is completely different thing.
>> In other words, Gambas Abs does everything what int abs, long abs and 
>> float abs combined does in C.
>> Jussi
>>
>> On Sun, Jun 10, 2018 at 10:52 PM, Demosthenes Koptsis 
>> <demosthenesk at gmail.com <mailto:demosthenesk at gmail.com>> wrote:
>>
>>     just for compatibility of porting libc
>>
>>     there are int abs, long abs, single abs, float abs
>>
>>     Gambas abs is only for floats
>>
>>     not great function but it gave us the bug to autocomplete system!
>>
>>
>>     On 06/10/2018 10:30 PM, Jussi Lahtinen wrote:
>>>     Yes, but why bother? Gambas already has abs().
>>>     Jussi
>>>
>>>     On Sun, Jun 10, 2018 at 10:09 PM, Demosthenes Koptsis
>>>     <demosthenesk at gmail.com <mailto:demosthenesk at gmail.com>> wrote:
>>>
>>>         is this correct?
>>>
>>>         'int abs (int number)
>>>         Public Extern {abs}(number As Integer) As Integer
>>>
>>>
>>>         ----[ Gambas mailing-list is hosted by
>>>         https://www.hostsharing.net ]----
>>>
>>>
>>>
>>>     ----[ Gambas mailing-list is hosted byhttps://www.hostsharing.net  ]----
>>
>>
>>     ----[ Gambas mailing-list is hosted by
>>     https://www.hostsharing.net ]----
>>
>
>
>
> Con Mobile Open 6 GB hai 6 Giga, 600 minuti e 300 SMS per il tuo 
> smartphone a 9€ al mese per sempre. Passa ora a Tiscali Mobile, il 
> nostro mese è vero! http://tisca.li/Open6GB0318
>
>
>
> ----[ Gambas mailing-list is hosted by https://www.hostsharing.net ]----

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.gambas-basic.org/pipermail/user/attachments/20180611/bd504137/attachment.html>


More information about the User mailing list