Hey guys, welcome back. So in this video we're going to discuss the knot logical operator. So the knot logical operator, what it does is that it converts true values to false and vice versa. So we will also convert to false value to a true. So here in this simple macro here, we're going to create a variable which is x, and we're going to put a value of three to the x variable. And then we're going to have an if statement here.
So here on the first part of the if statement, it says, if not x is equal to three, then give me a message box x is not equal to three. So basically, x is equal to three, this part here will yield a true because x is actually equal to three. However, because it's put inside a not logical operator, this means that this true yielded by this part, will actually become a force. So this whole thing will become a false. So that means that this if statement, when executed, it's not going to go and execute the message box because the condition here, which is not x equal to three is equal to false, because you can see here that the form of an if statement here is that if condition is equal to true, then you can go ahead and execute the code. So this part here, not x equal to three is actually the condition and this is going to become a false, right because x is equal to three.
This is true, but because it's inside not, then it's going to become a false. Now if you look on the following, else, if part here we will see our x is not equal to three, this part here will yield to false but because it's put inside a knot, then it's going to be a two. So here the condition is going to be equal to true. And actually, we're going to have this message box executed x is equal to So let's run through that and see what happens. So here we're going to assign x equal to three. And then we're going to test this, this condition, not x equal to three is going to be a full.
So the message box, the first one here is not going to be executed. And then we're going to test the else if you're, and you can see here that the message box has been executed. So basically, in a nutshell, the non logical operator converts to true to a false or false to a true and it's important to know about that logical operator. You could find it in somebody else's code, or you could use it to convert a true value to a false or vice versa. So that's it guys for the not logical operator. Thank you very much for watching this video and I'll see you on the next one.