I used the sample code found in library and was able to capture the barIndex and yValue from a mouse doubleclick to vPickBar and vPickValue. I want the last doubleclick I used to store these two values so that my Main() program can use them. But vPickBar and vPickValue always seem to have no value.
The 2nd drawTextReative confirms I have the numbers as vPickBar and vPickValue for I see two lines of text.
function onLButtonDblClk( barIndex, yValue,vPickBar, vPickValue) {
updateClickInfo(barIndex, yValue, vPickBar, vPickValue);
}
function updateClickInfo(barIndex, yValue, vPickBar, vPickValue) {
drawTextRelative(barIndex, yValue, "DblClicked bar " + barIndex + " at " + yValue.toFixed(2), Color.white, Color.navy, Text.BOLD, null, 14, "ClickInfo");
vPickBar = barIndex;
vPickValue = yValue;
drawTextRelative(vPickBar+20, vPickValue+.0006, "DblClicked ALEX bar " + vPickBar + " at " + vPickValue.toFixed(2), Color.red, Color.white, Text.BOLD, null, 14, "ClickInfo2");
Now in my Main program, as a test, I use vPickBar
function main( vPickBar, vPickValue ) {
setStudyTitle( PASS THRU (LIVE)" + vPickBar);
and I get
"PASS THRU (LIVE)undefined"
as my title, confirming that my math operations later on with vPickBar are doing me nothing. vPickbar and vPickValue are also "var"ed above Premain.
It seems these two values have an instantaneous value and then go immediately to nothing, or they can not exist outside of the special mouse click function. I want to grab these click values and stores them for use later. Even if I remove "vPickBar, vPickValue" as additional parameters to all used functions, this changes nothing.
What am I missing?
The 2nd drawTextReative confirms I have the numbers as vPickBar and vPickValue for I see two lines of text.
function onLButtonDblClk( barIndex, yValue,vPickBar, vPickValue) {
updateClickInfo(barIndex, yValue, vPickBar, vPickValue);
}
function updateClickInfo(barIndex, yValue, vPickBar, vPickValue) {
drawTextRelative(barIndex, yValue, "DblClicked bar " + barIndex + " at " + yValue.toFixed(2), Color.white, Color.navy, Text.BOLD, null, 14, "ClickInfo");
vPickBar = barIndex;
vPickValue = yValue;
drawTextRelative(vPickBar+20, vPickValue+.0006, "DblClicked ALEX bar " + vPickBar + " at " + vPickValue.toFixed(2), Color.red, Color.white, Text.BOLD, null, 14, "ClickInfo2");
Now in my Main program, as a test, I use vPickBar
function main( vPickBar, vPickValue ) {
setStudyTitle( PASS THRU (LIVE)" + vPickBar);
and I get
"PASS THRU (LIVE)undefined"
as my title, confirming that my math operations later on with vPickBar are doing me nothing. vPickbar and vPickValue are also "var"ed above Premain.
It seems these two values have an instantaneous value and then go immediately to nothing, or they can not exist outside of the special mouse click function. I want to grab these click values and stores them for use later. Even if I remove "vPickBar, vPickValue" as additional parameters to all used functions, this changes nothing.
What am I missing?
Comment