#6 Declaration of private constants

open
nobody
None
5
2007-01-23
2007-01-23
thilas
No

By default constants are private in VB. So I made the following modification in the source code to change this behaviour.

Class: clsBuilderVB
Method: doDecl

If p.token = "Public" Or _
p.token = "Private" Or _
p.token = "Global" Or _
p.token = "Friend" Or _
p.token = "Protected" Or _
p.token = "Dim" Then

scope = p.token
declaration = declaration & prepareToken
p.getToken
If p.token = "Friend" Then
declaration = declaration & prepareToken
p.getToken
End If
End If

becomes:

If p.token = "Public" Or _
p.token = "Private" Or _
p.token = "Global" Or _
p.token = "Friend" Or _
p.token = "Protected" Or _
p.token = "Dim" Then

scope = p.token
declaration = declaration & prepareToken
p.getToken
If p.token = "Friend" Then
declaration = declaration & prepareToken
p.getToken
End If
ElseIf p.token = "Const" Then
scope = "Private"
End If

Discussion