>Hi All
>Is macro sustitution available in Visual Basic .NET Like VFP
>
>Ex. In vfp we can call a function by putting the function name in the variable.
>
>myfunction = "Function007"
>do &myfunction
>
>is such thing possible in .NET
As Cetin mentioned this is not possible but by using Reflection. At first, I thought this was a very difficult thing to handle. But, after having used it at several occasions for various needs, it is not so difficult after all. I was able to achieve all my goals so far, based from VFP upscaled code to .NET, where I had such need. As for this one, try this:
Dim loClass As Type = Nothing
Dim loObject As Object = Nothing
Try
loClass = Type.GetType("YourClass")
loObject = Activator.CreateInstance(loClass)
Catch loError As Exception
oApp.ErrorSetup(loError)
Return False
End Try