[ARCHIVE!] Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Can't go anywhere without you - 4. - page 166
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
Thank you
Hi all. Can a function return multiple values (comma separated) ?
return(1,2)
Or is it nonsense? :)) I just need to specify lot and order price. It's not rational to write two functions for it.
The function can return a value in the parameter passed to it by reference &
the function can return a value to the parameter passed to it by reference &
Where can I read more about it? I can't find it in the documentation here on the site. Thank you very much in advance.
Where can I read more about it? I can't find it in the documentation here on the website. Thank you very much in advance.
https://docs.mql4.com/ru/basis/variables/formal
Hi all. Can a function return multiple values (comma separated) ?
return(1,2)
Or is it nonsense? :)) I just need to specify lot and order price, but it's not rational to write two functions for it.
The number is unlimited.
Hi all. Can a function return multiple values (comma separated) ?
return(1,2)
Or is it nonsense? :)) I just need to define the order price and lot, but it's not rational to write two functions for it.
Formally, it cannot. I.e., the function returns one value, but it may return a structure or a class (which is the same thing). Unfortunately, in MQL4 it is impossible, except for returning a structure that fits into 4 bytes (int). Then the information can be extracted using bitwise operations. Also you can experiment with DOUBLE and STRING.
function can return a value in the parameter passed to it by reference &
... except for the return of a structure that fits within 4 bytes (int). Further information can be extracted using bitwise operations.
You can alsochop upint in pieces with division(/) and remainder of division(%) operations.
It's easier to return a string and then parse it, you can put a lot of information there :)
You can alsochop an int into pieces using division(/) and remainder of division(%) operations.
You can also experiment with DOUBLE and STRING.