"i" question
#1

I am looking at Vortex Roleplay 2 as another resource on how to script. I have noticed the author of the script uses "i" a lot. Is this a custom variable or is it built into SAMP? If it is built into SAMP is there reading material on it I can see? Here is a snipit of code from Vortex Roleplay 2:

Код:
stock substr_count(substring[], string[]) {
	new
		tmpcount;

	for( new i = 0; i < strlen(string); i++)
	{
        if(strfind(string[i], substring, true))
        {
			tmpcount++;
        }
	}
	return tmpcount;
}
Reply
#2

https://sampwiki.blast.hk/wiki/Loops
Reply
#3

It's a custom variable. It's commonly used because it stands for index.
Reply
#4

It is a custom variable used.
Also in some cases,its used as integer.
Reply
#5

Quote:
Originally Posted by SuperViper
Посмотреть сообщение
It's a custom variable. It's commonly used because it stands for index.
Actually I think it's iteration.

http://en.wikipedia.org/wiki/Iteration
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)