Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Method call returns the wrong value
Message
 
 
À
26/01/2004 17:26:23
Gary Foster
Pointsource Consulting LLC
Chanhassen, Minnesota, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00870801
Message ID:
00870805
Vues:
8
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--
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform