How to write a function like Print(...)

 

Hi,

I want to know how the Print(...) function was coded, because I want to write such a function myself,

which takes infinite number of parameters.

Does anyone know? 

 
You can't do that directly in MQL. But you can write a function with several last parameters having default value. Also you may define multiple functions with the same name but different parameter list.
 
Stanislav Korotky:
You can't do that directly in MQL. But you can write a function with several last parameters having default value. Also you may define multiple functions with the same name but different parameter list.
Thanks!
 
Stanislav Korotky #:
You can't do that directly in MQL. But you can write a function with several last parameters having default value. Also you may define multiple functions with the same name but different parameter list.

Hi,

as of 2022, is this still true? :/ Giving my attempts, it seems so, but I may be doing it wrong.

 
Martin Bittencourt #: as of 2022, is this still true? :/ Giving my attempts, it seems so, but I may be doing it wrong.
There have been no changes and it still holds true.
 
Fernando Carreiro #:
There have been no changes and it still holds true.

Sad. I hope someday they will add this possibility :T

Thanks!

Reason: