Use of "continue" properly?
#1

I have a little problem with the use of "continue". I tried using the following code:
pawn Код:
if (!dini_Exists(File)) continue;
- It didn't turn out well. I looked at the SA-MP Wiki: https://sampwiki.blast.hk/wiki/Control_Structures#continue

As I understand "continue" can only be used in loops, and not in a simple function. Is that correct? If not how can I make the above code work?
Reply
#2

While in a loop, "continue;" is used to skip to the next looped whatever it is. For example
pawn Код:
for(new i = 0; i < MAX_PLAYERS; i++)
{
   if(i == 5) continue;
   {
      //code here
   }
}
That will skip i when it equals 5. And not execute the code for it.
Reply
#3

Quote:
Originally Posted by Grim_
Посмотреть сообщение
While in a loop, "continue;" is used to skip to the next looped whatever it is. For example
pawn Код:
for(new i = 0; i < MAX_PLAYERS; i++)
{
   if(i == 5) continue;
   {
      //code here
   }
}
That will skip i when it equals 5. And not execute the code for it.
Okay thanks alot,
Reply
#4

You're welcome.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)