tags:

views:

224

answers:

2

I'm reviewing some legacy VB6 code using WordPad (since I don't have VB6 installed). After many of the variable declarations at the module level, I see a second line that sets some sort of attribute for the variable, as shown in the example below. It appears that the attribute number, 1073741852, is the same for all of the declarations.

Public testPath as Integer
Attribute TestPath.VB_VarUserMemID = 1073741852

Since I don't have the code open in VB6, I'm not sure if the attribute lines are visible in the VB6 ide.

Does anyone know the significance of this attribute?

A: 

I looked up this page, which has text of a VB based bas module.

And it seems, the attribute is to maintain the order of declaration(?).
From the name, it sounds like member ID for the variable.

The attribute lines won't be visible in VB6.

Some of the attributes that are applicable to properties/methods can be set using "Procedure Attributes" dialog in VB6 (e.g. make this default property, hide in object browser etc).

shahkalpesh
A: 

I Googled the VB6 newsgroup. VB stores the attributes for procedures and public variables in lines like this, that aren't shown in the VB6 IDE. You view and edit these settings in the VB6 IDE through the Tools-Procedure Attributes dialog - despite the name it applies to public variables too.

Attribute x.VB_VarUserMemId represents the procedure ID assigned to the property/method. (0 means default property.)

MarkJ