jmichaeltayag
21st August 2014, 06:33
Hi need heelp ,

i know how to use the text.to.buf and get the certain string, my question is how can i put the string into TEXT as long?

Here's my code

ret = set.mem(tem.text,"")
ret = text.to.buf("whinh211.itxt",language$,80,tem.text) |text.to.buf

l1 = trim$(tem.text(1,5;80)) | Truck Scale Number
l2 = trim$(tem.text(1,6;80)) | Truck Number
l3 = trim$(tem.text(1,6;80))| Truck Scale Number
.
.

expample l1 and l2 i want it to put into INStext as tctxtn

here's my report layout
INStext as tctxtn


Thanks,

bhushanchanda
21st August 2014, 15:06
Hi,

You can use text.write function. Just create a temporary file. Open it, write your text and close it. Now proceed to use the function.

e.g.

file.tmp = creat.tmp.file$()
ft = seq.open(file.tmp,"w")
ret = seq.puts(text,ft) | text is your input text
seq.close(ft)

ret = text.write("tdsls401.txta",
"2",
"",
"",
"",
"",
"text",
"",
file.tmp)

jmichaeltayag
22nd August 2014, 04:29
Thanks for the reply sir Bhushan,

why is it can only get the 1st record of tttxt010?

Iam not that experience on script writing in baan. :(

jmichaeltayag
22nd August 2014, 04:56
Hi sir thanks for the reply, how come it only returns the 1st records of tttxt010 table?

Or

how can i create a TEXT as temporary file?


long ft
string file.tmp

string talx
talx = "abc"
|file.tmp = creat.tmp.file$( bse.tmp.dir$() )
file.tmp = creat.tmp.file$() |create temp file
ft = seq.open(file.tmp,"w") |open file with write method
ret = seq.puts(talx,ft) |text is your input text

ret = text.write("whinh211.itxt",
"2",
"",
"",
"",
"",
"text",
"",
file.tmp)



INStext = ft
seq.close(ft)

INStext = tctxtn
it only reads the 1st record of tttxt010



Iam not that experience on report script writing. :(

bhushanchanda
22nd August 2014, 11:12
Hi,

You need to close the file before writing to the table field.


long ft
string file.tmp

string talx
talx = "abc"
|file.tmp = creat.tmp.file$( bse.tmp.dir$() )
file.tmp = creat.tmp.file$() |create temp file
ft = seq.open(file.tmp,"w") |open file with write method
ret = seq.puts(talx,ft) |text is your input text
seq.close(ft)
ret = text.write("whinh211.itxt",
"2",
"",
"",
"",
"",
"text",
"",
file.tmp)



INStext = whinh211.itxt