setting properties

Attached is a simple class and a simple console application. 

if you look at the TPMixed property it is a type String and the private variable that it points to is a String (doesnt' have Type in front of it).  What happens is when you try to set the property the value doesn't hold, in this case a null value is stored (default value for a string) instead of the value passed to the property. 

If you run the attached console application you should see what I mean. 

 

TestObject.zip

Tags:

  • Verified Answer

    I ran your test using VC 2.2 update 1 and it worked correctly.

    I added some display statements after the property sets to show the current values and it displayed 1, 2, 3 as it should have:

              set testObject::TPTypeString to "1"

              set testObject::TPString to "2".

              set testObject::TPMixed to "3".

              display testObject::TPTypeString

              display testObject::TPString

              display testObject::TPMixed

    displayed:

    1

    2

    3

    Thanks