6.1.2.7 Information
Note
This section describes the implementation of MS-VBAL §6.1.2.7 Information.
The Information module is represented in the SDK by the interface
IStdInformationModule.
The Information module is declared in full: every member of MS-VBAL §6.1.2.7 has a declaration in
IStdInformationModule, and so does each of the two RD-VBA additions, Erl and Err. The module's symbols are read
off those declarations (RD-VBAL §6.0 Standard Library).
Note
Not implemented. Of the Information members, only Erl has a runtime implementation. Calling any other
member raises the run-time error "Application-defined or object-defined error".
6.1.2.7.1 Public Functions
Note
This section describes the implementation of MS-VBAL §6.1.2.7.1 Public Functions.
Erl and Err are not members MS-VBAL lists under this module. They are numbered after the last MS-VBAL member of
this section.
| § | Member | Notes |
|---|---|---|
| 6.1.2.7.1.1 | IMEStatus | |
| 6.1.2.7.1.2 | IsArray | |
| 6.1.2.7.1.3 | IsDate | |
| 6.1.2.7.1.4 | IsEmpty | |
| 6.1.2.7.1.5 | IsError | |
| 6.1.2.7.1.6 | IsMissing | In MS-VBA, always False for a non-Variant parameter. See RD-VBAL §5.3.1.11 Procedure Invocation Argument Processing. |
| 6.1.2.7.1.7 | IsNull | |
| 6.1.2.7.1.8 | IsNumeric | |
| 6.1.2.7.1.9 | IsObject | |
| 6.1.2.7.1.10 | QBColor | |
| 6.1.2.7.1.11 | RGB | |
| 6.1.2.7.1.12 | TypeName | |
| 6.1.2.7.1.13 | VarType | Declared to return a VbVarType value. See RD-VBAL §6.1.1 Predefined Enums. |
| 6.1.2.7.1.14 | 🧩 Erl |
RD-VBA addition. See §6.1.2.7.1.14. |
| 6.1.2.7.1.15 | 🧩 Err |
RD-VBA addition. See §6.1.2.7.1.15. |
6.1.2.7.1.14 Erl
🧩 Information.Erl is an RD-VBA addition to MS-VBAL. Erl returns the line number at which the most recent
run-time error was raised.
MS-VBAL does not document Erl. MS-VBA exposes Erl from the Information module as a hidden member.
🎯 Erl is a deliberate RD-VBA departure from MS-VBA, in two respects: what it counts, and its width.
What Erl counts
MS-VBA's Erl reports the last line-number label execution passed. A fault in an unnumbered statement is reported at
the nearest preceding numbered line. A program that numbers no lines gets 0 for every error.
MS-VBA's Erl reports the faulting line only when every line is numbered.
What RD-VBA's Erl counts is a setting of the environment, ErlLineNumbering, a member of
IRuntimeEnvironmentProfile.
ErlLineNumbering is bound from appsettings.json, like the rest of the runtime profile
(RD-VBAL §2.1 Implicit Storage).
ErlLineNumbering mode (VBErlLineNumbering) |
Erl reports |
|---|---|
DocumentLine (the default) |
The document line of the faulting statement, counted from 1 as an editor counts it. |
LineLabel |
The last line-number label at or before the faulting statement, or 0 when no line-number label precedes it. This matches MS-VBA's Erl. |
A named label never sets Erl, in either ErlLineNumbering mode. Only a label spelled as decimal digits sets Erl
(RD-VBAL §5.4.1.1 Statement Labels).
In a program that numbers every line, the line-number label is the document line, and LineLabel reports it.
LineLabel mode exists for a workspace whose own code depends on MS-VBA's Erl behaviour.
Width
MS-VBA's Erl has ushort resolution. It wraps around on any line number that does not fit, so for a program
numbered past line 65535 it reports a line that does not exist.
🎯 For this reason, RD-VBA's Erl returns a Long, in which every legal line number is representable.
Implementation
The line number Erl reports is carried on
ISessionErrorState.LineNumber. It is
captured at the one point where every run-time error reaches the session error state: the interpreter's
error-interception point (RD-VBAL §3.5.4 Execution).
In LineLabel mode, InstructionList.TryGetLineNumber
provides the line number Erl reports (RD-VBAL §3.5.1 InstructionList).
6.1.2.7.1.15 Err
🧩 Err is not a member MS-VBAL lists under this module. RD-VBA implements the MS-VBA shape of Err: a zero-argument
Function of the Information module, returning an instance of the class ErrObject.
The Err function, the ErrObject class, and the MS-VBAL shape they differ from are described in
RD-VBAL §6.1.3.2 Err Class.
⏮️ RD-VBAL §6.1.2.6 Financial | ⏭️ RD-VBAL §6.1.2.8 Interaction