Your First HMG Program

HMG Tutor 1

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

 –  #include “hmg.ch” :   Inclusion of header file, required every HMG program.

–    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, column=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.

That’s all !

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.