The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 906 - File: showthread.php PHP 7.2.24-0ubuntu0.18.04.17 (Linux)
File Line Function
/showthread.php 906 errorHandler->error



Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to determine when for-loop is done
FlawlessHappiness Offline
Posting Freak

Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation: 171
#1
How to determine when for-loop is done

How do I determine when a for-loop is done?

Or more specific, in what order does a for-loop run?
Say, I have

PHP Code: (Select All)
void Function()
{
for(
int i=1;i<=5;i++)
{
if(
GetLocalVarInt("Name_"+i) == 1)
{
return 
int(i);
}
}

SetEntityActive("Thing"false);


When this runs, it goes through 1 to 5, and if one of the local var named "Name_1" to "Name_5" are 1, it'll jump out of the function.
But when is SetEntityActive called? After the for-loop has run through all the numbers?

Trying is the first step to success.
(This post was last modified: 06-16-2015, 10:47 AM by FlawlessHappiness.)
06-16-2015, 10:47 AM
Find


Messages In This Thread
How to determine when for-loop is done - by FlawlessHappiness - 06-16-2015, 10:47 AM



Users browsing this thread: 1 Guest(s)