Joe Yoder wrote on 2012-02-13: 
>  I'm working on a utility to convert between CSV and DBF files.  I build
an array based on the information included in the CSV file, manually assign
fields names, and use it to create a DBF file.  I plan to save the array in
a memo field in a Formats table used to store formats.
>  
>  When a CSV file is read, the system will build an array and then compare
it to each saved format.  If there is no exact match, the system should
report the discrepancies and facilitate the creation of a new format.
>  
>  I'm thinking I will need to make a copy of the array to a different name
before I store it and then restore the arrays one at a time and compare the
array elements to determine compatibility.  It would be nice to somehow
embed the format name into the DBF file so that the system could figure out
which definition to use to do the conversion to CSV.
>  
>  Here are my questions:
>  
>  Is there a better way to change the name of an array than dimensioning a
new one to match the configuration and copying elements one at a time?
>  
>  Is there an unused area in the header of a DBF file that could be used to
store the format information.  If not - I can rely on the file name to
determine which format to use.
>  
>  Thanks in advance,
>  
>  Joe

Joe,

ACOPY() will copy an array.

I don't know of a way to save an ARRAY to a memo field, well directly. You
could LIST MEMORY TO file, then FILETOSTR it into the memo.

You might want to Create a cursor with the correct ARRAY structure needed to
create the DBF from. Then you can CURSORTOXML() this to text which can be
saved to the MEMO. Then SELECT * FROM (the table recreated from XMLTOCURSOR)
INTO ARRAY, once you find the right format.




Tracy Pearson
PowerChurch Software


_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: 
http://leafe.com/archives/byMID/profox/[email protected]
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to