>I have 2 files 1 parent and 1 child
>
>the relation is set to 1 to many. through set fields to command i get a nice output in a grid, where parent records are shown as asterixs (******) and child records are shown one by one
>
>Is there a way to redirect the set fields to output to a text file or by any way I can print that output,
>
>Instead of (*****), it may show parent table fields as blank.
>
>Pls help !!
You can do it a few ways :
1- Assume parent named pr and child ch and relation set and set fields issued.
select ch
chfields = set("fields",1) && fields set for child
select pr
prfields = set("fields",1) && fields set for parent
set library to fpath && foxtools.fll if windows
lnSpaces = 0
for ixc = 1 to words(prfields)
lnSpace = lnSpace + fsize(wordnum(prfields, ixc, " ,"))
endfor
set fields off && Turn off set fields temporarily
set alternate to myfile.txt
set alternate on
scan
? &prfields
select ch
if !eof() && Else nothing to print
?? &ch
skip
endif
scan while ch.linkexp = pr.linkexp && Whatever your relation is
? space(lnSpaces) , &ch
endscan
select pr
endscan
set alternate to
set alternate off && No more space but this is ok and works