views:

67

answers:

2

In Visual basic 6, i declare a sub like this:

Private Sub test1(ByRef XmlFooOutput As String)
  ...
End Sub

Aafter that, I declare another sub like the following one:

Private Sub test2(ByRef xmlFooOutput As String)
  ...
End Sub

Automagically, the first method is transformed in:

Private Sub test1(ByVal xmlFooOutput As String)
   ...
End Sub

So the XmlFooOutput parameter is transformed in xmlFooOutput.

This is a pretty dangerous feature because methods like those could be mapped to different XSL presentation files that read XML values through Xpath. So when test1 parameter is renamed, XSL bound to test1 method goes broken because Xpath points to XmlFooOuput but the correct value is now in xmlFooOutput.

Is it possible to remove this weird feature? I'm using Microsoft Visual Basic 6.0 (SP6).

This question has some duplicates:

From what I see, there's no practical solution to disable this Intellisense evil feature.

A: 

This is a feature of Visual Basic that probably originates back in QuickBasic, as has been pointed out stems from case insensitivity in names.

I tried the example of the OP and VB6 changes the declaration of test1() as described.

Its not possible to remove this feature - you will have to find another way round this.

quamrana
Actually we are living with this problem since 2005.Sometimes it happens that somebody in our team checkout some module, modify it adding another sub with different case, messing the other subs of the module.This is a subtle and awful bug that can be a pita to discover when you are developing because the renaming is done silently without warning.
systempuntoout
You need to find a way round this: Check your version control commits. Run your tests before committing. Best of all find a way of removing this requirement from your code.
quamrana
+4  A: 

The case of variable names and other identifiers makes absolutely no difference to the language - VB6 is case-insensitive.

I agree it can be annoying when the IDE changes the case of identifiers automatically. There is already a detailed discussion of possible workarounds in this question.

MarkJ