I have a dilema...
All of the recent posting about buttons got me back thinking about my favorite subject, buttons.
I want to make a button by calling
drawButtons();
in main()
function drawButtons(){
drawTextPixel(1, yHt, "34EMA "+ema34+"@URL=EFS:ema34OnOff", Color.blue, Color.red, Text.BUTTON|Text.RELATIVETOLEFT|Text.RELATIVETOBOT TOM, "Courier", 10, 10)
}
which calls ema34OnOff(), which sets a flag, ema34 to on or off and then redraws the button
function ema34OnOff(){
if(ema34=="On"){ema34="Off";}
else{ema34="On";}
drawButtons();
}
and then redraws the button
Then in main I either draw the ema or not...
if(ema34=="Yes) return vEMA;
return;
but for some reason the var ema34 is not making it out of the ema34OnOff function back to main.
var vEMA = new MAStudy(34, 0, "HLC/3", MAStudy.EXPONENTIAL);
What am I missing?
All of the recent posting about buttons got me back thinking about my favorite subject, buttons.
I want to make a button by calling
drawButtons();
in main()
function drawButtons(){
drawTextPixel(1, yHt, "34EMA "+ema34+"@URL=EFS:ema34OnOff", Color.blue, Color.red, Text.BUTTON|Text.RELATIVETOLEFT|Text.RELATIVETOBOT TOM, "Courier", 10, 10)
}
which calls ema34OnOff(), which sets a flag, ema34 to on or off and then redraws the button
function ema34OnOff(){
if(ema34=="On"){ema34="Off";}
else{ema34="On";}
drawButtons();
}
and then redraws the button
Then in main I either draw the ema or not...
if(ema34=="Yes) return vEMA;
return;
but for some reason the var ema34 is not making it out of the ema34OnOff function back to main.
var vEMA = new MAStudy(34, 0, "HLC/3", MAStudy.EXPONENTIAL);
What am I missing?
Comment