StrokesPlus.net
Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Options
Go to last post Go to first unread
rootstock  
#1 Posted : Wednesday, April 5, 2023 11:39:37 PM(UTC)
rootstock

Rank: Newbie

Reputation:

Groups: Approved
Joined: 9/13/2021(UTC)
Posts: 4
China

Thanks: 1 times
for(i = 0; i < 2; i++) {
for(i = 0; i < 2; i++) {
sp.MouseClick(new Point(-380,630), MouseButtons.Left, true, true);
sp.Sleep(500);

}
sp.MouseClick(new Point(-380,830), MouseButtons.Left, true, true);
sp.Sleep(500);
}

a greenhand question, i want to do a loop in a loop, but the code only runing one loop, outside loop doesn't work, what i did wrong ? thanks

Rob  
#2 Posted : Wednesday, April 5, 2023 11:55:12 PM(UTC)
Rob

Rank: Administration

Reputation:

Groups: Translators, Members, Administrators
Joined: 1/11/2018(UTC)
Posts: 1,349
United States
Location: Tampa, FL

Thanks: 28 times
Was thanked: 416 time(s) in 354 post(s)
Use a different variable for the inner loop, using i in both results in the inner loop's i being set to the same as the outer.

Use something like j

for(j = 0; j < 2; j++) {
Users browsing this topic
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.