Table of Contents

RDC00203 — Multiline parameter declaration

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

The declaration of one parameter is split over several lines with a line continuation.

A line continuation can break a parameter list anywhere there is white space (MS-VBAL §5.3.1.5 Parameter Lists), including in the middle of the declaration of a single parameter, between ByVal x and As Long. A parameter that is broken this way is harder to read than a list that has a parameter on each line. The diagnostic is an opinion of the analyzer and not a condition of the language: both are legal VBA.

A parameter list that has one parameter on each line is not reported: it is the declaration of one parameter that is split, not the list.

That the declaration spans several lines is a fact of the way it is written: the analyzer reads it off the syntax tree. It is a suggestion because joining the lines does not change what the parameter is.

How it is raised

Situation Example Resolution
The declaration of a parameter contains a line continuation. Sub Work(ByVal x _
As Long)
Write the declaration of the parameter on one line; break the list between parameters.

See also


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