这不是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 VisualStudio 6.0. These two versions differ only in Forms3 version. Machine1 (M1) has version 11.0.6254, Machine 2 (M2) has version11.0.6550...other than that, I''m hardpressed to find anythingsignificient that''s different.The question I have is, on M1, the Chr() function will return theproper value for input values 0-255, however, on M2, the Chr() functionwill return the proper value for input values 0-127, and return 0 forinput values 128-255. I realize that this has something to do with theANSI or ASCII encoding scheme...but how do I fix it? How do I get M2to 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 theproper value for input values 0-255, however, on M2, the Chr() functionwill return the proper value for input values 0-127, and return 0 forinput values 128-255. I realize that this has something to do with theANSI or ASCII encoding scheme...but how do I fix it? How do I get M2to return the proper values for ALL inputs from 0-255???As with all character queries, please keep in mind that VB6 does notsupport Unicode.In the Windows control panel you might check the Regional and LanguageOptions (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,MartinP.S. As this is a dotnet newsgroup, you might want to ask your questionin microsoft.public.vb which covers classic VB (<=VB6).This is not a VB6 newsgroup BenryFor a good forum with VB6 is http://www.developerfusion.co.uk because thereare so many users & you''ll get an almost immediate responseI 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 theproper value for input values 0-255, however, on M2, the Chr() functionwill return the proper value for input values 0-127, and return 0 forinput values 128-255. I realize that this has something to do with theANSI or ASCII encoding scheme...but how do I fix it? How do I get M2to return the proper values for ALL inputs from 0-255???As with all character queries, please keep in mind that VB6 does notsupport 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 Unicodeinstead of ANSI.--M S Herfried K. WagnerM V P <URL:http://dotnet.mvps.org/>V B <URL:http://dotnet.mvps.org/dotnet/faqs/> 这篇关于VB6 Chr()函数(应该很简单)问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!
07-25 05:18