Table of Contents

RDC00303 — Obsolete comment syntax

Severity: Information  ·  Family: RDC (Rubberduck Core analyzers)  ·  Raised by: ObsoleteRemCommentAnalyzer

A comment is written with the Rem keyword, in a language where that is a relic of classic BASIC.

An apostrophe starts the same comment (MS-VBAL §3.3.1 Separator and Special Tokens): Rem remark and ' remark are both comments that run to the end of the line, and a comment that begins with the word Remember is neither. The keyword is kept for backward compatibility. The diagnostic is an opinion of the analyzer and not a condition of the language: both are legal.

Whether Rem is a relic or how the language writes a comment depends on the language: the platform's BASIC, which an interactive shell is written in, keeps it as its own (SupportedLanguage.UsesClassicBasicSyntax). The language a module is loaded as is a fact the environment host vouches for (ModuleSemanticModel.Language); the analyzer has nothing to say about a module the host has not said it for, and does not guess. It is a suggestion because writing the apostrophe does not change what the comment is.

How it is raised

Situation Example Resolution
A comment is written with Rem in a module of VBA or VB6. Rem the total of the line Start the comment with an apostrophe: ' the total of the line.

See also


ACCUEIL • HOME | ℹ️ BIENVENUE • WELCOME | 🧩 BÂTISSONS • BUILD | RD-VBAL | SDK | 🌐 rubberduckvba.ca