local variable "string" shadows a variable
#1

Sziasztok!

The stack/heap used too much memory so I had to move the login/register system to the dialog.But after I pasted it under the dialog,a lot of warnings/errors appeared.I know what does the error/warning means,but it should be working well,but somehow it's not.


: warning 219: local variable "string" shadows a variable at a preceding level
D:\SAMP\gamemodes\loginommysql.pwn(5081) : warning 219: local variable "string" shadows a variable at a preceding level
D:\SAMP\gamemodes\loginommysql.pwn(5110) : warning 219: local variable "string" shadows a variable at a preceding level
D:\SAMP\gamemodes\loginommysql.pwn(5145) : warning 219: local variable "string" shadows a variable at a preceding level
D:\SAMP\gamemodes\loginommysql.pwn(5221) : warning 219: local variable "string" shadows a variable at a preceding level
D:\SAMP\gamemodes\loginommysql.pwn(5275) : error 021: symbol already defined: "string"
D:\SAMP\gamemodes\loginommysql.pwn(5329) : error 021: symbol already defined: "string"
D:\SAMP\gamemodes\loginommysql.pwn(5394) : warning 219: local variable "string" shadows a variable at a preceding level
etc........
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


2 Errors.


For example: The first dialog is the login,and the third is the dialog,which gives me warning.
http://pastebin.com/7K1FhB6h

Thanks for you help.
Reply
#2

Variable defined globally and in function. To fix mistake delete variable "string" definitions in lines 5275
and 5329
Reply
#3

Then it find's these errors in includes.But I don'T know why did this happen.The string was already there,I only pasted there a lot of other lines,and as a miracle these errors/warnings appeared.
Reply
#4

So you don't need help or your errors is anywhere else?
Reply
#5

instead of namming it "string", name it something else such as strings or something, it might work!.
Reply
#6

string, str, tmp are really common string variables, you shouldn't be using them or else it will conflict with includes and libraries. You can always rename them to g_String or something else, or even string_ which is quite easy to change.
Reply
#7

Got it.thanks.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)