First a correction:
That is not a good pratice anyway, one should always test directly myvar in that case.An Spanish developer writes something like :if ( Format(myvar,"On/Off" == "Activado" ) { ... }
Format has two parameters : first, the object that you want to format (numbers,dates, etc), and second (style) an string explaining the format (for instance,Format(5,"00") will return the string "05". Well, one of the "styles" is "On/Off". MSDN library says that it returns the string "Off" if a number is equals to zero,and "On" if the number is not equal to zero.
I've been testing it using Microsoft .NET, and to my surprise, in my
spanish windows box, it returns "Activado" (that means "On" in
Spanish") and "Desactivado" ("Off", in spanish).MSDN doesn't say any
more about this.
These things, are handled either as Microsoft, by using resources, or with Mono's GetText look-alike. Never write translating code (blocks of lots of if/switch).By now, I always return "On" or "Off" (in English), but I would like to know if anybody knows any universal symbol, or may be some general rules in Mono to do it in one or other way.
Have you checked, if you can only call the Formatting classes already in the class library? Most things in this VB.NET library are just wrappers for common classes.Any Idea?
Cheers,
Rafael Teixeira
Brazilian Polymath
Mono, MonoQLE Hacker
_________________________________________________________________
Protect your PC - get McAfee.com VirusScan Online http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963
_______________________________________________
Mono-list maillist - [EMAIL PROTECTED]
http://lists.ximian.com/mailman/listinfo/mono-list
