A stupid annoying warning.
#1

Hello all
Today I have madea tiny script,I won't give any details,but during the preparations I got a warning which I can not get rid of:
pawn Код:
warning 219: local variable "min" shadows a variable at a preceding level
For those lines:
pawn Код:
new year,month,day,hour,min,sec; //The warning is for this line
gettime(hour,min,sec);
getdate(year,month,day);
Can someone please help me?
Thanks and have a good day
Reply
#2

you are simply using the variable "min" somewhere else in your script (most prolly a global variable). by renaming (all) of your date variables should solve it:
Код:
new Tyear,Tmonth,Tday,Thour,Tmin,Tsec;
gettime(Thour,Tmin,Tsec);
getdate(Tyear,Tmonth,Tday);
the "T" will make the time variables unique. feel free to change that ugly T to a different char ^^
edit: just noticed its the native min(value1,value2) is causing it...
Reply
#3

Quote:
Originally Posted by Babul
Посмотреть сообщение
you are simply using the variable "min" somewhere else in your script (most prolly a global variable). by renaming (all) of your date variables should solve it:
Код:
new Tyear,Tmonth,Tday,Thour,Tmin,Tsec;
gettime(Thour,Tmin,Tsec);
getdate(Tyear,Tmonth,Tday);
the "T" will make the time variables unique. feel free to change that ugly T to a different char ^^
lol I don't want to,I like the T
Although I have just checked and there is no "min" variable in my script
Reply
#4

argh youre too fast! if you would have used "max" as minutes timer, the same would have happened too.
its the natives like min, max.
plop
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)