Normal
[USER=33203]@MovingAverage[/USER] I just had another look at this and I have come up with 2 working options for you (if you already don't have one)Option 1 - Simple and less sexy[CODE]if( ParamTrigger("batch", "Click here to run batch" ) ){ ShellExecute("runbatch", "C:\\Users\\*****your path *****\\Formulas\\Custom\\Batch Files\\Norgate_Batch.abb", "" ); // Add your path and batch file}[/CODE][ATTACH=full]113456[/ATTACH]Option 2 - Closer to what you are chasing[CODE]idMyButton = 2;function CreateGUI(){GuiButton( "Run Batch", idMyButton, 10, 20, 100, 20, notifyClicked );}function HandleEvents(){ for ( n = 0;id = GuiGetEvent( n, 0 );n++ ) // get the id of the event { code = GuiGetEvent( n, 1 ); switch ( id ) { case idMyButton: ShellExecute("runbatch", "C:\\Users\\*****your path *****\\Formulas\\Custom\\Batch Files\\Norgate_Batch.abb", "" ); // Add your path and batch file break; default: break; } }}CreateGUI();HandleEvents();[/CODE][ATTACH=full]113457[/ATTACH]
[USER=33203]@MovingAverage[/USER] I just had another look at this and I have come up with 2 working options for you (if you already don't have one)
Option 1 - Simple and less sexy
[CODE]if( ParamTrigger("batch", "Click here to run batch" ) )
{
ShellExecute("runbatch", "C:\\Users\\*****your path *****\\Formulas\\Custom\\Batch Files\\Norgate_Batch.abb", "" ); // Add your path and batch file
}[/CODE]
[ATTACH=full]113456[/ATTACH]
Option 2 - Closer to what you are chasing
[CODE]idMyButton = 2;
function CreateGUI()
GuiButton( "Run Batch", idMyButton, 10, 20, 100, 20, notifyClicked );
}
function HandleEvents()
for ( n = 0;id = GuiGetEvent( n, 0 );n++ ) // get the id of the event
code = GuiGetEvent( n, 1 );
switch ( id )
case idMyButton:
break;
default:
CreateGUI();
HandleEvents();[/CODE]
[ATTACH=full]113457[/ATTACH]
Hello and welcome to Aussie Stock Forums!
To gain full access you must register. Registration is free and takes only a few seconds to complete.
Already a member? Log in here.