Just found an answer to my own question in the form of "StringLen()" - this returns 0 if the string has not yet been assigned a value.
NULL is just macro for 0. There is useless to compare some string with NULL. There is no way to determine exactly uninitialized string. You can analyze last error. see stdlib.mq4 it should be errors 4008 and 4009
Thanks for the info!
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
anyArray[10];
if (anyArray[6] == johnny) etc.etc
returns a "not initialized string in array" error. A 'Print(anyArray[6]);' command produces a "(NULL)" but I can't find any way of checking to see if a string array element (or string variable) has actually been assigned something. I've tried 'if (anyArray[6] == "")' , 'if (anyArray[6] == "NULL") and 'if (anyArray[6] == "(NULL)") but get the above mentioned error every time. Any ideas?