restart application
Author |
Message |
endusto
|
Posted: Sun Feb 13, 2005 2:35 pm Post subject: restart application |
|
|
is there a code to restart the application? |
|
|
|
|
|
Sponsor Sponsor
|
|
|
Drakain Zeil
|
Posted: Sun Feb 13, 2005 3:08 pm Post subject: (No subject) |
|
|
You could put it (the entire program) in a loop I supose, what are you trying to do? |
|
|
|
|
|
endusto
|
Posted: Sun Feb 13, 2005 3:21 pm Post subject: (No subject) |
|
|
lol i meant to say close, not restart, im just making a guessing game for school.
code: | var difficulty:int
View.Set ("nobuttonbar")
Window.Set (defWinId, "title:Guess my numba FOO")
process easyP ( maxNum, lives:int , diff:string)
var easy:int := Rand.Int(1, maxNum)
var answer:int
var playagain:string
put skip
put "You have chosen " + diff + " as your difficulty..."
put "Enter your number"
put skip
loop
get answer
if (easy = answer) then
put skip
colorback (yellow)
put "You are correct, the number was: "
put easy
colorback (white)
put skip
put "Play again? y/n"
get playagain
if (playagain = "y") then
cls
else
exit
end if
put "Select a Difficulty"
put "1. Easy (1-25)"
put "2. Medium (1-50)"
put "3. Hard (1-100)"
elsif (easy > answer) then
put "The number is higher than that"
elsif (easy < answer) then
put "The number is lower than that"
end if
end loop
end easyP
put "Welcome to the guessing game!"
put "Please select a difficulty by entering the corresponding number"
put skip
put "1. Easy (1-25)"
put "2. Medium (1-50)"
put "3. Hard (1-100)"
get difficulty
if (difficulty = 1) then
fork easyP(25, 10, "easy")
elsif (difficulty = 2) then
fork easyP(50, 5, "medium")
elsif (difficulty = 3) then
fork easyP(100, 3, "hard")
elsif (difficulty > 3) then
end if
loop
exit when difficulty = 4
end loop
|
thats the code, but i want it so like if you press 4 it will exit. |
|
|
|
|
|
Bacchus
|
Posted: Sun Feb 13, 2005 3:42 pm Post subject: (No subject) |
|
|
theres a tutorial on that.
3 things you should do b4 u post:
1:Read CompSci Tutorials
2:Search for Help
3:Press F10 |
|
|
|
|
|
Andy
|
Posted: Sun Feb 13, 2005 5:21 pm Post subject: (No subject) |
|
|
return will end the program/subprogram immediately |
|
|
|
|
|
endusto
|
Posted: Sun Feb 13, 2005 5:45 pm Post subject: (No subject) |
|
|
i still couldnnt find it in the manual, what code do i use to close the program? |
|
|
|
|
|
Drakain Zeil
|
Posted: Sun Feb 13, 2005 6:07 pm Post subject: (No subject) |
|
|
I believe there is part of the GUI that lets you open windows, assign that window's ID number to a variable, then close it later.
Read the GUI manuals on opening windows, or check the tutorials here. |
|
|
|
|
|
ssr
|
Posted: Sun Feb 13, 2005 6:11 pm Post subject: (No subject) |
|
|
and
check the tutorials to learn them or press f 10
[/quote] |
|
|
|
|
|
Sponsor Sponsor
|
|
|
|
|