VB6 Chr()函数(应该很简单)问题 [英] VB6 Chr() function (should be simple) issue

查看:184
本文介绍了VB6 Chr()函数(应该很简单)问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有两台机器。两者都有Windows XP专业版。两者都有Visual

Studio 6.0。这两个版本仅在Forms3版本上有所不同。机器

1(M1)有版本11.0.6254,机器2(M2)有版本

11.0.6550 ...除此之外,我很难过找到任何东西

意思是'不同。


我的问题是,在M1上,Chr()函数将返回

输入值0-255的正确值,但是,在M2上,Chr()函数

将返回输入值0-127的正确值,并为

输入值128-255。我意识到这与

ANSI或ASCII编码方案有关......但我该如何解决?如何获得M2

以返回0-255的所有输入的正确值???


谢谢。

解决方案

Hello Benry,


我的问题是,在M1上,Chr()函数将返回

输入值0-255的正确值,但是,在M2上,Chr()函数

将返回输入值0-127的正确值,并返回0表示

输入值128-255。我意识到这与

ANSI或ASCII编码方案有关......但我该如何解决?我如何获得M2

来返回0-255的所有输入的正确值?



与所有字符查询一样,请记住VB6不支持
支持Unicode。


在Windows控制面板中,您可以检查区域和语言

选项(高级选项卡 - 仅适用于管理员帐户)

非Unicode的语言节目是。也许它是中文,

日语或其他2字节语言设置?


祝你好运,


Martin


PS由于这是一个dotnet新闻组,你可能想在microsoft.public.vb中提出你的问题

,它涵盖了经典VB(< = VB6)。

这不是VB6新闻组Benry


对于VB6的好论坛是 http://www.developerfusion.co.uk ,因为那里有很多用户&b; b你会得到一个几乎立即的回应


我希望这对你更有益


" Martin H. " < hk *** @ gmx.netschrieb:


>我的问题是,在M1上,Chr()函数将返回输入值0-255的正确值,但是,在M2上,Chr()函数将返回输入值0-127的正确值,并返回0表示
输入值128-255。我意识到这与
ANSI或ASCII编码方案有关......但我该如何解决呢?如何让M2
从0-255返回所有输入的正确值?



与所有字符查询一样,请记住VB6不支持
支持Unicode。



这是错的。 VB6字符串实际上是Unicode字符串,VB6支持

''ChrW''和''AscW''支持Unicode。使用''ChrW''和''AscW''代替

''Chr''和''Asc''可以在VB6和VB.NET中完成处理Unicode

而不是ANSI。


-

MS Herfried K. Wagner

MVP< URL:http ://dotnet.mvps.org/>

VB< URL:http://dotnet.mvps.org/dotnet/faqs/>


I have two machines. Both have Windows xp Pro. Both have Visual
Studio 6.0. These two versions differ only in Forms3 version. Machine
1 (M1) has version 11.0.6254, Machine 2 (M2) has version
11.0.6550...other than that, I''m hardpressed to find anything
significient that''s different.

The question I have is, on M1, the Chr() function will return the
proper value for input values 0-255, however, on M2, the Chr() function
will return the proper value for input values 0-127, and return 0 for
input values 128-255. I realize that this has something to do with the
ANSI or ASCII encoding scheme...but how do I fix it? How do I get M2
to return the proper values for ALL inputs from 0-255???

Thank you.

解决方案

Hello Benry,

The question I have is, on M1, the Chr() function will return the
proper value for input values 0-255, however, on M2, the Chr() function
will return the proper value for input values 0-127, and return 0 for
input values 128-255. I realize that this has something to do with the
ANSI or ASCII encoding scheme...but how do I fix it? How do I get M2
to return the proper values for ALL inputs from 0-255???

As with all character queries, please keep in mind that VB6 does not
support Unicode.

In the Windows control panel you might check the Regional and Language
Options (Advanced tab - only available with an Administrator account)
what the Language for non-Unicode programs is. Perhaps it''s Chinese,
Japanese or another 2byte language setting?

Best regards,

Martin

P.S. As this is a dotnet newsgroup, you might want to ask your question
in microsoft.public.vb which covers classic VB (<=VB6).


This is not a VB6 newsgroup Benry

For a good forum with VB6 is http://www.developerfusion.co.uk because there
are so many users & you''ll get an almost immediate response

I hope this will be more beneficial to you


"Martin H." <hk***@gmx.netschrieb:

>The question I have is, on M1, the Chr() function will return the
proper value for input values 0-255, however, on M2, the Chr() function
will return the proper value for input values 0-127, and return 0 for
input values 128-255. I realize that this has something to do with the
ANSI or ASCII encoding scheme...but how do I fix it? How do I get M2
to return the proper values for ALL inputs from 0-255???


As with all character queries, please keep in mind that VB6 does not
support Unicode.

That''s wrong. VB6 strings are actually Unicode strings and VB6 supports
''ChrW'' and ''AscW'' which support Unicode. Using ''ChrW'' and ''AscW'' instead of
''Chr'' and ''Asc'' can be done in both VB6 and VB.NET to deal with Unicode
instead of ANSI.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>


这篇关于VB6 Chr()函数(应该很简单)问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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