Re: How to execute commands one by one - WeOnlyDo Discussion board

Re: How to execute commands one by one (General questions)

by lax4u, Tuesday, July 03, 2007, 17:10 (6151 days ago) @ wodSupport

i did something like this. it will find Token Code: and then i send DTL + /r/n which is LF constant in my case. and check for : but it never find :


screen = telnet1.WaitFor( Press any key to continue , timeout);
telnet1.DataReady = 0;
telnet1.Send(LF);
if (!WhileTokenNotFound( Code: ))
{

telnet1.Send( DTL + LF);
telnet1.DataReady = 0;
screen = string.Empty;
if (!WhileTokenNotFound( : ))
{
telnet1.DataReady = 0;
screen = telnet1.Execute( sys + LF, $ , timeout);
}
}

private bool WhileTokenNotFound(string Token)
{
bool notFound = true;
while (notFound)
{
if (screen.IndexOf(Token) == -1)
{
screen = telnet1.ReceiveLine();
AddToList(screen);
}
else
{
notFound = false;
}
}
return notFound;
}



Complete thread: