Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Using the value contained in a string as a variable name
Message
 
 
À
Tous
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Titre:
Using the value contained in a string as a variable name
Divers
Thread ID:
00853175
Message ID:
00853175
Vues:
57
Hi all,

In VFP you can use the contents of a string as a variable:

nVar1 = 10
strVar = "var1"
nSum = &strVar + 1
* Result nSum = 11

Or as the name of a control:

strControlName = "myControl"
thisform.&strControlName..Caption = "Hello"

Or like this:

strCmd = "messagebox("Hello")"
&strCmd

Now for my question:

How can I reference the contents of a string in VS.NET (VB or C#) as shown above?

Best,
Vera
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform