%Import
This special method imports a Java package or a .NET assembly.
All special method names and keywords are case-insensitive, with the exception of library below.
Syntax
{connection->}%Import(library)
Syntax elements
connectionA connection object. The default connection object does not have to be named (although it can be).
libraryFor Java, the name of a Java package, or fully qualified class name.
For .NET, name of a .NET language DLL file (if located in the same folder as the DNLS service) or the full path to a DLL (if located elsewhere).
Package, class, file, and path names are case-sensitive, as they refer to external entities.
Comment
Once a library has been imported it will be included when subsequently searching for class names with the %New or %Static special methods.
Applicability
Language objects only.
Examples
Java package
Imports all classes in the java.io package:
%Import(java.io)
This is equivalent to the Java syntax import java.io.*
. The final .*
part is not required in DataBasic, but if used the package name must be enclosed in quotes, as follows:
%Import("java.io.*")
.NET assembly
Imports the ApplicationDesigner DLL.
%Import(ApplicationDesigner.dll)