Click here to Skip to main content
15,920,704 members
Home / Discussions / C#
   

C#

 
GeneralRe: Thread restart Pin
Dave Kreskowiak24-Jun-04 7:08
mveDave Kreskowiak24-Jun-04 7:08 
GeneralRe: Thread restart Pin
elraton25-Jun-04 4:22
elraton25-Jun-04 4:22 
GeneralRe: Thread restart Pin
Dave Kreskowiak25-Jun-04 11:51
mveDave Kreskowiak25-Jun-04 11:51 
GeneralAbout password Pin
wk_vigorous24-Jun-04 5:12
wk_vigorous24-Jun-04 5:12 
GeneralRe: About password Pin
Colin Angus Mackay24-Jun-04 5:30
Colin Angus Mackay24-Jun-04 5:30 
GeneralRe: About password Pin
wk_vigorous25-Jun-04 0:37
wk_vigorous25-Jun-04 0:37 
GeneralRe: About password Pin
Colin Angus Mackay25-Jun-04 0:48
Colin Angus Mackay25-Jun-04 0:48 
GeneralRe: About password Pin
wk_vigorous25-Jun-04 2:00
wk_vigorous25-Jun-04 2:00 
GeneralRe: About password Pin
Heath Stewart24-Jun-04 5:41
protectorHeath Stewart24-Jun-04 5:41 
GeneralRe: About password Pin
wk_vigorous25-Jun-04 0:19
wk_vigorous25-Jun-04 0:19 
GeneralRe: About password Pin
Heath Stewart25-Jun-04 3:38
protectorHeath Stewart25-Jun-04 3:38 
Generalboolean expression evaluation Pin
narada10824-Jun-04 5:12
narada10824-Jun-04 5:12 
GeneralRe: boolean expression evaluation Pin
Dave Kreskowiak24-Jun-04 5:47
mveDave Kreskowiak24-Jun-04 5:47 
GeneralRe: boolean expression evaluation Pin
narada10824-Jun-04 5:52
narada10824-Jun-04 5:52 
GeneralRe: boolean expression evaluation Pin
Heath Stewart24-Jun-04 6:02
protectorHeath Stewart24-Jun-04 6:02 
GeneralRe: boolean expression evaluation Pin
Heath Stewart24-Jun-04 6:12
protectorHeath Stewart24-Jun-04 6:12 
There are a couple ways you could do this, including one way in the BCL (though not easy).

The first is to reference the Microsoft.JScript.dll assembly and use the Eval class. In JScript .NET, this would be equivalent of the eval method (also in Javascript and JScript, though those aren't compiled languages nor do they target the CLR). I believe I saw an article on this some time back on MSDN. I could be wrong, but you could try searching for it or just give it a try.

The other way is to use Reflection Emit or the CodeDOM. Basically, you create a class that contains those variables and contains a method which evaluates those variables and returns a bool.

Read Emitting Dynamic Assemblies[^] in the .NET Framework SDK for more information about Reflection Emit and Generating and Compiling Source Code Dynamically in Multiple Languages[^] for more information on CodeDOM.

 

Microsoft MVP, Visual C#
My Articles
GeneralRe: boolean expression evaluation Pin
Dave Kreskowiak24-Jun-04 8:03
mveDave Kreskowiak24-Jun-04 8:03 
GeneralRe: boolean expression evaluation Pin
Karl 200027-Jun-04 11:51
Karl 200027-Jun-04 11:51 
GeneralRe: boolean expression evaluation Pin
Anonymous27-Jun-04 20:49
Anonymous27-Jun-04 20:49 
GeneralC# Open Dialog Box Pin
HyVong24-Jun-04 3:21
HyVong24-Jun-04 3:21 
GeneralRe: C# Open Dialog Box Pin
Heath Stewart24-Jun-04 5:09
protectorHeath Stewart24-Jun-04 5:09 
GeneralRe: C# Open Dialog Box Pin
HyVong24-Jun-04 5:18
HyVong24-Jun-04 5:18 
GeneralRe: C# Open Dialog Box Pin
Heath Stewart24-Jun-04 5:45
protectorHeath Stewart24-Jun-04 5:45 
GeneralRe: C# Open Dialog Box Pin
HyVong24-Jun-04 5:49
HyVong24-Jun-04 5:49 
GeneralRe: C# Open Dialog Box Pin
HyVong25-Jun-04 3:25
HyVong25-Jun-04 3:25 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.