[Gambas-user] abs as external function

vuott at tiscali.it vuott at tiscali.it
Sun Jun 10 23:29:36 CEST 2018


  
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 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 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
[1] ]----
>>> 
>>> ----[ Gambas mailing-list is hosted by
https://www.hostsharing.net [3] ]----
>> 
>> ----[ Gambas mailing-list
is hosted by https://www.hostsharing.net [4] ]----
  


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

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.gambas-basic.org/pipermail/user/attachments/20180610/1a8d99d3/attachment-0001.html>


More information about the User mailing list