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

Fields from records 3

Status
Not open for further replies.

Phil Thoms

Programmer
Oct 31, 2005
245
GB
Is it possible to convert several account numbers contained in records from a dbf file into individual fieldnames in a temporary table or dbf.
I am currently using Visual FoxPro version 6.0
Thank you.
 
Philthoms, you're right. I had forgotten about needing to count the fields for that purpose.

What's more, you should also include a check to make sure that the number of accounts isn't more than the number of columns that you have space for.

Mike


__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips, training, consultancy
 
For Mike Lewis:-
From my experience with this client the number of accounts likely is less than six. Mainly four or five.
I've not worked with arrays very much so what is best code for inserting a counter etc.
I will also need to create the NEW account fields.
Thanks
 
Come to think of it, you don't need to actually count the fields. There are a couple of easier ways.

If you are progammatically creating a table or cursor, use FCOUNT() to tell you how many fields there are. With an array, ALEN() will tell you the number of columns (pass 2 as the second parameter).

Mike


__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips, training, consultancy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top