>_FileHandler = FCREATE('yourTxtFile.txt') > >*:couldn't create the file >if _FileHandler = -1 > return >Endif > >Select 0 >Use yourTable >scan > _NumberOfFields=FCOUNT() > _FieldString = "" > For _X = 1 TO _NumberOfFields > *:Getting the name of the field > _Campo = FIELD(_X) > *:Verify the data type > _VariableType = TYPE(FIELD(_X)) > > *:Converting any type of data to string > Do Case > Case _VariableType = [N] > _VariableChar = Alltrim(Str(&_Campo)) > Case _VariableType = [D] > _VariableChar = DTOC(&_Campo) > Case _VariableType = [L] > _VariableChar = &_Campo > _VariableChar = IIF(_VariableChar,[.T.],[.F.]) > OtherWise > _VariableChar = &_Campo > EndCase > *:Building the string of using '$' as a separator, change the separator as needed > _FieldString = _FieldString + IIF(_X=_NumberOfFields,_VariableChar,_VariableChar + [$]) > EndFor > *:Writing the data in the file > =FPUTS(_FileHandler,_FieldString) >EndScan >=Fclose(_FileHandler) >Modi comm 'yourTxtFile.txt' >Return > >>