GET/SET IL Code

edited 4:40AM in FastScript
Hi.

Have just registered and am playing with fastscript 1.5. In particular, I am looking at using GetILCode and SetILCode, precompiling script then saving it for execution later, based on user actions.

The reason I am doing this is so the application runs as quickly as possible (it's a real-time application).

It was my understanding that GetILCode essentially grabs the compiled code currently in the Script control. Later, SetILCode should return the Script control to the code-based state it was in when I called GetILCode.

My observation, however, is that SetILCode appends the memory stream to whatever IL Code is already in the Script control.

I do not wish to call Clear, as there are numerous calls to addvariable, addmethod, etc, and the point of using Get/Set ILCode was for the quickest execution speed possible.

Is this a bug or expected behaviour?

Other than that I am very pleased so far with how the control works and is performing.

Comments

  • edited 4:40AM
    If you use one TfsScript component for all scripts, you have to call Clear method before you compile a new script or before SetILCode call. You can use two TfsScript components if you don't want to clear previously added variables/methods. First fsScript1 can be used for adding user items; second fsScript2 should have property Parent = fsScript1 and can be used for compiling and executing a script.
  • edited 4:40AM
    Thankyou, Alex.

    That works exactly the way I want.

    Fantastic response time on my query - gives me alot of confidence in your product!

    Kind regards,
    Aaron

Leave a Comment