seems like it's impossible to create such macro to deal with any amount of variables, like Print function does
Yes indeed, unlike C preprocessor, the MQL preprocessor does not support variadic macros that accept a variable number of arguments like #define PRINT(...).
amrali #: Yes, indeed, unlike the C preprocessor, the MQL preprocessor does not support variational macros that take a variable number of arguments, like #define PRINT(...).
h ttps:// gcc.gnu.org/onlinedocs/cpp/Variadic-Macros.html
Edit:
Workarounds, such as the previously published TOSTR(), can be used to support multiple Print() arguments.
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
seems like it's impossible to create such macro to deal with any amount of variables, like Print function does
You can use workaround solutions like the previously posted TOSTR() to support multiple arguments to Print() function.
I already did that here: https://www.mql5.com/en/forum/393227/page298#comment_56271584
Yes, indeed, unlike the C preprocessor, the MQL preprocessor does not support variational macros that take a variable number of arguments, like #define PRINT(...).
Offtopic, but want to correct. Highlighted:
Itis better to write "Added". It will be more correct in Russian.
Because "Edit" is not the right verb form to use here.
For general development ;)
Okay, thanks, Artyom. Now I realise that auto-translation eng->rus can sometimes change the meaning.
Yes. Nothing is perfect)
UPD: Here the meaning is not lost. It makes sense, but it looks "jaggy". Closer in meaning would be "Edited:"
Undocumented DEAL_TYPE: so compensation.
Undocumented DEAL_TYPE: so compensation.
Is it a type for draining the account to zero?
Some variable has a value of -1.
Which check will be executed faster to check this value: < 0 or == -1?
Some variable has a value of -1.
Which check will be executed faster to check this value: < 0 or == -1?
I can suppose that <0, because it is one machine command, and ==-1 - comparison with a constant to be loaded. But it depends on the compiler.
Also, it will only appear in some way in a rather large loop.
I can assume that <0 is a single machine command, and ==-1 is a comparison with a constant to be loaded. But it depends on the compiler.
Also, it will only appear in some way in a rather large loop.
https://godbolt.org/
And how many clock cycles and what instruction it takes - dig it yourself, if you are interested)))))
IMHO, in practical terms, it is absolutely unimportant.