bhrugu123
asked on
Fuction I want to add Argument
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
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
ASKER
what is actully loopcount do?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
if i add that i can run application faster or what? OR DO YOU KNOW ANY ANOTHER WAY TO DO IT?
I don't know if your application will run faster or not because I have no idea about the rest of the code nor the purpose of this function nor what it's actually doing... I just gave you an answer to what you've asked.
ASKER
IF i give you code so you can let me know that right way to do or not this is whole code.
ASKER
okay thanks
Question: "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."
I gave the user a way (and hinted them on another one) they can change the number of times the loop executes. That may not be what they're looking for but it's the answer to the question.
Thanks,
Tom
I gave the user a way (and hinted them on another one) they can change the number of times the loop executes. That may not be what they're looking for but it's the answer to the question.
Thanks,
Tom
Regards,
Tom
Open in new window