Program Entry Point

All ViviFire programs must contain one module that starts with Program and a name. This module is where your program starts execution.

The name of the program can be the same as one procedure. When that occurs, then that procedure becomes where the program starts execution. But, if there is no such procedure, then execution starts at the top of the module.

Declaration of the procedure

There are four different mixtures of parameters and return types. It can have one parameter or none. And it can return a value or not.

TODO

TODO

Program Zero

Sub Zero
   MessageBox "Start of program"
   MessageBox "End of program"
End Sub

TODO

TODO

Program One

Sub One As Int
   MessageBox "Start of program"
   MessageBox "End of program"
End Sub

TODO

TODO

Program Two

Sub Two(args() As String) As Int
   MessageBox "Start of program"
   For Each arg As String In args
   Begin
      MessageBox arg, "arg"
   When %NONE
      MessageBox "No args"
   End For
   MessageBox "End of program"
End Sub

TODO

TODO

Program Three

Sub Three(args() As String)
   MessageBox "Start of program"
   For Each arg As String In args
   Begin
      MessageBox arg, "arg"
   When %NONE
      MessageBox "No args"
   End For
   MessageBox "End of program"
End Sub

See also