Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Method call returns the wrong value
Message
 
 
To
26/01/2004 17:26:23
Gary Foster
Pointsource Consulting LLC
Chanhassen, Minnesota, United States
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00870801
Message ID:
00870805
Views:
7
This message has been marked as the solution to the initial question of the thread.
Gary,

What Flag value (5th parameter) did you pass to BINDEVENTS()? By default, a delegate code is called before event code so return value is from the event code. You've to pass Flag=1 to get return vale from the delegate code.

>I have an interesting ( read: highly annoying) problem. I have an array of form controls that have a method named GetDisplayValue that takes an integer parameter and returns a string value. I add an object at runtime to the controls that has this method and has a BINDEVENT call to bind the method call. When I step through the method, everything works like a champ, yet after the call, cValue = the passed value, even if the method is hardcoded to return a string. The BINDEVENTS seems to be working since program flow calls the method and the return value is set. I just don’t seem to be able to “catch” the return value.
>
>*-- Sample call
>LOCAL cValue
>cVAlue = ''
>cValue = aObjArray[1].GetDisplayValue(nSomeKeyNumber)
>? cValue && nSomeKeyNumber instead of the true return value
>
>
>I even re-did the object's method to do this:
>PROCEDURE GetDisplayValue
> LPARAMETER tnKey
> RETURN 'ABCDEF'
>ENDPROC
>
>I still get the passed value back instead of the ‘ABCFEF’! I hope I'm missing something obvious here. Any hints? Thanks.
>
>Gary
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform