Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need designtime property value at runtime

Status
Not open for further replies.

aharrisreid

Programmer
Nov 17, 2000
312
GB
Once a form is showing, I need to ascertain if the value of a property has changed from the value originally set in the PEM sheet. I have tried using PEMSTATUS(object,property,0), but this returns .T. even if the value was changed manually from the default value in the PEM sheet at design-time. I would have expected the result to be .F. until the value was changed once the program had started, not changed from its default value at designtime.

On a similar subject, I would like to ascertain the value of a property as set in the PEM sheet. Short of setting-up up another property to store the initial value of the original property in form.init(), is there a more efficient way of doing this?

Any help would be appreciated.

Regards,
Alan
 

Take a look at GETPEM()


Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
mgagnon, thanks for the reply...

>Take a look at GETPEM()

I tried GETPEM(), but this is returning the value of the property when the function is called, not the value as set in the PEM sheet.

Regards,
Alan
 
Hi Marcia,

>You may want to create an assign method on that property >and write some code there.

Thanks, I didn't think of that option.

Regards,
Alan
 
aharrisreid

Also use the AMEMBERS() function to determine IF a property has changes form its original setting. If you use it with the "C" flag, it will create an array of all the properies that changed from their original value.
Code:
PUBLIC ARRAY myProps[1]
AMEMBERS(myProps,this.Parent,1,'C')


Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
Mike, thanks for the reply.

>PUBLIC ARRAY myProps[1]
>AMEMBERS(myProps,this.Parent,1,'C')

Tried that, but unfortunately the resulting array includes properties that have have been changed in the PEM sheet of a subclass, but not altered since (eg. during running of a program). I would have expected PEM sheet values to become the new original value!

Regards,
Alan
 
aharrisreid said:
I would have expected PEM sheet values to become the new original value!
No, that would be the case in a subclass of that class when you don't change anything from that moment.

Bye, Olaf.
 
Hi Olaf, thanks for the reply.

>>Quote (aharrisreid):
>>I would have expected PEM sheet values to become the new >>original value!

>No, that would be the case in a subclass of that class >when you don't change anything from that moment.

I have since discovered that as long as the subclass is .vcx-based, any manually-set (ie. non-inherited) values will be regarded as the new 'original' value by PEMSTATUS() or GETPEM(). However, PEM-sheet changes to .scx-based subclassed forms are regarded as changes to the original class values.

Regards,
Alan

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top