locked
How to create a macro language RRS feed

  • Question

  • Hi

    I would like my application to have a macro language that among other things can execute small scripts at runtime to test certain conditions and set object attributes in my application. Any suggestions on how to achieve this? Can C# be executed runtime or should I rely on the VB Script engine?

    Any suggestions on how to approach this?

    Rgds

    Bertrand

    Tuesday, September 26, 2006 12:33 PM

Answers

  • There are basically two ways you can do this.  Either you can create, compile, and run .NET code at runtime, or you can use an interpreted language.  If you do the former, you'll have to package your runtime code into a static method or the like, compile it, load the resulting DLL into your application domain, and then use reflection to call the method.  If you want a runtime interpreter (which will probably lead to less overhead), one possibility would be to use the Lua Engine.  A .NET binding for Lua is available at http://www.lua.inf.puc-rio.br/luanet/.  The VB Script engine might be a possibility as well, but I don't know anything about it.
    Tuesday, September 26, 2006 3:51 PM