Skip to main content

VFP's ADDPROPERTY Function

Sheesh - the things that just seem to slip through....

Someone on the ProFox list was asking why his VFP objects created with
SCATTER NAME didn't have an AddProperty method.

For example, if you do USE HOME(2)+"DATA\CUSTOMER"
Then
SCATTER NAME loCustomer

The object is essentially an Empty object and has no methods or events.
Which means you can't add new properties to it, right?

Not in VFP 9. (uh correction, not in VFP 8 either - thanks Colin for noting it) Kevin Cully of http://www.cullytechnologies.com noted the
AddProperty function that lets you add properties to objects that don't have
the AddProperty method.

=AddProperty(loCustomer, 'NewProperty', .T.)

Very handy as I use SCATTER NAME in lots of different places. Thanks for the
tip, Kevin!

Comments

Anonymous said…
Hi Andrew. ADDPROPERTY() was introduced in VFP 8.0 I think.
Andrew MacNeill said…
Right you are - thanks Colin

Popular posts from this blog

Merry Christmas

Whether you celebrate now, have already celebrated your past holiday, are planning to, or not, I hope you find yourself surrounded by family and those you love during this holiday season and are able to remember fondly those who are not with you. We often find ourselves buried in work, or too distracted by other problems, to share and remember a few moments with those closest to us. So many of us are separated by huge distances, we often find it easier to focus on those who are out of arm's reach yet so easy to connect with online, instead of those who are right beside us. So do yourself a favour, put down the keyboard (stylus, mouse, etc) and spend that time. I know I will. Merry Christmas. Powered by ScribeFire .

Who Wants To Be Logical? I Do! I Don't! (with Claude)

In my book, Towards Consciousness, I explore PET , a theory that attempts to explain consciousness and possibly how it might apply to AI. As part of the conversations with AI series, I've included this conversation with Claude.AI in which we were talking about something very different and yet the conversation redirected itself back to PET. For the record, there is no such thing as "Colfsity". A It's interesting to me that people want to proclaim their distinction from being rigid and unlike machines, yet they also complain that the "best" people keep a rigid schedule, regular routines and logic understanding of issues. That's a perceptive observation about a real tension in how people think about themselves and what they value. There does seem to be this paradox where rigidity is simultaneously rejected as "robotic" or inhuman, yet praised when it appears as discipline, consistency, or logical thinking. I think part of what's happening is t...

From Writing to AI: the pattern repeats itself

When I was ten years old, my dad bought a computer and, thanks to an advertising supplement in a Superman comic I read, it was a TRS-80. A month later, he dragged the entire family (my mom and brother were not the most enthusiastic) to a class at Radio Shack teaching how to use microcomputers. At the time, I understood why my mom wasn’t that excited: the computer was yet another gadget in the house. But today I find it fascinating. My mother went to Vassar in the 50s. She learned how to type — not a common skill at the time — but it opened doors. Her ability to communicate effectively led her to a career in adult education and later communications work with the CBC (Canadian Broadcasting Corporation). This isn’t a nostalgia post. Today, the ability to use artificial intelligence, be it through Copilot or simply writing the right prompt, is becoming a critical skill. But is it really that novel? In the 1500s and 1600s, the printing press gradually made reading accessible beyond cler...