Skip to content

ObsoleteGlobalInspection

Philip Wales edited this page Apr 10, 2015 · 1 revision

Description: Use of obsolete Global access modifier

Type: CodeInspectionType.LanguageOpportunities

Default severity: CodeInspectionSeverity.Suggestion

This inspection finds public fields declared with the obsolete Global access modifier.

###Example:

Field foo is declared with the obsolete Global access modifier:

Global foo As Integer

Global is redundant and confusing, and was deprecated in favor of Public. Globals are a code smell anyway, right?


###QuickFixes

QuickFix: Replace 'Global' access modifier with 'Public'

Public foo As Integer

Global can only be specified in standard code modules. Public fields in standard code modules have exactly the same scope; this quickfix replaces the deprecated access modifier with the Public keyword.