Tomatocans
MIS
Altered the export code from the memo.exe export.fsl button to accomadate everything I need except I also want it to put the rowheaders for all fields in a table on the first line of ouput. I apologize this will be the only thing I will ever ask regarding ObjectPal. I am not familar with Paradox or ObjectPal.
Here is the code as stands:
method pushButton(var eventInfo Event)
var
b filebrowserinfo
thefile,delimiter,textfile,path string
t,t1 textstream
counter,counter1 smallint
temp anytype
m memo
lines array[] string
tc tcursor
endvar
ignoreCaseInStringCompares(yes)
delimiter="$"
;delimiter.view("Please enter the record delimiter"
;if delimiter="" then
;msginfo("Oops","You must enter a delimiter"
;return
;endif
b.allowabletypes=fbTable
b.selectedtype=b.allowabletypes
message("Select File to export"
if not filebrowser(thefile,b) then
return
endif
textfile="input.txt"
;textfile.view("Enter text file to create"
;if textfile="" then
;return
;endif
if not t.open(textfile,"nw" then
errorshow()
return
endif
path=getaliaspath(b.alias)+b.path
if path.substr(path.size())<>"\\" then
path=path+"\\"
endif
tc.open(path+thefile)
scan tc:
message("Exporting record "+string(tc.recno()))
for counter from 1 to tc.nfields()
if tc.fieldType(counter)<>"Graphic" and tc.fieldType(counter)<>"Oleobj" and tc.fieldType(counter)<>"Binaryblob" then
tc.fieldvalue(counter,temp)
if tc.fieldtype(counter)<>"Memo" and tc.fieldType(counter)<>"Fmtmemo" then
t.writestring(temp)
else
m=temp
;If the size is less that 32K, it can be treated as a string.
if m.size()<32768 then
t.writestring(temp)
else
m.writetofile("riv:temp"
t1.open("riv:temp","r"
t1.readline(lines)
for counter1 from 1 to lines.size()
t.writestring(lines[counter])
if counter1<lines.size() then
t.writeline(""
endif
endfor
t1.close()
endif
endif
if counter<tc.nfields() then
t.writestring("|"
endif
endif
endfor
;t.writeline(""
;t.writeline(delimiter)
endscan
t.close()
tc.close()
message("Done"
endmethod
how would u change to output rowheaders or field names to first line of output separated by | like the rest and $ to indicate end.
Here is the code as stands:
method pushButton(var eventInfo Event)
var
b filebrowserinfo
thefile,delimiter,textfile,path string
t,t1 textstream
counter,counter1 smallint
temp anytype
m memo
lines array[] string
tc tcursor
endvar
ignoreCaseInStringCompares(yes)
delimiter="$"
;delimiter.view("Please enter the record delimiter"
;if delimiter="" then
;msginfo("Oops","You must enter a delimiter"
;return
;endif
b.allowabletypes=fbTable
b.selectedtype=b.allowabletypes
message("Select File to export"
if not filebrowser(thefile,b) then
return
endif
textfile="input.txt"
;textfile.view("Enter text file to create"
;if textfile="" then
;return
;endif
if not t.open(textfile,"nw" then
errorshow()
return
endif
path=getaliaspath(b.alias)+b.path
if path.substr(path.size())<>"\\" then
path=path+"\\"
endif
tc.open(path+thefile)
scan tc:
message("Exporting record "+string(tc.recno()))
for counter from 1 to tc.nfields()
if tc.fieldType(counter)<>"Graphic" and tc.fieldType(counter)<>"Oleobj" and tc.fieldType(counter)<>"Binaryblob" then
tc.fieldvalue(counter,temp)
if tc.fieldtype(counter)<>"Memo" and tc.fieldType(counter)<>"Fmtmemo" then
t.writestring(temp)
else
m=temp
;If the size is less that 32K, it can be treated as a string.
if m.size()<32768 then
t.writestring(temp)
else
m.writetofile("riv:temp"
t1.open("riv:temp","r"
t1.readline(lines)
for counter1 from 1 to lines.size()
t.writestring(lines[counter])
if counter1<lines.size() then
t.writeline(""
endif
endfor
t1.close()
endif
endif
if counter<tc.nfields() then
t.writestring("|"
endif
endif
endfor
;t.writeline(""
;t.writeline(delimiter)
endscan
t.close()
tc.close()
message("Done"
endmethod
how would u change to output rowheaders or field names to first line of output separated by | like the rest and $ to indicate end.