Visual Basic has been implemented with the VB CodeDom.
- Syntax highlighting
- Compilation
- Execution
- Console ouput
- Return values
- Diagnostics
- Errors
Every VB fiddle code has to be written like the following:
Public Module [MName]
Public [Function or Sub]
' ...
End [Function or Sub]
End Module
Where [MName]
is any Module name (eg: Main
), and [Function or Sub]
can be either a returning function (Function
) or a void function (Sub
). The first found method will be the entry point.
You can use the following Globals/Variables inside your code:
-
Random
(object, .NETSystem.Random
, msdn): Create random numbers withRandom.Next(..)
-
Console
(object, .NETSystem.IO.StringWriter
, msdn): Write to Console withConsole.WriteLine(string)
orConsole.Write(string)
-
CurrentThread
(object, .NETSystem.Threading.Thread
, msdn): The thread this got initialized on (mostly UI Thread), can be used to access all properties or functions from aSystem.Threading.Thread
. -
Editor
(object, FiddleFiddle.UI.Editor
(fromSystem.Windows.Window
, msdn)): Fiddle's Editor window, can be used to access allUIElements
, properties, public functions or functions derived fromSystem.Windows.Window
. (Editor XAML code, Editor source code) -
App
(object, .NETSystem.Windows.Application
, msdn): Fiddle's callingApplication
/App
, can be used to access all properties or functions derived fromSystem.Windows.Application
) -
RunUi(Action)
(function,void Invoke(Action)
, declaration): A function with an anonymous function orAction
as a parameter to execute code on the UI Thread. This is required for getting/setting properties or calling functions fromEditor
orApp
because those are not thread safe. Example:
RunUi(Sub() Editor.Hide());