R
Roderick.Buhagiar
Is it possible to create dynamic code which is not part of a class ?
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Is it possible to create dynamic code which is not part of a class ?
Hello Roderick,
generally yes,
see:http://www.codeproject.com/useritems/Run-Time_Code_Generation1.asp
Regards
Frank
- Show quoted text -
then this:http://www.codeproject.com/cs/algorithms/matheval.aspwould fit
your needs
Regards
Frank
- Show quoted text -
Is it possible to create dynamic code which is not part of a class ?
Thanks a lot, but i was checking if it is possible to say for
example...
string mycode = "Console.WriteLine("Hello");";
then compile and run the code in mycode without putting in a class
name etc.. thanks.
Well, you could always have an autogenerated (or even fixed, dummy)
class name, and the rest of the class structure. It's a bit ugly,
given that it'll have to generate a whole assembly etc, but I don't
know of any other way of doing it.
Jon
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.