sorry for the newbie question
#1

sorry, but i've searched on these forums and sa-mp wiki (just incase) for info on what
Код:
while
is and does.
Reply
#2

it does exactly what it says
Код:
while (expression is true)
{
   // you can do something here
}
like for example

pawn Код:
new i = 0;
while (i < 5)
{
  printf("%d",i);
  i++;
}
Reply
#3

meh...
Reply
#4

Quote:
Originally Posted by Rav
it does exactly what it says
Код:
while (expression is true)
{
   // you can do something here
}
like for example

pawn Код:
new i = 0;
while (i < 5)
{
  printf("%d",i);
  i++;
}
Yes, what he said. Another example:

pawn Код:
new i = 0;
new e = 0;
while(!i)
{
  if (e > 5)
  {
    i = 1;
  }
  e++;
}
This will also break the while() when e is above 5, because i becomes 1 (true).

Quote:
Originally Posted by Freestyler
meh...
You like your post count, don't you?
Reply
#5

What can while be used for?
Reply
#6

Quote:
Originally Posted by [FF
Nimphious ]
What can while be used for?
It's a joke right?
Reply
#7

Why isn't this used more? I rarely see it in any released scripts.
Reply
#8

ohh. so does it just mean during the stuff in the () and then you have the {and }.
Reply
#9

Quote:
Originally Posted by MenaceX^
Quote:
Originally Posted by [FF
Nimphious ]
What can while be used for?
It's a joke right?
No. I have never seen (while) before and was just wondering what it could be used for.

Quote:
Originally Posted by iTails
Quote:
Originally Posted by [FF
Nimphious ]
What can while be used for?
Step away from the keyboard please.

Basically, you can do something, while doing something else. Common sense.
oic. thnx,
Reply
#10

Quote:
Originally Posted by Norn
Why isn't this used more? I rarely see it in any released scripts.
because for most things a for loop will do the same job with less effort to the scripter.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)