Thursday 11 February 2010

You live and Learn

Just found out something I didn't know re scripting.

If you are in the object about which you are scripting, you can omit the object name.

So, for example, if this is the ValueChanged event for FieldA, you DON'T need:

FieldA.Fill.Color.Red := 255 . etc

But can get away with:

Fill.Color.Red := 255 .

Show () .

Which saves some typing!

(I will also save some typing by NOT going back to old articles and blogs to adjust code. Sorry!)

More importantly, it means that a lot of scripts can be generic, as long as they reference the properties and methods of the current object, and that you are pasting them into objects that have those properties and methods.

No comments:

Post a Comment