#define GB_METHOD ( symbol , type , exec , signature ) ...
Declares a method symbol.
The Gambas datatypes can be :
Gambas datatype | Signature pattern | Corresponding structure |
---|---|---|
Boolean | "b" | GB_BOOLEAN |
Integer | "i" | GB_INTEGER |
Float | "f" | GB_FLOAT |
String | "s" | GB_STRING |
Date | "d" | GB_DATE |
Object | "o" | GB_OBJECT |
Variant | "v" | GB_VARIANT |
a class named Abc | "Abc" | GB_OBJECT |
If a method returns nothing, use NULL
as return datatype.
The signature is described by catenating the following patterns into a string :
Pattern | Meaning |
---|---|
b | A Boolean parameter |
i | An Integer paramater |
f | A Float parameter |
s | A String parameter |
d | A Date paramter |
o | An Object parameter |
v | A Variant paramter |
Abc; | An object parameter of the class Abc . A class name can contain the [ and the ] character. |
( name ) | Indicates the name of the next paramter |
[ | Beginning of optional parameters |
] | Ending of optional parameters. This pattern must ends the signature. |
< class , values > | Describes the different constants that can be used to set the value of the previous parameter. This is the name of a class, followed by a list of constants belonging to that class. If no constant is given, every constant of that class is assumed to be valid. |
. | Indicates that the method can take any additional parameter. Use GB.NParam to get the number of additional parameters. |