INCLUDE or #INCLUDE

Seit 3.7

#INCLUDE "filename" INCLUDE "filename"

Only for Gambas Scripting with gbs3.

Include a Gambas script file. Useful for Gambas scripting. For example:

#!/bin/env gbs3
Private myVar as Integer

#INCLUDE "DBDef.gbs"

MyIncludedConnectionFunction()

To create a reusable class one has to define it in the imported file. For example:

'===============MyClassFile.gbs============
CLASS MyClass

Static Public Function OpenDB(dbname as string)

End

END CLASS

'========================


'==========myscript.gbs==========

INCLUDE "MyClassFile.gbs"

MyClass.OpenDB("mydb")

See also