Solved

VB Engine localizes CStr(true) - want test mach. to do same

Posted on 2004-10-18
1
445 Views
Last Modified: 2012-05-05
I wrote an app that uses the actual text for "True" and "False".  For someone in Germany that is "Wahr" and "Falsch".  So this line:

   cstr(cbool(-1))

returns "True" for me, but "Wahr" for the German.

I want my test machine to return "Wahr" and "Falsch", so I can test my app.  I changed all the regional settings I could see to German, but it looks like I need to do something more so that the VB6 engine returns "Wahr" and "Falsch".  Anyone know what that is?
0
Comment
Question by:kevinbenedict
1 Comment
 
LVL 32

Accepted Solution

by:
Erick37 earned 250 total points
ID: 12341126
This used to be a "bug" in VB, but it seems to have been fixed in Visual Studio 6.0 Service Pack 3.
If you have SP3 or higher, then you should not see the coerced strings.  I believe that in order for your app to display German, you will have to explicitly use that language either in code or as an option as a language string resource.

See:
FIX: Visual Basic 6.0 Booleans are Coerced to Localized Strings
http://support.microsoft.com/default.aspx?scid=kb;EN-US;216379


And regarding the Resource Files:
Multiple String Table Model
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/resed98/html/vbconmultiplestringtablemodel.asp
0

Featured Post

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question