I am trying to say "if variable is NOT greater than or equal to, then do this"

Here is how I tried to write it:

if(mouse_x !>= 300){
blah blah blah
}

But my complier doesn't like that. Does anyone know what I did wrong? Thanks.

The not operator goes to the front. But in your case, I would suggest not using the not operator at all, and instead use the < operator. The reason for this is because the less than comparison is the opposite of >=; just like <= is the opposite of >.

if (mouse < 300){ // Does the same thing that you want
// ...
}

As for properly using the not operator, you could have done something to the effect of:

if (!(mouse >= 300)){ // Technically the same as "if (mouse < 300) {}"
// ...
}

I hope that this helps. :)

commented: nice explanation +2
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.