SA-MP Forums Archive
"i" question - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: "i" question (/showthread.php?tid=372742)



"i" question - BittleRyan - 28.08.2012

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;
}



Re: "i" question - Shockey HD - 28.08.2012

https://sampwiki.blast.hk/wiki/Loops


Re: "i" question - SuperViper - 28.08.2012

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


Re: "i" question - Lordzy - 28.08.2012

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


Re: "i" question - MP2 - 28.08.2012

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