|
-
Oct 1st, 2001, 10:02 AM
#1
Thread Starter
New Member
Need basic help on looping...
Forgive me but I am an old mainframe programmer that uses VB occasionally. Writing a gui for my package and can't figure out something. VB is event driven which is kinda weird to me. I can handle most things but I have a main routine that, if my link configuration has not been setup it shows another form to get the parms, then, when I get back I get the scoop from the registry. There is no getting back though (as I am sure you know). I need to get back to where I was in the routine I was in originally. I have a loop in the main process that looks like this (the timer was put in there to avoid a hard loop but, of course, it does nothing either):
Public Sub HostConnect()
Dim gotit As Integer
Timer2.Interval = 10000 'wait about 15 seconds
'gotta get our connection parameters, if not there then fetch them
gotit = 0
While gotit = 0
HostName = GetSetting("DMcom", "Host", "name", "notfound")
HostIP = GetSetting("DMcom", "Host", "name", "notfound")
HostPort = GetSetting("DMcom", "Host", "name", "notfound")
If HostName = "notfound" Or HostIP = "notfound" Or HostPort = "notfound" Then
ConnectSettingsfrm.Show
If FormLostFocus = True Then
' if we lost focus, wait for a bit
Timer2.Enabled = True
End If
Else
gotit = 1
End If
Wend
' ok, got parms, now connect
End Sub
Sorry to be a bother but I've just got some sort of mental block going here...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|