Information générale
Catégorie:
Codage, syntaxe et commandes
>>>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
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement