Xojo Developer Conference
25/27th April 2018 in Denver.
MBS Xojo Conference
6/7th September 2018 in Munich, Germany.

Platforms to show: All Mac Windows Linux Cross-Platform

/Util/Locale/CDblMBS function desktop
Function:
Required plugins for this example: MBS Util Plugin
You find this example project in your Plugins Download as a Xojo project file within the examples folder: /Util/Locale/CDblMBS function desktop
This example is the version from Mon, 20th Jan 2013.
Project "CDblMBS function desktop.rbp"
Class App Inherits Application
Const kEditClear = "&Delete"
Const kFileQuit = "&Quit"
Const kFileQuitShortcut = ""
End Class
Class Window1 Inherits Window
Control List Inherits Listbox
ControlInstance List Inherits Listbox
End Control
EventHandler Sub Open() dim de as string = l("de_DE", "deu", "de_DE.UTF8") dim en as string = l("en_US", "english", "en_US.UTF8") dim fr as string = l("fr_FR", "fra", "fr_FR.UTF8") // test normal mode test "1234" // default locale test "1.234" // default locale test "1,234", de // German test "1.234", en // US English test "1,234", fr // French test "1" // default locale test "1.0" // default locale test "1,0", de // German test "1.0", en // US English test "1,0", fr // French test "1234" // default locale test "1234.567" // default locale test "1234,567", de // German test "1234.567", en // US English test "1234,567", fr // French test "1.234,567", de // German test "1,234.567", en // US English test "1 234,567", fr // French // test exceptions test "xxx", fr // French test "1.23", "xxx" // invalid locale test "1,23", en End EventHandler
Sub Test(text as string, locale as string = "") #pragma BreakOnExceptions false List.AddRow text try dim value as Double if CDblMBS(text, value, locale) then List.Cell(List.LastIndex,1) = str(value) else List.Cell(List.LastIndex,1) = "failed" end if catch u as UnsupportedFormatException List.Cell(List.LastIndex,2) = u.message end try End Sub
Function l(Mac as string, Win as string, Lin as string) As string if TargetLinux then Return lin if TargetWin32 then Return win if TargetMacOS then Return mac End Function
End Class
MenuBar MenuBar1
MenuItem FileMenu = "&File"
MenuItem FileQuit = "#App.kFileQuit"
MenuItem EditMenu = "&Edit"
MenuItem EditUndo = "&Undo"
MenuItem UntitledMenu1 = "-"
MenuItem EditCut = "Cu&t"
MenuItem EditCopy = "&Copy"
MenuItem EditPaste = "&Paste"
MenuItem EditClear = "#App.kEditClear"
MenuItem UntitledMenu0 = "-"
MenuItem EditSelectAll = "Select &All"
End MenuBar
End Project

Feedback, Comments & Corrections

The items on this page are in the following plugins: MBS Util Plugin.




Links
MBS Xojo Chart Plugins