Call (stringvar), can this be done? 
Author Message
 Call (stringvar), can this be done?

Quote:

> I want to store the name of a procedure in a memory variable, then call
> the routine using the variable name.  If you must know, this is to be used
> in a STATE MACHINE application, in other words, data driven.  The
> application gets its flow by reading an external table into an array, then
> executing procecures in the order read

> For icounter = 1 to imax
>    sProcessName = saProcessName(icounter)
>    Call (sProcessName)
> Next icounter

> In Foxpro, it can easily be done with Macro Substitution, and in Clipper
> it can be easily done with Code blocks.  How can this be done in VB?

Store an ID (a constant integer) in the array and then call a subroutine
that
contains a "Select Case" with the appropriate procedures distributed
among
the "Case"s.  Example:

        Call Switcher(PROC_1)

        Sub Switcher(ID As Integer)
        Select Case
        Case PROC_1
                Call ProcOne
        ...

--
Charles C. Poston



Wed, 14 Jul 1999 03:00:00 GMT  
 Call (stringvar), can this be done?

I can't think of any direct way this could be done, though you could
approximate it with a select case statement listing all the available
subs...
--
Chris Behrens
Site Builder Network Level 2
http://www.deltav.net


"Outside of a dog, a book is a man's best friend.
Inside of a dog, it's too dark to read."



Quote:
> I want to store the name of a procedure in a memory variable, then call
> the routine using the variable name.  If you must know, this is to be
used
> in a STATE MACHINE application, in other words, data driven.  The
> application gets its flow by reading an external table into an array,
then
> executing procecures in the order read

> For icounter = 1 to imax
>    sProcessName = saProcessName(icounter)
>    Call (sProcessName)
> Next icounter

> In Foxpro, it can easily be done with Macro Substitution, and in Clipper
> it can be easily done with Code blocks.  How can this be done in VB?

> Thank You !
> Bill Custer



Sat, 17 Jul 1999 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Calling A Function (What am I doing wrong)

2. BAD DLL calling conventions - What am I doing wrong

3. Recordset: What am I doing wrong?

4. What am I doing wrong??

5. What am I doing wrong?

6. Help with syntax. What am I doing wrong

7. What am I doing wrong?

8. What am I doing wrong?

9. What am I doing wrong?

10. Please tell me what I am doing wrong - DAO parameter Append Query :(

11. Can this be done or am I dreaming?

12. Am I doing the OpenRecordset command correctly?

 

 
Powered by phpBB® Forum Software