ESPL: Mouse command example
Q: I'm learning how to use mouse function in my script. I tried using the following example code from the ESPL help documentation but it does not work. Is there something else that I must do before mouse function could work? It appears like the MOUSE command in ESPL is not working.
EXAMPLE: The following program opens an IBM daily chart. The program should report the Last price of the selected bar, whenever the mouse is clicked on the chart. Click near the left edge of the chart to stop the program.
if Mouse(x,y) then
Msg:='Last = ' + FormatPrice(IntToStr(zLast),True) + ' ';
A: The example is testing the mouse location at all times and the mouse X value prior to moving onto the chart is returning a Zero value which stops the Repeat loop. Solution is to edit the Until line to be this:
until (X>0) and (X<20);
Then the example works as intended. Click the RUN button. On the chart click at various places and the Message will show. If you move near the left edge the routine stops because X location will be <20.
| contact us
Ensign Software, Inc., 113 Stillwater Drive, Idaho Falls, ID 83404 Support: 801-328-1382 Billing: 208-552-2230
(c) 2014 Ensign Software, Inc. All Rights Reserved
Last modified 1/31/08 1:44 PM