How to create a "enum" style input in MC

Questions about MultiCharts and user contributed studies.
User avatar
BB123
Posts: 69
Joined: 24 Nov 2023
Has thanked: 23 times
Been thanked: 11 times

How to create a "enum" style input in MC

Postby BB123 » 03 Jan 2024

Trying to figure out how to create a Enum based input..... So a input where there is a drop down menu with multiple options and i can select one of them...
Here is a example.. This is just a example... I know we dont use months like that in PL-- but im trying to figure out how to be able to select one of a few options for a input..

example:
enum months
{
January,
February,
March,
April,
May,
June,
July,
August,
September,
October,
November,
December
};

User avatar
BB123
Posts: 69
Joined: 24 Nov 2023
Has thanked: 23 times
Been thanked: 11 times

Re: How to create a "enum" style input in MC

Postby BB123 » 07 Jan 2024

This is for anyone else looking for a answer to this..

The answer is-- MC doesn't do enum's

What you can do is have a input and then a if statement and do it that way..

example:
Vars: MyOptions(1);

if MyOptions = 1 then begin
do this;
end
else if MyOptions = 2 then begin
do that;
end
else if MyOptions = 3 then begin
do what:
end;

There is probably a more efficient way to code this but this should work and gets the job done..


Return to “MultiCharts”