Xojo Conferences
XDCMay2019MiamiUSA

Platforms to show: All Mac Windows Linux Cross-Platform

/SQL/Environment Test
Function:
Required plugins for this example: MBS SQL Plugin
You find this example project in your Plugins Download as a Xojo project file within the examples folder: /SQL/Environment Test
This example is the version from Tue, 14th Jan 2013.
Project "Environment Test.rbp"
Class App Inherits Application
Const kEditClear = "&Löschen"
Const kFileQuit = "Beenden"
Const kFileQuitShortcut = ""
End Class
Class Window1 Inherits Window
Control List Inherits Listbox
ControlInstance List Inherits Listbox
End Control
EventHandler Sub Open() TestMBS TestRB End EventHandler
Sub TestMBS() dim s as string = SQLGlobalsMBS.GetEnv("Testing") if s = "" then List.AddRow "Get value before OK." else List.AddRow "Get value before failed: "+s end if dim test as string = "Hello World ✔" dim b as Boolean = SQLGlobalsMBS.SetEnv("Testing", test) if b then list.addrow "SetEnv OK" else list.addrow "SetEnv failed" end if s = SQLGlobalsMBS.GetEnv("Testing") if s = test then List.AddRow "Get value mid OK: "+s else List.AddRow "Get value mid failed: "+s end if if s.Encoding = nil then List.AddRow "Text encoding missing!" elseif s.Encoding = encodings.UTF8 then List.AddRow "Text encoding OK" else List.AddRow "Text encoding wrong: "+s.Encoding.internetName end if b = SQLGlobalsMBS.UnSetEnv("Testing") if b then list.addrow "UnSetEnv OK" else list.addrow "UnSetEnv failed" end if s = SQLGlobalsMBS.GetEnv("Testing") if s = "" then List.AddRow "Get value after OK." else List.AddRow "Get value after failed: "+s end if End Sub
Sub TestRB() dim s as string = System.EnvironmentVariable("Testing") if s = "" then List.AddRow "Get value before OK." else List.AddRow "Get value before failed: "+s end if dim test as string = "Hello World ✔" System.EnvironmentVariable("Testing") = test s = System.EnvironmentVariable("Testing") if s = test then List.AddRow "Get value mid OK: "+s else List.AddRow "Get value mid failed: "+s end if if s.Encoding = nil then List.AddRow "Text encoding missing!" elseif s.Encoding = encodings.UTF8 then List.AddRow "Text encoding OK" else List.AddRow "Text encoding wrong: "+s.Encoding.internetName end if System.EnvironmentVariable("Testing") = "" s = System.EnvironmentVariable("Testing") if s = "" then List.AddRow "Get value after OK." else List.AddRow "Get value after failed: "+s end if End Sub
End Class
MenuBar MenuBar1
MenuItem FileMenu = "&Ablage"
MenuItem FileQuit = "#App.kFileQuit"
MenuItem EditMenu = "&Bearbeiten"
MenuItem EditUndo = "&Rückgängig"
MenuItem UntitledMenu1 = "-"
MenuItem EditCut = "&Ausschneiden"
MenuItem EditCopy = "&Kopieren"
MenuItem EditPaste = "&Einfügen"
MenuItem EditClear = "#App.kEditClear"
MenuItem UntitledMenu0 = "-"
MenuItem EditSelectAll = "&Alles auswählen"
End MenuBar
End Project

Feedback, Comments & Corrections

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




Links
MBS Xojo Chart Plugins