24.10.2010, 15:11
(
Последний раз редактировалось DVDK; 30.10.2010 в 11:26.
Причина: Added 4 new errors/warnings
)
This is a list of meanings of all the error/warnings in PAWN, included some examples and fixes.
This page includes;
If you find any other errors/warnings, please post it here and tell me how you got it, and fixed it.
* This page is "in-the-make" and can be updated anytime!
====================================>
* Error 001: expected token: "}", but found "["
- Used too many arrays inside an enum variable.
Example:
Fix:
===>
* Error 001: expected token: "}", but found "]"
- Found ] inside an enum variable.
Example:
Fix:
===>
* Error 001: expected token: ",", but found ";"
- A function has not been finished.
Example:
Fix:
===>
* Error 001: expected token: "]", but found ","
- There is no ] at the end of an enum variable.
Example:
Fix:
===>
* Error 001: expected token: "]", but found ";"
- There is no ] at the end of an array.
Example:
Fix:
===>
* Error 001: expected token: ";", but found "xxx.."
- Variable is using invalid symboles.
Example:
Fix:
===>
* Error 001: expected token: ";", but found "-identifier-"
- You forgot ";" after calling a function.
Example:
Fix:
===>
* Error 001: expected token: ";", but found "-integer value-"
- You forgot a [, ], or both while making an array.
Example:
OR
OR
Fix:
OR
====================================>
* Error 017: undefined symbol "test"
- "test" has been used, but never created/defined.
Example:
or
Fix:
OR
====================================>
* Error 020: invalid symbol name ""
- Variable is using invalid symboles in front.
Example:
Fix:
====================================>
* Error 021: symbol already defined: "test"
- Variable has already been created.
Example:
Fix:
====================================>
* Error 029: invalid expression, assumed zero
- Variable or function is not completed.
Example:
OR
OR
Fix:
OR
====================================>
* Error 032: array index out of bounds (variable "test")
- A number in an array in "test" is above the created limit.
Example:
Fix:
====================================>
* Error 033: array must be indexed (variable "test")
- There is an array missing in "test".
Example:
Fix:
====================================>
* Error 035: argument type mismatch (argument xxx)
- Wrong usage of a parameter in a function.
Example:
Fix:
====================================>
* Error 037: invalid string (possibly non-terminated string)
- The usage of a string is wrong (probably forgot a ").
Example:
Fix:
====================================>
* Warning 202: number of arguments does not match definition
- The called function has too less or too many parameters.
Example:
WHILE
Fix:
====================================>
* Warning 203: symbol is never used: "test"
- "test" has been created/defined, but never used.
Example:
OR
Fix:
OR
====================================>
* Warning 204: symbol is assigned a value that is never used: "test"
- Variable has been created and set, but has no effect.
Example:
Fix:
====================================>
* Warning 215: expression has no effect
ATTENTION: Please fix any other errors first!
- Variable has been used but never created.
Example:
Fix:
====================================>
* Warning 217: loose indentation (Thanks to LarzI)
- Incorrect identation.
Example:
OR
Fix:
Indentation is tabs in script.
First code starts at column 0 (or 1) which is 0 tabs.
If a sub-part of a code (after a opening bracket { or if statement generally) you put a tab.
====================================>
* Warning 219: local variable "test" shadows a variable at a preceding level (Thanks to randomkid8![Cool](images/smilies/cool.gif)
- A same named variable has been created at a preceding level.
Example:
Fix:
====================================>
* Fatal error 107: too many error messages on one line
ATTENTION: Please fix any other errors first!
- There are too many errors.
This page includes;
Quote:
- Error: 001 ( ![]() - Error: 017 - Error: 020 - Error: 021 NEW - Error: 029 - Error: 032 - Error: 033 - Error: 035 NEW - Error: 037 NEW - Warning: 202 - Warning: 203 - Warning: 204 NEW - Warning: 217 - Warning: 215 NEW - Warning: 219 NEW - Fatal Error: 107 NEW |
* This page is "in-the-make" and can be updated anytime!
====================================>
* Error 001: expected token: "}", but found "["
- Used too many arrays inside an enum variable.
Example:
pawn Код:
enum testenum
{
test[2][5],
};
new testvariable[testenum];
pawn Код:
enum testenum
{
test[2],
};
new testvariable[testenum];
* Error 001: expected token: "}", but found "]"
- Found ] inside an enum variable.
Example:
pawn Код:
enum testenum
{
test],
};
new testvariable[testenum];
pawn Код:
enum testenum
{
test,
};
new testvariable[testenum];
* Error 001: expected token: ",", but found ";"
- A function has not been finished.
Example:
pawn Код:
test(0;
pawn Код:
test(0);
* Error 001: expected token: "]", but found ","
- There is no ] at the end of an enum variable.
Example:
pawn Код:
enum testenum
{
test[2,
};
new testvariable[testenum];
pawn Код:
enum testenum
{
test[2],
};
new testvariable[testenum];
* Error 001: expected token: "]", but found ";"
- There is no ] at the end of an array.
Example:
pawn Код:
new test[2;
pawn Код:
new test[2];
* Error 001: expected token: ";", but found "xxx.."
- Variable is using invalid symboles.
Example:
pawn Код:
new te?st;
pawn Код:
new test;
* Error 001: expected token: ";", but found "-identifier-"
- You forgot ";" after calling a function.
Example:
pawn Код:
test(0)
pawn Код:
test(0);
* Error 001: expected token: ";", but found "-integer value-"
- You forgot a [, ], or both while making an array.
Example:
pawn Код:
new test[2]5];
pawn Код:
new test 2];
pawn Код:
new test 2;
pawn Код:
new test[2][5];
pawn Код:
new test[2];
====================================>
* Error 017: undefined symbol "test"
- "test" has been used, but never created/defined.
Example:
pawn Код:
test = 1;
pawn Код:
Test();
pawn Код:
new test;
test = 1;
pawn Код:
Test();
Test()
{
}
====================================>
* Error 020: invalid symbol name ""
- Variable is using invalid symboles in front.
Example:
pawn Код:
new ?test;
pawn Код:
new test;
* Error 021: symbol already defined: "test"
- Variable has already been created.
Example:
pawn Код:
new test;
new test;
pawn Код:
new test;
====================================>
* Error 029: invalid expression, assumed zero
- Variable or function is not completed.
Example:
pawn Код:
new test[;
pawn Код:
test(;
pawn Код:
test);
pawn Код:
new test;
pawn Код:
test();
====================================>
* Error 032: array index out of bounds (variable "test")
- A number in an array in "test" is above the created limit.
Example:
pawn Код:
new test[2];
test[3] = 5;
pawn Код:
new test[2];
test[0] = 5;
====================================>
* Error 033: array must be indexed (variable "test")
- There is an array missing in "test".
Example:
pawn Код:
new test[2];
test = 5;
pawn Код:
new test[2];
test[0] = 5;
====================================>
* Error 035: argument type mismatch (argument xxx)
- Wrong usage of a parameter in a function.
Example:
pawn Код:
SendClientMessage("playerid", 0x000000FF, "This is a test message!");
pawn Код:
SendClientMessage(playerid, 0x000000FF, "This is a test message!");
====================================>
* Error 037: invalid string (possibly non-terminated string)
- The usage of a string is wrong (probably forgot a ").
Example:
pawn Код:
SendClientMessage(playerid, 0x000000FF, "This is a test message!);
pawn Код:
SendClientMessage(playerid, 0x000000FF, "This is a test message!");
* Warning 202: number of arguments does not match definition
- The called function has too less or too many parameters.
Example:
pawn Код:
test(2, 5, 7);
pawn Код:
test(int1, int2)
{
// stuff
}
pawn Код:
test(2, 5);
====================================>
* Warning 203: symbol is never used: "test"
- "test" has been created/defined, but never used.
Example:
pawn Код:
new test;
pawn Код:
testfunction(test)
{
// stuff
}
pawn Код:
new test;
test = 0;
pawn Код:
testfunction()
{
// stuff
}
====================================>
* Warning 204: symbol is assigned a value that is never used: "test"
- Variable has been created and set, but has no effect.
Example:
pawn Код:
new test;
test = 1;
pawn Код:
new test;
test = 1;
if(test == 1)
{
// Etc..
====================================>
* Warning 215: expression has no effect
ATTENTION: Please fix any other errors first!
- Variable has been used but never created.
Example:
pawn Код:
test = 1;
pawn Код:
new test;
test = 1;
====================================>
* Warning 217: loose indentation (Thanks to LarzI)
- Incorrect identation.
Example:
pawn Код:
if( strcmp( cmdtext, "/test", true ))
{
MyFunctionHere;
if( something == somethingElse )
{ somethingMuchElse; }
return true;
}
pawn Код:
if( strcmp( cmdtext, "/test", true ))
{
MyFunctionHere;
if(something == somethingElse)
{
somethingMuchElse;
}
return true;
}
Indentation is tabs in script.
First code starts at column 0 (or 1) which is 0 tabs.
If a sub-part of a code (after a opening bracket { or if statement generally) you put a tab.
pawn Код:
if( strcmp( cmdtext, "/test", true ))
{ //first part of code, no tabs
MyFunctionHere; //pawn uses 4 spaces for one tab. This is after a opening bracket, therefore we enter one tab.
if( something == somethingElse ) //here is another statement, but followed by a bracket, so the bracket won't be indented.
{
somethingMuchElse; //this, on the other hand, is after a bracket, therefore we indent with another tab.
} //the bracket is closed, therefore we go back to the column where the bracket is positioned (indented).
return true; //still the same column, since there are no more opening-brackets, and no statements.
} //closing this part of code - go back to the first column
====================================>
* Warning 219: local variable "test" shadows a variable at a preceding level (Thanks to randomkid8
![Cool](images/smilies/cool.gif)
- A same named variable has been created at a preceding level.
Example:
pawn Код:
public TestFunction()
{
new test;
if(Example)
{
new test;
test = 1;
}
}
pawn Код:
public TestFunction()
{
new test;
if(Example)
{
test = 1;
}
}
====================================>
* Fatal error 107: too many error messages on one line
ATTENTION: Please fix any other errors first!
- There are too many errors.