SA-MP Forums Archive
Sublime Text Editor 3 - warning problems - 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: Sublime Text Editor 3 - warning problems (/showthread.php?tid=648889)



Sublime Text Editor 3 - warning problems - Saddin - 30.01.2018

I start working on new script and now my Sublime Text shows a lot of warnings:

PHP Code:
warning 219local variable "i" shadows a variable at a preceding level
warning 219
local variable "i" shadows a variable at a preceding level
warning 219
local variable "i" shadows a variable at a preceding level
warning 219
local variable "i" shadows a variable at a preceding level
warning 219
local variable "i" shadows a variable at a preceding level
warning 219
local variable "i" shadows a variable at a preceding level
warning 219
local variable "i" shadows a variable at a preceding level
warning 219
local variable "i" shadows a variable at a preceding level
warning 219
local variable "i" shadows a variable at a preceding level
warning 219
local variable "i" shadows a variable at a preceding level
warning 219
local variable "i" shadows a variable at a preceding level
warning 219
local variable "i" shadows a variable at a preceding level
warning 219
local variable "i" shadows a variable at a preceding level
warning 219
local variable "i" shadows a variable at a preceding level 
Does anyone know the fix? I know what warning means but I don't have time and nerves to go and fix over 1000 variable names... in more than 1 file.


Re: Sublime Text Editor 3 - warning problems - RogueDrifter - 30.01.2018

that looks like you did something like this:
PHP Code:
new i;
public 
OnPlayerConnect(playerid)
{
    for(new 
ii<MAX_PLAYERSi++;)
    { 
//..etc

that's why you should leave such single letters for loops only.
EDIT:
All you need to do is find the new i; on top of your script somewhere and simply remove it.


Re: Sublime Text Editor 3 - warning problems - VeryTallMidget - 30.01.2018

But if "i" is declared again, isn't its value erased ? - meaning it has NULL, empty value.
Mostly variables are re-usable with no problems...
Global and Local variables dont have conflict, variables inside procedures and functions are local.
Maybe sa:mp script works differently...


Re: Sublime Text Editor 3 - warning problems - Saddin - 30.01.2018

In Pawno everything is fine but in Sublime I got warning from script and includes also...


Re: Sublime Text Editor 3 - warning problems - VeryTallMidget - 30.01.2018

Maybe Sublime is over-reacting

Does Sublime have built-in error checking for Pawno or c++ ?


Re: Sublime Text Editor 3 - warning problems - cuber - 30.01.2018

Quote:
Originally Posted by VeryTallMidget
View Post
Maybe Sublime is over-reacting
Do you even know what the fuck are you talking about? A BIG-ASS NO.


Re: Sublime Text Editor 3 - warning problems - RogueDrifter - 30.01.2018

I'm using it and i never faced any problems, perhaps you should try using zeexs compiler as the build system?


Re: Sublime Text Editor 3 - warning problems - Saddin - 31.01.2018

Someone?


Re: Sublime Text Editor 3 - warning problems - Kane - 31.01.2018

Go back to where you last used ` i ` as a variable and look for any problems.

are you using modules?


Re: Sublime Text Editor 3 - warning problems - Saddin - 01.02.2018

Quote:
Originally Posted by Arthur Kane
View Post
Go back to where you last used ` i ` as a variable and look for any problems.

are you using modules?
No, I'm not using modules.


Re: Sublime Text Editor 3 - warning problems - PepsiCola23 - 01.02.2018

do you have use space intendation on?