Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Macrosubstitution in VB.NET
Message
 
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Divers
Thread ID:
01010831
Message ID:
01011053
Vues:
17
Hi, David.

>In VFP the function Evaluate or macrosubstitution is used to execute a string...
>
>as that in VB.NET can be done??
>
>For example:
>
>Dim oObj as String
>oObj = "Form1.Text4.Text"
>&oObj = "Test"

As others pointed, you can use Reflection to do it, and Rick explains this perfectly in his papers. However, have in mind that in many cases you have other means to solve this. VFP developers are very accustomed to use this as it is easy and performs well enough in most cases, but non-VFP developers never had such a feature so readily available and didn't need it.

My recommendation would be to think about other approaches, and use dynamic code as a last resort. It is not only a performance issue. In many situations the performance impact is negliglible, but the problem is that you relax many many analysis features, as the ability to parse and refactor that code, leverage compiler checking, etc.

Saludos,
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform