RDC00304 — Obsolete error syntax
Severity: Information · Family: RDC (Rubberduck Core analyzers) ·
Raised by: ObsoleteErrorStatementAnalyzer
An Error statement raises a run-time error, in a language where that is a relic of classic BASIC.
Error 5 raises the error Err.Raise 5 does (MS-VBAL §5.4.4.3 Error Statement), and the standard library has Err.Raise in every
language of the platform: it takes a source, a description and the rest of what an error is, which the statement cannot. The statement is kept for backward compatibility. The
diagnostic is an opinion of the analyzer and not a condition of the language: both are legal.
As for RDC00303, it depends on the language: the platform's BASIC keeps the statement as its own
(SupportedLanguage.UsesClassicBasicSyntax), and the language a module is loaded as is a fact the environment host vouches
for. Even there, Err.Raise is available, since the standard library is loaded. The analyzer has nothing to say about a module the host has not said the language for.
How it is raised
| Situation | Example | Resolution |
|---|---|---|
An Error statement in a module of VBA or VB6. |
Error 5 |
Use Err.Raise 5. |
See also
ACCUEIL • HOME | ℹ️ BIENVENUE • WELCOME | 🧩 BÂTISSONS • BUILD | RD-VBAL | SDK | 🌐 rubberduckvba.ca