A quick help with functions.

Kailash Bai Mina  


I want to show my function's input like that.

normally it is : [Variable Type][Space][Variable Name]

I want :   [Variable Type][Space][Whatever I Want (eg :  flags=TIME_DATE|TIME_MINUTES)]

A little Help Will Be Really Appreciated.

Kailash Bai Mina  
Fernando Carreiro #:

I am having difficulty trying to understand what it is you want. Please explain more.

However, irrespective of what you want, remember that the like all languages, MQL has a set number of rules and that you have to follow those programming rules.

See the image.


TimeToString is a predefined Function.
So, they can do anything with it they want and show int flags=TIME_DATE|TIME_MINUTES.

But I just want to know that is this possible for us to do this and show something like that(red marked) in that above yellow box?

Kailash Bai Mina  
Fernando Carreiro #:

I am having difficulty trying to understand what it is you want. Please explain more.

However, irrespective of what you want, remember that the like all languages, MQL has a set number of rules and that you have to follow those programming rules.

My main point : 

when I create enum I set the values inside it as ORDER_TYPE_OPEN, ORDER_TYPE_PENDING, ORDER_TYPE_BOTH.

and after I use that enum in the function's input.

It would be great if i can show  ORDER_TYPE_OPEN|ORDER_TYPE_PENDING|ORDER_TYPE_BOTH in yellow suggestion/input/idk  box.

Fernando Carreiro  
Kailash Bai Mina #: My main point : when I create enum I set the values inside it as ORDER_TYPE_OPEN, ORDER_TYPE_PENDING, ORDER_TYPE_BOTH. and after I use that enum in the function's input. It would be great if i can show  ORDER_TYPE_OPEN|ORDER_TYPE_PENDING|ORDER_TYPE_BOTH in yellow suggestion/input/idk  box.

That is not the meaning of the help provided in the pop-up tooltip for the function TimeToString. It is not showing the "options". It is showing that the default value for flags is "TIME_DATE | TIME_MINUTES" which is the mathematical "OR" of two constants. It is in fact a single value calculated from "ORing" the two constants which is assigned as the default value for that parameter. They are bit flags, not enumerations. It has nothing to do with a selection from a list of possible enumerations.

Kailash Bai Mina  
Fernando Carreiro #:

That is not the meaning of the help provided in the pop-up tooltip for the function TimeToString. It is not showing the "options". It is showing that the default value for flags is "TIME_DATE | TIME_MINUTES" which is the mathematical "OR" of two constants. It is in fact a single value calculated from "ORing" the two constants which is assigned as the default value for that parameter. They are bit flags, not enumerations. It has nothing to do with a selection from a list of possible enumerations.

So, If it gets the job done (setting a deafult value)
I am ok with it




why am i not able to do that?

Fernando Carreiro  
Kailash Bai Mina #: why am i not able to do that?

Because its a user function and the compiler automatically calculates the resultant constant to be used as the default value.

Kailash Bai Mina  
Fernando Carreiro #:

Because its a user function and the compiler automatically calculates the resultant constant to be used as the default value.

So how can i do it like that predefined funtion (TimeToString)?

Fernando Carreiro  
Kailash Bai Mina #: So how can i do it like that predefined funtion (TimeToString)?

You can't!

Kailash Bai Mina  
Fernando Carreiro #:

You can't!

Ohh,
Thanks for your time and knowledge.
Reason: