VB6编辑器改变变量名的大小写 [英] VB6 Editor changing case of variable names

查看:12
本文介绍了VB6编辑器改变变量名的大小写的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不太喜欢 Visual Basic,但我的任务是维护一个旧的 VB6 应用程序.每当我签出一个文件时,编辑器都会自动将一堆大写的变量名替换为小写.我怎么能让这个停止!?我不想把它们全部改回来,当我试图找到真正的差异时,让这些更改显示在 SourceSafe差异"中是一件很痛苦的事情.

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 variable names with lowercase automatically. How can I make this stop!? I don't want to have to change them all back, and it's a pain to have these changes show up in SourceSafe "Differences" when I'm trying to locate the REAL differences.

它也在定义中自动改变它:Dim C as Control 变为 Dim c as Control.Dim X& 变为 Dim x&.但它并不总是这样做.例如,从 Dim x& 往下三行,有一个 Dim Y&,大写,它没有改变.为什么要这样对我?

It is changing it automatically in the definition, too: Dim C as Control becomes Dim c as Control. Dim X& becomes Dim x&. But it doesn't do it all the time; for example, three lines down from Dim x&, there's a Dim Y&, uppercase, which it did not change. Why's it do this to me?

推荐答案

继续DJ的回答...

而且它不仅会改变同一范围内变量的大小写.

And it won't only change the case of variables in the same scope either.

它将改变整个项目中所有同名变量的大小写.因此,即使它们在一个地方以大写形式声明,另一个模块也可能有不同的变量使用相同的小写变量名,导致项目中的所有变量都变为小写,这取决于加载了哪个声明(?)或最后编辑.

It will change the case of all variables with the same name in your entire project. So even if they're declared in uppercase in one place, another module might have different variables using the same variable names in lowercase, causing all variables in your project to change to lowercase, depending on which of the declarations was loaded (?) or edited last.

所以你的 C 和 X 变量改变大小写而 Y 没有改变的原因可能是因为 C 和 X 在你的项目的其他地方也被声明了,但是是小写的,而 Y 没有.

So the reason your C and X variables are changing case, while the Y isn't, is probably because C and X are declared somewhere else in your project too, but in lowercase, while Y isn't.

这里还提到了它,他们似乎最关心的地方当使用大小写区分局部变量和全局变量时,此类变量名称会发生​​冲突.他们最终选择了前缀.

There's another mention of it here, where they mostly seem concerned with such variable names conflicting when case is being used to differentiate local from global variables. They end up going for prefixes instead.

我能想到的唯一选择是使用其他具有 VB6 突出显示功能的编辑器进行编辑...

The only alternative I can think of is to use some other editor with VB6-highlighting capabilities to do your editing...

这篇关于VB6编辑器改变变量名的大小写的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆