![](/images/backgrounds/286549/hp-sunsoft-pascal-4-0-users-manual-549395254x1.png)
10
Sample Program
The following program, xview.p, makes a window:
program hello(output);
#include "stddefs_p.h" #include "attrgetset_p.h"
var
base_frame :Frame; base_panel :Panel;
message :Xv_panel_or_item_ptr;
text :string;
begin
text := 'Hello, World!';
xv_init(0);
base_frame := xv_create(nil, FRAME, 0);
base_panel := xv_create(base_frame, PANEL, 0);
message := xv_create(panel, PANEL_MESSAGE, 0); set_PANEL_LABEL_STRING(message, text);
window_main_loop(base_frame);
end. {hello}
To compile xview.p and link in the necessary libraries, use the following
hostname% pc
Now run the executable file:
hostname% a.out
Soon after you run the executable file, the window opens as a single frame, with the string Hello, World! in the frame header.
230 | Pascal 4.0 User’s Guide |