Download MetaTrader 5

How to make the user select from a list of inputs for a particular input ?

To add comments, please log in or register
KoT 009
44109
KoT 009  

Normally if we include a string input, one can enter any string.

But i want to restrict to choose from a list of 3 strings just like in a combo box. 

Alain Verleyen
Moderator
31203
Alain Verleyen  
chandra100:

Normally if we include a string input, one can enter any string.

But i want to restrict to choose from a list of 3 strings just like in a combo box. 

Use an ENUM.
Simon Gniadkowski
Moderator
18004
Simon Gniadkowski  
chandra100:

Normally if we include a string input, one can enter any string.

But i want to restrict to choose from a list of 3 strings just like in a combo box. 

Something like this . . .

input ENUM_MA_METHOD MA_Method=MODE_SMMA;

from here: https://www.mql5.com/en/docs/basis/variables/inputvariables

Documentation on MQL5: Language Basics / Variables / Input Variables
Documentation on MQL5: Language Basics / Variables / Input Variables
  • www.mql5.com
Language Basics / Variables / Input Variables - Documentation on MQL5
KoT 009
44109
KoT 009  
angevoyageur:
Use an ENUM.
Thanks. i think it will work for user created ENUMS too.
To add comments, please log in or register