Hm doesn't the TS mean a comma delimited list of only 1 field in the table?
In that case:
def var hbuf as handle.
def var ctab as char.
def var hque as handle.
def var cval as char.
def stream stre.
output stream stre to value("c:\temp\export.txt").
ctab = "<table>".
cvar = "".
create buffer hbuf for table ctab.
create query hque.
hque:set-buffers(hbuf).
hque:query-prepare(substitute("for each &1",ctab)).
hque:query-open.
hque:get-first(no-lock).
do while not hque:query-off-end:
cvar = cvar + "," + hbuf:buffer-field(1):buffer-value.
hque:get-next(no-lock).
end.
hque:query-close.
delete object hque.
cvar = trim(cvar,",").
put stream stre unformatted cvar.
In the above, the buffer-field(1) is of course the number of the field you want to export, in this case field number 1.
But if you really want it done right, a "," is not the most beautiful character to be used as a delimiter.
Why not?
Imagine you have the following values of your Field(1) column:
"one"
"two"
"three,four"
"five"
what will happen? Exactly, you get a wrong interpretation of the values in your export. Personally, i'd advocate a CHR(1) delimiter for exports, because this is a delimiter that would never be found in any character or integer string. This is of course a little off topic, but it never hurts to start some discussion on how to put things right ;-).