Executing Dynamically Generated VB Source Code  
Author Message
Gustav OK





PostPosted: Common Language Runtime, Executing Dynamically Generated VB Source Code Top

I have had good success generating machine instructions (binary) and having them executed within a C++ Subroutine framework, however I have no idea how to accomplish this task using VB using it CLR

Example;

Public Class DynamicVB

public a as integer

public b as integer = 1

public c as integer = 2

public vbsource as string = "a = b + c"

public function validateVB(vbsource) as string

'compile within the context of this class (DynamicVB) and return

'error messages that the system generates

end function

public function executeVB(vbsource) as boolean

---lines of code that do something

---execute the vbsource string

---final lines of code and return with a status that I generate

end function

end class

Please Help me solve this problem.

Thanks,...Gustav



.NET Development35