|
Home > Archive > dBASE Questions and Answers > February 2006 > Calling function with parameter from out of WITH....ENDWITH construct
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Calling function with parameter from out of WITH....ENDWITH construct
|
|
| Pieter van Heerden 2006-02-12, 11:23 am |
| I place an image in a contrainer on a form. The image contains an outline map of a country and on this image map I place weather stations as images (small coloured squares). These can be a few hundres. When double clicking on a station I need to run a
function that does a few things....
The country map and weather stations are placed after opening the form, dependiong on the country selected by the user. The solution to running a function applicable to all stations, seems to be to place the function outside the CLASS ... ENDCLASS constr
uct and have it called by a leftDblClick event for whatever station the user is interested in.
In the WITH...ENDWITH construct of the weather station a
onLeftDblClick = alter(mstationno)
is inserted. The problem is that when calling the function without the parameter, it works. However, inserting the parameter (a station identifier) leads to different reactions:
1. Error message telling me that a function is required (the function definition includes a handle to which the parameter can be passed)
or
2. It calls the function and runs through it(!).
Event 1 above is the more common occurance. Event 2 happens about once in ten.
Can someone please put me on the right track?
And thanks to all who responds to our requests.
| |
| Michael Nuwer [dBVIPS] 2006-02-13, 7:24 am |
| Pieter van Heerden wrote:
>
> Can someone please put me on the right track?
>
Perhaps something like the following will work for you:
function onLeftDblClick(flags
, col, row)
form.alter(mstationno)
return
function alter(mstationno)
?mstationno
return
|
|
|
|
|