Home All Groups Group Topic Archive Search About

Calling Subprocedures

Author
21 Sep 2006 2:29 PM
craig via DotNetMonster.com
I'm sure there is a simple answer, but I just can't get my head around this
today.  I have various Sub's that each generate a specific report.  I have
the Sub's name in a variable.  Other than testing the contents of the
variable for each name like:

If ProcName="FaceSheet" Then
     FaceSheet()
ElseIf ProcName="ProgNote" then
     ProgNote().............

Is there a way that I can make the call to the Sub using the contents of the
variable?

Thanks,
Craig


Author
21 Sep 2006 2:58 PM
Kerry Moorman
Craig,

If your code is structured in such a way that you can take advantage of it,
the CallByName function is by far the easiest way to call methods (subs) by
name.

Kerry Moorman


Show quoteHide quote
"craig via DotNetMonster.com" wrote:

> I'm sure there is a simple answer, but I just can't get my head around this
> today.  I have various Sub's that each generate a specific report.  I have
> the Sub's name in a variable.  Other than testing the contents of the
> variable for each name like:
>
> If ProcName="FaceSheet" Then
>      FaceSheet()
> ElseIf ProcName="ProgNote" then
>      ProgNote().............
>
> Is there a way that I can make the call to the Sub using the contents of the
> variable?
>
> Thanks,
> Craig
>
> --
> Message posted via DotNetMonster.com
> http://www.dotnetmonster.com/Uwe/Forums.aspx/dotnet-vb-net/200609/1
>
>
Author
22 Sep 2006 2:32 AM
GS
great variation theme of alter goto from COBOL!
Show quoteHide quote
"Kerry Moorman" <KerryMoor***@discussions.microsoft.com> wrote in message
news:533AA298-52A1-42AC-BAC3-64A6F51ED36D@microsoft.com...
> Craig,
>
> If your code is structured in such a way that you can take advantage of
it,
> the CallByName function is by far the easiest way to call methods (subs)
by
> name.
>
> Kerry Moorman
>
>
> "craig via DotNetMonster.com" wrote:
>
> > I'm sure there is a simple answer, but I just can't get my head around
this
> > today.  I have various Sub's that each generate a specific report.  I
have
> > the Sub's name in a variable.  Other than testing the contents of the
> > variable for each name like:
> >
> > If ProcName="FaceSheet" Then
> >      FaceSheet()
> > ElseIf ProcName="ProgNote" then
> >      ProgNote().............
> >
> > Is there a way that I can make the call to the Sub using the contents of
the
> > variable?
> >
> > Thanks,
> > Craig
> >
> > --
> > Message posted via DotNetMonster.com
> > http://www.dotnetmonster.com/Uwe/Forums.aspx/dotnet-vb-net/200609/1
> >
> >