Function return (OpenInsight 32-Bit)
At 24 AUG 2004 03:33:08AM William Ng wrote:
I have a function that ask user to key in some value and then it will calculate the result and return it.I call this function from the quickevent and set return to @self and text.
The problem is when the user click cancel instead of keying it the values, so the function return blank.This instead is return to my control and ovewrite whatever in it.Thus clearing my control.
It should not clear it if i cancel.So, is there someway i can tell it to if return nothing then dont overwite with the quickevent?
I notice for popup, if i cancel it will not overwrite.Is popup not a function? How is this done?
At 24 AUG 2004 04:53AM [email protected] wrote:
possibly the easiest method would be to pass the value in your control. Then you can pass back the value if your routine has not created a value.
Make sense?
Phone: 971-570-2005
At 24 AUG 2004 05:08AM William Ng wrote:
I was hoping i do not have to assign the value to my control.That is why i use a function instead of a subroutine and return the value using the quickevent.
The standard popup can do this but why not my function ? Does OI handle popup and function differently?
=== At 24 AUG 2004 09:24AM [email protected] wrote: ===
NG] 'I was hoping i do not have to assign the value to my control'
I never mentioned assigning to your control.
If you pass the original value to your function THEN if the function has nothing to pass back, have it pass back the data you originally passed it.
function myfunction(datain)
* data in is the data originally in the control
rtnData='
if rtnData=' then rtnData=datain
return rtnData
this way the quickevent will simply pass back the data to the control.
Of course if this is too much you could review popup_sub and see what is happening in the source. I believe it is still part of the base system sysprocs
Phone: 971-570-2005
At 24 AUG 2004 09:47AM [email protected] wrote:
fyi .. the bits you need aren't in popup_sub but in popup.
I believe that when the QE fires it gets its returned data in a common .. possibly Popup_RetVal@ (defined in popup_equates). then QE determines whether to stuff the data or not. It appears that this is not the default for calling a function with QE
If i am wrong i am sure someone will tell me
Phone: 971-570-2005
At 24 AUG 2004 09:31PM William Ng wrote:
Sorry for not understanding.I get the picture now.That is a great idea.
I got confused because for quickevent, i do not know how to pass the value of the control in, so i thought u ment passing it back.
So how can i pass the value of the control in as the quickevent parameter?
At 25 AUG 2004 12:00AM William Ng wrote:
Thanks for the info.
I think you are right, quickevent handle function differently for popup even if popup is a function.What i do not understand is why?
Why should there be a difference?How am i suppose to use function with quickevent then?I must ensure my function will not 100% break?