Predator
16th December 2008, 08:34
hi,

I try to write a simple text into adjustment line but it did not go thru, can please help...below is the scripts

function update.whinh521.txta()
{

long l.ret, temp.text
|long l.layout.lfn
string l.layout(256)
extern domain tcmcs.str17 text.field
db.retry.point()

select whinh521.txta
from whinh521 for update
where whinh521._index1 = {:temp.orno3, 10}
selectdo
|write.item.text( whinh521.txta, "whinh521.txta", "2",
| "Testing")
text.field = "whinh521.txta"
attr.textlang$ = "2"
attr.textkw1$ = "Adjustment orders"
attr.textkw2$ = "Order line"
attr.textkw3$ = temp.orno3 & "/" & str$(10)
attr.textkw4$ = ""
attr.textopt$ = "text"
l.layout = "testing"
if whinh521.txta = 0 then
temp.text = textfield.to.database(162)
l.ret = 1
l.ret = TEXT.WRITE(
text.field,
attr.textlang$,
attr.textkw1$,
attr.textkw2$,
attr.textkw3$,
attr.textkw4$,
"text",
attr.textopt$,
l.layout)
endif
db.update(twhinh521, db.retry)
commit.transaction()
selectempty
endselect

}


Thank you

NvpBaaN
19th December 2008, 22:55
Try this:

l.ret = TEXT.WRITE("whinh521.txta",
attr.textlang$,
attr.textkw1$,
attr.textkw2$,
attr.textkw3$,
attr.textkw4$,
"text",
attr.textopt$,
l.layout)