help needed

Bookit Enterprises bookit.grant at
Tue Sep 15 17:10:38 EDT 2020

I am doing some code to do a data dump from Studio, for one of my clients who is moving to another vendor.

I have the following code, which works just fine, gathers all the data, puts it in a spreadsheet named after the file format it came from:

Do $files.$makelist($ref.$name) Returns iFilesList     ;; gather existing slots
Do iFilesList.$redefine(iFileName)

Calculate iPath as sys(11)
Calculate iPath as mid(iPath,1,pos('books',iPath)-1)     ;; path to my df storage folder

Set current list iFilesList
For each line in list from 1 to #LN step 1     ;; get all the data from each slot
Load from list
If iFileName='FGlobalVariables'|iFileName='#APPLICATION'|iFileName='#SLOTS’ ; FGlobalVariables  is memory only
 Set main file {[iFileName]}
 Set read/write files {[iFileName]}
 Clear main file
 Set current list iDataTransferList
 Define list {[iFileName]}
    Add line to list
 Until flag false
 Set print or export file name {[con(iPath,iFileName)]}
 Prepare for export to file {Tab-delimited}
 Export data iDataTransferList
 Set current list iFilesList
End If
End For
Close data file

However, I would like to include the field names as the first line of the exported list, which is essentially the list definition.
Because the list is defined by the field names, some of which are numeric, or boolean, so I think I need to export the field names first, then do the ‘Export data’ command.  But I can’t seem to wrap my old brain around how to do it.

Any ideas you could help me with?

Grant Thiessen

More information about the omnisdev-en mailing list