Rank: Advanced Member
Groups: Approved
Joined: 9/26/2018(UTC) Posts: 73 Location: 北京 Thanks: 18 times Was thanked: 1 time(s) in 1 post(s)
|
Hello Rob: I need your help: break destroys the execution of for loop script. Thank you. Quote:aa:for (i=1; i<=10;i++) { sp.Sleep(350); sp.SendString(String(i)); sp.Sleep(50); bb:for( i=1;i<=9999;i++ ) { sp.Sleep(50); var yyy=sp.GetCurrentMousePoint().Y; if (yyy>=850 || yyy<=25) {break bb;} sp.Sleep(50); } sp.Sleep(50); } Edited by user Thursday, January 21, 2021 1:47:36 AM(UTC)
| Reason: Not specified
|
|
|
|
Rank: Administration
Groups: Translators, Members, Administrators Joined: 1/11/2018(UTC) Posts: 1,349 Location: Tampa, FL Thanks: 28 times Was thanked: 416 time(s) in 354 post(s)
|
You were using i in both loops, so the inner loop was increasing i beyond 10, causing the outer loop to exit once you broke out of the inner loop. Changed the inner loop to use j instead. Code:aa:
for (i=1; i<=10; i++)
{
sp.Sleep(350);
sp.SendString(String(i));
sp.Sleep(50);
bb:
for (j=1; j<=9999; j++)
{
sp.Sleep(50);
var yyy = sp.GetCurrentMousePoint().Y;
if (yyy>=850 || yyy<=25)
{
break bb;
}
sp.Sleep(50);
}
sp.Sleep(50);
}
Edited by user Thursday, January 21, 2021 1:46:51 PM(UTC)
| Reason: Not specified
|
|
|
|
Rank: Advanced Member
Groups: Approved
Joined: 9/26/2018(UTC) Posts: 73 Location: 北京 Thanks: 18 times Was thanked: 1 time(s) in 1 post(s)
|
This problem has been solved perfectly. Thank you very much.
|
|
|
|
Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.
Important Information:
The StrokesPlus.net Forum uses cookies. By continuing to browse this site, you are agreeing to our use of cookies.
More Details
Close