BasicNoUIObjLoadModule Method |
Loads a module by parsing it and preparing it for execution.
Namespace: WinWrap.Basic.ServerAssembly: WinWrap.Basic.Server (in WinWrap.Basic.Server.dll)
Syntaxpublic bool LoadModule(
string fileName
)
Public Function LoadModule (
fileName As String
) As Boolean
public:
virtual bool LoadModule(
String^ fileName
) sealed
Parameters
- fileName String
-
Load this module.
If fileName is a null string, use the value of the
FileName property as the file name.
Return Value
Boolean
Return True if the module is loaded.
Implements
IBasicNoUILoadModule(String)
RemarksLoadModule does not change any code visible in the IDE.
All Public declarations in the module are available
when loading other modules or running other macros.
Loading a module has these special considerations:
-
Loading a module that was started as a macro (not loaded) returns False.
-
Loading a module already loaded by a '#Uses comment returns True.
All syntax errors are reported via the
Error property.
Macro/Module Paths
Macro/module paths are typically file paths.
However, it is sometimes useful to work with macros/modules that are not
stored as files.
A macro/module path is of the form:
Part
|
Description
|
---|
'*'
|
Paths that being with '*' are non-file system macro/modules.
The application provides the methods for reading and writing these files.
Paths that begin and end with '*' are hidden from the IDE.
User's can't step into or otherwise inspect the contents.
|
'**'
|
Paths that begin with '**' are non-file system modules.
The application provides the methods for reading and writing these files.
Running an event-driven module loads it using LoadModule.
|
path
|
This is the identity of the macro/module.
|
Example
Load and then unload a module:
if (basicIdeCtl1.LoadMoule("TEST.BAS"))
{
MessageBox.Show("TEST.BAS is loaded.");
basicIdeCtl1.UnloadModule("TEST.BAS");
}
If BasicIdeCtl1.LoadModule("TEST.BAS") Then
MessageBox.Show("TEST.BAS is loaded.")
BasicIdeCtl1.UnloadModule "TEST.BAS"
End If
if (basicIdeCtl1->LoadMoule(L"TEST.BAS"))
{
MsgBox::Show(L"TEST.BAS is loaded.");
basicIdeCtl1->UnloadModule(L"TEST.BAS");
}
See Also