Am trying to nest an if within a repeat, is this something that is possible?
The main code block is below and currently ignores the if statement and completes DoSort as part of the repeat loop...
procedure Main();
var
data: IntArray;
begin
OpenGraphicsWindow('Sort Visualiser', 800, 600);
LoadResourceBundle( 'NumberBundle.txt' );
GUISetForegroundColor( ColorBlack );
GUISetBackgroundColor( ColorWhite );
ShowPanel( 'NumberPanel' );
ClearScreen(ColorWhite);
repeat
ProcessEvents();
UpdateInterface();
DrawInterface();
RefreshScreen(60);
if ButtonClicked( 'Sort Button' ) then
begin
DoSort();
end;
until WindowCloseRequested();
end;
begin
Main();
end.