The difference between 'while' and 'for'
#7

Quote:
Originally Posted by Vince
Посмотреть сообщение
For is used when you know how many times you want to iterate, while is for the other case. For example; you don't usually know how many lines there are in a file or how many rows were returned by SQL query.
Yes, but couldnt you just do it like
Код:
new
	a = 0;
while (a < 'MAX_PLAYERS, FILE_LINES or ROWS')
{
	// Code in the loop
	a++;
}
Reply


Messages In This Thread
The difference between 'while' and 'for' - by 2KY - 14.04.2012, 14:21
Re: The difference between 'while' and 'for' - by iggy1 - 14.04.2012, 14:22
Re: The difference between 'while' and 'for' - by 2KY - 14.04.2012, 14:50
Re: The difference between 'while' and 'for' - by iggy1 - 14.04.2012, 14:52
Re: The difference between 'while' and 'for' - by Shetch - 14.04.2012, 14:55
Re: The difference between 'while' and 'for' - by Vince - 14.04.2012, 14:56
Re: The difference between 'while' and 'for' - by Shetch - 14.04.2012, 14:58
Re: The difference between 'while' and 'for' - by iggy1 - 14.04.2012, 15:05
AW: The difference between 'while' and 'for' - by Nero_3D - 14.04.2012, 15:40

Forum Jump:


Users browsing this thread: 1 Guest(s)