dbinderbr
27th September 2002, 17:48
Hello friends,
Yes.. I am still testing AFS funcions, now in a more complex situation (but not so complex).
I had a problem with the usage of stpapi.continue.process and stpapi.zoom.option.
When I used just the zoom.option the process was executed fine and the record was inserted in the main session and another in the subsession. So, I remembered that this subsession was being called by the continue (cont.process) by the use of zoom.to and also there were another lines before the zoom. Because of this, I have to activate the cont.process too, when I used just the zoom.option these lines were not executed.. then my problem began... the code is listed bellow:
function long add.record.to.tudcb000(domain tcmcs.str8 p.esqu,
domain tcmcs.str50 p.desc,
domain tcmcs.str50 p.dcri,
domain tcmcs.str50 p.derr,
domain tuxch.dfor p.dfor,
domain tcmcs.str1 p.sepa,
domain tgyenox p.auto,
domain tudcb.tipo.o p.tipo,
ref string o.mess())
{
stpapi.put.field("tudcbo101m000", "tudcb000.esqu.o", p.esqu)
stpapi.put.field("tudcbo101m000", "tudcb000.desc.o", p.desc)
stpapi.put.field("tudcbo101m000", "tudcb000.dcri.o", p.dcri)
stpapi.put.field("tudcbo101m000", "tudcb000.derr.o", p.derr)
stpapi.put.field("tudcbo101m000", "tudcb000.dfor.o", str$(etol(p.dfor)))
stpapi.put.field("tudcbo101m000", "tudcb000.sepa.o", p.sepa)
stpapi.put.field("tudcbo101m000", "tudcb000.auto.o", str$(etol(p.auto)))
stpapi.put.field("tudcbo101m000", "tudcb000.tipo.o", str$(etol(p.tipo)))
stpapi.enum.answer("tudcbo101m000", "tudcb00001.o", tcyesno.yes)
ret = stpapi.insert("tudcbo101m000", true, o.mess)
if not ret then
ret = stpapi.recover("tudcbo101m000", error.msg)
else
o.mess = "Record Inserted Sucessfully in tudcb000."
execute.tudcbo102s000() |# cont.process
endif
stpapi.end.session("tudcbo101m000")
return(isspace(o.mess))
}
function execute.tudcbo102s000()
{
stpapi.handle.subproc("tudcbo101m000", "tudcbo102s000", "add")
stpapi.zoom.option("tudcbo101m000", 1, "tudcbo102s000", error.msg)
stpapi.continue.process("tudcbo101m000", error.msg)
stpapi.put.field("tudcbo102s000", "tudcb001.cpac.o", "ti")
stpapi.put.field("tudcbo102s000", "tudcb001.cmod.o", "itm")
stpapi.put.field("tudcbo102s000", "tudcb001.flno.o", "001")
ret = stpapi.insert("tudcbo102s000", true, o.mess)
if not ret then
ret = stpapi.recover("tudcbo102s000", error.msg)
else
o.mess = "Record Inserted Sucessfully in tudcb001."
endif
stpapi.end.session("tudcbo102s000")
}
As you can see in bold, if I remove the continue.process the program runs well but anything into the cont.process is not executed, when I run with the stpapi.continue.process the zoom.to$ is executed and the session gets frozen.
Any suggestion?
:confused: Thanks in advance. :confused:
Yes.. I am still testing AFS funcions, now in a more complex situation (but not so complex).
I had a problem with the usage of stpapi.continue.process and stpapi.zoom.option.
When I used just the zoom.option the process was executed fine and the record was inserted in the main session and another in the subsession. So, I remembered that this subsession was being called by the continue (cont.process) by the use of zoom.to and also there were another lines before the zoom. Because of this, I have to activate the cont.process too, when I used just the zoom.option these lines were not executed.. then my problem began... the code is listed bellow:
function long add.record.to.tudcb000(domain tcmcs.str8 p.esqu,
domain tcmcs.str50 p.desc,
domain tcmcs.str50 p.dcri,
domain tcmcs.str50 p.derr,
domain tuxch.dfor p.dfor,
domain tcmcs.str1 p.sepa,
domain tgyenox p.auto,
domain tudcb.tipo.o p.tipo,
ref string o.mess())
{
stpapi.put.field("tudcbo101m000", "tudcb000.esqu.o", p.esqu)
stpapi.put.field("tudcbo101m000", "tudcb000.desc.o", p.desc)
stpapi.put.field("tudcbo101m000", "tudcb000.dcri.o", p.dcri)
stpapi.put.field("tudcbo101m000", "tudcb000.derr.o", p.derr)
stpapi.put.field("tudcbo101m000", "tudcb000.dfor.o", str$(etol(p.dfor)))
stpapi.put.field("tudcbo101m000", "tudcb000.sepa.o", p.sepa)
stpapi.put.field("tudcbo101m000", "tudcb000.auto.o", str$(etol(p.auto)))
stpapi.put.field("tudcbo101m000", "tudcb000.tipo.o", str$(etol(p.tipo)))
stpapi.enum.answer("tudcbo101m000", "tudcb00001.o", tcyesno.yes)
ret = stpapi.insert("tudcbo101m000", true, o.mess)
if not ret then
ret = stpapi.recover("tudcbo101m000", error.msg)
else
o.mess = "Record Inserted Sucessfully in tudcb000."
execute.tudcbo102s000() |# cont.process
endif
stpapi.end.session("tudcbo101m000")
return(isspace(o.mess))
}
function execute.tudcbo102s000()
{
stpapi.handle.subproc("tudcbo101m000", "tudcbo102s000", "add")
stpapi.zoom.option("tudcbo101m000", 1, "tudcbo102s000", error.msg)
stpapi.continue.process("tudcbo101m000", error.msg)
stpapi.put.field("tudcbo102s000", "tudcb001.cpac.o", "ti")
stpapi.put.field("tudcbo102s000", "tudcb001.cmod.o", "itm")
stpapi.put.field("tudcbo102s000", "tudcb001.flno.o", "001")
ret = stpapi.insert("tudcbo102s000", true, o.mess)
if not ret then
ret = stpapi.recover("tudcbo102s000", error.msg)
else
o.mess = "Record Inserted Sucessfully in tudcb001."
endif
stpapi.end.session("tudcbo102s000")
}
As you can see in bold, if I remove the continue.process the program runs well but anything into the cont.process is not executed, when I run with the stpapi.continue.process the zoom.to$ is executed and the session gets frozen.
Any suggestion?
:confused: Thanks in advance. :confused: