EXPORT

EXPORT [ OPTIONAL ]

This keyword, when placed alone at the beginning of a class file declares the class as exported.

That means that this class will be visible from the outside when making a component.

If the OPTIONAL keyword is specified, then the class will be exported only if no other previously loaded component has already exported a class with the same name.

Examples

' Gambas class file
'
' This is an implementation of a new ListBox control put in a component

INHERITS ListBox
EXPORT

...

Namespace support

Sinds 3.17

Namespaces allow to choose the name of a class when it is exported.

In that public name, it is now possible to insert a colon, where the part before the colon is the "namespace".

For the Gambas interpreter, namespaces are just a convention. It only deals with the full exported name of the class.

EXPORT AS Namespace:PublicName [ OPTIONAL ]

This syntax exports the current class by using the Namespace:PublicName public name.

EXPORT TO Namespace [ OPTIONAL ]

This syntax exports the current class by using the Namespace:ClassName public name, where ClassName is the name of the current class.

EXPORT TO DEFAULT [ OPTIONAL ]

This syntax exports the current class by using its name, without any namespace.

As now the IDE allows to define a default name space for all exported class of a project, this syntax is the only way to export a class with the same name, as the EXPORT keyword alone does before.

See also