Raised This Month: $51 Target: $400
 12% 

A few questions about pawn...


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
SweatyBanana
BANNED
Join Date: Sep 2005
Location: LOL
Old 12-07-2005 , 11:27   A few questions about pawn...
Reply With Quote #1

Ok...so i read a 175 page pawn manual and I have a few questions...

Is this true?:
Code:
If the pawn parser produces a list of errors, the first error in this list is a true error, but the diagnostic messages below it may not be errors at all.

After the pawn parser sees an error, it tries to step over it and complete the compilation. However, the stumbling on the error may have confused the pawn parser so that subsequent legitimate statements are misinterpreted and reported as errors too.

When in doubt, fix the first error and recompile.

Code:
Can a static variable be defined once in a plugin and be used throughout it?
And why not include these for the compiler...so people know whats wrong...

Code:
demo.p(3) : error 001: expected token: ";", but found "{"

would be: expected token: token, but found token A required token is omitted.

ERROR #'s:

001 expected token: token, but found token
A required token is omitted.

002 only a single statement (or expression) can follow each \case"
Pitfalls: 120
Compound state-
ment: 102
Every case in a switch statement can hold exactly one statement. To put
multiple statements in a case, enclose these statements between braces
(which creates a combound statement).

003 declaration of a local variable must appear in a compound block
Compound state-
ment: 102 The declaration of a local variable must appear between braces (\{: : :}")
at the active scope level.
When the parser 
ags this error, a variable declaration appears as the
only statement of a function or the only statement below an if, else,
for, while or do statement. Note that, since local variables are accessible
only from (or below) the scope that their declaration appears
in, having a variable declaration as the only statement at any scope is
useless.

004 function name is not implemented
Forward declara-
tion: 73 There is no implementation for the designated function. The function
may have been \forwardly" declared |or prototyped| but the full function
denition including a statement, or statement block, is missing.

005 function may not have arguments
The function main() is the program entry point. It may not have arguments.

006 must be assigned to an array
String literals or arrays must be assigned to an array. This error message
may also indicate a missing index (or indices) at the array on the right
side of the \=" sign.

007 operator cannot be redened
Only a select set of operators may be redened, this operator is not one
of them. See page 77 for details.

008 must be a constant expression; assumed zero
The size of arrays and the parameters of most directives must be constant
values.

009 invalid array size (negative or zero)
The number of elements of an array must always be 1 or more.
136  Error and warning messages

010 illegal function or declaration
The compiler expects a declaration of a global variable or of a function
at the current location, but it cannot interpret it as such.

011 invalid outside functions
The instruction or statement is invalid at a global level. Local labels and
(compound) statements are only valid if used within functions.

012 invalid function call, not a valid address
The symbol is not a function.

013 no entry point (no public functions)
The le does not contain a main function or any public function. The
compiled le thereby does not have a starting point for the execution.

014 invalid statement; not in switch
The statements case and default are only valid inside a switch statement.

015 \default" must be the last clause in switch statement
pawn requires the default clause to be the last clause in a switch
statement.

016 multiple defaults in \switch"
Each switch statement may only have one default clause.

017 undened symbol symbol
The symbol (variable, constant or function) is not declared.

018 initialization data exceeds declared size
Initialization: 56
An array with a specied size is initialized, but the number of initiallers
exceeds the number of elements specied (e.g. \arr[3]={1,2,3,4};"
the array is specied to have three elements, but there are four initiallers).

019 not a label: name
A goto statement branches to a symbol that is not a label.

020 invalid symbol name
Symbol name
syntax: 88 A symbol may start with a letter, an underscore or an \at" sign (\@")
and may be followed by a series of letters, digits, underscore characters
and \@" characters.

021 symbol already dened: identier
The symbol was already dened at the current level.
Error and warning messages  137

022 must be lvalue (non-constant)
The symbol that is altered (incremented, decremented, assigned a value,
etc.) must be a variable that can be modied (this kind of variable is
called an lvalue). Functions, string literals, arrays and constants are no
lvalues. Variables declared with the \const" attribute are no lvalues
either.

023 array assignment must be simple assignment
When assigning one array to another, you cannot combine an arithmetic
operation with the assignment (e.g., you cannot use the \+=" operator).

024 \break" or \continue" is out of context
The statements break and continue are only valid inside the context
of a loop (a do, for or while statement). Unlike the languages C/C++
and Java, break does not jump out of a switch statement.

025 function heading diers from prototype
The number of arguments given at a previous declaration of the function
does not match the number of arguments given at the current declaration.

026 no matching \#if..."
The directive #else or #endif was encountered, but no matching #if
directive was found.

027 invalid character constant
Escape sequence:
90 One likely cause for this error is the occurrence of an unknown escape
sequence, like \\x". Putting multiple characters between single quotes,
as in 'abc' also issues this error message. A third cause for this error
is a situation where a character constant was expected, but none (or a
non-character expression) were provided.

028 invalid subscript (not an array or too many subscripts): identi-
er
The subscript operators \[" and \]" are only valid with arrays. The number
of square bracket pairs may not exceed the number of dimensions of
the array.

029 invalid expression, assumed zero
The compiler could not interpret the expression.

030 compound statement not closed at the end of le
An unexpected end of le occurred. One or more compound statements
138 ? Error and warning messages
are still unnished (i.e. the closing brace \g" has not been found).

031 unknown directive
The character \#" appears rst at a line, but no valid directive was
specied.

032 array index out of bounds
The array index is larger than the highest valid entry of the array.

033 array must be indexed (variable name)
An array as a whole cannot be used in a expression; you must indicate
an element of the array between square brackets.

034 argument does not have a default value (argument index)
You can only use the argument placeholder when the function denition
species a default value for the argument.

035 argument type mismatch (argument index)
The argument that you pass is dierent from the argument that the function
expects, and the compiler cannot convert the passed-in argument
to the required type. For example, you cannot pass the literal value \1"
as an argument when the function expects an array or a reference.

036 empty statement
Empty com-
pound block:
102
The line contains a semicolon that is not preceded by an expression.
pawn does not support a semicolon as an empty statement, use an empty
compound block instead.

037 invalid string (possibly non-terminated string)
A string was not well-formed; for example, the nal quote that ends
a string is missing, or the lename for the #include directive was not
enclosed in double quotes or angle brackets.

038 extra characters on line
There were trailing characters on a line that contained a directive (a
directive starts with a # symbol, see page 107).

039 constant symbol has no size
A variable has a size (measured in a number of cells), a constant has
no size. That is, you cannot use a (symbolic) constant with the sizeof
operator, for example.

040 duplicate \case" label (value value)
A preceding \case label" in the list of the switch statement evaluates
to the same value.
Error and warning messages ? 139

041 invalid ellipsis, array size is not known
You used a syntax like \arr[] = { 1, ... };", which is invalid,
because the compiler cannot deduce the size of the array from the declaration.

042 invalid combination of class speciers
A function or variable is denoted as both \public" and \native", which
is unsupported. Other compinations may also be unsupported; for example,
a function cannot be both \public" and \stock" (a variable may
be declared both \public" and \stock").

043 character constant exceeds range for packed string
Usually an attempt to store a Unicode character in a packed string where
a packed character is 8-bits.

044 mixing named and positional parameters
You must either use named parameters or positional parameters for all
parameters of the function.

045 too many function arguments
The maximum number of function arguments is currently limited to 64.

046 unknown array size (variable name)
For array assignment, the size of both arrays must be explicitly dened,
also if they are passed as function arguments.

047 array sizes do not match, or destination array is too small
For array assignment, the arrays on the left and the right side of the
assignment operator must have the same number of dimensions. In addition:
 for multi-dimensional arrays, both arrays must have the same size;
 for single arrays with a single dimension, the array on the left side of
the assignment operator must have a size that is equal or bigger than
the one on the right side.
When passing arrays to a function argument, these rules also hold for
the array that is passed to the function (in the function call) versus the
array declared in the function denition.
When a function returns an array, all return statements must specify
an array with the same size and dimensions.
140 ? Error and warning messages

048 array dimensions do not match
For an array assignment, the dimensions of the arrays on both sides of
the \=" sign must match; when passing arrays to a function argument,
the arrays passed to the function (in the function call) must match with
the denition of the function arguments.
When a function returns an array, all return statements must specify
an array with the same size and dimensions.

049 invalid line continuation
Single line com-
ment: 88 A line continuation character (a backslash at the end of a line) is at
an invalid position, for example at the end of a le or in a single line
comment.

050 invalid range
A numeric range with the syntax \n1 .. n2", where n1 and n2 are
numeric constants, is invalid. Either one of the values in not a valid
number, or n1 is not smaller than n2.

051 invalid subscript, use \[ ]" operators on major dimensions
You can use the \array character index" operator (braces: \{ }" only
for the last dimension. For other dimensions, you must use the cell index
operator (square brackets: \[ ]").

052 multi-dimensional arrays must be fully initialized
If an array with more than one dimension is initialized at its declaration,
then there must be equally many literal vectors/sub-arrays at the right
of the equal sign (\=") as specied for the major dimension(s) of the
array.

053 exceeding maximum number of dimensions
The current implementation of the pawn compiler only supports arrays
with one or two dimensions.

054 unmatched closing brace
A closing brace (\}") was found without matching opening brace (\{").

055 start of function body without function header
An opening brace (\{") was found outside the scope of a function. This
may be caused by a semicolon at the end of a preceding function header.

056 local variables and function arguments cannot be public
A local variable or a function argument starts with the character \@",
which is invalid.
Error and warning messages ? 141

057 Unnished expression before compiler directive
Compiler directives may only occur between statements, not inside a
statement. This error typically occurs when an expression statement is
split over multiple lines and a compiler directive appears between the
start and the end of the expression. This is not supported.

058 duplicate argument; same argument is passed twice
Named versus
positional pa-
rameters: 66
In the function call, the same argument appears twice, possibly through
a mixture of named and positional parameters.

059 function argument may not have a default value (variable name)
All arguments of public functions must be passed explicitly. Public
functions are typically called from the host application, who has no
knowledge of the default parameter values. Arguments of user dened
operators are implied from the expression and cannot be inferred from
the default value of an argument.

060 multiple \#else" directives between \#if : : : #endif
Two or more #else directives appear in the body between the matching
#if and #endif.

061 \#elseif" directive follows an \#else" directive
All #elseif directives must appear before the #else directive. This
error may also indicate that an #endif directive for a higher level is
missing.

062 number of operands does not t the operator
When redening an operator, the number of operands that the operator
has (1 for unary operators and 2 for binary operators) must be equal to
the number of arguments of the operator function.

063 operator requires that the function result has a \bool" tag
Logical and relational operators are dened as having a result that is
either true (1) or false (0) and having a \bool" tag. A user dened
operator should adhere to this denition.

064 cannot change predened operators
One cannot dene operators to work on untagged values, for example,
because pawn already denes this operation.

065 function argument may only have a single tag (argument num-
ber)
142 ? Error and warning messages
In a user dened operator, a function argument may not have multiple
tags.

066 function argument may not be a reference argument or an array
(argument number)
In a user dened operator, all arguments must be cells (non-arrays) that
are passed \by value".

067 variable cannot be both a reference and an array (variable
name)
A function argument may be denoted as a \reference" or as an array,
but not as both.

068 invalid rational number precision in #pragma
The precision was negative or too high. For 
oating point rational numbers,
the precision specication should be omitted.

069 rational number format already dened
This #pragma con
icts with an earlier #pragma that specied a dierent
format.

070 rational number support was not enabled
#pragma ratio-
nal: 111 A rational literal number was encountered, but the format for rational
numbers was not specied.

071 user-dened operator must be declared before use (function
Forward declara-
tion: 73 name)
Like a variable, a user-dened operator must be declared before its rst
use. This message indicates that prior to the declaration of the userde
ned operator, an instance where the operator was used on operands
with the same tags occurred. This may either indicate that the program
tries to make mixed use of the default operator and a user-dened operator
(which is unsupported), or that the user-dened operator must be
\forwardly declared".

072 \sizeof" operator is invalid on \function" symbols
You used something like \sizeof MyCounter" where the symbol \My-
Counter" is not a variable, but a function. You cannot request the size
of a function.

073 function argument must be an array (argument name)
The function argument is a constant or a simple variable, but the function
requires that you pass an array.
Error and warning messages ? 143

074 #dene pattern must start with an alphabetic character
Any pattern for the #define directive must start with a letter, an underscore
(\_") or an \@"-character. The pattern is the rst word that
follows the #define keyword.

075 input line too long (after substitutions)
Either the source le contains a very long line, or text substitutions make
a line that was initially of acceptable length grow beyond its bounds.
This may be caused by a text substitution that causes recursive substitution
(the pattern matching a portion of the replacement text, so that
this part of the replacement text is also matched and replaced, and so
forth).

076 syntax error in the expression, or invalid function call
The expression statement was not recognized as a valid statement (so it
is a \syntax error"). From the part of the string that was parsed, it looks
as if the source line contains a function call in a \procedure call" syntax
(omitting the parentheses), but the function result is used |assigned to
a variable, passed as a parameter, used in an expession: : :

077 malformed UTF-8 encoding, or corrupted le: lename
The le starts with an UTF-8 signature, but it contains encodings that
are invalid UTF-8. If the source le was created by an editor or converter
that supports UTF-8, the UTF-8 support is non-conforming.

078 function uses both \return" and \return <value>"
The function returns both with and without a return value. The function
should be consistent in always returning with a function result, or in
never returning a function result.

079 inconsistent return types (array & non-array)
The function returns both values and arrays, which is not allowed. If a
function returns an array, all return statements must specify an array
(of the same size and dimensions).

080 unknown symbol, or not a constant symbol (symbol name)
Where a constant value was expected, an unknown symbol or a nonconstant
symbol (variable) was found.

081 cannot take a tag as a default value for an indexed array pa-
rameter (symbol name)
The tagof operator was used on an array parameter where the array
also had an index. This is unsupported.
144 ? Error and warning messages

082 user-dened operators and native functions may not have states
Only standard and public functions may have states.

083 a function may only belong to a single automaton (symbol
name)
The function was also assigned a state of another automaton. This is
not supported.

084 state con
ict: one of the states is already assigned to another
State speciers:
74 implementation (symbol name)
The specied state appears in the state specier of two implementations
of the same function.

085 no states are dened for function name
Fall-back: 74
When this error occurs, the function has a fall-back implementation, but
no other states. Use a state-less function instead.

086 unknown automaton name
The \state" statement refers to an unknown automaton.

087 unknown state name for automaton name
The \state" statement refers to an unknown state (for the specied
automaton).

Fatal Errors
100 cannot read from le: lename
The compiler cannot nd the specied le or does not have access to it.

101 cannot write to le: lename
The compiler cannot write to the specied output le, probably caused
by insucient disk space or restricted access rights (the le could be
read-only, for example).

102 table over
ow: table name
An internal table in the pawn parser is too small to hold the required
data. Some tables are dynamically growable, which means that there
was insucient memory to resize the table. The \table name" is one of
the following:
\staging buer": the staging buer holds the code generated for an
expression before it is passed to the peephole optimizer. The staging
Error and warning messages ? 145
buer grows dynamically, so an over
ow of the staging buer basically
is an \out of memory" error.
\loop table": the loop table is a stack used with nested do, for, and
while statements. The table allows nesting of these statements up to 24
levels.
\literal table": this table keeps the literal constants (numbers, strings)
that are used in expressions and as initiallers for arrays. The literal table
grows dynamically, so an over
ow of the literal table basically is an \out
of memory" error.
\compiler stack": the compiler uses a stack to store temporary information
it needs while parsing. An over
ow of this stack is probably caused
by deeply nested (or recursive) le inclusion. The compiler stack grows
dynamically, so an over
ow of the compiler stack basically is an \out of
memory" error.
\option table": in case that there are more options on the command line
or in the response le than the compiler can cope with.

103 insucient memory
General \out of memory" error.

104 invalid assembler instruction symbol
An invalid opcode in an #emit directive.

105 numeric over
ow, exceeding capacity
A numeric constant, notably a dimension of an array, is too large for the
compiler to handle. For example, when compiled as a 16-bit application,
the compiler cannot handle arrays with more than 32767 elements.

106 compiled script exceeds the maximum memory size (number
See #pragma
amxlimit on
page 109
bytes)
The memory size for the abstract machine that is needed to run the
script exceeds the value set with #pragma amxlimit. This means that
the script is too large to be supported by the host. You might try reducing
the script's memory requirements by:
 setting a smaller stack/heap area |see #pragma dynamic at page 110;
 using packed strings instead of unpacked strings |see pages 90 and
123;
 putting repeated code in separate functions;
 putting repeated data (strings) in global variables;
146 ? Error and warning messages
 trying to nd more compact algorithms to perform the same task.

107 too many error/warning messages on one line
A single line that causes several error/warning messages is often an indication
that the pawn parser is unable to \recover" from an earlier error.
In this situation, the parser is unlikely to make any sense of the source
code that follows |producing only (more) inappropriate error messages.
Therefore, compilation is halted.

108 codepage mapping le not found
#pragma code-
page: 109 The le for the codepage translation that was specied with the -c compiler
option or the #pragma codepage directive could not be loaded.

109 invalid path: path name
A path, for example for include les or codepage les, is invalid.

110 assertion failed: expression
#assert direc-
tive: 107 Compile-time assertion failed.

111 user error: message
#error directive:
107 The parser fell on an #error directive.

Warnings
200 symbol is truncated to number characters
The symbol is longer than the maximum symbol length. The maximum
length of a symbol depends on wether the symbol is native, public or
neither. Truncation may cause dierent symbol names to become equal,
which may cause error 021 or warning 219.

201 redenition of constant/macro (symbol name)
The symbol was previously dened to a dierent value, or the text substitution
macro that starts with the prex name was redened with a
dierent substitution text.

202 number of arguments does not match denition
At a function call, the number of arguments passed to the function (actual
arguments) diers from the number of formal arguments declared in
the function heading. To declare functions with variable argument lists,
use an ellipsis (...) behind the last known argument in the function
heading; for example: print(formatstring,...); (see page 71).
Error and warning messages ? 147

203 symbol is never used: identier
A symbol is dened but never used. Public functions are excluded from
the symbol usage check (since these may be called from the outside).

204 symbol is assigned a value that is never used: identier
A value is assigned to a symbol, but the contents of the symbol are never
accessed.

205 redundant code: constant expression is zero
Where a conditional expression was expected, a constant expression with
the value zero was found, e.g. \while (0)" or \if (0)". The the
conditional code below the test is never executed, and it is therefore
redundant.

206 redundant test: constant expression is non-zero
Where a conditional expression was expected, a constant expression with
a non-zero value was found, e.g. if (1). The test is redundant, because
the conditional code is always executed.

207 unknown \#pragma"
The compiler ignores the pragma. The #pragma directives may change
between compilers of dierent vendors and between dierent versions of
a compiler of the same version.

208 function with tag result used before denition, forcing reparse
User-dened op-
erators: 77
Forward declara-
tion: 73
When a function is \used" (invoked) before being declared, and that
function returns a value with a tag name, the parser must make an
extra pass over the source code, because the presence of the tag name
may change the interpretation of operators (in the presence of userde
ned operators). You can speed up the parsing/compilation process
by declaring the relevant functions before using them.

209 function should return a value
The function does not have a return statement, or it does not have
an expression behind the return statement, but the function's result is
used in a expression.

210 possible use of symbol before initialization: identier
A local (uninitialized) variable appears to be read before a value is assigned
to it. The compiler cannot determine the actual order of reading
from and storing into variables and bases its assumption of the execution
order on the physical appearance order of statements an expressions in
the source le.
148 ? Error and warning messages

211 possibly unintended assignment
Where a conditional expression was expected, the assignment operator
(=) was found instead of the equality operator (==). As this is a frequent
mistake, the compiler issues a warning. To avoid this message, put
parentheses around the expression, e.g. if ( (a=2) ).

212 possibly unintended bitwise operation
Where a conditional expression was expected, a bitwise operator (& or |)
was found instead of a Boolean operator (&& or ||). In situations where
a bitwise operation seems unlikely, the compiler issues this warning. To
avoid this message, put parentheses around the expression.

213 tag mismatch
Tags are dis-
cussed on page
59
A tag mismatch occurs when:
 assigning to a tagged variable a value that is untagged or that has a
dierent tag
 the expressions on either side of a binary operator have dierent tags
 in a function call, passing an argument that is untagged or that has a
dierent tag than what the function argument was dened with
 indexing an array which requires a tagged index with no tag or a wrong
tag name

214 possibly a \const" array argument was intended: identier
Arrays are always passed by reference. If a function does not modify the
array argument, however, the compiler can sometimes generate more
compact and quicker code if the array argument is specically marked
as \const".

215 expression has no eect
The result of the expression is apparently not stored in a variable or used
in a test. The expression or expression statement is therefore redundant.

216 nested comment
pawn does not support nested comments.

217 loose indentation
Statements at the same logical level do not start in the same column;
that is, the indents of the statements are dierent. Although pawn is a
free format language, loose indentation frequently hides a logical error
in the control 
ow.
The compiler can also incorrectly assume loose indentation if the tab
size with which you indented the source code diers from the assumed
Error and warning messages ? 149
size, see #pragma tabsize on page 111 or the compiler option -t on
page 153.

218 old style prototypes used with optional semicolon
When using \optional semicolons", it is preferred to explicitly declare
forward functions with the forward keyword than using terminating
semicolon.

219 local variable identier shadows a symbol at a preceding level
A local variable has the same name as a global variable, a function, a
function argument, or a local variable at a lower precedence level. This
is called \shadowing", as the new local variable makes the previously
dened function or variable inaccessible.

220 expression with tag override must appear between parentheses
In a case statement and in expressions in the conditional operator (\ ?
: "), any expression that has a tag override should be enclosed between
parentheses, to avoid the colon to be misinterpreted as a separator of the
case statement or as part of the conditional operator.

221 label name identier shadows tag name
A code label (for the goto instruction) has the same name as a previously
dened tag. This may indicate a faultily applied tag override; a typical
case is an attempt to apply a tag override on the variable on the left of
the = operator in an assignment statement.

222 number of digits exceeds rational number precision
A literal rational number has more decimals in its fractional part than
the precision of a rational number supports. The remaining decimals are
ignored.

223 redundant \sizeof": argument size is always 1 (symbol name)
A function argument has a as its default value the size of another argument
of the same function. The \sizeof" default value is only useful
when the size of the referred argument is unspecied in the declaration
of the function; i.e., if the referred argument is an array.

224 indeterminate array size in \sizeof" expression (symbol name)
#if : : : #else
: : : #endif: 108
The operand of the sizeof operator is an array with an unspecied size.
That is, the size of the variable cannot be determined at compile time.
If used in an \if" instruction, consider a conditionally compiled section,
replacing if by #if.
150  Error and warning messages

225 unreachable code
The indicated code will never run, because an instruction before (above)
it causes a jump out of the function, out of a loop or elsewhere. Look
for return, break, continue and goto instructions above the indicated
line.

226 a variable is assigned to itself (symbol name)
There is a statement like \x = x" in the code. The parser checks for
self assignments after performing any text and constant substitutions,
so the left and right sides of an assignment may appear to be dierent
at rst sight. For example, if the symbol \TWO" is a constant with the
value 2, then \var[TWO] = var[2]" is also a self-assignment.
Self-assignments are, of course, redundant, and they may hide an error
(assignment to the wrong variable, error in declaring constants).
Note that the pawn parser is limited to performing \static checks" only.
In this case it means that it can only compare array assignments for
self-assignment with constant array indices.

227 more initiallers than enum elds
An array whose size is declared with an enum symbol contains more
values/elds as initiallers than the enumeration denes.

228 length of initialler exceeds size of the enum eld
An array whose size is declared with an enum symbol, and the relevant
enumeration eld has a size. The initialler in the array contains more
values than the size of the enumeration eld allows.

229 index tag mismatch (symbol name)
When indexing an array, the expression used as the index has a dierent
tag than what the one in the declaration of the array. See pages 26 and
60 for an explanation and examples.

230 no implementation for state name / function name, no fall-back
A function is lacking an implementation for the indicated state. The
compiler cannot (statically) check whether the function will ever be
called in that state, and therefore it issues this warning. When the function
would be called for the state for which no implementation exists,
the abstract machine aborts with a run time error.
See page 74 on how to specify a fall-back function, and page 41 for a
description and an example.
Error and warning messages ? 151

231 state specication on forward declaration is ignored
State speciers:
74 A state specication is redundant on forward declarations. The function
signature must be equal for all states. Only the implementations of the
function are state-specic.

232 compaction buer over
ow
Compact encoding may in some particular cases result in les that would
actually be bigger than the non-compact encoding. The abstract machine
cannot handle this, as it unpacks the P-code \in place". When the
compiler deticts this situation, it re-builds the file with compact encoding
switched o. To avoid this warning, force building the File with plain
(\non-compact").
SweatyBanana is offline
Send a message via AIM to SweatyBanana Send a message via Yahoo to SweatyBanana
SweatyBanana
BANNED
Join Date: Sep 2005
Location: LOL
Old 12-07-2005 , 11:56  
Reply With Quote #2

Anyone going to answer my questions?
SweatyBanana is offline
Send a message via AIM to SweatyBanana Send a message via Yahoo to SweatyBanana
mysticssjgoku4
Veteran Member
Join Date: Jan 2005
Location: Chicago Heights, IL
Old 12-07-2005 , 11:58  
Reply With Quote #3

Quote:
If the pawn parser produces a list of errors, the first error in this list is a true error, but the diagnostic messages below it may not be errors at all.

After the pawn parser sees an error, it tries to step over it and complete the compilation. However, the stumbling on the error may have confused the pawn parser so that subsequent legitimate statements are misinterpreted and reported as errors too.

When in doubt, fix the first error and recompile.
Yes that is true, I've ran into many times. A single line can lead many more errors, the end result is the first error listed.



Quote:
Code:
Can a static variable be defined once in a plugin and be used throughout it?
Yes, just create a new variable at the top of a plugin

Code:
new variable[32]

Don't include it in brackets or any functions and it's used throughout the plugin globally.
__________________

mysticssjgoku4 is offline
Send a message via AIM to mysticssjgoku4 Send a message via MSN to mysticssjgoku4
SweatyBanana
BANNED
Join Date: Sep 2005
Location: LOL
Old 12-07-2005 , 12:11  
Reply With Quote #4

Thanks

+Karma
SweatyBanana is offline
Send a message via AIM to SweatyBanana Send a message via Yahoo to SweatyBanana
DotNetJunkie
Senior Member
Join Date: May 2005
Location: In front of my pc
Old 12-07-2005 , 15:48  
Reply With Quote #5

Quote:
Originally Posted by mysticssjgoku4
Yes that is true, I've ran into many times. A single line can lead many more errors, the end result is the first error listed.
yeah, this is one of the damn problems with C/C++ (and similar languages)
that makes it hard to debug, the compiler may trigger tens and
even hundreds of errors when the cause is only coming from like
1 or 2 lines.
__________________
DotNetJunkie is offline
Send a message via ICQ to DotNetJunkie Send a message via AIM to DotNetJunkie Send a message via MSN to DotNetJunkie Send a message via Yahoo to DotNetJunkie
Peli
Veteran Member
Join Date: Mar 2004
Location: San Diego, CA
Old 12-07-2005 , 20:37  
Reply With Quote #6

So bannana, did that manual help you?
Peli is offline
Send a message via MSN to Peli
SweatyBanana
BANNED
Join Date: Sep 2005
Location: LOL
Old 12-07-2005 , 20:56  
Reply With Quote #7

Meh...i still dont understand much...

I read all 175 pages of it in about 3-4 hours...it hurt my head...
SweatyBanana is offline
Send a message via AIM to SweatyBanana Send a message via Yahoo to SweatyBanana
Peli
Veteran Member
Join Date: Mar 2004
Location: San Diego, CA
Old 12-07-2005 , 21:01  
Reply With Quote #8

You will learn more when you discover it's easy to code AMXX plugins.
Peli is offline
Send a message via MSN to Peli
[ --<-@ ] Black Rose
ANNIHILATED
Join Date: Sep 2005
Location: Stockholm, Sweden.
Old 12-08-2005 , 11:41  
Reply With Quote #9

Quote:
Originally Posted by SweatyBanana
Meh...i still dont understand much...

I read all 175 pages of it in about 3-4 hours...it hurt my head...
omg u read it?
i have never, ever opened it

i have learned to script from other plugins... the first 1 i looked at was admin models
[ --<-@ ] Black Rose is offline
SweatyBanana
BANNED
Join Date: Sep 2005
Location: LOL
Old 12-08-2005 , 11:46  
Reply With Quote #10

yea well...
SweatyBanana is offline
Send a message via AIM to SweatyBanana Send a message via Yahoo to SweatyBanana
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 06:50.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode