Virtual properties

Andrew Kluthe andrew at rjdfarm.com
Tue Mar 23 17:08:18 EDT 2010


I understand the differences between a script and a handler. A
getProp/setProp message or trigger is a property handler. If you look at the
user guide, there is a section on page 247 titled "Virtual Properties". This
is what I was speaking of. The problem I am having is understanding the
difference between a property handler and a virtual property handler.

I.E. the way I understand it:

A Custom property might be a Date for instance. I could write a setProp or
getProp that reformats the date when it is set or given. 

set the startDate of control "blah" to the date 

then I could make a virtual getProp that gets the startDate property,
manipulates it and returns it.

put the startDateYear of control "blah"

The difference is that startDateYear doesn't hold a value, just uses getProp
to pull the year out of startDate and return it, but makes the code more
readable and organized.

instead of

put year(the startDate of control "blah")


Thank you for the response though.

And with this clarification of what I think I understand, am I getting that
right anyone?
-- 
View this message in context: http://n4.nabble.com/Virtual-properties-tp1679610p1679691.html
Sent from the Revolution - User mailing list archive at Nabble.com.



More information about the use-livecode mailing list