luis melo
25th July 2007, 23:10
Hi,
I need know what the procedure for record the text of a determine iten with utilizing program code.
e.g.: I'd like to do via program code what the command ESC+S of tttxt2200m000.
Thanks in advance,
Luis
bdittmar
26th July 2007, 10:15
Hi,
I need know what the procedure for record the text of a determine iten with utilizing program code.
e.g.: I'd like to do via program code what the command ESC+S of tttxt2200m000.
Thanks in advance,
Luis
Hello,
you are able to create a text file in different ways.
One is : use seq functions to create the file and text.to.buf for writing
the text to this file.
Regards
en@frrom
26th July 2007, 14:48
Assuming you are looking to extract an existing Baan-text, I enclose a sample script of how to export Baan texts to csv-file.
|******************************************************************************
|* 0 VRC B50E b rom2
|* Export texts from ttmmxxx
|* Eli Nager
|* 15-05-07 [15:14]
|******************************************************************************
|* Script Type: 0
|******************************************************************************
|****************************** DECLARATION SECTION ***************************
table tttmmxxx |
extern domain tcmcs.s999 line
extern domain tcmcs.long ret, i
extern domain tcmcs.long fileid
extern domain tcmcs.str132 txt(30)
string curr.line(2048)
#define PATH "${BSE}/tmp/ttmmmxxx.csv"
#define TR(x) strip$(shiftl$(x))
#define DLM ";"
#include <bic_text>
function main()
{
ret = 0
ret = file.rm(PATH)
fileid = seq.open(PATH, "wt")
if fileid < 0 then
message("kon bestand niet openen")
else
select ttmmxxx.*
from ttmmxxx
where ttmmxxx.txta > 0
order by ttmmxxx._index1
selectdo
curr.line = ""
curr.line = TR(ttmmxxx.code) & DLM & TR(ttmmxxx.valu)
set.mem(txt, "")
ret = text.to.buf("ttmmxxx.txta", "1", 30, txt)
for i = 1 to ret
curr.line = curr.line & DLM & strip$(txt(1,i))
endfor
seq.puts(curr.line, fileid)
endselect
if seq.close(fileid) = 0 then
message("Text-velden ttmmxxx ge-exporteerd naar bestand: " & PATH)
else
message("Kon text-velden niet wegschrijven naar bestand: " & PATH)
endif
endif
}
|****************************** PROGRAM SECTION ***************************
|****************************** ZOOM FROM SECTION ***************************
|****************************** FORM SECTION ***************************
|****************************** CHOICE SECTION ***************************
|****************************** FIELD SECTION ***************************
|****************************** MAIN TABLE SECTION ***************************
|****************************** FUNCTION SECTION ***************************
Hope this helps.
Regards,
Eli Nager
luis melo
26th July 2007, 23:39
Hi Guys
Thanks for your solutions