Hi board....
I am writing table data to a comma delimited file, everything goes well until I get to a memo field. The syntax for .memo_write_to_file() is.....
.Fieldname.memo_write_to_file([Filename,Flags] )
I don't know the name of the memo field, so I use fld.name_get() to pass the memo's field name to a variable & in turn pass it to the memo_write_to_file().
The problem is that I am getting an error message "tbl.f_name subelement not found" can anyone see where I am loosing it at?? I thought that replacing the field name with a variable wouldn't be a problem???
Thanks for looking at this...
doug
FOR i = 1 TO number_of_fields
fld = tbl.field_get(i)
f_name = fld.name_get()
field_type = fld.type_get()
SELECT
CASE field_type = "N"
file_pointer2.write(chr(34)+STR(fld.value_get())+chr(34)+",")
CASE field_type = "D"
file_pointer2.write(chr(34)+DTOC(fld.value_get())+chr(34)+",")
CASE field_type = "L"
file_pointer2.write(chr(34)+IIF(fld.value_get(),"T","F")+chr(34)+",")
CASE field_type = "M"
file_pointer2.write(chr(34))'leading quote
file_pointer2.close()
tbl.f_name.memo_write_to_file(filename2,MEMO_APPEND)
file_pointer2=file.open(filename2,FILE_RW_SHARED)
size = file.bytes_get()
file.seek(size)
file_pointer2.write(chr(34)+",")'trailing quote & delimiter
CASE field_type = "B"
file_pointer2.write(chr(34)+chr(34)+",")
CASE ELSE
FILE_POINTER2.WRITE(chr(34)+alltrim(fld.value_get())+chr(34)+",")
END SELECT
NEXT i
I am writing table data to a comma delimited file, everything goes well until I get to a memo field. The syntax for .memo_write_to_file() is.....
.Fieldname.memo_write_to_file([Filename,Flags] )
I don't know the name of the memo field, so I use fld.name_get() to pass the memo's field name to a variable & in turn pass it to the memo_write_to_file().
The problem is that I am getting an error message "tbl.f_name subelement not found" can anyone see where I am loosing it at?? I thought that replacing the field name with a variable wouldn't be a problem???
Thanks for looking at this...
doug
FOR i = 1 TO number_of_fields
fld = tbl.field_get(i)
f_name = fld.name_get()
field_type = fld.type_get()
SELECT
CASE field_type = "N"
file_pointer2.write(chr(34)+STR(fld.value_get())+chr(34)+",")
CASE field_type = "D"
file_pointer2.write(chr(34)+DTOC(fld.value_get())+chr(34)+",")
CASE field_type = "L"
file_pointer2.write(chr(34)+IIF(fld.value_get(),"T","F")+chr(34)+",")
CASE field_type = "M"
file_pointer2.write(chr(34))'leading quote
file_pointer2.close()
tbl.f_name.memo_write_to_file(filename2,MEMO_APPEND)
file_pointer2=file.open(filename2,FILE_RW_SHARED)
size = file.bytes_get()
file.seek(size)
file_pointer2.write(chr(34)+",")'trailing quote & delimiter
CASE field_type = "B"
file_pointer2.write(chr(34)+chr(34)+",")
CASE ELSE
FILE_POINTER2.WRITE(chr(34)+alltrim(fld.value_get())+chr(34)+",")
END SELECT
NEXT i
Comment