vassilych / cscs

CSCS: Customized Scripting in C#

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Operating on host project data

gmcfarlane opened this issue · comments

Hello sir

thank you for the cool work. I have been looking for this, originally found the mdsn articles...

I have a project that deals with financial data. I have projects, cashflows, etc.
I want to be able to let the user do some basic scripting and say 'this instance should be the sum of those things...' etc.

i originally pulled the code off msdn. After thinking about a lot of approaches... embedding delegates, i decided the most straight forward way was to make the parser not be a singleton.
Instead, i make a parser instance, and pass data into that, then all the functions have access to the parser.

i considered passing data into the singleton, but figured it was a matter of time before two scripts walked on each other. the data would essentially be a global.

I ran into an issue w/ the msdn code and found this github.

I am going to do some testing and make sure i dont have the same basic problem here.
Assuming that checks out, how would you suggest integrating host project data?
I see there is one other issue that essentially asking for the same thing.

Hey there. Upon studying the new codebase, I realize that you have made a lot of progress. Very much appreciated. I have put my data in the parserScript object. This gets passed along w/ each script and is precisely what was needed to solve my issue.
It also addresses the concern i had about 2 scripts fighting w/ each other over the global variables in your previous version!

awesome work sir.

greg

Hi Greg,

The new version now has support for multiple interpreters, take a look.
No more global shared variables.

Cheers,
Vassili

Not sure what does it have to do with CSCS? You provided C# code, not CSCS...