As usual, the program does not do anything useful, but from it you can learn something about GUI: how to show, how to fill a gui field.
In POWER-KI you have may ways to write an "Hello World!", the simplest is to create an assembly (.pka) and use one these two functions in the CODE of the MAIN EXO: chatput("HELLO WORLD!); consout("HELLO WORLD!), But in this example we want to show you an HW a little more complete, so that you can appreciate some of the PWK features.
The program has a very simple behavior: it starts, displays the GUI, writes a first message, waits two seconds, writes "Hello WORLD!" and goes into an infinite loop from which exits when the GUI sets a global variable.
From the menu of the WorkBench, create the package which we call "DEMO_HelloWord", to it we will add: to the resources a background image chosen from among those present in the directory PWK-PRG \ RES, to the UserInterface a GUI and to the assembly the executable.
In the FORM element of the GUI we will insert an image, which will be used to display the background, and a LABEL with a FONT element. In LIVE mode we will give the right position and dimension to the object.
In the assembly we add a GUI item that connect the GUI to it. In the CLOSE case of the TRIG we set the Global stop@main symbol to 1;
In the Main, we set the stop symbol to 0 and we send the SHOW message to the GUI, so that the user can see it. In the TEXT element of the label we put the notice to wait. The sleep function is invoked, on its end we change the message. The program flow goes now in a while loop, where every 200ms is cecked the value of stop symbol, on 1 the loop is terminated as well as the program.