Is this
the same as this:
As it is said in https://www.mql5.com/en/docs/basis/types/object_pointers;
> To quickly validate the pointer, you can also use operator "!" (LNOT) which checks it via an implicit call of the CheckPointer function.
>CheckPointer will check if the object actually exists, even if the value in pointer is not NULL.
I know, the question was:
Isif(pointerObj == NULL || CheckPointer(pointerObj)==POINTER_INVALID){..}
the same as
if(!pointerObj){..}
Yes or no?
According to the documentation, "This is checked by an implicit call to the CheckPointer function." I don't know what kind of pointer check is performed (I suspect POINTER_INVALID) AND whether the pointer is also checked for NULL behind the scene when doing if(!pointerObj). That's the questions, nothing else.

- www.mql5.com
>CheckPointer will check if the object actually exists, even if the value in pointer is not NULL.
I know, the question was:
Isthe same as
Yes or no?
According to the documentation, "This is checked by an implicit call to the CheckPointer function." I don't know what kind of pointer check is performed (I suspect POINTER_INVALID) AND whether the pointer is also checked for NULL behind the scene when doing if(!pointerObj). That's the questions, nothing else.
>CheckPointer will check if the object actually exists, even if the value in pointer is not NULL.
I know, the question was:
Isthe same as
Yes or no?
According to the documentation, "This is checked by an implicit call to the CheckPointer function." I don't know what kind of pointer check is performed (I suspect POINTER_INVALID) AND whether the pointer is also checked for NULL behind the scene when doing if(!pointerObj). That's the questions, nothing else.
Your second if-statement is a single, implicit call to CheckPointer, validating the pointer. It will be false if CheckPointer returns POINTER_INVALID.
if(!pointerObj){..}
also return false if pointerObj is NULL?
Otherwise, only the following statement
f(pointerObj == NULL || !pointerObj){..}
is the same as
if(pointerObj == NULL || CheckPointer(pointerObj)==POINTER_INVALID){..}
Am I right?
The question is valid, but still answered already.
I know my question is valid. And your answers aren't!
I can't see a simple yes or no from any of your answers —my questions are very direct and crystal-clear, aren't they? I know you maybe want to help—but please don't answer if you can't give clear, direct answers!
Look at your answers; is there a "yes" or "no"? Why don't you just answer "yes" or "no" instead of giving an indirect answer with a lot of room for interpretation and wasting my time with your trivial, unhelpful answers. The summary of your answers:
You said:
"Your second if-statement is a single, implicit call to CheckPointer, validating the pointer. It will be false if CheckPointer returns POINTER_INVALID."
I know! That's not the question! And will it be also false if the pointer is NULL.That's the interesting part which you do not say.
You said:
"CheckPointer will check if the object actually exists, even if the value in pointer is not NULL."
Such a contradictory answer! Even if the value in the pointer is not NULL? Again, especially for you:
CheckPointer checks whether the object actually exists, even if the value in the pointer is NULL." That would be a straightforward answer.
But you're causing a lot of confusion on this topic—even though it's a clear yes-or-no question. So please stop answering like that!
Again – for everyone else who knows how to answer a simple yes or no question correctly
Is this
if(pointerObj == NULL || CheckPointer(pointerObj)==POINTER_INVALID){..}
the same as
if(!pointerObj){..}
Yes or no
I know my question is valid. And your answers aren't!
I can't see a simple yes or no from any of your answers —my questions are very direct and crystal-clear, aren't they? I know you maybe want to help—but please don't answer if you can't give clear, direct answers!
Look at your answers; is there a "yes" or "no"? Why don't you just answer "yes" or "no" instead of giving an indirect answer with a lot of room for interpretation and wasting my time with your trivial, unhelpful answers.
Again – for everyone else who knows how to answer a simple yes or no question correctly
Is this
the same as
Yes or no?
No ? Not so easy.
Maybe. It depends to what is applying the "same" ?
Strictly speaking they are not the same as they are different.
Semantically they are not the same as we don't know how '!' is implemented with a pointer. Maybe !ptr is replaced by ptr== NULL || CheckPointer(ptr)==POINTER_INVALID by the compiler ?
The final result is the same though. No ?
When checking via "!" You are checking by CheckPointer() == POINTER_INVALID
I don't know if the syntactical simplification if(!pointer) also checks for NULL. But apparently not.
Nevertheless, A little tip:
Please don't answer such simple yes-or-no questions with contradictions or uncertainties – that is neither polite nor helpful. And if you don't "want" to answer such easy questions directly, then don't answer - that's not correct!

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Is this
the same as this:
if(!pointerObj){..}
As it is said in https://www.mql5.com/en/docs/basis/types/object_pointers;
> To quickly validate the pointer, you can also use operator "!" (LNOT) which checks it via an implicit call of the CheckPointer function.