Annulé

Compile VB code on the fly

I have a program which can run vb.net code using CodeDom compiler. Basically it helps me to add programming functionality to my application. This is not too tough and such a sample can be found in codeproject website :

[url removed, login to view]

What I have done is :

I have 2 modules :

Module 1: Initializes and runs the script engine by sending code user may have typed.

Module 2: The script engine has access to this module, so here I can declare the sub/functions which the user can call in his code.

Good news: It's running fine.

Bad news: The module style is a problem if I want multiple code to run simultaneously. This is what we need to solve.

I want to create multiple instances of the engine & code so that each can run independently and don't modify each other's values.

Example:

Public Module RunCode

Friend Age as integer = 20

Sub Run()

' executing user code

' init script

[url removed, login to view]("[url removed, login to view]")

[url removed, login to view]("[url removed, login to view]")

[url removed, login to view]("[url removed, login to view]")

results = [url removed, login to view](parameter, usercode)

End Sub

End Module

Public Module Module1 ' user has access to functions/subs here

Sub IncreaseAge(ByVal A as Integer)

Age = Age + A ' var age declared in modulerun code is modified here

End Sub

End Module

' Code user will write

Call IncreaseAge(5) ' increments age by 5 years

What needs to be done ?

What I want is to convert the module to classes so that I can create objects of the classes and run the program. This way the variables (age in the above example) is not tampered with. Each object will have can keep its own value. Otherwise right now if I run multiple instances of such a program each one will modify the age variable can this can lead to unexpected results.

Plus I do not want user to write code as [url removed, login to view](5). The user will write normal vb code (without objects etc) but I have to have have instance of class so that variables in objects are independent and multiple execution of usercode can take place without any execution modifying common variables.

Interested freelancers should know vb.net well and I will be happy to answer any questions you may have.

Compétences : .NET, Architecture Logicielle, Visual Basic

Voir plus : write programming code, what is com in vb.net, what is a variable in programming, what is a module in programming, what is a class in programming, what are classes in programming, visual basic programming code, visualbasic programming, visual age, vb.net articles, vb articles, variables in programming, using functions in vb.net, tough questions, runcode, programming with microsoft visual basic 2012, programming what is a class, place code, net programming questions, microsoft visual basic programming, http www freelancers net, good and the bad, functions in vb.net with example, freelancers vb net, freelancers that know c

Concernant l'employeur :
( 24 commentaires ) New Delhi, India

N° du projet : #1607912

4 freelance font une offre moyenne de $219 pour ce travail

SKMSystems

I'm a .Net expert and I can handle this issue. Please contact me for further details.

177 $ USD en 7 jours
(4 Commentaires)
4.0
radpalani

I have 15 + years of experience in Microsoft Technologies and one of 5000 MCAD Member's in .net plaform.I worked almost all Microsoft technologies. I understand your [url removed, login to view] could be delivered on monday if you Plus

250 $ USD en 2 jours
(0 Commentaires)
0.0
RuturajG

I have 9+ years experience on IT, I was done report designer which creates run time design and any database connectivity, done ERP project for non financial company.

200 $ USD en 20 jours
(0 Commentaires)
0.0
CBCIndia

Please check the PM.

250 $ USD en 7 jours
(0 Commentaires)
0.0