Quick question about passing variables to subs to reduce the need for
publicly declared variables in VB6. If I have an event sub (MouseDown) that
runs a few lines of code, how can I use a variable in that sub without
making it global? I tried adding the variable to the arguments of the sub,
but VB doesn't seem to like anything other than the predescribed format of
the event. So, for example, given the MouseDown event:
Private Sub Form_MouseDown( Button As Integer, Shift As Integer, X As Single,
Y As Single)
I would intuitively add a variable in such a manner:
Private Sub Form_MouseDown( Button As Integer, Shift As Integer, X As Single,
Y As Single, foo as Whatever)
which doesn't work. How should I do this instead?
-Dan
publicly declared variables in VB6. If I have an event sub (MouseDown) that
runs a few lines of code, how can I use a variable in that sub without
making it global? I tried adding the variable to the arguments of the sub,
but VB doesn't seem to like anything other than the predescribed format of
the event. So, for example, given the MouseDown event:
Private Sub Form_MouseDown( Button As Integer, Shift As Integer, X As Single,
Y As Single)
I would intuitively add a variable in such a manner:
Private Sub Form_MouseDown( Button As Integer, Shift As Integer, X As Single,
Y As Single, foo as Whatever)
which doesn't work. How should I do this instead?
-Dan
Comment