Execute a String

  • Thread starter Thread starter Fabio
  • Start date Start date
F

Fabio

Hi all,

for example:
I have the string

Dim Test as String = "me.bt_test.enable = false"

Now I want to "execute" the string that will disable the button.

How can I do this???

Thanks in Advance
 
That's going to be next to impossible.

There is a way to dynamically generate and compile code. However, that code
has to be a class with methods you can call. So after dynamically creating
and compiling this class, you need to create an instance of it using
reflection, and then invoke it using reflection, and have it do something.

This class would of course have no idea about 'bt_test' or anything like
that, so you would have to pass that in. And in the end, it would be pretty
clugy, and of course not at all generic, not to mention very slow.

So i would recommend you find another way to achieve whatever it is you are
going for.
 
Back
Top