Hello,
I have several commonly used functions in an EFS library. I am having an issue with Buttons not referencing
the correct button handler when the function from the library is called.
EXAMPLE:
My Main script:
LiveTradingDrone.efslib contains:
My problem is, even though buttons are plotted when showButtons() is called from the main function, when i actually click on the button
the handler (droneStartHandle) is not being executed. Is there another way I should be referencing EFS handles when using a library?
tia
I have several commonly used functions in an EFS library. I am having an issue with Buttons not referencing
the correct button handler when the function from the library is called.
EXAMPLE:
My Main script:
PHP Code:
var drone = addLibrary( "LiveTradingDrone.efsLib" );
function main() {
drone.showButtons();
}
LiveTradingDrone.efslib contains:
PHP Code:
var tdrone = null;
function droneStartHandle () {
var cdate = getMonth(0) + "/" + getDay(0) + "/" + getYear(0) + " @ " + getHour(0) + ":" + getMinute(0);
debugPrintln("Drone start handle called @ " + cdate);
tdrone = "on";
}
function droneStopHandle () {
var cdate = getMonth(0) + "/" + getDay(0) + "/" + getYear(0) + " @ " + getHour(0) + ":" + getMinute(0);
debugPrintln("Drone STOP handle called @ " + cdate);
tdrone = null;
}
function showButtons() {
if (tdrone != "on") {
drawTextAbsolute( 0, 50, "Start Drone Trading@URL=EFS:droneStartHandle", Color.yellow, Color.blue, Text.BOLD | Text.ONTOP | Text.FRAME | Text.RELATIVETOLEFT | Text.RELATIVETOTOP | Text.BUTTON, "Verdana", 10, "button");
} else {
drawTextAbsolute( 23, 50, "CEASE drone@URL=EFS:droneStopHandle", Color.yellow, Color.blue, Text.BOLD | Text.ONTOP | Text.FRAME | Text.RELATIVETOLEFT | Text.RELATIVETOTOP | Text.BUTTON, "Verdana", 10, "button");
}
}
My problem is, even though buttons are plotted when showButtons() is called from the main function, when i actually click on the button
the handler (droneStartHandle) is not being executed. Is there another way I should be referencing EFS handles when using a library?
tia
Comment