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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Collections?!

Status
Not open for further replies.

jmcswain

Programmer
May 30, 2001
16
0
0
US
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!
 
HI
Have you read the following topics..
DBGETPROP, DBSETPROP
These little command are doing a lot of magic for me.. in getting and setting various automated routines.

FOr example.. When i use wizard an create a VIEW using view designer, the view fields dont get properties like field captions etc from the underlying table. I have created utilities.. which ill collect these properties and set the views automaticaly.

But the above properties.. relate to DBC contained tables.

Now coming to free tables.. you have to thnik of a table dictionery containing the field names, the captions etc..
I suggest, you can make something similar to the properties set in the DBC DBGETPROP.. so that similarities can be maintained. Also additional features can be added by us.

This is precisly what some of the tools available in themarket is doing.. such as stonefield kit.

Hope this is of some help to you :) ramani :-9
(Subramanian.G),FoxAcc, ramani_g@yahoo.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top