troubleshooting Question

Fuction I want to add Argument

Avatar of bhrugu123
bhrugu123Flag for United States of America asked on
JavaScriptJScript
8 Comments1 Solution542 ViewsLast Modified:
We want to modify the total number of half-seconds (or number of times the loop executes), not the number of milliseconds that the sleep method pauses.

My fuction is
function BlueZone_WaitForPrompt(objHost, strPrompt, strError)
{
      var timer = 0;
      var bzError =0;
      var x = new Object();                 
      var y = new Object();
      var buffer = new Object();
      var ErrorBuffer = new Object()
      
      var iTimerMax = 90;
      if (strPrompt == '<N>') {
            iTimerMax = 20;
      }

      while (timer < iTimerMax)
       {
            // Read from the current cursor location...
            objHost.GetCursor(y, x);
            objHost.ReadScreen(buffer, strPrompt.length, y.Num, x.Num - strPrompt.length);
            if (strPrompt == buffer.Str) {
                  CourWndAutomation.Sleep(500);
                  return true;
            }

            timer++;

            if(strPrompt == VERIFY_NEW_PW_PROMPT && doForcePasswordReset==false){
                  //Special case, read line returned from system above cursor
                  objHost.ReadScreen(Errorbuffer, VERIFY_PW_ERROR.length, y.Num - 2, VERIFY_PW_ERROR.x);
                  Errorbuffer.Str = Errorbuffer.Str.trim();
                  if((Errorbuffer.Str != "") && (Errorbuffer.Str != ADMINPASSWORD_PROMPT.trim())){
                        strError = buffer.Str;
                        break;
                  }
            } 

            CourWndAutomation.Sleep(500);
      }

      if (strError != "") {
            Log("Error: The value " + buffer.Str + " did not match the expected value " + strPrompt) //Log out what has been read from screen
            throw(strError);
      }
return false
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 8 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 8 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros