Making a FOR loop repeat only once
Author |
Message |
(-.-)>YoGiBeHR<(-.-
|
Posted: Mon Nov 13, 2006 7:35 pm Post subject: Making a FOR loop repeat only once |
|
|
Hello CompSci
I have a main menu, with options: Start, About and Help
When the user clicks START (start is a procedure for the game) the proggie will load the game procedure, and inside that game procedure another procedure for graphics will be loaded inside...
So , how do I make my for loop play only once please, thank you! |
|
|
|
|
 |
Sponsor Sponsor

|
|
 |
Clayton

|
Posted: Mon Nov 13, 2006 7:42 pm Post subject: (No subject) |
|
|
some code would be nice to see here, as I don't know why you even have a loop if you only want the code to run once.
However, if you want the code to run only once (for whatever reason you want a loop to run once...), use a for loop:
Turing: |
for Index : 1 .. 1
%code in here
end for
|
You could also have some sort of boolean flag and run a conditional loop:
Turing: |
var flag : boolean := false
loop
%do code
%action permits an exit
flag := true
exit when flag
end loop
|
Please post the code so we can give some more help |
|
|
|
|
 |
Dannyd534
|
Posted: Mon Nov 13, 2006 7:43 pm Post subject: (No subject) |
|
|
either send me the code and ill try to figure it out or...i think u do somthing like stop(or exit i forgot) when blah blah blah user clicks play or w/e u wanna do |
|
|
|
|
 |
Dannyd534
|
|
|
|
 |
|
|