Here is actual test code:
Set clr_input in input dialog as clrNONE .... return clr_input=255,255,255
#property strict #property script_show_inputs input color clr_input=clrRed; // try set: clrNONE but in user´s input dialog! No in code mql4. //+-------------------------------------+ -----+--------------------------- //| Script program start function | | //+-------------------------------------+ | void OnStart() // \|/ { // V Alert("clr_input=",clr_input); // output: clr_input=255,255,255 color clr=clrNONE; Alert("clr=",clr); // output: clr=clrNONE }
Intrusting. But it works ok.
endy5: 2) How check if user set on input color clrNONE?
| Why do you care what color the user has set a line to? Just draw the line. |
eevviill:
Intrusting. But it works ok.
Intrusting. But it works ok.
very interesting row: inputs: clr_input=....
WHRoeder:
endy5: 2) How check if user set on input color clrNONE? | Why do you care what color the user has set a line to? Just draw the line. |
if (<user_input_set_clrNONE>) SetColorScheme_Auto() else SetColorScheme_User();
By MT4: clrNONE is the same as 255,255,255 but in documentation is clrNONE have value "-1" ... Have I error somewhere?
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
Section 1: (input data for script, indicator, EA)
input color clr=clrNONE; // or extern color clr=clrNONE; declaration by user
OnStart() // or OnInit()
Alert(clr); // return 255,255,255
or
Section 2:
OnStart()
{
color clr=clrNONE; // declaraion inside
Alert(clr); // return clrNONE
}
My questions:
1) Why?
2) How check if user set on input color clrNONE?
Ad Section 1) condition as: if (clr==clrNONE) is unsatisfiable. 255,255,255 (white) is always different clrNONE (value -1 by documentation MQL)