compile or modify .cs file at runtime

Hi there guys.

I have the following challange:

My users must be able to type in a math formula and this must include some variables. I have been messing around with accessing javascript eval, but that is just not working for me. So my question is this, can I compile a .cs script at runtime and based on some info that I read from a setup-textfile create a new c sharp script? Is this possible at all and will I be able to run that script from within my application? Maybe have an existing script and modify it? I don’t know…

Any help with thi surgent problem will be greatly appreciated.

Thanks

Doubt it.

Why don’t you simply interpret it yourself?

Quick google:

Thanks for the reply NPSF

I have been looking at a lot of stuff out there. I can’t see that the one that you send will work since it is limited to basic opperators and I need almost all math features as well as being able to pass parameters (or rather variables).

Then I guess your going to have to spend some time coding :slight_smile:

This is basic programming, why the hell would you want to edit the source code? lol

Take a look at C# tutorials for making calculators, it’s one of the first things you do on any programming course, just after “hello world”.

no callahan

You have a complete misinterpretation of what I’m doing, hence you sarcastic reply…
If you can’t be helpful, rather shut up.