Microsoft KB Archive/190238

= BUG: AddProperty Fails With Initial Value of Type Currency =

Article ID: 190238

Article Last Modified on 12/11/1999

-

APPLIES TO


 * Microsoft Visual FoxPro 6.0 Professional Edition

-



This article was previously published under Q190238



SYMPTOMS
When you call the AddProperty method of an object and pass an initial value of type currency, you may receive the following error when the AddProperty executes:

Unrecognized command verb.



RESOLUTION
To work around this behavior, you can pass the initial value as a named expression or pass a variable containing the initial value, as follows: oCst.AddProperty("currencyvalue",($0)) NOTE: Note the added parentheses around the currency value.

-or-

yCurVal = $0 oCst.AddProperty("currencyvalue", yCurVal) NOTE: The initial value is passed as a variable.



STATUS
Microsoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article. We are researching this bug and will post new information here in the Microsoft Knowledge Base as it becomes available.



MORE INFORMATION
The AddProperty method takes two parameters. The first parameter is the name for the added property, and the second parameter is the value of the newly added property.

Steps to Reproduce Behavior
  Type the following in the Command window: oCst = NEWOBJECT("custom") oCst.AddProperty("currencyvalue",$0) 

RESULTS: The error "Unrecognized command verb" occurs.   The following code works without error: * Pass as named expression. oCst.AddProperty("currencyvalue",($0))

-or-

* Pass as variable. yCurVal = $0 oCst.AddProperty("currencyvalue", yCurVal) 

