tags:

views:

61

answers:

3

In the Form_Load event of this ultralegacy app I need to transliterate over to a web app is this command/statement "WaitOn" that occurs right after the On Error GoTo...

Does anyone remember what WaitOn means?

Here's the code snippet:

Dim sCmd As String
Dim iFileHandle As Integer
Dim sFileName As String
Dim i As Integer
Dim sKeyWord As String
Dim sWindowPosition As String
Dim iWindowState As Integer
Dim sSystemId As String
Dim sMetrics() As String

On Error GoTo MainFormLoadErr
WaitOn
ReDim gsFundsUsed(0 To 0)
ReDim gsObjectsUsed(0 To 0)
Set gsActiveSpread = Nothing
.
.
.
MainFormLoadExit:
WaitOff
Close
Exit Sub

MainFormLoadErr:
MsgBox Error$(Err) & " in MainForm Load"
Resume MainFormLoadExit

There is a corresponding WaitOff down there I just found. I don't think WaitOn is part of a line label.


As @C-Pound Guru suggested, WaitOn and WaitOff were methods in one of the (many) modules of the program. Not clear from the the names of the subroutines was the fact that their task was to set the mouse pointer to the Wait Cursor, and then return to the default, later.

Sub WaitOn ()
  On Error Resume Next
  Screen.MousePointer = 11
End Sub

Sub WaitOff ()
  On Error Resume Next
  Screen.MousePointer = 0
End Sub
+2  A: 

Can you post an actual code snippet? I haven't used VB in a while, but WaitOn is probably just a line label if it follows On Error GoTo.

klaasens
You are correct. Anything after "On Error Goto" was a label.
David
Uh, I don't think so. See the code I added...
Cyberherbalist
Aww, I got back here too late. The question is already answered. After looking at your code snippet, I see that WaitOn is not a label. Glad to see you have your answer.
klaasens
A: 

What happens if you right-click and Go To Definition? And does the code currently run? Check the references - maybe it's something from a non-standard dll.

CodeByMoonlight
VB3 doesn't have a right-click context menu so no Go To Definition. Unfortunately, or this question never would have been asked.
Cyberherbalist
+1  A: 

I've never come across a 'WaitOn' or 'WaitOff' command in VB. You might want to double-check the code to see if there's a WaitOn method written (and a WaitOff method as well). It's not a label as VB labels end with a colon (:).

C-Pound Guru
Bingo. Looking thru the code for a login method I ran into both WaitOn and WaitOff. VB3 doesn't have a right-click context menu so no Go To Definition.
Cyberherbalist