Like most people, you probably guessed “ENTRYFIELD”. But in fact the message box shows “MyForm”.
Is this a bug in dBASE? No. According to Ken Chan, this is WAD (Working As Designed) — and documented (see below). He says that “this behavior may be a by-product of dBASE’s pass-by-reference nature”.
msgbox() to show “ENTRYFIELD”
(the behavior we’re more likely to desire), we must enclose the
this in parentheses:
form.xyz( (this) )
The extra parentheses force the
evaluation of the object reference. That reference is then passed
to the method.
|Here’s an extract from the “PARAMETERS”
topic in the On-Line Help:
Passing this and form
the special object references this
parameters to the method of another object, they must be enclosed in parentheses
to be passed by value. If not, the value of the
take on the corresponding values for the target object, and no longer refer
to the calling objects.
to the dQuiz