Example Hello world programs

Contents


HBasic code with HBasic stdgui library


 In this example we use the normal HBasic stdgui library package and start
the program execution with the HBasic interpreter or compiler.


Sub button1_clicked()
Print "Hello world"
End Sub

Example hello_world.bas:  Example of a normal HBasic method.



HBasic code with NET library mscorlib.dll


In this example we use the method System.Console.WriteLine from the .NET mscorlib library package. We have to include .NET support into the current project and insert the mscorlib.dll with the package manager.


Sub button1_clicked()
System.Console.WriteLine( "Hello world" )
End Sub

Example hello_world.bas:  Example of a normal HBasic method.



HBasic code with NET compiler

HBasic code with NET compiler


Class mainclass
Sub Main
    Print "Hello world"
End Sub
End Class


Example hello_net.bas:  Example of a special Basic code for NET compiler.



HBasic using NET Console library methods

Include NET support in project options and package mscorlib.dll in package manager.


Sub button1_clicked()
 System.Console.writeLine( "Hello world" )
End Sub

Example hello_net.bas:  Example of a special Basic code for NET compiler.



C# code with DotGNU compiler

Hello world example with C# code.


Using System;

class
{
  Method Main()
  {
     Console.WriteLine( "Hello world" );
  }
}

Example hello_world.cs:  Example of a special C#.



HBasic code with Qt-C library


Preparation: Include Qt-C support for the current project.


Sub button1_clicked()
Dim s As QString

s = New QString( "Hello world" )
Print s
End Sub

Example qtc_hello.bas:  Example of a Hello world output with the QString class from the Qt-C library.


Hello world in IL Assembler code


May be useful and therefore possible in the future.