enum day doesn't have a value does it? Unless value is re-assigned, Sunday will be value 0,Monday 1 etc
enum day
{
Sunday,
Monday,
Tuesday,
Wednesday,
Thursday,
Friday,
Saturday
};
Change them around
enum day
{
Saturday,
Friday,
Thursday,
Wednesday,
Tuesday,
Monday,
Sunday
};
and then Saturday will be 0, Friday 1 etc
I think he wants to display a chosen day like a string there is probably a way, but the documentation on using enums is true to form ...
I would like to know what is the point of gouping them in a named set.
OK after hacking at that with a script I think I got it now. Probably this description is technically wrong but for all intents it seems to be, creating the enum days set is kinda like defining a new data type, so you can declare a new variable of the days type .... then you could use it in EnumToString() ... You might be able to pass day directly to the create function I'm not sure about all that though.
enum days { Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday }; days day = 4; Print(EnumToString(day)); //prints Thursday
OK after hacking at that with a script I think I got it now. Probably this description is technically wrong but for all intents it seems to be, creating the enum days set is kinda like defining a new data type, so you can declare a new variable of the days type .... then you could use it in EnumToString() ... You might be able to pass day directly to the create function I'm not sure about all that though.
Thanks,
I've learnt something new there :)
Thanks,
I've learnt something new there :)
A new one probably : there is no need to create a new enum for days, it's already existing.
ENUM_DAY_OF_WEEK mylearningday=FRIDAY; Print("My learning day is ",EnumToString(mylearningday));
A new one probably : there is no need to create a new enum for days, it's already existing.
I what I did correct or is that an undocumented thing that might not work in the future ?
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Title pretty much says it all. How do I display on chart which day is selected with create object? Just throwing the variable name in there like so shows as '0' on chart.
enum day { Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday };