You can use e.g. bool x = (bool)StringCompare("false", line[4], false); // 0 (null), if "false"== line[4]
(Just typed not tested!)

Dokumentation zu MQL5: Stringfunktionen / StringCompare
- www.mql5.com
Vergleicht zwei Strings gibt das Ergebnis des Vergleichs als Ganzzahl zurück. Parametsr string1 [in] Der erste String. string2 [in]...

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
Hello there, this is for information. I have recently struggled to convert string to bool in MQL5.
Thanks to the tip of a friend, I could resolve it. I want to post it here, in case somebody has the same problem.
The source field is a string, which has either "true" or "false".
Important, this must be small letters, not capital letters.
The target field is of type bool.
This conversion will bring back "TRUE" if the source is "true" and "FALSE" if the source is "false".
just to explain: my source-field is in an array, and it is in the 4th place.
the target field is called
it is another field in an array