I think TTnScript is the way to go. You can dynamically add/remove events according to which "screen" you detect. If you don't use TTnScript, has a look at his source code to understand how to get hand on the input stream to chack for data.
I also uploaded a modified version of the components. It is a proposal of changes by John Porteous. It will probably appear shortly in the distribution. You may try it: http://www.overbyte.be/arch/dump/EmulVTJohnPorteous.zip Contribute to the SSL Effort. Visit http://www.overbyte.be/eng/ssl.html -- [EMAIL PROTECTED] Author of ICS (Internet Component Suite, freeware) Author of MidWare (Multi-tier framework, freeware) http://www.overbyte.be ----- Original Message ----- From: "Humm, Markus" <[EMAIL PROTECTED]> To: <email@example.com> Sent: Friday, November 17, 2006 11:46 AM Subject: [twsocket] Telnet problems > Hello, > > I've some big problems with the telnet components, the biggest one being > the lack of documentation. > > What I want to do is the following: > > 1. start a telnet session (that one works) > > 2. have a list of commands > > 3. loop through the list and carry out one command after the other > > 4. display the telnet output in some window, scrollable so that I can > see the history to verify it. > > What I'm doing right now is: > > 1. start a telnet connection > > 2. wait until isconnected becomes true or 2 sec. Timeout > (the telnetserver is the only node on a local lan so it's fast and > works reliably) > > 3. In the OnDataAvailable I do this: > > if endofcommands = false then > begin > TnEmulVT.SendStr(nextcommandstring); > end; > > Where commandstring will be sometings like '2'+#13 or 'mytext'+#13 or > ''+#13. > > 4. the device on the other side is menu based where each menu item has a > number unique to that menu level. > > e.g. the main menu might look like this: > > 1. first submenu > 2. second submenu > > If I go to 2nd submenu another menu is displayed: > > 1. do something > 2. do something other > 3. set testtext > > If I go to the 2nd submenu and select the 3. item I get a prompt: > > enter your text: > > After this prompt I want to enter text and if it is terminated by #13 > I get the 2nd submenu displayed again, (seems normal) where I can get > up to the main menu by just sending #13. > > I get to the "set testtext" menu already and the prompt is displayed, > but my text sent is not entered as it seems. > I've a breakpoint in nDataAvailable but it is only reached twice, so > the call of that menu works but the text > isn't enered because it's nerver being sent due to OnDataAvailabe not > being raised. LocalEcho is off. > My program simply displays the terminal then and when I enter some > chars they're always shown twice in the terminal. > Why is this? > > I tried OnLocalEcho as well but I think the results where even worse, > I think it only occured once and then stopped. > What good is OnEndOfRecord for besides? > > I think I can't use TnScript, because the same menu items will be > displayed several times because I have > to "traverse" the submenus several times. > > Scrolling back also messes up the whole TnEmulVT as well as changing the > font size and lineheight > (the cursor is between the lines then). So this would be a enhancement > request ( ;-) ) to properly support these things. > > Greetings > > Markus > -- > To unsubscribe or change your settings for TWSocket mailing list > please goto http://www.elists.org/mailman/listinfo/twsocket > Visit our website at http://www.overbyte.be -- To unsubscribe or change your settings for TWSocket mailing list please goto http://www.elists.org/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be