Author |
Message |
Tubs
|
Posted: Fri Jun 06, 2003 11:33 am Post subject: Forking quit |
|
|
How can i set my program so that if the ESC button is pressed, it will close the window?
code: | var Choice : string
process Exit
if Choice = KEY_ESC then
quit
end if
end Exit
fork Exit
for I : 1..10
delay (100)
put I
end for |
doesnt work cause i suck at turing |
|
|
|
|
|
Sponsor Sponsor
|
|
|
PaddyLong
|
Posted: Fri Jun 06, 2003 11:54 am Post subject: (No subject) |
|
|
it doesn't appear that you are actually getting any input for Choice
do something like
code: |
if hasch then
getch (Choice)
end if
|
put that into your Exit process before your if Choice = KEY_ESC ..
but for that to work you'd need to make Choice declared as
code: |
var Choice : string (1)
|
also, if the only input you're going to be getting for Choice is to see whether to quit or not in the Exit process, you might as well make it a local variable to Exit (so just declare your var Choice : string (1) inside of the Exit process) |
|
|
|
|
|
Tubs
|
Posted: Fri Jun 06, 2003 12:11 pm Post subject: (No subject) |
|
|
code: | process Exit
var Choice : string (1)
if hasch then
getch (Choice)
end if
if Choice = KEY_ESC then
quit
end if
end Exit
fork Exit
for I : 1..10
delay (100)
put I
end for |
ya still doesnt work, cuase i am dumb |
|
|
|
|
|
Tony
|
|
|
|
|
Martin
|
Posted: Fri Jun 06, 2003 1:52 pm Post subject: (No subject) |
|
|
code: | process Exit
loop
if Choice = KEY_ESC then
quit
end if
end loop
end Exit |
A process still runs like a procedure, so when its end is reached, it will stop. |
|
|
|
|
|
PaddyLong
|
Posted: Sat Jun 07, 2003 7:03 pm Post subject: (No subject) |
|
|
code: |
process Exit
var Choice : string (1)
loop
if hasch then
getch (Choice)
if Choice = KEY_ESC then
quit
end if
end if
end loop
end Exit
fork Exit
for I : 1 .. 10
delay (100)
put I
end for
|
|
|
|
|
|
|
Andy
|
Posted: Sat Jun 07, 2003 7:11 pm Post subject: (No subject) |
|
|
if u suck at turing, then why is ur rank programmer? |
|
|
|
|
|
PaddyLong
|
Posted: Sat Jun 07, 2003 7:23 pm Post subject: (No subject) |
|
|
you are a very obnoxious individual dodge_tomahawk. you should learn a bit of modesty. |
|
|
|
|
|
Sponsor Sponsor
|
|
|
Andy
|
Posted: Sat Jun 07, 2003 7:55 pm Post subject: (No subject) |
|
|
hmmm, why? |
|
|
|
|
|
void
|
Posted: Sun Jun 08, 2003 10:36 am Post subject: (No subject) |
|
|
dodge_tomahawk.. dun worry man...Paddy is just on crack...theres no sympathy for stupidity...but being a programmer isnt a rank that you earn..its just one of those usergroups that you join..or atleast that how i got in..**laughs maniacly** (spell. error) |
|
|
|
|
|
Tubs
|
Posted: Tue Jun 10, 2003 11:57 am Post subject: (No subject) |
|
|
dodge_tomahawk wrote: if u suck at turing, then why is ur rank programmer?
i dont actually suck i just diss myself a lot |
|
|
|
|
|
Blade
|
Posted: Tue Jun 10, 2003 12:33 pm Post subject: (No subject) |
|
|
heh... you dont join usergroups to get yer rank to change... mine hasnt changed yet. im actually a "kick ass hacker" it shows in my profile thing.. just not in my posts. it depends on how many posts you get... thats how it changes... *shakes head* |
|
|
|
|
|
Andy
|
Posted: Tue Jun 10, 2003 5:48 pm Post subject: (No subject) |
|
|
ya... lots of ranks dun show for some reason, i wanna my newbe hacker to show |
|
|
|
|
|
Tony
|
Posted: Tue Jun 10, 2003 7:48 pm Post subject: (No subject) |
|
|
dodge, you dont deserve your newbe hacker. If anything, I'm gonna assign 1337 spammer to you, cuz thats what you do best |
Tony's programming blog. DWITE - a programming contest. |
|
|
|
|
Tubs
|
Posted: Wed Jun 11, 2003 11:09 am Post subject: (No subject) |
|
|
well this weird shit....
code: | process Exit
var Choice : string (1)
loop
drawfillbox (1, maxy - 15, 70, maxy, 12)
Font.Draw ("ESC to Quit", 2, maxy - 10, font1, blue)
delay (1000)
if hasch then
getch (Choice)
if Choice = KEY_ESC then
quit
end if
end if
end loop
end Exit
fork Exit
Start
fork Exit |
when i remove the drawing command for quit it doesnt work, but if its not there it works |
|
|
|
|
|
|