Your First HMG Program
I'll not be original, so this program will display a 'Hello World' message
#include "hmg.ch"
Function Main
DEFINE WINDOW Win_1 ;
AT 0,0 ;
WIDTH 400 ;
HEIGHT 200 ;
TITLE 'Tutor 01 - Hello World!' ;
MAIN
END WINDOW
ACTIVATE WINDOW Win_1
Return
¼ DEFINE WINDOW command will create the main window for the program.
¼ Win_1 is the name of the window.
¼ AT 0,0 indicates the window position (row=0,col=0)
¼ WIDTH 400 means that the window will have 400 pixels width.
¼ HEIGHT 200 means that the window will have 200 pixels height.
¼ TITLE 'Hello World!' indicates the text in the window title bar.
¼ MAIN indicates that we are defining the main application window
(a main window is required for all HMG applications)
¼ ACTIVATE WINDOW Form_1 will show the window and start the event loop.