
Simple Question, Please help!!! :)))
Hi Danny,
You're confusing Subroutines with Gosubs; they're different. If
you intend to use a Gosub like:
GoSub ControlBrk
then you're going to need:
ControlBrk: '<--- Note the Colon (:) to denote a line label
'code
'code
'code
Return
AND, the ControlBrk routine has to be in the same sub as the
GoSub.
On the other hand, a better method in VB is to use Subroutines.
Use:
Call ControlBrk
with:
Sub ControlBrk()
'code
'code
'code
End Sub
Good luck!
Signet
--
~~~~~~~~~~~~~~~~~~~~
"For every action, there is an equal and opposite criticism."
Quote:
> Doing this rather silly school project for which we were
requested to
> use subroutines (with little guidance).
> I'm using the command:
> "GoSub ControlBrk"
> I now need to program the ControlBrk part of my program and I
was
> thinking that would go something like this....
> Sub ControlBrk <--- what's the Syntax for this????
> code
> code
> code
> Return
> (which will return control to the statement following my GoSub
> command)
> Well I keep getting compiler errors and the darn thing won't
run. I
> think it's because my Syntax is wrong for the programming of the
> actual subroutine. Any ideas????
> Thanks,
> Danny
> PS - Though this program is being done in VB, right now we're
only
> doing hard coding without the visual aspect. VB without the V ;)