[Mono-list] About Format Function (VB.NET)

Daniel Campos danielcampos@netcourrier.com
18 Feb 2003 16:27:11 +0000


Hi! 
 
 Currently, i'm developing code into Microsoft.VisualBasic
(FileSystem.cs and Strings.cs). Just now i am writing some code to
"unstub" the Format function from Strings.cs. I've found a problem in
which I don't know what to do: 
 
  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. 
 
 I've been looking into System.Globalization, cause I thought there
could be something like an universal symbol to translate "On" and "Off",
but I didn't find anything. 
 
 I think this "multilanguage implementation" can be a real problem for a
developer,  for instance : 
 
  An Spanish developer writes something like : 
 
  if ( Format(myvar,"On/Off" == "Activado" ) 
  { 
  	... 
  } 
 
  He tests the program and it works OK, but the program is installed in
France and it fails... 
 
   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 (I can implement an internal
"translation" function to return the string in some languages... but i'd
need some help with Chinese and other Languages...:) 
 
  Any Idea? 
 
  thanks, Daniel Campos
-- 
Daniel Campos <danielcampos@netcourrier.com>