
-----------------------------------
Unknown25
Sun Jan 15, 2012 1:44 pm

exiting program
-----------------------------------
What is it you are trying to achieve?
To exit program when mouse is clicked on a specific location


What is the problem you are having?
I can't find the correct command to do so


Describe what you have tried to solve this problem
So basically the home page is a picture that has 3 buttons. Play, instructions and exit. When you click exit I don't want to program to just stop but to close.

I tried putting exit but it doesn't exit the actual program but stops it.

So there is no actual button, it is just one picture but the picture design has buttons.


Please specify what version of Turing you are using
The latest.

So what code should I use.

So I am using buttonwait, when I click on that section of the picture, (where it says exit), for the program to actually exit/close.

Thanks a lot for your help in advance.

-----------------------------------
Aange10
Sun Jan 15, 2012 1:58 pm

RE:exiting program
-----------------------------------
Well, your at least on the right track. To close the window, you simply use Window.Close (id). But there is a great tutorial for that [url=http://compsci.ca/v3/viewtopic.php?t=8901]here.

Buttonwait is terrible, in my opinion. I'd suggest using any of the clicking modules at [url=http://compsci.ca/v3/viewtopic.php?t=30381]module. It can be quite useful to use other people's tools.


[url=http://compsci.ca/v3/viewtopic.php?t=30321]Aange10's Simple Cliking
[url=http://compsci.ca/v3/viewtopic.php?t=29263]Zren's Advanced Input / Clicking

-----------------------------------
Unknown25
Sun Jan 15, 2012 3:26 pm

RE:exiting program
-----------------------------------
Thanks, it took me a while but I learned how to do it. And I will also check out those modules too.

-----------------------------------
tg851
Mon Jan 16, 2012 11:01 am

Re: exiting program
-----------------------------------
to just make it totaly quit the program,the 
command Error.Halt comes to mind
a simple example

put"press enter to quit"
var chars : array char of boolean 
        loop 
            Input.KeyDown (chars) 
  if chars (KEY_ENTER) then 
                Error.Halt("program quit")
end if
end loop

useful for bulletproofing,for when issued,it will unconditionally end the program,and is quite easily used.plus the message is customizable,good for a game over blurb or something similar
