pblancha
11th October 2001, 01:35
Hi,

i'm using text.write in a script and all it does is create an empty message, but the tmp_file is not empty. What i'm doing is:

rc = text.to.buf("tttxt010.ctxt",lang,10,buf)
tmp_file = buf(1,1)

**** this part is working, tmp_file has the info that was
stored in tttxt010.text

rc = text.write("tdsls002.txta","lang","","","","","","",tmp_file)

*** This part is returning the new text number in tdsls002.txta
but the text is empty. tmp_file is not empty

Anybody worked with text.read() and text.write() ?
am i missing something?

thanks

LittleJohn
12th October 2001, 02:48
Hi,

The reason why you r not able to get the text is because u r not using the proper text group.
Every user has a default text group associated.

Here is what you can do....

lets presume you already have some data in a file (outfile)...
and you want to write this data to the table field tdsls002.txta.
2 - is the language
My default text group is "text". I give the group there directly, not required to store it in a variable again.

ret = text.write("tdsls002.txta", "2", "", "", "", "", "text", "", outfile)

NOTE : Remember to do a COMMIT.TRANSACTION() for this table.
A text.write is like a database write.

This should solve your problem.

Cheers
Minhaaj