CodeDom and CodeBinaryOperatorType, no "not equal"

G

Glenn Roberts

Hi,

I've been using CodeDom to generate and compile source code...
.....but, have found that in the CodeBinaryOperatorType (used when making a
CodeBinaryOperatorExpression), there is no "not equal"
.....there are the usual, equals, greater than etc...but no, not equals.

I would have thought not equals is also a common enough relation.
What is the easiest way to represent a not equals ?

I have 2 expressions, and simply want to say something like;

if ( a != b )
{
...etc
}

I have the 2 expressions, a and b, represented as CodeDom objects...and
simply want to see if they are not equal. I'm not sure if I could use a
CodeSnippet somehow, to combine them ?

I don't seem to be able to use a "not" operator. to try and do an equals,
and then negate it..
...because, annoyingly, there is no "not" operator either...

I guess I could do something like,

if ( ( a> b) | ( a < b) )

but..this seems pretty messy !

any advice appreciated,
thanks !
 
G

Glenn Roberts

Or...can I use the IdentityInequality operator ?
There is IdentityEquality, and ValueEquality.
I was assuming I wanted something like ValueInequality
....but, does IdentityInequality work ?

...I better try it ! ;)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top