pillai.ganesh
17th May 2014, 16:21
Hi Guys,

I'm facing a problem while reading spanish text present in my tctxtn field- tsxyz007.emtx.

There is a word present in my field -> "Compañia"

Which when read and stored in temporary file comes as -> "Compa>¼ñia "


The code that I use to read the text is as below:
tmp_file = creat.tmp.file$( bse.tmp.dir$() )
ret = text.read ("tsxyz007.emtx", "5", kw1, kw2, kw3, kw4, tgroup, edit_opt, tmp_file, 1)


Thanks,
Ganesh

bhushanchanda
19th May 2014, 10:55
Hi,

What is the return value for the function? Also, have you tried without the lock?

Check this link, which uses the predefined variables while reading.

Thread (http://www.baanboard.com/baanboard/showthread.php?t=60004)

pillai.ganesh
19th May 2014, 12:33
Thanks for the link Bhushan. :)
I have found the solution for this problem, with the help of mb.export$() function.
See the below code:
tmp_file = creat.tmp.file$( bse.tmp.dir$() )
if text.present.in.language(tsxyz007.emtx, i.language, no.lines)
= 1 then
if alloc.mem( tmp.array,
tccom.dll0015.domain.length("tcmcs.str256m"),
no.lines) = 0 then
ret = text.to.buf("tsxyz007.emtx",
i.language,
no.lines,
tmp.array)
if ret > 0 then
fp = seq.open(tmp_file, "w")
for i = 1 to no.lines
tmp.line = tmp.array(1,i)
ret1 = mb.export$(tmp.line, tmp.line)
tmp.array(1,i) = tmp.line
ret1 = seq.puts(tmp.line, fp)
endfor
ret1 = seq.close(fp)
endif

else
dal.set.error.message("tiascs0004")
|* Not enough memory
endif
endif

bhushanchanda
19th May 2014, 12:36
Hi,

Glad it worked for you. Thanks for posting the solution. Will help other
s facing the same issue.