At 09:11 2015-07-07, Ken Dibble <[email protected]> wrote:
Here's an odd one:

Today, in my VFP 9 SP1 production .exe, my error logger reported VFP Error 11 ("Function argument value, type, or count is invalid.") on a call from a form like this:

MyForm.MyMethod:

BooleanResult = oMyObject.Method(THISFORM,"specifictablename",oMyOtherObject.Method("fieldname"))
** end method**

This system has been in operation since late 2007. I normally have zero problems passing methods as parameters to other methods, so this surprised me.

You do not pass a method above. There being no method type in VFP, you can not do it. What you are passing as the third parameter to oMyObject.Method is the return value from a method call.

The data types of the passed variables are not really relevant:

Toss that assumption. The error message states that something of the sort may be it.

With not much to go on, I suggest that you examine each of the items in the statement to see that they really are what you think they are. Something may have been overwritten. In particular, start by checking that oMyObject and oMyOtherObject are of type object, that neither is .null., and that each refers to the correct class.

[snip]

Is passing a method as a parameter to another method an official no-no in VFP?

     It is impossible, and you are labelling something else as it.

[snip]

Sincerely,

Gene Wirchenko


_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: http://leafe.com/archives/byMID/profox/
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to