Using

From Xojo Documentation

Language Keyword

Makes all of the public declarations in a module (or namespace) available for inside the scope of the code as if it were defined there.

Usage

Using [Global.]identifier1.identifier2
Using [Global.]identifier

Notes

The only legal identifier for a Using statement is a module (namespace) name. The first identifier will be resolved recursively, from inner to outer scope as usual. If you would rather skip the recursive search, you may use the Global prefix.

When Using is used in code, it obeys code block scoping rules.

You can also use Using with classes and modules (Insert ↠ Using Clause). When used in this manner, the Using applies to the entire class or module and all code contained within it.

Sample Code

Access the Dictionary without using its full namespace:

Using Xojo.Core
Var d As New Dictionary

Avoid the Xojo namespace:

Using Xojo
Var d As New Core.Dictionary

Code block scoping:

If True Then
Using Xojo.Core
Var d As New Dictionary
End If

Var d As Xojo.Core.Dictionary ' Using statement is out of scope here