By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,556 Members | 1,669 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,556 IT Pros & Developers. It's quick & easy.

halt application flow until condition is met

P: n/a
Hi,

I've posted my code to try and explain myself better, although its not
correct and i realise this cos i've chopped bits out to make things
easier to read.

Basically in start.vb, frmapplication should only open when the
conditions X and Y are 1.

So i tried to wait for Y to be 1 before proceeding to X, by means of a
DO UNTIL Y = 1, but this doesnt seem to work and causes the program to
crash.

can anyone suggest a better way of doing this?? all I want to do is
halt the flow of sub main() until Y = 1. is there a means to halt in
VB.net? or a better way of doing this??

Thanks

David
'''''''''''''''''''''''''''''''''''''''''''''''''' '''''''''''''''''''''''''''''''''''''start.vb''''' '''''''''''''''''''''''''''''''''''''''''''''''''' ''''''''''''''''''''''''''''''''
Module startup

Public Class Accepted
Public Shared Y As Integer
Public Shared X As Integer
End Class

Public Sub main()
register.Show()
Do Until Accepted.Y = 1

Loop
If Accepted.X = 1 Then
register.Close()
Application.Run(frmapplication)
Else
MsgBox("Invalid Registration Key", MsgBoxStyle.Critical,
" ")
End If
End Sub

End Module
'''''''''''''''''''''''''''''''''''''''''''''''''' '''''''''''''''''''''''''''''''''''''
'''''''''''''''''''''''''''''''''''''''''''''''''' '''''''''''''''''''''''''''''''''''''register.vb'' '''''''''''''''''''''''''''''''''''''''''''''''''' '''''''''''''''''''''''''''''''''''

Public Class B

Private Sub Continue_Click() Handles Continue.Click

If validate() = true then
Accepted.Y = 1
Accepted.X = 1
Else
MsgBox("Invalid Registration Key", MsgBoxStyle.Critical, "
")
End If

End Sub

end Class
'''''''''''''''''''''''''''''''''''''''''''''''''' '''''''''''''''''''''''''''''''''''''

Feb 6 '06 #1
Share this Question
Share on Google+
1 Reply


P: n/a
I would look at ShowModalDialog. Is this what you are trying to do ?
(i.e.the control flow is back to the line that follows ShowModalDialog only
once the dialog is closed).

---
Patrice

<go*************@hotmail.com> a écrit dans le message de
news:11**********************@f14g2000cwb.googlegr oups.com...
Hi,

I've posted my code to try and explain myself better, although its not
correct and i realise this cos i've chopped bits out to make things
easier to read.

Basically in start.vb, frmapplication should only open when the
conditions X and Y are 1.

So i tried to wait for Y to be 1 before proceeding to X, by means of a
DO UNTIL Y = 1, but this doesnt seem to work and causes the program to
crash.

can anyone suggest a better way of doing this?? all I want to do is
halt the flow of sub main() until Y = 1. is there a means to halt in
VB.net? or a better way of doing this??

Thanks

David
'''''''''''''''''''''''''''''''''''''''''''''''''' ''''''''''''''''''''''''''
'''''''''''start.vb''''''''''''''''''''''''''''''' ''''''''''''''''''''''''''
'''''''''''''''''''''''''''''' Module startup

Public Class Accepted
Public Shared Y As Integer
Public Shared X As Integer
End Class

Public Sub main()
register.Show()
Do Until Accepted.Y = 1

Loop
If Accepted.X = 1 Then
register.Close()
Application.Run(frmapplication)
Else
MsgBox("Invalid Registration Key", MsgBoxStyle.Critical,
" ")
End If
End Sub

End Module
'''''''''''''''''''''''''''''''''''''''''''''''''' ''''''''''''''''''''''''''
'''''''''''

'''''''''''''''''''''''''''''''''''''''''''''''''' ''''''''''''''''''''''''''
'''''''''''register.vb'''''''''''''''''''''''''''' ''''''''''''''''''''''''''
'''''''''''''''''''''''''''''''''
Public Class B

Private Sub Continue_Click() Handles Continue.Click

If validate() = true then
Accepted.Y = 1
Accepted.X = 1
Else
MsgBox("Invalid Registration Key", MsgBoxStyle.Critical, "
")
End If

End Sub

end Class
'''''''''''''''''''''''''''''''''''''''''''''''''' ''''''''''''''''''''''''''
'''''''''''

Feb 6 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.