From Xojo Documentation

Revision as of 14:49, 10 July 2018 by PLefebvre (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
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.


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


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
Dim d As New Dictionary

Avoid the Xojo namespace:

Using Xojo
Dim d As New Core.Dictionary

Code block scoping:

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

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