473,399 Members | 3,302 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,399 software developers and data experts.

halt application flow until condition is met

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
1 1827
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Bruce W...1 | last post by:
A scripting newbie question... I'm trying to understand some code I found. This script conducts a poll and writes the results to a text file. The following statement is part of the source file. ...
9
by: Alvin Bruney [MVP] | last post by:
Exceptions must not be used to control program flow. I intend to show that this statement is flawed. In some instances, exceptions may be used to control program flow in ways that can lead to...
10
by: Dennis D. | last post by:
Hello: There are a series of textboxes (x.text, y.text, z.text etc.) in which user input is expected. As: dtmX=CDate(x.text) dtmY=CDate(y.text) dtmZ=CDate(z.text) where x, y, and z.text...
8
by: TrtnJohn | last post by:
I have an application where I would like to block waiting on an asynchronous event and still process messages. I can implement a hard loop to block such as: Do While StillWaiting...
15
by: shannon | last post by:
Hello, I am wondering if a Do until loop can be used in Javascript. I have an array and want to fill the array 10 times with the users details until it reaches 10 or if they press cancel. I'm...
1
by: googlinggoogler | last post by:
Hi, Sorry for the poor topic name, i couldnt think how to word it any better. I have put below my code and I hope this makes what im trying to say, easier to understand. (I realise that the...
7
by: Buck Rogers | last post by:
Hi all! Newbie here. Below is an example from Teach Yourself C in 21 Days. My apologies if it is a bit long. What I don't understand is how the "get_data" function can call the...
7
by: Thomas Nelson | last post by:
Occasionally someone posts to this group complaining about the lack of "repeat ... until" in python. I too have occasionally wished for such a construct, and after some thinking, I came up with...
1
by: Sladan | last post by:
Hi! I'm currently writing a poker program i .net compact framework. In one method I have a while-loop that goes through every player until everyone is finished betting. What I need is some way to...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.