Enum VBErlLineNumbering
What Erl counts as the line a run-time error was raised at.
public enum VBErlLineNumbering
Fields
DocumentLine = 0The line the faulting statement is really on, counted from
1as an editor counts it.The default: it answers the question the caller is actually asking, for any code at all, and it never names a line the fault was not on.
LineLabel = 1The last line-number label at or before the faulting statement, or
0when none precedes it — bug for bug with MS-VBA.For source that carries a line number on every line, this is the document line, which is why it is the right answer for a numbered BASIC program and the wrong one for everything else. Choose it when a workspace's own code depends on MS-VBA's behaviour.
Remarks
🎯 An RD-VBA dial, because MS-VBA's own answer is not a useful one. Erl there reports the last
line-number label it passed, and hardly any code numbers every line — so a fault in an
unnumbered statement is reported at whichever numbered line came before it, however far back that is,
and a program that numbers nothing is told every error happened at line 0. The number is
truthful only for a program in which every single line is numbered, which is to say a BASIC program.