I'm a long-time procedural programmer gradually easing into OOP. In VB I wrote a nifty little class complete with properties and methods, and one of my properties was a "Fields" collection. (It's a VBClip class for reading clipper tables with more than 255 fields in them using low-level unix-style file access.)
Now I'm creating a "Structure" class in VFP to hold table properties. This class will take a subset of table fields (there are 1000+ fields spread over 6 tables - nothing is normalized) and create a spreadsheet out of them. The idea is to have the programmer write a simple little program that'll end up looking something like:
Upload.AddField("G_LOAN","Loan Number"
Upload.AddField("B_NAME","Borrower Name"
...
Upload.CreateSpreadsheet("C:\Upload.XLS"
You get the idea. Naturally, drawing on my VB OOP experience, I wanted to set up a Fields collection in my Upload class. But from what I can gather in the VFP help file, there is no way to create a collection. How can this be? I thought VFP's OOP was superior to VB's. (Inheritance, polymorphism, etcetera...)
My question: What is the best way to accomplish this? Arrays? The seemingly non-existant collection? Subclassing?
Bear in mind that this is a purely programmatic class with no user interface or visible aspect whatsoever. It's just a big ole DEFINE CLASS sitting in a PRG file.
Please help!
Now I'm creating a "Structure" class in VFP to hold table properties. This class will take a subset of table fields (there are 1000+ fields spread over 6 tables - nothing is normalized) and create a spreadsheet out of them. The idea is to have the programmer write a simple little program that'll end up looking something like:
Upload.AddField("G_LOAN","Loan Number"
Upload.AddField("B_NAME","Borrower Name"
...
Upload.CreateSpreadsheet("C:\Upload.XLS"
You get the idea. Naturally, drawing on my VB OOP experience, I wanted to set up a Fields collection in my Upload class. But from what I can gather in the VFP help file, there is no way to create a collection. How can this be? I thought VFP's OOP was superior to VB's. (Inheritance, polymorphism, etcetera...)
My question: What is the best way to accomplish this? Arrays? The seemingly non-existant collection? Subclassing?
Bear in mind that this is a purely programmatic class with no user interface or visible aspect whatsoever. It's just a big ole DEFINE CLASS sitting in a PRG file.
Please help!