psuryava
16th April 2013, 13:17
Hi All,

Please have a look at below piece of code. Sometimes it works perfectly fine but sometimes it hangs either at brp.open, brp.close or at brp.ready(written in function read.main.table()) . No clue why this is happening. Please help me to solve this problem.

Please see attached file for detail screenshots where debugger hangs.

select tcsil999.*
from tcsil999
where tcsil999._index1 inrange {:cuno.f} and {:cuno.t}
and tcsil999.email <> ""
and tcsil999.aemail <> ""
selectdo
if isspace(tcsil999.email) or isspace(tcsil999.aemail) then
break
endif

spool.fileout = creat.tmp.file$(bse.tmp.dir$())
invoice.file.name = spool.fileout
inv.rep = brp.open("rtdsil041011003", "ASCIN", 0)
read.main.table(tcsil999.cuno)
brp.close(inv.rep)

mark_h
16th April 2013, 16:58
I have had something like this happen - not sure it was exactly the same problem. In the past I have had various programs freeze up when they ran faster than some of the shell commands it ran. What I ended up doing was putting in suspend(1000) or something like it, to give commands time to clear up. You can try this after the brp.close - but I have done it after shell commands and even after ending subsessions to give the system time to clean things up. Like I said I cannot say with any certainty this is the same problem. Especially since it seems to be random where it occurs.

Other than that - can't think of anything other than making sure the device and tmp files that are created are not still being accessed when trying to close them.

vinay sharma
18th June 2013, 17:02
kindly show your read.main.table fuction


regards
vinay