Styler formatting
It seems not to recognize else if
it transforms them into else, then if
Here is some test code
and once passed through the styler
This bothers me.... Can we do something to keep the else ifs?
THANKS
There is nothing wrong with that. In fact, it is showing you the correct levels of the code.
In this case, it would be much better to use a "switch" operator instead of the multiple "if".
- www.mql5.com
I think I found
In tools => options, styler tab choose "google" for example and the "else if" are kept.
Formatting on anything else isn't quite how I want it, but it will be fine
int value = 5; if (value == 1) { Print("Value is 1"); } else if (value == 2) { Print("Value is 2"); } else if (value == 3) { Print("Value is 3"); } else if (value == 4) { Print("Value is 4"); } else { Print("Value is not 1, 2, 3, or 4"); }
Good morning
I have a problem with the styler accessible in tools => Styler
It seems not to recognize else if
it transforms them into else, then if
Here is some test code
and once passed through the styler
This bothers me.... Can we do something to keep the else ifs?
THANKS