Turing ISP help
Girls CPT
What will we cover?
What does the main loop do?
% the intro method is called here
loop
exit when GUI.ProcessEvent
end loop
% the goodbye method is called here
/* most methods are called inside other
methods instead of in the main program */
Program Flow
Useful Syntax
% creates a window (declared as a global variable)
var mainWin : int := Window.Open ("position:100;100,graphics:800;600")
% closes the window (used in the goodbye method)
Window.Close (mainWin)
Where the window appears on the monitor screen
Width of the window
Height of the window
Useful Syntax
% creates a button
var mainMenuButton : int := GUI.CreateButtonFull (150, 295, 150, "Main Menu", mainMenu, 50, '^m', true)
% hides the button
GUI.Hide (mainMenuButton)
Where the button appears on the window
Width of the button
Words that are written on the button
The method the button calls
Height of the button
Shortcut to use the button (in this case shift + m)
Useful Syntax
If one procedure calls a second procedure the code for the second procedure should be written above the first procedure ( because the program needs to know that the second procedure actually exists). If the second procedure calls the first one as well then you can use forward proc procedureName to tell the program that the procedure exists and it will no longer matter if the procedure is called in code that’s above it
forward proc method2
proc method1
% code
end method1
body method2
% code
end method2
Should be written before any code for methods