Is it possible to have a dynamic operator? I know I could parse it out and find the symbol just wondered if it was possible.

string aString = "5";
int a = 5;
int b = 6;
string op = "<";

//want to do something like dynamically without checking the value of op
if( a op b)

//want to use the same thing like this
Int32.TryParse(aString, out a);

Operator.TryParse(op, out );

just need to create my own class to do this? or is there somthing i am forgetting

appreciate your help

Could you tell me what is your final purpose may I give you better idea

I'm not going to do it this way, i just need a quick app put together

i have a testing application that is loading an xml file that has conditional operators in it

<Variable>numIterations</Value>
<Condition> < </Condition>
<LimitNum>10</LimitNum>

rather than doing a switch on the condition string, i wondered if it was possible to use something like i stated up above

If you have a class that leavrages your entire activity then you can implement IComparable interface method CompareTo() it is the best solution

yeh thats what i'll do, just trying to see if there was some trickery that i had forgot

thanks jugortha

Not at all, you're welcome

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.