The following example creates a delimited data file from any existing table the user chooses. GETFILE( ) is used to find and open a table and PUTFILE( ) is used to return the name of the target file.
gcTableName = GETFILE('DBF', 'Open Table:')
USE (gcTableName)
gcDelimName = ALIAS( ) + '.DLM'
gcDelimFile = PUTFILE('Delimited file:', gcDelimName, 'DLM')
IF EMPTY(gcDelimFile) && Esc pressed
CANCEL
ENDIF
COPY TO (gcDelimFile) DELIMITED && Create delimited file
MODIFY FILE (gcDelimFile) NOEDIT