PRB: "Property Not Found" Occurs When Running Form (129207)
The information in this article applies to:
- Microsoft Visual FoxPro for Windows 3.0
This article was previously published under Q129207 SYMPTOMS
The following error message displays while you are running a form:
Property Not Found
CAUSE
The period (.) operator was used in conjunction with macro substitution to
reference a property that contains the name of an object. Because the
compiler recognizes the period as the macro terminator, it doesn't evaluate
the remainder of the line that contains the property.
WORKAROUND
To work around this problem, add an additional period after the macro
substitution. The first period terminates the macro and the second allows
the compiler to reference the property.
For example, to fix the problem, refer to the "Steps to Reproduce Behavior"
section of this article, and replace the lines that use a single period to
reference properties with the following lines of code:
This.&cOButton..Caption="Button"-cOldbNo && Originally used one period
This.&cOButton..Picture=''
*** ...
This.&cButton..Caption="" && These lines are farther
This.&cButton..Picture='c:\vfp\fox.bmp' && down in the example
NOTE: Macro substitution can usually be replaced by the superior EVALUATE()
function, but using EVALUATE() requires an additional line of code. In this
example, program execution is faster and the amount of executable code
generated by the compiler/linker is smaller. For example:
Instead of:
This.&cOButton..Picture=''
Use:
oRef=EVAL("THIS."+cOButton)
oRef.Picture=''
STATUS
This behavior is by design.
Modification Type: | Major | Last Reviewed: | 8/3/2000 |
---|
Keywords: | kberrmsg KB129207 |
---|
|