Why does this fail so miserably?

BlitzMax Forums/BlitzMax Programming/Why does this fail so miserably?

but this doesn't work escape does nothing! What's the difference?
Polled input isn't running. The Graphics() command starts this as well as setting the graphics object.


Why not just do it like so?...
Strict

Local fullscreen=1
Local screenwidth = 801 '800
Local screenheight = 600
Local forcewindowedmode = 0

If FullScreen
	'Try 32 bit, failing that try 16 bit, failing that use windowed mode	
	If GraphicsModeExists(ScreenWidth, ScreenHeight,32)
		Graphics ScreenWidth, ScreenHeight, 32, 60
	ElseIf GraphicsModeExists(ScreenWidth, ScreenHeight, 16)
		Graphics ScreenWidth, ScreenHeight, 16, 60
	Else	
		ForceWindowedMode = 1
		FullScreen = 0
		
		Graphics ScreenWidth, ScreenHeight, 0, 60				
	EndIf
EndIf

Repeat

Until KeyHit(KEY_ESCAPE) Or AppTerminate()

End