<p>I'm developing a system that needs to execute Intersystems Cache Terminal Scripts.</p>

<p>When I run a routine inside the regular Caché terminal or a telnet terminal, Cache executes the routine until the end with no problems. But when I try to run the same routine, but this time calling the routine within a Caché terminal Script, Caché disconnects the session after a while. There is no mention at all in the documentation of a "timeout" setting or anything realted to the "" messages i'm getting.</p>

<p>The script is run just like this:</p>

<pre><code>Cterm.exe /console=cn_iptcp:192.168.2.13[23] c:\test.s
</code></pre>

<p>1) Does anybody know what may be causing Interystems Caché to disconnected the session in the middle of the run (the session isn't idle either. It regularly outputs status messages to the console)?</p>

<p>2) Any ideas of how to solve it?</p>

<p>Thanks,</p>

<p>Luís Fernando</p>

Is there a chance it's not a timeout, but some other problem?  Possibly a runtime error that's not being trapped/logged?
The main difference between running from the interactive console and as a script is that when you run interactively you're in Programmer Mode, but in the script you're in User Mode.  I can't think of any reason off-hand why that would matter, but possibly your code is sensitive to that.
Here's something to try:  Write a very simple script that does nothing except write out a character every now and then.  Maybe something like this:
F I=1:1:360 H 10 W "."  ;Write a dot every 10 seconds for 1 hour
If that gets the timeout too then you know it's the terminal, not your code.