GLBasic forum

Main forum => GLBasic - en => Topic started by: Darmakwolf on 2010-Apr-30

Title: Simple question
Post by: Darmakwolf on 2010-Apr-30
This may be a terribly stupid question, but I want to be able to quit an application in the Wiz, but volume +&- is rather silly. I know how to disable that from working, but there seems to be no way to just get back to the wiz's menu screen. END doesn't do the trick. Help?
Title: Re: Simple question
Post by: Ian Price on 2010-Apr-30
You can just end all running functions/loops and it'll exit back to the WIZ menu.

Eg

Code (glbasic) Select

SETSCREEN 320,240,0

main()

// Main function
FUNCTION main:

LOCAL quit=0

// Loop until the condition is met (ie quit<>0)
WHILE quit=0

// Loop through all possible key values and exit the function if key pressed
FOR n=0 TO 255
IF KEY(n) THEN QUIT=1
NEXT

PRINT "PRESS ANY KEY TO EXIT",10,10

SHOWSCREEN

WEND

ENDFUNCTION


That's from memory, not tested, but it should work.
Title: Re: Simple question
Post by: Darmakwolf on 2010-Apr-30
That does the trick on the Wiz! Thank you much.