blanchap
16th February 2005, 21:10
Hi,
anyone ever used the text.write function? I'm trying to populate automatically the header text using this function and it does not work. Here is part of my code:
#include <bic_text>
zoom.to$("tdwsl0201sc00",z.session,"","",0) |session that creates a tmp file
stat = import("tmp.sort.file",zoom.file) |get the tmp file back
stat = text.write("tdwsl001.txta","2","","","","","","",tmp.sort.file)
Text does not get created.
have any suggestions?
thanks
PB
NPRao
16th February 2005, 21:25
Refer to this piece of code -
function extern long before.save.object(long mode)
{
domain tcmcs.long6 max.reqid
if mode = DAL_NEW then
select max(zmmig200.reqid):max.reqid
from zmmig200
selectdo
endselect
zmmig200.reqid = max.reqid + 1
endif
if zmmig200.note = 0 then
return(put.def.mig.text())
endif
.....
}
|******************************************************************************
function extern long put.def.mig.text()
{
long fp
string temp.file(256)
temp.file = creat.tmp.file$(bse.tmp.dir$())
fp = seq.open(temp.file,"w")
if fp < 1 then
dal.set.error.message("zmmigs0006") |* File Handling Errors
return(DALHOOKERROR)
endif
e = seq.puts("Migration Request # " & str$(zmmig200.reqid), fp)
e = seq.puts("Description of Change: ", fp)
e = seq.puts("Menus/sessions affected: ", fp)
e = seq.puts("Process Dependencies: ", fp)
e = seq.puts("System test: ", fp)
e = seq.puts("Setup required: ", fp)
e = seq.puts("", fp)
e = seq.puts("Other Systems affected and how: ", fp)
e = seq.close(fp)
|txtg = start.session(MODAL,"tttxt1110m000","zmmig1100m000","tttxt0005._index1")
|if isspace(txtg) then
| dal.set.error.message("zmmigs0005")|* Text group has to be selected
| return(DALHOOKERROR)
|endif
tttxt005.txtg = "text"
e = text.write("zmmig200.note", "", "","","","", tttxt005.txtg, "", temp.file)
e = file.rm(temp.file)
return(0)
}
|******************************************************************************
blanchap
17th February 2005, 15:45
Hi,
Thanks, the text.write is working now (it's returning a text number into txta field). The only thing is that it's not updating the table. Session is still asking me if i want to create a new text.
choice.text.manager:
before.choice:
zoom.to$("tdwsl0201sc00",z.session,"","",0)
stat = import("tmp.sort.file",zoom.file)
stat = text.write("tdwsl001.txta","2","","","","","text","",zoom.file)
commit.transaction()
could it be because i'm doing it in a before.choice of the text.manager?
regards
PB
blanchap
18th February 2005, 18:22
Hi,
yes, it was because i was in choice.text.manager
function text.write worked. Thanks for your help
regards
PB