GET/SET IL Code

edited 6:24AM 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 6:24AM
    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 6:24AM
    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

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.