VB6 Editor changing case of variable names

前端 未结 10 937
迷失自我
迷失自我 2020-12-08 13:24

I\'m not much of a Visual Basic person, but I am tasked with maintaining an old VB6 app. Whenever I check out a file, the editor will replace a bunch of the uppercase varia

相关标签:
10条回答
  • 2020-12-08 13:58

    Continuing from Mercator's excellent answer...

    I'd recommend:

    1. Check out all files (I assume you're using VSS for a VB6 app)
    2. Do a rebuild of the entire project group
    3. Recheck back into VSS

    Now base you're the real differences rather than the 'auto' changes that VB6 has tried to apply.

    0 讨论(0)
  • 2020-12-08 13:59

    Since I always find this thread first looking for a solution to messed-up casing, here is one Simon D proposed in a related question:

    If you just need to fix one variable's casing (e.g. you accidentally made a cOrrectCAse variable and now they are all over the place), you can correct this for good by adding

    #If False Then
        Dim CorrectCase
    #End If
    

    to the beginning of your module. If you save the project and remove the statement later, the casing remains correct.

    Using Excel VBA I often accidentally change all Range.Row to Range.row by carelessly dimming a row variable inside some function - with the help of Simon D's solution I can fix this now.

    0 讨论(0)
  • 2020-12-08 14:06

    Enums are even worse. Getting the case wrong anywhere the enum is used changes the case of the definition.

    0 讨论(0)
  • 2020-12-08 14:06

    DJ is spot on... VB always changes the case of variables to match the original declaration. It's a 'feature'.

    0 讨论(0)
提交回复
热议问题