BioloMICS logo
×
BioloMICS menu

A first simple example

 
This little example will display a message box inside a popup dialog, and in the bottom console.
 
 
Imports System
Imports Biolomics.BioCallback
 
Public Class MyNewClass
 
     ' This function is called when running this script
     Shared Sub Main()
 
          '     Create an instance of class MyNewClass and call its functions
          Dim c As New MyNewClass
          c.SayHello()
     End Sub
 
     '     Write sub functions here
     Public Sub SayHello()
          '     Show a simple message box
          MsgBox("Hello world !")
 
          '     Write to the ouput window
          Console.Write("Hello world !")
     End Sub
End Class
 
 
There is a few Imports statements necessary to have access to common functions.
 
Note that in the new version, BioCallback becomes Biolomics.BioCallback
 
A class is declared.
Give it any name you like.
Function DrawMessages() is useful to draw all error messages at the bottom of the window after running the code.
The Main() function must remain, as it is the only function executed when pressing the Run button.
So all other functions must be called from that one.
 
Now press the Compile button or the Compile and Run button .
 
The line: MsgBox("Hello")
 
will display a first message box:
 
while the second line:
 
Console.Write("Hello world !")
 
Just writes the given text in the bottom console window.
 
Not really useful so far, but promising...
 
Note that in all other examples in this chapter, function SayHello() is replaced by some more intuitive functions.