Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Indirect procedure call
Message
De
20/01/1999 09:52:42
 
 
À
20/01/1999 09:32:20
Information générale
Forum:
Visual Basic
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00176211
Message ID:
00177987
Vues:
33
>>>Hi everybody,
>>>
>>>I have 76 procedures .These procedures process different tasks.
>>>I read the names of these procedures into a string variable.
>>>How can I call a procedure if the name of the procedure is in a string variable?
>>>I tried to use scripting control but no success so far.
>>>Thanks,
>>>Vlad
>>
>>If you use VB5, I would say... make a by Select Case statement. I don't think of another way to do that.
>>
>>If you use VB6, take a look at the CallByName statement. It allows you to call a method or a property from a string!!!
>
>
>Eric,
>
>My office is trying to convert a U.S. and State/County thematic mapping program that we wrote in FoxPro 2.6 into VB 6.0.
>
>We are faced with the same problem. We found the CallByName command in VB6; but, couldn't figure out just how to use it - we're new to VB. Could you give me an example of the sytax we need to use?
>
>Thanks,
>
>Dan


Hi Dan,
this is what we did:

result = CallByName(objloader, callstr, VbMethod, ar_dbs(), db, Form1)
where objolader is the instance of the class,
callstr= property name
and the parameters the procedure take( in our case array, database and form)

Good luck!
Regards,
Vlad
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform