Unforgiving400
New member
- Joined
- Feb 21, 2008
- Messages
- 3
- Programming Experience
- 3-5
I have a program (its really big so i wont post it all) but im trying to get the main program to stop and wait for the user to make a selection in a diffrent form. in the past i got by this by making lots of sub like
main.start >
other.getInput>
main.keepgoing
but the way this program works i cant think of a way to just stop the loop and resum without seriusly recoding thousands of lines of code, and that does not sould like fun.
this is the main.sub that runs the program:
if you have questions about the other code i can post it.
but the buffers are just variables that hold the input from other functions and then are cleared after there used.
basicly the problem im seeing is when i run the code the loop keeps running so fast the display never catches up so the selection form never becoms usable because the proccess of the loop freezes up the program.
main.start >
other.getInput>
main.keepgoing
but the way this program works i cant think of a way to just stop the loop and resum without seriusly recoding thousands of lines of code, and that does not sould like fun.
this is the main.sub that runs the program:
VB.NET:
Private Sub RUN_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RUN.Tick
ActingPlayer.Text = World.GetCharacter(PlayerIndex).GetType.ToString
If World.GetCharacter(PlayerIndex).isHuman() Then
While World.GetCharacter(PlayerIndex).isActing()
ActionSelection.Show()
While actionBuffer < 0
'This should wait for the ActionSelection to finish its action
End While
selectingSpace = True
While locbuffer.Equals(Nothing)
'This should wait for the user to click a location
End While
World.GetCharacter(PlayerIndex).getAction(actionBuffer).Cast(World.GetCharacter(PlayerIndex), locBuffer)
clearActionBuffer()
End While
Else
World.GetCharacter(PlayerIndex).Act()
End If
PlayerIndex += 1
If PlayerIndex + 1 < World.numberOfCharacters Then
PlayerIndex += 1
Else
PlayerIndex = 0
End If
End Sub
if you have questions about the other code i can post it.
but the buffers are just variables that hold the input from other functions and then are cleared after there used.
basicly the problem im seeing is when i run the code the loop keeps running so fast the display never catches up so the selection form never becoms usable because the proccess of the loop freezes up the program.