Dokumentaro de Gambaso
Compilation & Installation
Components
Documents
Indekso de Lingvo
Language Overviews
LeguMin
Lexicon
Registro

BEGIN_METHOD

#define BEGIN_METHOD ( name , arguments ) ...

Begins the implementation of a method.

  • name is the name of the function, as specified in the class declaration.

  • arguments describes the arguments of the method.

Be careful ! As the implementation function will receive its arguments as a pointer at the interpreter stack, arguments is actually the inside of a structure describing the stack contents.

Consequently:

  • Each argument must be one of the Gambas Value Datatype.

  • The arguments are separated by semicolons, and NOT commas.

A method named "foo" declared this way :

...
GB_METHOD("foo", NULL, "iisvbInteger[];d", do_foo),
...

will be implemented this way :

BEGIN_METHOD(do_foo,
  GB_INTEGER param1;
  GB_INTEGER param2;
  GB_STRING param3;
  GB_VARIANT param4;
  GB_BOOLEAN param5;
  GB_OBJECT param6;
  GB_DATE param7)

...

END_METHOD

Note that the argument separator is a semicolon, and that the last argument has no semicolon at its end.

See also