Error illegal expression pascal

Error illegal expression free pascal This section lists all parser messages. The parser takes care of the semantics of you language, i.e. it determines if your Pascal constructs are correct. Error: Parser — Syntax Error An error against the Turbo Pascal language was encountered. This typically happens when an illegal character is found in […]

Error illegal expression free pascal

This section lists all parser messages. The parser takes care of the semantics of you language, i.e. it determines if your Pascal constructs are correct. Error: Parser — Syntax Error
An error against the Turbo Pascal language was encountered. This typically happens when an illegal character is found in the source file. Error: INTERRUPT procedure cannot be nested
An INTERRUPT procedure must be global. Warning: Procedure type ”arg1” ignored
The specified procedure directive is ignored by FPC programs. Error: Not all declarations of ”arg1” are declared with OVERLOAD
When you want to use overloading using the OVERLOAD directive, then all declarations need to have OVERLOAD specified. Error: Duplicate exported function name ”arg1”
Exported function names inside a specific DLL must all be different. Error: Duplicate exported function index arg1
Exported function indexes inside a specific DLL must all be different. Error: Invalid index for exported function
DLL function index must be in the range 1.. $ FFFF . Warning: Relocatable DLL or executable arg1 debug info does not work, disabled.
It is currently not possible to include debug information in a relocatable DLL. Warning: To allow debugging for win32 code you need to disable relocation with -WN option
Stabs debug info is wrong for relocatable DLL or EXES. Use -WN if you want to debug win32 executables. Error: Constructor name must be INIT
You are declaring an object constructor with a name which is not init , and the -Ss switch is in effect. See the switch -Ss (see page 123 ). Error: Destructor name must be DONE
You are declaring an object destructor with a name which is not done , and the -Ss switch is in effect. See the switch -Ss (see page 123 ). Error: Procedure type INLINE not supported
You tried to compile a program with C++ style inlining, and forgot to specify the -Si option ( -Si (see page 122 )). The compiler doesn’t support C++ styled inlining by default. Warning: Constructor should be public
Constructors must be in the ’public’ part of an object (class) declaration. Warning: Destructor should be public
Destructors must be in the ’public’ part of an object (class) declaration. Note: Class should have one destructor only
You can declare only one destructor for a class. Error: Local class definitions are not allowed
Classes must be defined globally. They cannot be defined inside a procedure or function. Fatal: Anonymous class definitions are not allowed
An invalid object (class) declaration was encountered, i.e. an object or class without methods that isn’t derived from another object or class. For example:

will trigger this error. Note: The object ”arg1” has no VMT
This is a note indicating that the declared object has no virtual method table. Error: Illegal parameter list
You are calling a function with parameters that are of a different type than the declared parameters of the function. Error: Wrong number of parameters specified for call to ”arg1”
There is an error in the parameter list of the function or procedure – the number of parameters is not correct. Error: overloaded identifier ”arg1” isn’t a function
The compiler encountered a symbol with the same name as an overloaded function, but it is not a function it can overload. Error: overloaded functions have the same parameter list
You’re declaring overloaded functions, but with the same parameter list. Overloaded function must have at least 1 different parameter in their declaration. Error: function header doesn’t match the previous declaration ”arg1”
You declared a function with the same parameters but different result type or function modifiers. Error: function header ”arg1” doesn’t match forward : var name changes arg2 =ї arg3
You declared the function in the interface part, or with the forward directive, but defined it with a different parameter list. Note: Values in enumeration types have to be ascending
Free Pascal allows enumeration constructions as in C. Examine the following two declarations:

The second declaration would produce an error. A _UAS needs to have a value higher than A _E , i.e. at least 7. Error: With cannot be used for variables in a different segment
With stores a variable locally on the stack, but this is not possible if the variable belongs to another segment. Error: function nesting ї 31
You can nest function definitions only 31 levels deep. Error: range check error while evaluating constants
The constants are out of their allowed range. Warning: range check error while evaluating constants
The constants are out of their allowed range. Error: duplicate case label
You are specifying the same label 2 times in a case statement. Error: Upper bound of case range is less than lower bound
The upper bound of a case label is less than the lower bound and this is useless. Error: typed constants of classes or interfaces are not allowed
You cannot declare a constant of type class or object. Error: functions variables of overloaded functions are not allowed
You are trying to assign an overloaded function to a procedural variable. This is not allowed. Error: string length must be a value from 1 to 255
The length of a shortstring in Pascal is limited to 255 characters. You are trying to declare a string with length less than 1 or greater than 255. Warning: use extended syntax of NEW and DISPOSE for instances of objects
If you have a pointer a to an object type, then the statement new(a) will not initialize the object (i.e. the constructor isn’t called), although space will be allocated. You should issue the new(a,init) statement. This will allocate space, and call the constructor of the object. Warning: use of NEW or DISPOSE for untyped pointers is meaningless
Error: use of NEW or DISPOSE is not possible for untyped pointers
You cannot use new(p) or dispose(p) if p is an untyped pointer because no size is associated to an untyped pointer. It is accepted for compatibility in TP and DELPHI modes, but the compiler will still warn you if it finds such a construct. Error: class identifier expected
This happens when the compiler scans a procedure declaration that contains a dot, i.e., an object or class method, but the type in front of the dot is not a known type. Error: type identifier not allowed here
You cannot use a type inside an expression. Error: method identifier expected
This identifier is not a method. This happens when the compiler scans a procedure declaration that contains a dot, i.e., an object or class method, but the procedure name is not a procedure of this type. Error: function header doesn’t match any method of this class ”arg1”
This identifier is not a method. This happens when the compiler scans a procedure declaration that contains a dot, i.e., an object or class method, but the procedure name is not a procedure of this type. procedure/function arg1
When using the -vd switch, the compiler tells you when it starts processing a procedure or function implementation. Error: Illegal floating point constant
The compiler expects a floating point expression, and gets something else. Error: FAIL can be used in constructors only
You are using the fail keyword outside a constructor method. Error: Destructors cannot have parameters
You are declaring a destructor with a parameter list. Destructor methods cannot have parameters. Error: Only class methods, class properties and class variables can be referred with class references
This error occurs in a situation like the following:

Type :
Tclass = Class of Tobject;

Free is not a class method and hence cannot be called with a class reference. Error: Only class methods, class properties and class variables can be accessed in class methods
This is related to the previous error. You cannot call a method of an object from inside a class method. The following code would produce this error:

class procedure tobject.x;

Because free is a normal method of a class it cannot be called from a class method. Error: Constant and CASE types do not match
One of the labels is not of the same type as the case variable. Error: The symbol cannot be exported from a library
You can only export procedures and functions when you write a library. You cannot export variables or constants. Warning: An inherited method is hidden by ”arg1”
A method that is declared virtual in a parent class, should be overridden in the descendant class with the override directive. If you don’t specify the override directive, you will hide the parent method; you will not override it. Error: There is no method in an ancestor class to be overridden: ”arg1”
You are trying to override a virtual method of a parent class that does not exist. Error: No member is provided to access property
You specified no read directive for a property. Warning: Stored property directive is not yet implemented
This message is no longer used, as the stored directive has been implemented. Error: Illegal symbol for property access
There is an error in the read or write directives for an array property. When you declare an array property, you can only access it with procedures and functions. The following code would cause such an error.

Error: Cannot access a protected field of an object here
Fields that are declared in a protected section of an object or class declaration cannot be accessed outside the module where the object is defined, or outside descendent object methods. Error: Cannot access a private field of an object here
Fields that are declared in a private section of an object or class declaration cannot be accessed outside the module where the class is defined. Error: Overridden methods must have the same return type: ”arg2” is overridden by ”arg1” which has another return type
If you declare overridden methods in a class definition, they must have the same return type. Error: EXPORT declared functions cannot be nested
You cannot declare a function or procedure within a function or procedure that was declared as an export procedure. Error: Methods cannot be EXPORTed
You cannot declare a procedure that is a method for an object as export ed. Error: Call by var for arg no. arg1 has to match exactly: Got ”arg2” expected ”arg3”
When calling a function declared with var parameters, the variables in the function call must be of exactly the same type. There is no automatic type conversion. Error: Class isn’t a parent class of the current class
When calling inherited methods, you are trying to call a method of a non-related class. You can only call an inherited method of a parent class. Error: SELF is only allowed in methods
You are trying to use the self parameter outside an object’s method. Only methods get passed the self parameters. Error: Methods can be only in other methods called direct with type identifier of the class
A construction like sometype.somemethod is only allowed in a method. Error: Illegal use of ’:’
You are using the format : (colon) 2 times on an expression that is not a real expression. Error: range check error in set constructor or duplicate set element
The declaration of a set contains an error. Either one of the elements is outside the range of the set type, or two of the elements are in fact the same. Error: Pointer to object expected
You specified an illegal type in a new statement. The extended syntax of new needs an object as a parameter. Error: Expression must be constructor call
When using the extended syntax of new , you must specify the constructor method of the object you are trying to create. The procedure you specified is not a constructor. Error: Expression must be destructor call
When using the extended syntax of dispose , you must specify the destructor method of the object you are trying to dispose of. The procedure you specified is not a destructor. Error: Illegal order of record elements
When declaring a constant record, you specified the fields in the wrong order. Error: Expression type must be class or record type, got arg1
A with statement needs an argument that is of the type record or class . You are using with on an expression that is not of this type. Error: Procedures cannot return a value
In Free Pascal, you can specify a return value for a function when using the exit statement. This error occurs when you try to do this with a procedure. Procedures cannot return a value. Error: constructors, destructors and class operators must be methods
You’re declaring a procedure as destructor, constructor or class operator, when the procedure isn’t a class method. Error: Operator is not overloaded
You’re trying to use an overloaded operator when it is not overloaded for this type. Error: Impossible to overload assignment for equal types
You cannot overload assignment for types that the compiler considers as equal. Error: Impossible operator overload
The combination of operator, arguments and return type are incompatible. Error: Re-raise isn’t possible there
You are trying to re-raise an exception where it is not allowed. You can only re-raise exceptions in an except block. Error: The extended syntax of new or dispose isn’t allowed for a class
You cannot generate an instance of a class with the extended syntax of new . The constructor must be used for that. For the same reason, you cannot call dispose to de-allocate an instance of a class, the destructor must be used for that. Error: Procedure overloading is switched off
When using the -So switch, procedure overloading is switched off. Turbo Pascal does not support function overloading. Error: It is not possible to overload this operator. Related overloadable operators (if any) are: arg1
You are trying to overload an operator which cannot be overloaded. The following operators can be overloaded :

Error: Comparative operator must return a boolean value
When overloading the = operator, the function must return a boolean value. Error: Only virtual methods can be abstract
You are declaring a method as abstract, when it is not declared to be virtual. Fatal: Use of unsupported feature: ”arg1”.
You’re trying to force the compiler into doing something it cannot do yet. Error: The mix of different kind of objects (class, object, interface, etc) isn’t allowed
You cannot derive objects , classes , cppclasses and interfaces intertwined. E.g. a class cannot have an object as parent and vice versa. Warning: Unknown procedure directive had to be ignored: ”arg1”
The procedure directive you specified is unknown. Error: arg1 can be associated with only one variable
You cannot specify more than one variable before the absolute , export , external , weakexternal , public and cvar directives. As a result, for example the following construct will provide this error:

Error: absolute can only be associated with a var or const
The address of an absolute directive can only point to a variable or constant. Therefore, the following code will produce this error:

var p : longint absolute x;

Error: Only one variable can be initialized
You cannot specify more than one variable with a initial value in Delphi mode. Error: Abstract methods shouldn’t have any definition (with function body)
Abstract methods can only be declared, you cannot implement them. They should be overridden by a descendant class. Error: This overloaded function cannot be local (must be exported)
You are defining an overloaded function in the implementation part of a unit, but there is no corresponding declaration in the interface part of the unit. Warning: Virtual methods are used without a constructor in ”arg1”
If you declare objects or classes that contain virtual methods, you need to have a constructor and destructor to initialize them. The compiler encountered an object or class with virtual methods that doesn’t have a constructor/destructor pair. Macro defined: arg1
When -vc is used, the compiler tells you when it defines macros. Macro undefined: arg1
When -vc is used, the compiler tells you when it undefines macros. Macro arg1 set to arg2
When -vc is used, the compiler tells you what values macros get. Info: Compiling arg1
When you turn on information messages ( -vi ), the compiler tells you what units it is recompiling. Parsing interface of unit arg1
This tells you that the reading of the interface of the current unit has started Parsing implementation of arg1
This tells you that the code reading of the implementation of the current unit, library or program starts Compiling arg1 for the second time
When you request debug messages ( -vd ) the compiler tells you what units it recompiles for the second time. Error: No property found to override
You want to override a property of a parent class, when there is, in fact, no such property in the parent class. Error: Only one default property is allowed
You specified a property as Default , but the class already has a default property, and a class can have only one default property. Error: The default property must be an array property
Only array properties of classes can be made default properties. Error: Virtual constructors are only supported in class object model
You cannot have virtual constructors in objects. You can only have them in classes. Error: No default property available
You are trying to access a default property of a class, but this class (or one of its ancestors) doesn’t have a default property. Error: The class cannot have a published section, use the < $ M+ >switch
If you want a published section in a class definition, you must use the < $ M+ >switch, which turns on generation of type information. Error: Forward declaration of class ”arg1” must be resolved here to use the class as ancestor
To be able to use an object as an ancestor object, it must be defined first. This error occurs in the following situation:

where ParentClass is declared but not defined. Error: Local operators not supported
You cannot overload locally, i.e. inside procedures or function definitions. Error: Procedure directive ”arg1” not allowed in interface section
This procedure directive is not allowed in the interface section of a unit. You can only use it in the implementation section. Error: Procedure directive ”arg1” not allowed in implementation section
This procedure directive is not allowed in the implementation section of a unit. You can only use it in the interface section. Error: Procedure directive ”arg1” not allowed in procvar declaration
This procedure directive cannot be part of a procedural or function type declaration. Error: Function is already declared Public/Forward ”arg1”
You will get this error if a function is defined as forward twice. Or if it occurs in the interface section, and again as a forward declaration in the implementation section. Error: Cannot use both EXPORT and EXTERNAL
These two procedure directives are mutually exclusive. Hint: ”arg1” not yet supported inside inline procedure/function
Inline procedures don’t support this declaration. Hint: Inlining disabled
Inlining of procedures is disabled. Info: Writing Browser log arg1
When information messages are on, the compiler warns you when it writes the browser log (generated with the < $ Y+ >switch). Hint: may be pointer dereference is missing
The compiler thinks that a pointer may need a dereference. Fatal: Selected assembler reader not supported
The selected assembler reader (with < $ ASMMODE xxx >is not supported. The compiler can be compiled with or without support for a particular assembler reader. Error: Procedure directive ”arg1” cannot be used with arg2
You specified a procedure directive that conflicts with other directives. For instance cdecl and pascal are mutually exclusive. Error: Calling convention doesn’t match forward
This error happens when you declare a function or procedure with e.g. cdecl; but omit this directive in the implementation, or vice versa. The calling convention is part of the function declaration, and must be repeated in the function definition. Error: Property cannot have a default value
Set properties or indexed properties cannot have a default value. Error: The default value of a property must be constant
The value of a default declared property must be known at compile time. The value you specified is only known at run time. This happens e.g. if you specify a variable name as a default value. Error: Symbol cannot be published, can be only a class
Only class type variables can be in a published section of a class if they are not declared as a property. Error: This kind of property cannot be published
Properties in a published section cannot be array properties. They must be moved to public sections. Properties in a published section must be an ordinal type, a real type, strings or sets. Error: An import name is required
Some targets need a name for the imported procedure or a cdecl specifier. Error: Division by zero
A division by zero was encountered. Error: Invalid floating point operation
An operation on two real type values produced an overflow or a division by zero. Error: Upper bound of range is less than lower bound
The upper bound of an array declaration is less than the lower bound and this is not possible. Warning: string ”arg1” is longer than ”arg2”
The size of the constant string is larger than the size you specified in string type definition. Error: string length is larger than array of char length
The size of the constant string is larger than the size you specified in the Array[x..y] of char definition. Error: Illegal expression after message directive
Free Pascal supports only integer or string values as message constants. Error: Message handlers can take only one call by ref. parameter
A method declared with the message directive as message handler can take only one parameter which must be declared as call by reference. Parameters are declared as call by reference using the var -directive. Error: Duplicate message label: ”arg1”
A label for a message is used twice in one object/class. Error: Self can only be an explicit parameter in methods which are message handlers
The Self parameter can only be passed explicitly to a method which is declared as message handler. Error: Threadvars can be only static or global
Threadvars must be static or global; you cannot declare a thread local to a procedure. Local variables are always local to a thread, because every thread has its own stack and local variables are stored on the stack. Fatal: Direct assembler not supported for binary output format
You cannot use direct assembler when using a binary writer. Choose an other output format or use another assembler reader. Warning: Don’t load OBJPAS unit manually, use < $ mode objfpc >or < $ mode delphi >instead
You are trying to load the ObjPas unit manually from a uses clause. This is not a good idea. Use the < $ MODE OBJFPC >or < $ mode delphi >directives which load the unit automatically. Error: OVERRIDE cannot be used in objects
Override is not supported for objects, use virtual instead to override a method of a parent object. Error: Data types which require initialization/finalization cannot be used in variant records
Some data types (e.g. ansistring ) need initialization/finalization code which is implicitly generated by the compiler. Such data types cannot be used in the variant part of a record. Error: Resourcestrings can be only static or global
Resourcestring cannot be declared local, only global or using the static directive. Error: Exit with argument cannot be used here
An exit statement with an argument for the return value cannot be used here. This can happen for example in try..except or try..finally blocks. Error: The type of the storage symbol must be boolean
If you specify a storage symbol in a property declaration, it must be a boolean type. Error: This symbol isn’t allowed as storage symbol
You cannot use this type of symbol as storage specifier in property declaration. You can use only methods with the result type boolean, boolean class fields or boolean constants. Error: Only classes which are compiled in $ M+ mode can be published
A class-typed field in the published section of a class can only be a class which was compiled in < $ M+ >or which is derived from such a class. Normally such a class should be derived from TPersistent . Error: Procedure directive expected
This error is triggered when you have a < $ Calling >directive without a calling convention specified. It also happens when declaring a procedure in a const block and you used a ; after a procedure declaration which must be followed by a procedure directive. Correct declarations are:

Error: The value for a property index must be of an ordinal type
The value you use to index a property must be of an ordinal type, for example an integer or enumerated type. Error: Procedure name too short to be exported
The length of the procedure/function name must be at least 2 characters long. This is because of a bug in dlltool which doesn’t parse the .def file correctly with a name of length 1. Error: No DEFFILE entry can be generated for unit global vars
Error: Compile without -WD option
You need to compile this file without the -WD switch on the command line. Fatal: You need ObjFpc (-S2) or Delphi (-Sd) mode to compile this module
You need to use < $ MODE OBJFPC >or < $ MODE DELPHI >to compile this file. Or use the corresponding command line switch, either -Mobjfpc or -MDelphi. Error: Cannot export with index under arg1
Exporting of functions or procedures with a specified index is not supported on this target. Error: Exporting of variables is not supported under arg1
Exporting of variables is not supported on this target. Error: Improper GUID syntax
The GUID indication does not have the proper syntax. It should be of the form

Where each X represents a hexadecimal digit. Warning: Procedure named ”arg1” not found that is suitable for implementing the arg2.arg3
The compiler cannot find a suitable procedure which implements the given method of an interface. A procedure with the same name is found, but the arguments do not match. Error: interface identifier expected
This happens when the compiler scans a class declaration that contains interface function name mapping code like this:

and the interface before the dot is not listed in the inheritance list. Error: Type ”arg1” cannot be used as array index type
Types like qword or int64 are not allowed as array index type. Error: Con- and destructors are not allowed in interfaces
Constructor and destructor declarations are not allowed in interfaces. In the most cases method QueryInterface of IUnknown can be used to create a new interface. Error: Access specifiers cannot be used in INTERFACEs and OBJCPROTOCOLs
The access specifiers public , private , protected and published cannot be used in interfaces, Objective-C protocols and categories because all methods of an interface/protocol/category must be public. Error: An interface, helper or Objective-C protocol or category cannot contain fields
Declarations of fields are not allowed in interfaces, helpers and Objective-C protocols and categories. An interface/helper/protocol/category can contain only methods and properties with method read/write specifiers. Error: Cannot declare local procedure as EXTERNAL
Declaring local procedures as external is not possible. Local procedures get hidden parameters that will make the chance of errors very high. Warning: Some fields coming before ”arg1” were not initialized
In Delphi mode, not all fields of a typed constant record have to be initialized, but the compiler warns you when it detects such situations. Error: Some fields coming before ”arg1” were not initialized
In all syntax modes but Delphi mode, you cannot leave some fields uninitialized in the middle of a typed constant record. Warning: Some fields coming after ”arg1” were not initialized
You can leave some fields at the end of a type constant record uninitialized (The compiler will initialize them to zero automatically). This may be the cause of subtle problems. Error: VarArgs directive (or ’. ’ in MacPas) without CDecl/CPPDecl/MWPascal/StdCall and External
The varargs directive (or the “. ” varargs parameter in MacPas mode) can only be used with procedures or functions that are declared with external and one of cdecl , cppdecl , stdcall and mwpascal . This functionality is only supported to provide a compatible interface to C functions like printf. Error: Self must be a normal (call-by-value) parameter
You cannot declare Self as a const or var parameter, it must always be a call-by-value parameter. Error: Interface ”arg1” has no interface identification
When you want to assign an interface to a constant, then the interface must have a GUID value set. Error: Unknown class field or method identifier ”arg1”
Properties must refer to a field or method in the same class. Warning: Overriding calling convention ”arg1” with ”arg2”
There are two directives in the procedure declaration that specify a calling convention. Only the last directive will be used. Error: Typed constants of the type ”procedure of object” can only be initialized with NIL
You cannot assign the address of a method to a typed constant which has a ’procedure of object’ type, because such a constant requires two addresses: that of the method (which is known at compile time) and that of the object or class instance it operates on (which cannot be known at compile time). Error: Default value can only be assigned to one parameter
It is not possible to specify a default value for several parameters at once. The following is invalid:

Instead, this should be declared as

Error: Default parameter required for ”arg1”
The specified parameter requires a default value. Warning: Use of unsupported feature!
You’re trying to force the compiler into doing something it cannot do yet. Hint: C arrays are passed by reference
Any array passed to a C function is passed by a pointer (i.e. by reference). Error: C array of const must be the last argument
You cannot add any other argument after an array of const for cdecl functions, as the size pushed on stack for this argument is not known. Hint: Type ”arg1” redefinition
This is an indicator that a previously declared type is being redefined as something else. This may, or may not be, a potential source of errors. Warning: cdecl’ared functions have no high parameter
Functions declared with the cdecl modifier do not pass an extra implicit parameter. Warning: cdecl’ared functions do not support open strings
Openstring is not supported for functions that have the cdecl modifier. Error: Cannot initialize variables declared as threadvar
Variables declared as threadvar cannot be initialized with a default value. The variables will always be filled with zero at the start of a new thread. Error: Message directive is only allowed in Classes
The message directive is only supported for Class types. Error: Procedure or Function expected
A class method can only be specified for procedures and functions. Warning: Calling convention directive ignored: ”arg1”
Some calling conventions are supported only by certain CPUs. I.e. most non-i386 ports support only the standard ABI calling convention of the CPU. Error: REINTRODUCE cannot be used in objects
reintroduce is not supported for objects, Objective-C classes and Objective-C protocols. Error: Each argument must have its own location
If locations for arguments are specified explicitly as it is required by some syscall conventions, each argument must have its own location. Things like

are not allowed. Error: Each argument must have an explicit location
If one argument has an explicit argument location, all arguments of a procedure must have one. Error: Unknown argument location
The location specified for an argument isn’t recognized by the compiler. Error: 32 Bit-Integer or pointer variable expected
The libbase for MorphOS/AmigaOS can be given only as longint , dword or any pointer variable. Error: Goto statements are not allowed between different procedures
It isn’t allowed to use goto statements referencing labels outside the current procedure. The following example shows the problem:

procedure p2;
begin
goto l1; // This goto ISN’T allowed
end;

Fatal: Procedure too complex, it requires too many registers
Your procedure body is too long for the compiler. You should split the procedure into multiple smaller procedures. Error: Illegal expression
This can occur under many circumstances. Usually when trying to evaluate constant expressions. Error: Invalid integer expression
You made an expression which isn’t an integer, and the compiler expects the result to be an integer. Error: Illegal qualifier
One of the following is happening :

  • You’re trying to access a field of a variable that is not a record.
  • You’re indexing a variable that is not an array.
  • You’re dereferencing a variable that is not a pointer.

Error: High range limit Ў low range limit
You are declaring a subrange, and the high limit is less than the low limit of the range. Error: Exit’s parameter must be the name of the procedure it is used in or of a surrounding procedure
The parameter of a exit call in macpas mode must be either the name of the current subroutine or of a surrounding one Error: Illegal assignment to for-loop variable ”arg1”
The type of a for loop variable must be an ordinal type. Loop variables cannot be reals or strings. You also cannot assign values to loop variables inside the loop (Except in Delphi and TP modes). Use a while or repeat loop instead if you need to do something like that, since those constructs were built for that. Error: Cannot declare local variable as EXTERNAL
Declaring local variables as external is not allowed. Only global variables can reference external variables. Error: Procedure is already declared EXTERNAL
The procedure is already declared with the EXTERNAL directive in an interface or forward declaration. Warning: Implicit uses of Variants unit
The Variant type is used in the unit without any used unit using the Variants unit. The compiler has implicitly added the Variants unit to the uses list. To remove this warning the Variants unit needs to be added to the uses statement. Error: Class and static methods cannot be used in INTERFACES
The specifier class and directive static cannot be used in interfaces because all methods of an interface must be public. Error: Overflow in arithmetic operation
An operation on two integer values produced an overflow. Error: Protected or private expected
strict can be only used together with protected or private . Error: SLICE cannot be used outside of parameter list
slice can be used only for arguments accepting an open array parameter. Error: A DISPINTERFACE cannot have a parent class
A DISPINTERFACE is a special type of interface which cannot have a parent class. Dispinterface always derive from IDispatch type. Error: A DISPINTERFACE needs a guid
A DISPINTERFACE always needs an interface identification (a GUID). Warning: Overridden methods must have a related return type. This code may crash, it depends on a Delphi parser bug (”arg2” is overridden by ”arg1” which has another return type)
If you declare overridden methods in a class definition, they must have the same return type. Some versions of Delphi allow you to change the return type of interface methods, and even to change procedures into functions, but the resulting code may crash depending on the types used and the way the methods are called. Error: Dispatch IDs must be ordinal constants
The dispid keyword must be followed by an ordinal constant (the dispid index). Error: The range of the array is too large
Regardless of the size taken up by its elements, an array cannot have more than high(ptrint) elements. Additionally, the range type must be a subrange of ptrint. Error: The address cannot be taken of bit packed array elements and record fields
If you declare an array or record as packed in Mac Pascal mode (or as packed in any mode with < $ bitpacking on >), it will be packed at the bit level. This means it becomes impossible to take addresses of individual array elements or record fields. The only exception to this rule is in the case of packed arrays elements whose packed size is a multiple of 8 bits. Error: Dynamic arrays cannot be packed
Only regular (and possibly in the future also open) arrays can be packed. Error: Bit packed array elements and record fields cannot be used as loop variables
If you declare an array or record as packed in Mac Pascal mode (or as packed in any mode with < $ bitpacking on >), it will be packed at the bit level. For performance reasons, they cannot be used as loop variables. Error: VAR, TYPE and CONST are allowed only in records, objects and classes
The usage of VAR, TYPE and CONST to declare new types inside an object is allowed only inside records, objects and classes. Error: This type cannot be a generic
Only Classes, Objects, Interfaces and Records are allowed to be used as generic. Warning: Don’t load LINEINFO unit manually, Use the -gl compiler switch instead
Do not use the lineinfo unit directly, Use the -gl switch which automatically adds the correct unit for reading the selected type of debugging information. The unit that needs to be used depends on the type of debug information used when compiling the binary. Error: No function result type specified for function ”arg1”
The first time you declare a function you have to declare it completely, including all parameters and the result type. Error: Specialization is only supported for generic types
Types which are not generics cannot be specialized. Error: Generics cannot be used as parameters when specializing generics
When specializing a generic, only non-generic types can be used as parameters. Error: Constants of objects containing a VMT are not allowed
If an object requires a VMT either because it contains a constructor or virtual methods, it’s not allowed to create constants of it. In TP and Delphi mode this is allowed for compatibility reasons. Error: Taking the address of labels defined outside the current scope isn’t allowed
It isn’t allowed to take the address of labels outside the current procedure. Error: Cannot initialize variables declared as external
Variables declared as external cannot be initialized with a default value. Error: Illegal function result type
Some types like file types cannot be used as function result. Error: No common type possible between ”arg1” and ”arg2”
To perform an operation on integers, the compiler converts both operands to their common type, which appears to be an invalid type. To determine the common type of the operands, the compiler takes the minimum of the minimal values of both types, and the maximum of the maximal values of both types. The common type is then minimum..maximum. Error: Generics without specialization cannot be used as a type for a variable
Generics must be always specialized before being used as variable type. Warning: Register list is ignored for pure assembler routines
When using pure assembler routines, the list with modified registers is ignored. Error: Implements property must have class or interface type
A property which implements an interface must be of type class or interface. Error: Implements-property must implement interface of correct type, found ”arg1” expected ”arg2”
A property which implements an interface actually implements a different interface. Error: Implements-property must have read specifier
A property which implements an interface must have at least a read specifier. Error: Implements-property must not have write-specifier
A property which implements an interface may not have a write specifier. Error: Implements-property must not have stored-specifier
A property which implements an interface may not have a stored specifier. Error: Implements-property used on unimplemented interface: ”arg1”
The interface which is implemented by a property is not an interface implemented by the class. Error: Floating point not supported for this target
The compiler parsed a floating point expression, but it is not supported. Error: Class ”arg1” does not implement interface ”arg2”
The delegated interface is not implemented by the class given in the implements clause. Error: Type used by implements must be an interface
The implements keyword must be followed by an interface type. Error: Variables cannot be exported with a different name on this target, add the name to the declaration using the ”export” directive (variable name: arg1, declared export name: arg2)
On most targets it is not possible to change the name under which a variable is exported inside the exports statement of a library. In that case, you have to specify the export name at the point where the variable is declared, using the export and alias directives. Error: Weak external symbols are not supported for the current target
A ”weak external” symbol is a symbol which may or may not exist at (either static or dynamic) link time. This concept may not be available (or implemented yet) on the current cpu/OS target. Error: Forward type definition does not match
Classes and interfaces being defined forward must have the same type when being implemented. A forward interface cannot be changed into a class. Note: Virtual method ”arg1” has a lower visibility (arg2) than parent class arg3 (arg4)
The virtual method overrides an method that is declared with a higher visibility. This might give unexpected results. E.g., in case the new visibility is private then a call to “inherited” in a new child class will call the higher-visible method in a parent class and ignores the private method. Error: Fields cannot appear after a method or property definition, start a new visibility section first
Once a method or property has been defined in a class or object, you cannot define any fields afterwards without starting a new visibility section (such as public , private , etc.). The reason is that otherwise the source code can appear ambiguous to the compiler, since it is possible to use modifiers such as default and register also as field names. Error: Parameters or result types cannot contain local type definitions. Use a separate type definition in a type block.
In Pascal, types are not considered to be identical simply because they are semantically equivalent. Two variables or parameters are only considered to be of the same type if they refer to the same type definition. As a result, it is not allowed to define new types inside parameter lists, because then it is impossible to refer to the same type definition in the procedure headers of the interface and implementation of a unit (both procedure headers would define a separate type). Keep in mind that expressions such as “file of byte” or “string[50]” also define a new type. Error: ABSTRACT and SEALED conflict
ABSTRACT and SEALED cannot be used together in one declaration Error: Cannot create a descendant of the sealed class ”arg1”
Sealed means that class cannot be derived by another class. Error: SEALED class cannot have an ABSTRACT method
Sealed means that class cannot be derived. Therefore no one class is able to override an abstract method in a sealed class. Error: Only virtual methods can be final
You are declaring a method as final, when it is not declared to be virtual. Error: Final method cannot be overridden: ”arg1”
You are trying to override a virtual method of a parent class that does not exist. Error: Only one message can be used per method.
It is not possible to associate multiple messages with a single method. Error: Invalid enumerator identifier: ”arg1”
Only ”MoveNext” and ”Current” enumerator identifiers are supported. Error: Enumerator identifier required
”MoveNext” or ”Current” identifier must follow the enumerator modifier. Error: Enumerator MoveNext pattern method is not valid. Method must be a function with the Boolean return type and no required arguments.
”MoveNext” enumerator pattern method must be a function with Boolean return type and no required arguments Error: Enumerator Current pattern property is not valid. Property must have a getter.
”Current” enumerator pattern property must have a getter Error: Only one enumerator MoveNext method is allowed per class/object
Class or Object can have only one enumerator MoveNext declaration. Error: Only one enumerator Current property is allowed per class/object
Class or Object can have only one enumerator Current declaration. Error: For in loop cannot be used for the type ”arg1”
For in loop can be used not for all types. For example it cannot be used for the enumerations with jumps. Error: Objective-C messages require their Objective-C selector name to be specified using the ”message” directive.
Objective-C messages require their Objective-C name (selector name) to be specified using the message ‘someName:’ procedure directive. While bindings to other languages automatically generate such names based on the identifier you use (by replacing all underscores with colons), this is unsafe since nothing prevents an Objective-C method name to contain actual colons. Error: Objective-C does not have formal constructors nor destructors. Use the alloc, initXXX and dealloc messages.
The Objective-C language does not have any constructors or destructors. While there are some messages with a similar purpose (such as init and dealloc ), these cannot be identified using automatic parsers and do not guarantee anything like Pascal constructors/destructors (e.g., you have to take care of only calling “designated” inherited “constructors”). For these reasons, we have opted to follow the standard Objective-C patterns for instance creation/destruction. Error: Message name is too long (max. 255 characters)
Due to compiler implementation reasons, message names are currently limited to 255 characters. Error: Objective-C message symbol name for ”arg1” is too long
Due to compiler implementation reasons, mangled message names (i.e., the symbol names used in the assembler code) are currently limited to 255 characters. Hint: Defining a new Objective-C root class. To derive from another root class (e.g., NSObject), specify it as the parent class.
If no parent class is specified for an Object Pascal class, then it automatically derives from TObject. Objective-C classes however do not automatically derive from NSObject, because one can have multiple root classes in Objective-C. For example, in the Cocoa framework both NSObject and NSProxy are root classes. Therefore, you have to explicitly define a parent class (such as NSObject) if you want to derive your Objective-C class from it. Error: Objective-C classes cannot have published sections.
In Object Pascal, “published” determines whether or not RTTI is generated. Since the Objective-C runtime always needs RTTI for everything, this specified does not make sense for Objective-C classes. Fatal: This module requires an Objective-C mode switch to be compiled
This error indicates the use of Objective-C language features without an Objective-C mode switch active. Enable one via the -M command line switch, or the $ modeswitch x directive. Error: Inherited methods can only be overridden in Objective-C and Java, add ”override” (inherited method defined in arg1)
Hint: Inherited methods can only be overridden in Objective-C and Java, add ”override” (inherited method defined in arg1).
It is not possible to reintroduce methods in Objective-C or Java like in Object Pascal. Methods with the same name always map to the same virtual method entry. In order to make this clear in the source code, the compiler always requires the override directive to be specified when implementing overriding Objective-C or Java methods in Pascal. If the implementation is external, this rule is relaxed because Objective-C and Java do not have any override -style keyword (since it’s the default and only behaviour in these languages), which makes it hard for automated header conversion tools to include it everywhere. The type in which the inherited method is defined is explicitly mentioned, because this may either be an objcclass or an objccategory in case of Objective-C. Error: Message name ”arg1” in inherited class is different from message name ”arg2” in current class.
An overriding Objective-C method cannot have a different message name than an inherited method. The reason is that these message names uniquely define the message to the Objective-C runtime, which means that giving them a different message name breaks the “override” semantics. Error: It is not yet possible to make unique copies of Objective-C or Java types
Duplicating an Objective-C or Java type using type x = type y; is not yet supported. You may be able to obtain the desired effect using type x = objcclass(y) end; resp. type x = class(y) end; instead. Error: Objective-C categories and Object Pascal class helpers cannot be used as types
It is not possible to declare a variable as an instance of an Objective-C category or an Object Pascal class helper. A category/class helper adds methods to the scope of an existing class, but does not define a type by itself. An exception of this rule is when inheriting an Object Pascal class helper from another class helper. Error: Categories do not override, but replace methods. Use ”reintroduce” instead.
Error: Replaced methods can only be reintroduced in Objective-C, add ”reintroduce” (replaced method defined in arg1).
Hint: Replaced methods can only be reintroduced in Objective-C, add ”reintroduce” (replaced method defined in arg1).
A category replaces an existing method in an Objective-C class, rather than that it overrides it. Calling an inherited method from an category method will call that method in the extended class’ parent, not in the extended class itself. The replaced method in the original class is basically lost, and can no longer be called or referred to. This behaviour corresponds somewhat more closely to reintroduce than to override (although in case of reintroduce in Object Pascal, hidden methods are still reachable via inherited). The type in which the inherited method is defined is explicitly mentioned, because this may either be an objcclass or an objccategory. Error: Getter for implements interface must use the target’s default calling convention.
Interface getters are called via a helper in the run time library, and hence have to use the default calling convention for the target ( register on i386 and x86_64, stdcall on other architectures). Error: Typed files cannot contain reference-counted types.
The data in a typed file cannot be of a reference counted type (such as ansistring or a record containing a field that is reference counted). Error: Operator is not overloaded: arg2 ”arg1”
You are trying to use an overloaded operator when it is not overloaded for this type. Error: Operator is not overloaded: ”arg1” arg2 ”arg3”
You are trying to use an overloaded operator when it is not overloaded for this type. Error: Expected another arg1 array elements
When declaring a typed constant array, you provided to few elements to initialize the array Error: String constant too long while ansistrings are disabled
Only when a piece of code is compiled with ansistrings enabled ( < $ H+ >), string constants longer than 255 characters are allowed. Error: Type cannot be used as univ parameter because its size is unknown at compile time: ”arg1”
univ parameters are compatible with all values of the same size, but this cannot be checked in case a parameter’s size is unknown at compile time. Error: Only one class constructor can be declared in class: ”arg1”
You are trying to declare more than one class constructor but only one class constructor can be declared. Error: Only one class destructor can be declared in class: ”arg1”
You are trying to declare more than one class destructor but only one class destructor can be declared. Error: Class constructors cannot have parameters
You are declaring a class constructor with a parameter list. Class constructor methods cannot have parameters. Error: Class destructors cannot have parameters
You are declaring a class destructor with a parameter list. Class destructor methods cannot have parameters. Fatal: This construct requires the < $ modeswitch objectivec1 >mode switch to be active
Objective-Pascal constructs are not supported when < $ modeswitch ObjectiveC1 >is not active. Error: Unicodechar/string constants cannot be converted to ansi/shortstring at compile-time
It is not possible to use unicodechar and unicodestring constants in constant expressions that have to be converted into an ansistring or shortstring at compile time, for example inside typed constants. The reason is that the compiler cannot know what the actual ansi encoding will be at run time. Error: For-in Objective-Pascal loops require < $ modeswitch ObjectiveC2 >to be active
Objective-C “fast enumeration” support was added in Objective-C 2.0, and hence the appropriate modeswitch has to be activated to expose this feature. Note that Objective-C 2.0 programs require Mac OS X 10.5 or later. Error: The compiler cannot find the NSFastEnumerationProtocol or NSFastEnumerationState type in the CocoaAll unit
Objective-C for-in loops (fast enumeration) require that the compiler can find a unit called CocoaAll that contains definitions for the NSFastEnumerationProtocol and NSFastEnumerationState types. If you get this error, most likely the compiler is finding and loading an alternate CocoaAll unit. Error: Typed constants of the type ’procedure is nested’ can only be initialized with NIL and global procedures/functions
A nested procedural variable consists of two components: the address of the procedure/function to call (which is always known at compile time), and also a parent frame pointer (which is never known at compile time) in case the procedural variable contains a reference to a nested procedure/function. Therefore such typed constants can only be initialized with global functions/procedures since these do not require a parent frame pointer. Fatal: Declaration of generic inside another generic is not allowed
At the moment, scanner supports recording of only one token buffer at the time (guarded by internal error 200511173 in tscannerfile.startrecordtokens). Since generics are implemented by recording tokens, it is not possible to have declaration of a generic (type or method) inside another generic. Error: Forward declaration ”arg1” must be resolved before a class can conform to or implement it
An Objective-C protocol or Java Interface must be fully defined before classes can conform to it. This error occurs in the following situation (example for Objective-C, but the same goes for Java interfaces):

where MyProtocol is declared but not defined. Error: Record types cannot have published sections
Published sections can be used only inside classes. Error: Destructors are not allowed in records or helpers
Destructor declarations are not allowed in records or helpers. Error: Class methods must be static in records
Class methods declarations are not allowed in records without static modifier. Records have no inheritance and therefore non static class methods have no sense for them. Error: Parameterless constructors are not allowed in records or record/type helpers
Constructor declarations with no arguments are not allowed in records or record/type helpers. Error: Either the result or at least one parameter must be of type ”arg1”
It is required that either the result of the routine or at least one of its parameters be of the specified type. For example class operators either take an instance of the structured type in which they are defined, or they return one. Error: Type parameters may require initialization/finalization — cannot be used in variant records
Type parameters may be specialized with types which (e.g. ansistring ) need initialization/finalization code which is implicitly generated by the compiler. Error: Variables being declared as external cannot be in a custom section
A section directive is not valid for variables being declared as external. Error: Non-static and non-global variables cannot have a section directive
A variable placed in a custom section is always statically allocated so it must be either a static or global variable. Error: ”arg1” is not allowed in helper types
Some directives and specifiers like ”virtual”, ”dynamic”, ”override” are not allowed inside helper types in mode ObjFPC (they are ignored in mode Delphi), because they have no meaning within helpers. Also ”abstract” isn’t allowed in either mode. Error: Class constructors are not allowed in helpers
Class constructor declarations are not allowed in helpers. Error: The use of ”inherited” is not allowed in a record
As records don’t support inheritance the use of ”inherited” is prohibited for these as well as for record helpers (in mode ”Delphi” only). Error: Type declarations are not allowed in local or anonymous records
Records with types must be defined globally. Types cannot be defined inside records which are defined in a procedure or function or in anonymous records. Error: Duplicate implements clause for interface ”arg1”
A class may delegate an interface using the ”implements” clause only to a single property. Delegating it multiple times is a error. Error: Interface ”arg1” cannot be delegated by ”arg2”, it already has method resolutions
Method resolution clause maps a method of an interface to a method of the current class. Therefore the current class has to implement the interface directly. Delegation is not possible. Error: Interface ”arg1” cannot have method resolutions, ”arg2” already delegates it
Method resolution is only possible for interfaces that are implemented directly, not by delegation. Error: Invalid codepage
When declaring a string with a given codepage, the range of valid codepages values is limited to 0 to 65535. Error: Only fields (var-sections) and constants can be final in object types
A final (class) field must be assigned a single value in the (class) constructor, and cannot be overwritten afterwards. A final (typed) constant is read-only. Error: Final fields are currently only supported for external classes
Support for final fields in non-external classes requires a full data flow analysis implementation in FPC, which it currently still lacks. Error: Typed constants are not allowed here, only formal constants are
Java interfaces define a namespace in which formal constant can be defined, but since they define no storage it is not possible to define typed constants in them (those are more or less the same as initialised class fields). Error: Constructors are not automatically inherited in the JVM; explicitly add a constructor that calls the inherited one if you need it
Java does not automatically add inherited constructors to child classes, so that they can be hidden. For compatibility with external Java code, FPC does the same. If you require access to the same constructors in a child class, define them in the child class and call the inherited one from there. Parsing internally generated code: arg1
The compiler sometimes internally constructs Pascal code that is subsequently injected into the program. These messages display such code, in order to help with debugging errors in them. Error: This language feature is not supported on managed VM targets
Certain language features are not supported on targets that are managed virtual machines. Error: Calling a virtual constructor for the current instance inside another constructor is not possible on the JVM target
The JVM does not natively support virtual constructor. Unforunately, we are not aware of a way to emulate them in a way that makes it possible to support calling virtual constructors for the current instance inside another constructor. Error: Overriding method ”arg1” cannot have a lower visibility (arg2) than in parent class arg3 (arg4)
The JVM does not allow lowering the visibility of an overriding method. Error: Procedure/Function declared with call option NOSTACKFRAME but without ASSEMBLER
nostackframe call modifier is supposed to be used in conjunction with assembler. Error: Procedure/Function declared with call option NOSTACKFRAME but local stack size is arg1
nostackframe call modifier used without assembler modifier might still generate local stack needs. Error: Cannot generate property getter/setter arg1 because its name clashes with existing identifier arg2
Automatically generated getters/setters cannot have the same name as existing identifiers, because this may change the behaviour of existing code. Warning: Automatically generated property getter/setter arg1 overrides the same-named getter/setter in class arg2
Automatically generated property getters/setters on the JVM platform are virtual methods, because the JVM does not support non-virtual methods that can be changed in child classes. This means that if a child class changes an inherited property definition, the behaviour of that property can change compared to native targets since even if a variable is declared as the parent type, by calling the virtual method the getter from the child will be used. This is different from the behaviour on native targets or when not activating automatically generated setters/getters, because in that case only the declared type of a variable influences the property behaviour. Warning: Case mismatch between declared property getter/setter arg1 and automatically constructed name arg2, not changing declared name
If a property’s specified getter/setter already corresponded to the naming convention specified by the automatic getter/setter generation setting except in terms of upper/lowercase, the compiler will print a warning because it cannot necessarily change that other declaration itself not can it add one using the correct case (it could conflict with the original declaration). Manually correct the case of the getter/setter to conform to the desired coding rules. TChild overrides Error: Constants declarations are not allowed in local or anonymous records
Records with constants must be defined globally. Constants cannot be defined inside records which are defined in a procedure or function or in anonymous records. Error: Method declarations are not allowed in local or anonymous records
Records with methods must be defined globally. Methods cannot be defined inside records which are defined in a procedure or function or in anonymous records. Error: Property declarations are not allowed in local or anonymous records
Records with properties must be defined globally. Properties cannot be defined inside records which are defined in a procedure or function or in anonymous records. Error: Class member declarations are not allowed in local or anonymous records
Records with class members must be defined globally. Class members cannot be defined inside records which are defined in a procedure or function or in anonymous records. Error: Visibility section ”arg1” not allowed in records
The visibility sections ( protected) and ( strict protected) are only useful together with inheritance. Since records do not support that they are forbidden. Error: Directive ”arg1” not allowed here
This directive is not allowed in the given context. E.g. ”static” is not allowed for instance methods or class operators. Error: Assembler blocks not allowed inside generics
The use of assembler blocks/routines is not allowed inside generics. Error: Properties can be only static, global or inside structured types
Properties cannot be declared local, only global, using the static directive or inside structured types. Error: Overloaded routines have the same mangled name
Some platforms, such as the JVM platform, encode the parameters in the routine name in a prescribed way, and this encoding may map different Pascal types to the same encoded (a.k.a. “mangled”) name. This error can only be solved by removing or changing the conflicting definitions’ parameter declarations or routine names. Error: Default values can only be specified for value, const and constref parameters
A default parameter value allows you to not specify a value for this parameter when calling the routine, and the compiler will instead pass the specified default (constant) value. As a result, default values can only be specified for parameters that can accept constant values. Warning: Pointer type ”arg1” ignored
The specified pointer type modifier is ignored, because it is not supported on the current platform. This happens, for example, when a far pointer is declared on a non-x86 platform. Error: Global Generic template references static symtable
A generic declared in the interface section of a unit must not reference symbols that belong solely to the implementation section of that unit. Unit arg1 has been already compiled meanwhile.
This tells you that the recursive reading of the uses clauses triggered already a compilation of the current unit, so the current compilation can be aborted. Error: Explicit implementation of methods for specializations of generics is not allowed
Methods introduced in a generic must be implemented for the generic. It is not possible to implement them only for specializations. Error: Generic methods are not allowed in interfaces
Generic methods are not allowed in interfaces, because there is no way to specialize a suitable implementation. Error: Generic methods can not be virtual
Generic methods can not be declared as virtual as there’d need to be a VMT entry for each specialization. This is however not possible with a static VMT. Error: Dynamic packages not supported for target OS
Support for dynamic packages is not implemented for the specified target OS or it is at least not tested and thus disabled. Error: The HardFloat directive cannot be used if soft float code is generated or fpu emulation is turned on
The HardFloat directive can only be used if an instruction set is used which supports floating point operations. Error: Index arg1 is not a valid internal function index
The index specified for the compilerproc directive is not an index that’s recognized by the compiler. Warning: Operator overload hidden by internal operator: ”arg1” arg2 ”arg3”
An operator overload is defined for the specified overload, but the internal overload by the compiler takes precedence. This only happens for operators that had been overloadable before (e.g. dynamic array + dynamic array), but aren’t anymore due to an internal operator being defined while this behavior is controllable by a modeswitch (in case of dynamic arrays that is the modeswitch ArrayOperators ). Error: Thread variables inside classes or records must be class variables
A threadvar section inside a class or record was started without it being prefixed by class . Error: Only static methods and static variables can be referenced through an object type
This error occurs in a situation like the following:

Type
TObj = object
procedure test;
end;

test is not a static method and hence cannot be called through a type, but only using an instance.

Источник

The «script» (which isn’t a script — it’s code) is wrong.

You’re inside a case statement:

tInteger :
   begin
       if(jinfo<maxinfo) then
       begin
         jinfo:=jinfo+1;
         lokasi[jinfo]:=ScanStr;
         WRITE(ResFile,jinfo:4);
       end;
       WRITE(ResFile,'   ');
       WRITE(ResFile,inum);
   end;

The only thing valid after that is either another case branch, an optional else clause, or a final end.

case TheThing of
  ThingA:
    begin
      // Code here
    end;
  ThingB:
    begin
      // Code here
    end;
else
    // Else code here
end;

You have another full begin..end block, which is invalid syntax.

BEGIN
  ScanStr:='';
  REPEAT
       ScanStr:=ScanStr+cc;
       ReadChar;
  UNTIL NOT (cc in ['a'..'z','A'..'Z','0'..'9','_']);
  {Test KeyWord}
  TampStr:=UpperCase(ScanStr);
  i:=1; j:=JmlKeyWord; {index pencarian keyword dalam tabel}
  REPEAT
     k:=(i+j) DIV 2;
     IF TampStr<=KeyWord[k] THEN j:=k-1;
     IF TampStr>=KeyWord[k] THEN i:=k+1;
  UNTIL i>j;

  IF i-j>1 THEN
  BEGIN k:=k+ORD(tKurungTutup); Token := KeyToken; END
  ELSE
  BEGIN Token := tIdentifier;
  ScanStr:=COPY(ScanStr,1,10); END;
end;

2 / 2 / 2

Регистрация: 07.01.2012

Сообщений: 112

1

25.03.2013, 20:51. Показов 5489. Ответов 10


Что не правильно?

Миниатюры

Исправить ошибку Illegal expression
 

__________________
Помощь в написании контрольных, курсовых и дипломных работ, диссертаций здесь



0



web-raised

7 / 7 / 2

Регистрация: 25.03.2013

Сообщений: 73

25.03.2013, 22:32

2

Ты везьде использовал знаки меньше и больше < и > , а нада дужки ( ) . и там вместо

Pascal
1
2
readln(a); 
readln(b);

лучше сделай

Pascal
1
readln(a,b);



1



Почетный модератор

64272 / 47571 / 32739

Регистрация: 18.05.2008

Сообщений: 115,182

26.03.2013, 09:44

3

Код нужно текстом выкладывать, а не картинкой. Открываете файл .pas в текстовом редакторе, копируете, выкладываете в тему и обрамляете тегами PASKAL



1



1642 / 1091 / 487

Регистрация: 17.07.2012

Сообщений: 5,345

26.03.2013, 22:09

4

Цитата
Сообщение от Puporev
Посмотреть сообщение

Код нужно текстом выкладывать, а не картинкой. Открываете файл .pas в текстовом редакторе, копируете, выкладываете в тему и обрамляете тегами PASKAL

Да,правило нужное,а то я глянул и даже не понял что это не скобки там,а знаки «больше» «меньше».



1



Эдуард1998

29.03.2013, 20:18

5

Там надо было readln (a,b);

web-raised

7 / 7 / 2

Регистрация: 25.03.2013

Сообщений: 73

29.03.2013, 20:35

6

Цитата
Сообщение от web-raised
Посмотреть сообщение

И там вместо

Pascal
1
2
readln(a); 
readln(b);

лучше сделай

Pascal
1
readln(a,b);

Я это написал и это не главная ошибка, это даже не ошибка.



0



2 / 2 / 2

Регистрация: 07.01.2012

Сообщений: 112

31.03.2013, 17:43

 [ТС]

7

Цитата
Сообщение от web-raised
Посмотреть сообщение

Я это написал и это не главная ошибка, это даже не ошибка.

Ну вот и я думаю, что это все равно…



0



1642 / 1091 / 487

Регистрация: 17.07.2012

Сообщений: 5,345

31.03.2013, 17:44

8

Лучший ответ Сообщение было отмечено Памирыч как решение

Решение

Там вместо скобок знаки больше-меньше,писали ж уже.



1



2 / 2 / 2

Регистрация: 07.01.2012

Сообщений: 112

31.03.2013, 23:40

 [ТС]

9

Цитата
Сообщение от Новичок
Посмотреть сообщение

Там вместо скобок знаки больше-меньше,писали ж уже.

Да, да, спасибо!
Я разобрался!



0



1642 / 1091 / 487

Регистрация: 17.07.2012

Сообщений: 5,345

31.03.2013, 23:42

10

Ну я так понимаю,вопросы исчерпаны.



0



2 / 2 / 2

Регистрация: 07.01.2012

Сообщений: 112

01.04.2013, 18:16

 [ТС]

11

Цитата
Сообщение от Новичок
Посмотреть сообщение

Ну я так понимаю,вопросы исчерпаны.

Да, темы закрыта!



1



В этом разделе описаны сообщения синтаксического анализатора. Синтаксический анализатор выполняет работу по проверке семантики вашего языка, то есть проверяет правильность языковых конструкций Pascal.

Сообщение

Описание

Error: Parser -Syntax Error

Ошибка Turbo Pascal была обнаружена. Это обычно происходит, если неправильный символ найден в исходном файле.

Error: INTERRUPT procedure can’t be nested

Процедура INTERRUPT должна быть глобальной.

Warning: Procedure type «Сообщение» ignored

Указанная процедурная директива игнорируется программами FPC.

Error: Not all declarations of «Сообщение» are declared with OVERLOAD

Если вы хотите использовать директиву OVERLOAD, то все объявления должны объявляться с OVERLOAD.

Error: Duplicate exported function name «Сообщение»

Экспортируемые имена функций в указанной DLL не должны совпадать.

Error: Invalid index for exported function

Индекс функции DLL должен быть в диапазоне 1..$FFFF.

Warning: Relocatable DLL or executable arg1 debug info does not work, disabled

В данный момент невозможно включить отладочную информацию в перемещаемую DLL.

Warning: To allow debugging for win32 code you need to disable relocation with -WN option

Попытка включить отладочную информацию в перемещаемую DLL или EXE — файл. Используёте ‑WN, если хотите отлаживать исполняемые файлы Win32.

Error: Constructor name must be INIT

Вы объявили конструктор объекта, имя которого не инициализировано, а переключатель -Ss установлен. См. опцию -Ss (раздел «(*) 5.1.5. Параметры для исходных кодов (опции языка)»).

Error: Destructor name must be DONE

Вы объявили деструктор объекта, имя которого не завершено, а переключатель -Ss установлен. См. опцию -Ss (раздел «(*) 5.1.5. Параметры для исходных кодов (опции языка)»).

Error: Procedure type INLINE not supported

Вы пытаетесь компилировать программу с стилем С++, но забыли указать опцию -Si (-Si, см. раздел «5.1.5. Параметры для исходных кодов (опции языка)»). По умолчанию компилятор не поддерживает стиль С++.

Warning: Constructor should be public

Конструктор должен быть в разделе public объявления объекта (класса).

Warning: Destructor should be public

Деструктор должен быть в разделе public объявления объекта (класса).

Note: Class should have one destructor only

Вы должны объявлять только один деструктор для класса.

Error: Local class definitions are not allowed

Классы должны быть объявлены глобально. Они не могут быть объявлены внутри процедуры или функции.

Fatal: Anonymous class definitions are not allowed

Было обнаружено неправильное объявление объекта (класса), например, объект или класс без методов, не являются рпоизводными от другого объекта. Пример:

Type o = object
 a : longint;
end;

вызовет ошибку.

Note: The object «Сообщение» has no VMT

Это замечание означает, что объявленный объект не имеет таблицы виртуальных методов.

Error: Illegal parameter list

Вы вызываете функцию с параметрами, которые отличаются от параметров, указанных при объявлении функции.

Error: Wrong number of parameters specified for call to «Сообщение»

Это ошибка в списке параметров функции или процедуры – неправильное количество параметров.

Error: overloaded identifier «Сообщение» isn’t a function

Компилятор обнаружил идентификатор с именем, которое совпадает с именем перегружаемой функции, но этот идентификатор не является функцией, которая может быть перегружаемой.

Error: overloaded functions have the same parameter list

Вы объявили перегружаемые функции, но с одинаковым списком параметров. Перегружаемая функция должна иметь не менее 1 отличия в параметрах от объявленной функции.

Error: function header doesn’t match the previous declaration «Сообщение»

Вы объявили функцию с одинаковыми параметрами, но тип результата отличается.

Error: function header «Сообщ1» doesn’t match forward : var name changes Сообщ2 => Сообщ3

Вы объявили функцию в интерфейсной части, или с директивой forward, но с различным списком параметров.

Note: Values in enumeration types have to be ascending

Free Pascal допускает перечисления как в С. Проверьте следующие два объявления:

type a = (A_A,A_B,A_E:=6,A_UAS:=200);
type a = (A_A,A_B,A_E:=6,A_UAS:=4);

Второе объявление вызовет ошибку, потому что значение A_UAS должно быть больше, чем A_E, то есть не меньше 7.

Error: With cannot be used for variables in a different segment

Локальная переменная записывается в стек, но это невозможно, если переменная принадлежит другому сегменту.

Error: function nesting > 31

Вы можете объявлять вложенные функции только до 31 уровня в глубину.

Error: range check error while evaluating constants

Константы находятся за пределами допустимого диапазона.

Warning: range check error while evaluating constants

Константы находятся за пределами допустимого диапазона.

Error: duplicate case label

Вы указали одну и ту же метку 2 раза в конструкции case.

Error: Upper bound of case range is less than lower bound

Верхняя граница метки в конструкции case меньше, чем нижняя граница, а это неправильно.

Error: typed constants of classes or interfaces are not allowed

Вы не можете объявить константу типа класса или объекта.

Error: functions variables of overloaded functions are not allowed

Вы пытаетесь назначить перегружаемую функцию процедурной переменной. Это не допускается.

Error: string length must be a value from 1 to 255

Длина shortstring в Pascal ограничена 255 символами. Вы пытаетесь объявить строку длиной меньше 1 или больше 255 символов.

Warning: use extended syntax of NEW and DISPOSE for instances of objects

Если вы имеете указатель на объектный тип, то оператор new(a) не будет инициализировать объект (то есть конструктор не вызывается), даже если имеется свободное место для выделения памяти. Вы должны использовать оператор new(a,init). Он выделит память и вызовет конструктор объекта.

Warning: use of NEW or DISPOSE for untyped pointers is meaningless

Использование NEW или DISPOSE для нетипизированных указателей не имеет смысла.

Error: use of NEW or DISPOSE is not possible for untyped pointers

Вы не можете использовать new(p) или dispose(p), если p – это нетипизированный указатель, потому что для него нельзя определить размер. Это принято для совместимости с режимами TP и DELPHI, но компилятор предупредит вас, если найдёт такую конструкцию.

Error: class identifier expected

Это сообщение появляется, если компилятор обнаружил объявление процедуры, которая содержит точку, то есть метод объекта или класса, но тип перед точкой не известен компилятору.

Error: type identifier not allowed here

Вы не можете использовать тип внутри выражения.

Error: method identifier expected

Идентификатор не является методом. Это сообщение появляется, если компилятор обнаружил объявление процедуры, которая содержит точку, то есть метод объекта или класса, но имя процедуры не является процедурой данного типа.

Error: function header doesn’t match any method of this class «Сообщение»

Идентификатор не является методом. Это сообщение появляется, если компилятор обнаружил объявление процедуры, которая содержит точку, то есть метод объекта или класса, но имя процедуры не является процедурой данного типа.

procedure/function Сообщение

Если используется переключатель -vd, то компилятор сообщает вам, когда он начинает выполнять процедуру или функцию.

Error: Illegal floating point constant

Компилятор ожидал увидеть выражение с плавающей точкой, но получил нечто другое.

Error: FAIL can be used in constructors only

Вы использовали ключевое слово fail вне метода конструктора.

Error: Destructors can’t have parameters

Вы объявили деструктор со списком параметров. Методы деструктора не могут иметь параметры.

Error: Only class methods can be referred with class references

Эта ошибка возникает в ситуации, подобной следующей:

Type :
Tclass = Class of Tobject;
Var C : TClass;
begin

C.free

Free – это не метод класса и, следовательно, не может быть вызван со ссылкой на класс.

Error: Only class methods can be accessed in class methods

Это связано похоже на предыдущую ошибку. Вы не можете вызвать метод объекта из внутреннего метода класса. Следующий код вызовет такую ошибку:

class procedure tobject.x;
begin free

Так как free – это нормальный метод класса, он не может быть вызван из метода класса.

Error: Constant and CASE types do not match

Одна из меток конструкции CASE имеет тип, отличный от типа переменной переключателя CASE.

Error: The symbol can’t be exported from a library

Вы можете экспортировать процедуры и функции, только когда вы пишите библиотеку. Вы не можете экспортировать переменные и константы.

Warning: An inherited method is hidden by «Сообщение»

Метод, который объявлен как virtual в классе-предке, должен быть перезаписан в классе-потомке с директивой override. Если вы не укажете директиву override, вы скроете метод предка.

Error: There is no method in an ancestor class to be overridden: «Сообщение»

Вы пытаетесь переписать директивой override виртуальный метод класса- предка, который не существует.

Error: No member is provided to access property

Вы не указали директиву read для свойства.

Warning: Stored property directive is not yet implemented

Это сообщение больше не используется, так как записанная директива была выполнена.

Error: Illegal symbol for property access

Это ошибка директив read или write для свойства типа массива. Если вы объявляете свойство-массив, вы можете получить доступ к нему только с помощью процедуры или функции. Следующий код вызовет такую ошибку:

tmyobject = class
i : integer;
property x [i : integer]: integer read I write i;
 

Error: Cannot access a protected field of an object here

Поля, которые объявлены в разделе protected объекта или класса, не могут быть доступны из другого модуля.

Error: Cannot access a private field of an object here

Поля, которые объявлены в разделе private объекта или класса, не могут быть доступны из другого модуля.

Error: Overridden methods must have the same return type: «Сообщение2» is overriden by «Сообщение1» which has another return

Если вы объявили перегружаемые методы в определении класса, они должны иметь одинаковый тип возвращаемого результата.

Error: EXPORT declared functions can’t be nested

Вы не можете объявить функцию или процедуру внутри функции или процедуры, которая была объявлена как экспортная процедура.

Error: Methods can’t be EXPORTed

Вы не можете объявить процедуру, которая является методом для экспортируемого объекта.

Error: Call by var for arg no. Сообщ1 has to match exactly: Got «Сообщ2» expected «Сообщ3»

Если вызывающая функция объявлена с параметрами var, то переменные в вызываемой функции должны иметь точно такой же тип. Они не преобразуются автоматически.

Error: Class isn’t a parent class of the current class

Когда вызываются наследуемые методы, вы пытаетесь вызвать метод не связанный с классом. Вы можете только вызвать метод класса- предка.

Error: SELF is only allowed in methods

Вы пытаетесь использовать параметр self вне метода объекта. Только методы могут получать параметры self.

Error: Methods can be only in other methods called direct with type identifier of the class

Конструкция, подобная следующей: НекийТип.НекийМетод допускается только для методов.

Error: Illegal use of ’:’

Вы использовали формат : (двоеточие) 2 раза в выражении, которое не предусматривает такой формат.

Error: range check error in set constructor or duplicate set element

Объявление множества содержит ошибку. Какой-то элемент находится вне диапазона или имеется два одинаковых элемента.

Error: Pointer to object expected

Вы указали неправильный тип в операторе new. Расширенный синтаксис new требует параметра типа объект.

Error: Expression must be constructor call

Когда используете расширенный синтаксис new, вы должны указать метод конструктора объекта, когда пытаетесь его создать. Процедура, которую вы указали, не является конструктором.

Error: Expression must be destructor call

Когда используете расширенный синтаксис dispose, вы должны указать метод деструктора объекта, когда пытаетесь его разрушить. Процедура, которую вы указали, не является деструктором.

Error: Illegal order of record elements

При объявлении записи-константы вы указали поля в неправильном порядке.

Error: Expression type must be class or record type

Для оператора with необходим аргумент, который имеет тип записи или класса. Вы используете выражение, которое не относится ни к одному из данных типов.

Error: Procedures can’t return a value

В Free Pascal вы можете указать возвращаемое значение для функции, когда используете оператор exit. Эта ошибка случается, если вы пытаетесь сделать то же самое с процедурой. Процедура не может возвращать значение.

Error: constructors and destructors must be methods

Вы объявили процедуру как конструктор или деструктор, когда процедура не является методом класса.

Error: Operator is not overloaded

Вы пытаетесь использовать перегружаемый оператор, когда он не является перегружаемым для этого типа.

Error: Impossible to overload assignment for equal types

Вы не можете перегрузить аргумент для типов, которые компилятор рассматривает как эквивалентные.

Error: Impossible operator overload

Комбинация оператор/аргумент/возвращаемое значение является несовместимой.

Error: Re-raise isn’t possible there

Вы пытаетесь вызвать исключение там, где это недопустимо. Вы можете вызвать исключение только в блоке except.

Error: The extended syntax of new or dispose isn’t allowed for a class

Вы не можете создать экземпляр класса с расширенным синтаксисом new. Для этого должен использоваться конструктор. По тем же соображениям вы не можете использовать вызов dispose для уничтожения экземпляра класса. Для этого нужно использовать деструктор.

Error: Procedure overloading is switched off

Если используется переключатель –So, то перегрузка процедур отключена. Turbo Pascal не поддерживает перегрузку функций.

Error: It is not possible to overload this operator. Related overloadable operators (if any) are: Сообщение

Вы пытаетесь перегрузить оператор, который не может быть перегружен. Следующие операторы не могут быть перегружаемыми: +, -, *, /, =, >, <, <=, >=, is, as, in, **, :=

Error: Comparative operator must return a boolean value

Если перегружающий оператор – это =, то функция должна возвращать логическое значение.

Error: Only virtual methods can be abstract

Вы объявили метод как абстрактный, когда он не объявлен как виртуальный.

Fatal: Use of unsupported feature!

Вы пытаетесь форсировать компилятор, когда он к этому не готов.

Error: The mix of different kind of objects (class, object, interface, etc) isn’t allowed

Вы не можете порождать объекты, классы и интерфейсы (objects, classes, cppclasses и interfaces) друг от друга. Например, класс не может быть предком объекта и наоборот.

Warning: Unknown procedure directive had to be ignored: «Сообщение»

Вы указали неизвестную процедурную директиву.

Error: absolute can only be associated to one variable

Вы не можете указать более одной переменной перед директивой absolute. Таким образом, следующая конструкция вызовет эту ошибку:

Var Z : Longint;
X,Y : Longint absolute Z;
 

Error: absolute can only be associated with a var or const

Адрес директивы absolute может только указывать на переменную или константу. Таким образом, следующий код вызовет эту ошибку:

Procedure X;
var p : longint absolute x;
 

Error: Only one variable can be initialized

Вы не можете указать более одной переменной с начальным значением в режиме Delphi.

Error: Abstract methods shouldn’t have any definition (with function body)

Абстрактные методы можно только объявлять. Вы не можете их выполнить. Они должны быть перегружены в классе-потомке.

Error: This overloaded function can’t be local (must be exported)

Вы определили перегружаемую функцию в разделе implementation модуля, но она не ссылается на объявление в разделе interface.

Warning: Virtual methods are used without a constructor in «Сообщение»

Если вы определили объекты или классы, содержащие виртуальные методы, то вам необходимо иметь конструктор и деструктор для их инициализации. Компилятор нашёл объект или класс с виртуальными методами, которые не имеют пары конструктор/деструктор.

Macro defined: Сообщение

Если используется –vc, то компилятор сообщает вам, если он определяет макрос.

Macro undefined: Сообщение

Если используется –vc, то компилятор сообщает вам, если он не определяет макрос.

Macro Сообщение1 set to Сообщение2

Если используется –vc, то компилятор сообщает вам, когда макрос получает значения.

Info: Compiling Сообщение

Если вы включили информационные сообщения (-vi), компилятор сообщает вам, что модули перекомпилированы.

Parsing interface of unit Сообщение

Сообщение о том, что начато чтения интерфейсной части модуля.

Parsing implementation of Сообщение

Сообщение о том, что начато чтения исполняемой части модуля, библиотеки или программы.

Compiling Сообщение for the second time

Если вы запросили отладочную информацию (-vd), компилятор сообщает вам, что он повторно перекомпилировал модули.

Error: No property found to override

Вы хотите перегрузить свойство существующего класса-предка, но там такого свойства нет.

Error: Only one default property is allowed

Вы указали свойство как Default, но класс уже имеет свойство по умолчанию, а класс может иметь только одно такое свойство.

Error: The default property must be an array property

Только массив свойств класса может быть сделан свойствами по умолчанию.

Error: Virtual constructors are only supported in class object model

Вы не можете иметь виртуальные конструкторы в объектах. Это допускается только для классов.

Error: No default property available

Вы пытаетесь получить доступ к свойству класса по умолчанию, но этот класс (или один из его предков) не имеет свойства по умолчанию.

Error: The class can’t have a published section, use the {$M+} switch

Если вы хотите определить в классе раздел published, вы должны использовать переключатель {$M+}, который включает генерацию информации.

Error: Forward declaration of class «Сообщение» must be resolved here to use the class as ancestor

Чтобы иметь возможность использовать объект как объект-предок, его нужно сначала определить. Эта ошибка случается в следующей ситуации:

Type ParentClas = Class;
ChildClass = Class(ParentClass)

end;

где ParentClass объявлен, но не определён.

Error: Local operators not supported

Вы не можете перегружать локальные операторы, то есть внутри определения процедуры или функции.

Error: Procedure directive «Сообщение» not allowed in interface section

Эта процедурная директива не допускается в разделе interface модуля. Вы можете использовать её только в разделе implementation.

Error: Procedure directive «Сообщение» not allowed in implementation section

Эта процедурная директива не допускается в разделе implementation модуля. Вы можете использовать её только в разделе interface.

Error: Procedure directive «Сообщение» not allowed in procvar declaration

Эта процедурная директива не может быть частью объявления процедурного типа или типа функции.

Error: Function is already declared Public/Forward «Сообщение»

Вы получите эту ошибку, если функция дважды объявлена как forward. Или если она имеется в разделе interface, а затем имеется объявление forward в разделе implementation.

Error: Can’t use both EXPORT and EXTERNAL

Эти две процедурные директивы являются взаимно исключающими.

Warning: «arg1» not yet supported inside inline procedure/function

Встроенные процедуры не поддерживают это объявление.

Warning: Inlining disabled

Встроенные процедуры отключены.

Info: Writing Browser log Сообщение

Если информационные сообщения включены, то компилятор предупреждает вас, когда записывает лог обозревателя (генерируемый переключателем {$Y+ }).

Hint: may be pointer dereference is missing

Компилятор предполагает, что указатель нужно разыменовать.

Fatal: Selected assembler reader not supported

Выбранный ассемблер (с {$ASMMODE xxx} не поддерживается. Компилятор может работать с или без поддержки редкого ассемблера.

Error: Procedure directive «Сообщение» has conflicts with other directives

Вы указали процедурную директиву, которая конфликтует с другой директивой. Например, cdecl и pascal являются взаимно исключающими, то есть несовместимыми.

Error: Calling convention doesn’t match forward

Эта ошибка случается, когда вы объявляете функцию или процедуру, например, с cdecl, но пропускаете эту директиву в разделе implementation, или наоборот. Соглашение о вызовах – это часть объявления функции, которая должна быть повторена в определении функции.

Error: The default value of a property must be constant

Значение по умолчанию объявленного свойства должно быть известно во время компиляции. Значение, которое вы указали, будет известно только во время выполнения. Эта ошибка случается, например, если вы указали имя переменной как значение по умолчанию.

Error: Symbol can’t be published, can be only a class

Только переменные типа класса могут быть в разделе published класса, если они не объявлены как свойства.

Error: This kind of property can’t be published

Свойства в разделе published не могут быть массивом. Они должны быть перемещены в раздел public. Свойства в разделе published должны быть порядкового, вещественного, строкового типа или множеством.

Error: An import name is required

Некоторые целевые платформы требуют имени для импортируемой процедуры или спецификатора cdecl.

Error: Division by zero

Было обнаружено деление на ноль.

Error: Invalid floating point operation

Операция с двумя значениями вещественного типа вызвала переполнение или деление на ноль.

Error: Upper bound of range is less than lower bound

Верхняя граница объявленного массива меньше, чем нижняя граница, а это недопустимо.

Warning: string «Сообщение1» is longer than «Сообщение2»

Размер строковой константы больше, чем размер, указанный вами при определении строкового типа.

Error: string length is larger than array of char length

Размер строковой константы больше, чем размер, указанный вами при определении Array[x..y] of char.

Error: Illegal expression after message directive

Free Pascal поддерживает только целочисленные или строковые значения в качестве констант для сообщений.

Error: Message handlers can take only one call by ref. parameter

Метод, объявленный с директивой message как обработчик сообщения, может принять только один параметр, который должен быть передан по ссылке. Параметры, передаваемые по ссылке, используют директиву var.

Error: Duplicate message label: «Сообщение»

Метка для сообщения используется дважды в одном объекте/классе.

Error: Self can only be an explicit parameter in methods which are message handlers

Параметр Self может передаваться ТОЛЬКО в метод, который объявлен как обработчик сообщения.

Error: Threadvars can be only static or global

Потоковые переменные должны быть статическими или глобальными. Вы не можете объявить локальный поток для процедуры. Локальные переменные являются всегда локальными в потоке, потому что каждый поток свой собственный стек и локальные переменные записываются в стек.

Fatal: Direct assembler not supported for binary output format

Вы не можете использовать ассемблер напрямую, если используете бинарный писатель. Вы берите другой выходной формат или используйте другой ассемблер.

Warning: Don’t load OBJPAS unit manually, use n{n$mode objfpcn} or n{n$mode delphin} instead

Вы пытаетесь загрузить модуль ObjPas вручную из раздела uses. Это плохая идея. Используйте директивы {$MODE OBJFPC} или {$mode delphi}, которые загружают этот модуль автоматически.

Error: OVERRIDE can’t be used in objects

Override не поддерживается для объектов, используйте virtual вместо этого для перегрузки метода объекта-предка.

Error: Data types which require initialization/finalization can’t be used in variant records

Некоторые типы данных (например, ansistring) требуют кода инициализации/финализации, который полностью генерируется компилятором. Такие типы данных нельзя использовать в вариантной части записи.

Error: Resourcestrings can be only static or global

Строка ресурсов не может быть объявлена локально, только глобально или с директивой static.

Error: Exit with argument can’t be used here

Выход из блока с аргументом для возвращаемого значения не может здесь использоваться. Эта ошибка может случиться, например, в блоке try..except или try..finally.

Error: The type of the storage symbol must be boolean

Если вы указали символ storage в объявлении свойства, то оно должно быть логического типа.

Error: This symbol isn’t allowed as storage symbol

Вы не можете использовать этот типа символа как спецификатор storage в объявлении свойства. Вы можете использовать только методы результатом логического типа, логическими полями класса или логическими константами.

Error: Only classes which are compiled in $M+ mode can be published

Поле типа класса в разделе published класса может быть только классом, который был скомпилирован в {$M+} или который является потомком такого класса. Обычно такой класс должен быть потомком от TPersistent.

Error: Procedure directive expected

Эта ошибка случается, если вы имеете директиву {$Calling} без указанного условия вызова. Это также случается, если процедура объявлена в блоке констант и вы используете точку с запятой (;) после объявления процедуры, которое должна следовать за процедурной директивой. Правильное объявление:

const
p : procedure;stdcall=nil;
p : procedure stdcall=nil;
 

Error: The value for a property index must be of an ordinal type

Значение, которое вы используете для индекса свойства, должно быть порядкового типа.

Error: Procedure name too short to be exported

Длина имени процедуры или функции должна быть не менее 2 символов. Это потому, что имеется ошибка в dlltool, который неправильно распознаёт файлы .def с именами длиной в 1 символ.

Error: No DEFFILE entry can be generated for unit global vars

Нет вхождений DEFFILE, которые могут быть сгенерированы для глобальных переменных модуля.

Error: Compile without -WD option

Вам нужно компилировать этот файл без опции –WD в командной строке.

Fatal: You need ObjFpc (-S2) or Delphi (-Sd) mode to compile this module

Вам нужно использовать {$MODE OBJFPC} или {$MODE DELPHI} для компиляции этого файла. Или использовать соответствующую опцию командной строки, любую из -objfpc или -MDelphi.

Error: Can’t export with index under Сообщение

Экспортирование функций или процедур с указанным индексом не поддерживается данной целевой платформой.

Error: Exporting of variables is not supported under Сообщение

Экспортирование переменных не поддерживается данной целевой платформой.

Error: Improper GUID syntax

Код GUID имеет неправильный синтаксис. Он должен иметь формат:

{XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}

Где каждый X – шестнадцатиричное число.

Warning: Procedure named «Сообщ1» not found that is suitable for implementing the Сообщ2.Сообщ3

Компилятор не может найти подходящую процедуру, которая выполняет данный метод интерфейса. Процедура с таким именем найдена, но параметры не совпадают.

Error: interface identifier expected

Это сообщение появляется, если компилятор сканирует объявление класса, который содержит interface функции, подобно следующему:

type
TMyObject = class(TObject, IDispatch)
function IUnknown.QueryInterface=MyQueryInterface;
….

а interface не перечислен в списке потомков.

Error: Type «Сообщение» can’t be used as array index type

Типы, подобные qword или int64, не допускается использовать в индексах массивов.

Error: Con-and destructors aren’t allowed in interfaces

Объявления конструктора и деструктора не допускаются в интерфейсах. В большинстве случаев метод QueryInterface интерфейса IUnknown можно использовать для создания нового интерфейса.

Error: Access specifiers can’t be used in INTERFACEs and OBJCPROTOCOLs

Спецификаторы доступности public, private, protected и published нельзя использовать в интерфейсах, Objective-C протоколов и категорий потому что все методы интерфейса/протокола/категории должны быть доступны (public).

The access specifiers public, private, protected and published can’t be used in interfaces, Objective-C protocols and categories because all methods of an interface/protocol/category must be public.

В спецификаторы доступа public, private, protected и published не могут быть использованы в интерфейсах, Objective-C протоколов и категорий, так как все методы интерфейсного / протокола / категории должен быть публичным.

Error: An interface can’t contain fields

Error: An interface, helper or Objective-C protocol or category cannot contain fields

Объявления полей не допускаются в интерфейсах. Интерфейс может содержать только методы и свойства с методом чтения/записи и спецификатором доступа.

Declarations of fields are not allowed in interfaces, helpers and Objective-C protocols and categories. An interface/helper/protocol/category can contain only methods and properties with method read/write specifiers.

Заявления полей не допускаются в интерфейсах, помощников и Objective-C протоколов и категорий.Интерфейс / помощник / протокол / категория может содержать только методы и свойства с помощью метода чтения / записи спецификаторов.

Error: Can’t declare local procedure as EXTERNAL

Объявление локальных процедур как внешних невозможно. Локальные процедуры получают скрытые параметры, которые делают вероятность ошибки очень высокой.

Warning: Some fields coming before «Сообщение» weren’t initialized

В режиме Delphi не все поля записи-константы могут быть инициализированы, компилятор предупреждает вас, когда обнаруживает такую ситуацию.

Error: Some fields coming before «Сообщение» weren’t initialized

Во всех режимах синтаксиса, кроме режима Delphi, вы не можете инициализировать некоторые поля в середине записи-константы.

Warning: Some fields coming after «Сообщение» weren’t initialized

Вы можете инициализировать некоторые поля в конце записи-константы (компилятор их инициализирует со значением 0 автоматически). Это может вызвать труднонаходимые проблемы.

Error: VarArgs directive (or ’…’ in MacPas) without CDecl/CPPDecl/MWPascal and External

Директива varargs (или ‘…’ параметр varargs в режиме MacPas) может использоваться только с процедурами и функциями, которые объявлены как external и одним из cdecl, cppdecl или mwpascal. Эта функциональность поддерживается только для совместимости интерфейса функций C, подобных printf.

Error: Self must be a normal (call- by-value) parameter

Вы не можете объявить Self как параметр const или var, он должен быть всега параметром, передаваемым по значению.

Error: Interface «Сообщение» has no interface identification

Если вы хотите назначить интерфейс для константы, то интерфейс должен иметь значение GUID.

Error: Unknown class field or method identifier «Сообщение»

Свойства должны ссылаться на поле или метод в этом же классе.

Warning: Overriding calling convention «Сообщение1» with «Сообщение2»

Имеются две директивы в объявлении процедуры, которые определяют соглашение о вызовах. Только последняя директива будет использоваться.

Error: Typed constants of the type «procedure of object» can only be initialized with NIL

Вы не можете связать адрес метода с типизированной константой, которая имеет тип «процедура объекта», потому что такая константа требует два адреса: для метода (который известен во время компиляции) и для объекта или класса (который неизвестен во время компиляции).

Error: Default value can only be assigned to one parameter

Невозможно указать значение по умолчанию для нескольких параметров. Следующий пример неправильный:

Procedure MyProcedure (A,B : Integer = 0);

Вместо этого вы должны написать так:

Procedure MyProcedure (A : Integer = 0; B : Integer = 0);

Error: Default parameter required for «Сообщение»

Указанный параметр требует значения по умолчанию.

Warning: Use of unsupported feature!

Вы пытаетесь заставить компилятор выполнить какое-либо действие, которое он пока не может выполнить.

Hint: C arrays are passed by reference

Какой-то массив, переданный в функцию С, является переданным по ссылке.

Error: C array of const must be the last argument

Вы не можете добавить какой-либо другой параметр после массива констант для функции cdecl, так как размер стека для этого параметра неизвестен.

Hint: Type «Сообщение» redefinition

Это сообщение указывает на то, что ранее объявленный тип был переопределён как-то иначе. Это может быть (а может и не быть) потенциально ошибкой исходного кода.

Warning: cdecl’ared functions have no high parameter

Функции, объявленные с модификатором cdecl, не имеют дополнительного явного параметра.

Warning: cdecl’ared functions do not support open strings

Openstring не поддерживается для функций, которые имеют модификатор cdecl.

Error: Cannot initialize variables declared as threadvar

Переменные, объявленные как threadvar, не могут быть инициализированы с значением по умолчанию. Такие переменные всегда обнуляются при старте нового потока.

Error: Message directive is only allowed in Classes

Директива message поддерживается только для типов Class.

Error: Procedure or Function expected

Метод класса может быть указан только для процедур и функций.

Warning: Calling convention directive ignored: «Сообщение»

Некоторые соглашения о вызовах поддерживаются только определёнными процессорами. Например, большинство не i386 портов поддерживаются только стандартным соглашением о вызовах ABI.

Error: REINTRODUCE can’t be used in objects

reintroduce не поддерживается для объектов. Objective-C classes and Objective-C protocols.

Error: Each argument must have its own location

Если размещение для аргументов указано явно, как того требуют некоторые соглашения системных вызовов (syscall), то каждый аргумент должен иметь своё собственное размещение. Мысли, подобные этим

procedure p(i,j : longint r1’);

недопустимы.

Error: Each argument must have an explicit location

Если для одного аргумента указано явно размещение, то все аргументы процедуры должны иметь явно указанное размещение.

Error: Unknown argument location

Размещение, указанное для аргумента, не распознаётся компилятором.

Error: 32 Bit-Integer or pointer variable expected

libbase для MorphOS/AmigaOS можно получить только как переменную longint, dword или любой указатель.

Error: Goto statements aren’t allowed between different procedures

Не допускается использовать оператор goto, ссылающийся на метку, которая находится за пределами текущей процедуры. Следующий пример показывает эту проблему:


procedure p1;
label
  l1;
  procedure p2;
  begin
    goto l1; // Такой переход не допускается
  end;
begin
p2
l1:
end;

 

Fatal: Procedure too complex, it requires too many registers

Тело вашей процедуры слишком большое для компилятора. Вы должны разделить процедуру на несколько меньших процедур.

Error: Illegal expression

Это может случиться во многих ситуациях. Обычно происходит при попытке вычислить выражение с константами.

Error: Invalid integer expression

Вы написали выражение, которое не является целочисленным, а компилятор ожидал целочисленный результат.

Error: Illegal qualifier

Один из следующих вариантов:

Вы пытаетесь получить доступ к полю переменной, которая не является записью

Вы индексируете переменную, которая не является массивом.

Вы разыменовываете переменную, которая не является указателем.

Error: High range limit < low range limit

Вы объявили поддиапазон, где верхний предел меньше, чем нижний предел диапазона.

Error: Exit’s parameter must be the name of the procedure it is used in

Не локальный выход не допускается. Эта ошибка случается только в режиме MacPas.

Error: Illegal assignment to for-loop variable «Сообщение»

Тип переменной цикла for должен быть порядковым. Переменные цикла не могут быть строками или вещественными числами. Вы также не можете назначать значения переменным цикла внутри этого цикла (кроме режимов Delphi и TP). Используйте циклы while или repeat вместо цикла for, если вам необходимо снять вышеописанные ограничения.

Error: Can’t declare local variable as EXTERNAL

Объявление локальных переменных как external не допускается. Только глобальные переменные могут быть связаны с внешними переменными.

Error: Procedure is already declared EXTERNAL

Процедура уже объявлена с директивой EXTERNAL в объявлении interface или forward.

Warning: Implicit uses of Variants unit

Тип Variant используется в каком-либо модуле без подключения модуля Variants. Компилятор требует явно указывать модуль Variants в разделе uses. Для удаления этого сообщения модуль Variants должен быть добавлен в список модулей в разделе uses.

Error: Class and static methods can’t be used in INTERFACES

Спецификатор class и директива static не могут использоваться в интерфейсах, потому что все методы интерфейса должны быть общедоступными.

Error: Overflow in arithmetic operation

Операция с двумя целочисленными значениями вызвала переполнение.

Error: Protected or private expected

strict можно использовать только совместно с protected или private.

Error: SLICE can’t be used outside of parameter list

slice можно использовать только для аргументов, принимающих параметр открытого массива.

Error: A DISPINTERFACE can’t have a parent class

DISPINTERFACE – это специальный тип интерфейса, который не может иметь класса-предка.

Error: A DISPINTERFACE needs a guid

DISPINTERFACE всегда требует идентификации интерфейса (GUID).

Warning: Overridden methods must have a related return type. This code may crash, it depends on a Delphi parser bug

Если вы объявили перегружаемые методы в определении класса, они должны иметь одинаковый тип возвращаемого результата. Некоторые версии Delphi позволяют изменять тип возвращаемого результата методов интерфейса, и даже заменять процедуры на функции, но в результате код может оказаться неработоспособен на используемых типах и вызываемых методах.

Error: Dispatch IDs must be ordinal constants

Ключевое слово dispid должно следовать за константой порядкового типа (индекс dispid).

Error: The range of the array is too large

Несмотря на правильно указанный размер, количество элементов в массиве не может быть более чем high(ptrint). Кроме того, тип, определяющий диапазон массива, должен быть поддиапазоном ptrint.

Error: The address cannot be taken of bit packed array elements and record fields

Если вы объявили массив или запись как packed в режиме Mac Pascal (или как packed в любом режиме с {$bitpacking on}), то он будет запакован до битового уровня. Это означает, что невозможно будет получить индивидуальный адрес элемента массива или поля записи. Исключение из этого правила возможно только в том случае, если размер упаковки кратен 8.

Error: Dynamic arrays cannot be packed

Только стандартные (и возможно в будущем – открытые) массивы могут быть упакованы.

Error: Bit packed array elements and record fields cannot be used as loop variables

Если вы объявили массив или запись как packed в режиме Mac Pascal (или как packed в любом режиме с {$bitpacking on}), то он будет запакован до битового уровня. Это означает, что для работы с таким массивом нельзя будет использовать циклы.

Error: VAR and TYPE are allowed only in generics

Использование VAR и TYPE для объявлений новых типов допускается только внутри generics.

Error: This type can’t be a generic

Только классы, объекты, интерфейсы и записи могут использоваться как generic.

Warning: Don’t load LINEINFO unit manually, Use the -gl compiler switch instead

Не используйте модуль lineinfo напрямую. Используйте переключатель ‑gl, который правильно и автоматически добавляет этот модуль для чтения выбранного типа отладочной информации. Модуль, который требуется для использования отладочной информации соответствующего типа, используется, когда компилируется бинарный файл.

Error: No function result type specified for function «Сообщение»

Когда вы объявляете функцию первый раз, вы должны объявлять её в полной форме, то есть со всеми параметрами и типом результата.

Error: Specialization is only supported for generic types

Типы, не являющиеся generics, не могут быть специализированы.

Error: Generics can’t be used as parameters when specializing generics

Если специализация generic, то только не-generic типы могут использоваться как параметры.

Error: Constants of objects containing a VMT aren’t allowed

Если объект требует VMT, потому что он содержит конструктор или виртуальные методы, то не допускается создавать в нём константы. В режимах TP и Delphi это разрешено для совместимости.

Error: Taking the address of labels defined outside the current scope isn’t allowed

Не допускается брать адрес метки за пределами текущей процедуры.

Error: Cannot initialize variables declared as external

Переменные, объявленные как external, не могут быть инициализированы значением по умолчанию.

Error: Illegal function result type

Некоторые типы, например, файловые, не могут использоваться как результат, возвращаемый функцией.

Error: No common type possible between «Сообщ1» and «Сообщ2»

Для выполнения операций с целыми числами компилятор преобразовал оба операнда в их общий тип, который оказался неправильным. Для определения общего типа операндов, компилятор берёт минимум из минимальных значений обоих типов, а затем максимум из максимальных значений обоих типов. Общий тип получается минимум..максимум.

Error: Generics without specialization cannot be used as a type for a variable

Generics должен быть всегда специализирован перед использованием как тип переменной.

Warning: Register list is ignored for pure assembler routines

Если используется чисто ассемблерная процедура, то список с изменёнными регистрами игнорируется.

Error: Implements property must have class or interface type

Свойство, которое принадлежит интерфейсу, должно быть типа класса или интерфейса.

Error: Implements-property must implement interface of correct type, found «Сообщ1» expected «Сообщ2»

Свойство, которое принадлежит интерфейсу, на самом деле принадлежит другому интерфейсу.

Error: Implements-property must have read specifier

Свойство, которое принадлежит интерфейсу, должно иметь, по меньшей мере, спецификатор read.

Error: Implements-property must not have write-specifier

Свойство, которое принадлежит интерфейсу, может не иметь спецификатор write.

Error: Implements-property must not have stored-specifier

Свойство, которое принадлежит интерфейсу, может не иметь спецификатора stored.

Error: Implements-property used on unimplemented interface: «Сообщение»

Интерфейс, которому принадлежит свойство, не принадлежит классу.

Error: Floating point not supported for this target

Компилятор проанализировал выражение с плавающей точкой, но оно не поддерживается.

Error: Class «Сообщ1» does not implement interface «Сообщ2»

Делегированный интерфейс не принадлежит классу, данному в разделе implements.

Error: Type used by implements must be an interface

Ключевое слово implements должно применяться с типом interface.

Error: Variables cannot be exported with a different name on this target, add the name to the declaration using the «export»

На большинстве целевых платформ невозможно изменять имена, под которыми переменные экспортируются внутри операторов exports библиотеки. В таком случае вам нужно указать экспортируемое имя в точке, где объявлена переменная, используя export и директиву alias.

Error: Weak external symbols are not supported for the current target

Символ «weak external» – это символ, который может существовать, а может и нет (при static или dynamic) во время компоновки. Эта концепция может быть недоступна (или ещё не работать) на текущей платформа или процессоре.

Error: Forward type definition does not match

Классы и интерфейсы с объявлением forward должны иметь одинаковые типы с implemented. Интерфейс forward не может быть изменён в классе.

Note: Virtual method «Сообщ1» has a lower visibility (Сообщ2) than parent class Сообщ3 (Сообщ4)

Виртуальный метод перегружает метод, который объявлен с более высокой видимостью. Это может дать непредвиденные результаты.

Error: Fields cannot appear after a method or property definition, start a new visibility section first

Однажды определив метод или свойство в классе или объекте, вы не можете определить какие-либо поля впоследствии без начального раздела видимости (такого как public, private и т.п.).

The reason is that otherwise the source code can appear ambiguous to the compiler, since it is possible to use modifiers such as default and register also as field names.

Причина в том, что в противном случае исходный код может оказаться неоднозначной в компилятор, так как можно использовать модификаторы, такие как умолчанию и регистрации также в качестве имен полей.

Error: Parameters cannot contain local type definitions. Use a separate type definition in a type block.

В Pascal нельзя передавать определения типов в качестве параметров, даже если они семантически эквивалентны простым типам. Переменные или параметры должны быть одинакового типа, если они ссылаются на определения одинаковых типов. В результате это не позволяет объявлять новые типы внутри списка параметров, потому что тогда возможны ссылки на то же определение типа в заголовке процедуры в разделах interface и implementation модуля (оба заголовка процедуры определены с разными типами). Помните, что выражения, такие как file of byte или “string[50] также должны определяться как новый тип. Например, вы не можете объявить процедуру:

Procedure MyProc(st : string[50]);

Это приведёт к данной ошибке. Правильно будет так:

Type TMyStr = string[50];
Procedure MyProc(st : TMyStr);
 

Error: ABSTRACT and SEALED conflict

ABSTRACT и SEALED не могут использоваться вместе в одном объявлении.

Error: Cannot create a descendant of the sealed class «Сообщение»

Неизвестный метод этого класса не может быть унаследован другим классом.

Error: SEALED class cannot have an ABSTRACT method

Неизвестный метод этого класса не может быть унаследован. Следовательно, ни один класс не способен перегрузить абстрактный метод в неизвестном классе.

Error: Only virtual methods can be final

Вы объявили метод как финальный, когда он не объявлен как виртуальный.

Error: Final method cannot be overridden: «Сообщение»

Вы пытаетесь перегрузить виртуальный метод родительского класса, который не существует.

Error: Invalid enumerator identifier: «Сообщение»

Только идентификаторы перечислений «MoveNext» и «Current» поддерживаются.

Error: Enumerator identifier required

Идентификатор «MoveNext» или «Current» должен сопровождать модификатор нумератора.

Error: Enumerator MoveNext pattern method is not valid.

Метод должен быть функцией с результатом типа Boolean, а соответствующий нумератор «MoveNext« должен быть функцией с результатом типа Boolean и не требовать аргументов.

Error: Enumerator Current pattern property is not valid. Property must have a getter.

Нумератор «Current» соответствующего свойства должен быть больше.

Error: Only one enumerator MoveNext method is allowed per class/object

Класс или объект может иметь только один нумератор MoveNext.

Error: Only one enumerator Current property is allowed per class/object

Класс или объект может иметь только один нумератор Current.

Error: For in loop cannot be used for the type «Сообщение»

For в цикле может использоваться не для всех типов. Например, он не может использоваться для нумераторов.

Error: Objective-C messages require their Objective-C selector name to be specified using the ”message” directive.

Objective-C messages require their Objective-C name (selector name) to be specified using the message ‘someName:’ procedure directive. While bindings to other languages automatically generate such names based on the identifier you use (by replacing all underscores with colons), this is unsafe since nothing prevents an Objective-C method name to contain actual colons.

Objective-C сообщения требуют свое имя Objective-C (имя селектора), который будет указан с помощью сообщения ‘SomeName:’ Директива процедура. Хотя привязки на другие языки автоматически генерировать такие имена, основанные на идентификатор вы используете (путем замены всех подчеркивает двоеточиями), это небезопасно, так как ничто не мешает Objective-C имя метода, чтобы содержать фактические двоеточия.

Error: Objective-C does not have formal constructors nor destructors. Use the alloc, initXXX and dealloc messages.

The Objective-C language does not have any constructors or destructors. While there are some messages with a similar purpose (such as init and dealloc), these cannot be identified using automatic parsers and do not guarantee anything like Pascal constructors/destructors (e.g., you have to take care of only calling “designated” inherited “constructors”). For these reasons, we have opted to follow the standard Objective-C patterns for instance creation/destruction.

Язык Objective-C не имеет конструкторов и деструкторов. Хотя есть некоторые сообщения, с той же целью (например, инициализации и dealloc), они не могут быть определены с помощью автоматических анализаторов и ничего не гарантирует, как Pascal конструкторов / деструкторов (например, вы должны заботиться о только называя «назначен» в наследство «конструкторы «). По этим причинам, мы решили следовать стандартным образцам Objective-C, например создания / уничтожения.

Error: Message name is too long (max. 255 characters)

Due to compiler implementation reasons, message names are currently limited to 255 characters

Error: Objective-C message symbol name for ”arg1” is too long

Due to compiler implementation reasons, mangled message names (i.e., the symbol names used in the assembler code) are currently limited to 255 characters.

Hint: Defining a new Objective-C root class. To derive from another root class (e.g., NSObject), specify it as the parent class.

If no parent class is specified for an Object Pascal class, then it automatically derives from TObject. Objective-C classes however do not automatically derive from NSObject, because one can have multiple root classes in Objective-C. For example, in the Cocoa framework both NSObject and NSProxy are root classes. Therefore, you have to explicitly define a parent class (such as NSObject) if you want to derive your Objective-C class from it.

Error: Objective-C classes cannot have published sections.

In Object Pascal, “published” determines whether or not RTTI is generated. Since the Objective-C runtime always needs RTTI for everything, this specified does not make sense for Objective-C classes.

Fatal: This module requires an Objective-C mode switch to be compiled

This error indicates the use of Objective-C language features without an Objective-C mode switch active. Enable one via the -M command line switch, or the $modeswitch x directive.

Error: Inherited methods can only be overridden in Objective-C, add ”override” (inherited method defined in arg1)

Hint: Inherited methods can only be overridden in Objective-C, add ”override” (inherited method defined in arg1)

It is not possible to reintroduce methods in Objective-C like in Object Pascal. Methods with the same name always map to the same virtual method entry. In order to make this clear in the source code, the compiler always requires the override directive to be specified when implementing overriding Objective-C methods in Pascal. If the implementation is external, this rule is relaxed because Objective-C does not have any override-style keyword (since it’s the default and only behaviour in that language), which makes it hard for automated header conversion tools to include it everywhere. The type in which the inherited method is defined is explicitly mentioned, because this may either be an objcclass or an objccategory.

Error: Message name ”arg1” in inherited class is different from message name ”arg2” in current class.

An overriding Objective-C method cannot have a different message name than an inherited method. The reason is that these message names uniquely define the message to the Objective-C runtime, which means that giving them a different message name breaks the “override” semantics.

Error: It is not yet possible to make unique copies of Objective-C types

Duplicating an Objective-C type using type x = type y; is not yet supported. You may be able to obtain the desired effect using type x = objcclass(y) end; instead.

Error: Objective-C categories and Object Pascal class helpers cannot be used as types

It is not possible to declare a variable as an instance of an Objective-C category or an Object Pascal class helper. A category/class helper adds methods to the scope of an existing class, but does not define a type by itself. An exception of this rule is when inheriting an Object Pascal class helper from another class helper.

Error: Categories do not override, but replace methods. Use ”reintroduce” instead.

Error: Replaced methods can only be reintroduced in Objective-C, add ”reintroduce” (replaced method defined in arg1).

Hint: Replaced methods can only be reintroduced in Objective-C, add ”reintroduce” (replaced method defined in arg1).

A category replaces an existing method in an Objective-C class, rather than that it overrides it. Calling an inherited method from an category method will call that method in the extended class’ parent, not in the extended class itself. The replaced method in the original class is basically lost, and can no longer be called or referred to. This behaviour corresponds somewhat more closely to reintroduce than to override (although in case of reintroduce in Object Pascal, hidden methods are still reachable via inherited). The type in which the inherited method is defined is explicitly mentioned, because this may either be an objcclass or an objccategory.

Error: Getter for implements interface must use the target’s default calling convention.

Interface getters are called via a helper in the run time library, and hence have to use the default calling convention for the target (register on i386 and x86_64, stdcall on other architectures).

Error: Typed files cannot contain reference-counted types.

The data in a typed file cannot be of a reference counted type (such as ansistring or a record containing a field that is reference counted).

Error: Operator is not overloaded: arg2 ”arg1”

You are trying to use an overloaded operator when it is not overloaded for this type.

Error: Operator is not overloaded: ”arg1” arg2 ”arg3”

You are trying to use an overloaded operator when it is not overloaded for this type.

Error: Expected another arg1 array elements

When declaring a typed constant array, you provided to few elements to initialize the array

Error: String constant too long while ansistrings are disabled

Only when a piece of code is compiled with ansistrings enabled ({$H+}), string constants longer than 255 characters are allowed.

Error: Type cannot be used as univ parameter because its size is unknown at compile time: ”arg1”

univ parameters are compatible with all values of the same size, but this cannot be checked in case a parameter’s size is unknown at compile time.

Error: Only one class constructor can be declared in class: ”arg1”

You are trying to declare more than one class constructor but only one class constructor can be declared.

Error: Only one class destructor can be declared in class: ”arg1”

You are trying to declare more than one class destructor but only one class destructor can be declared.

Error: Class constructors can’t have parameters

You are declaring a class constructor with a parameter list. Class constructor methods cannot have parameters.

Error: Class destructors can’t have parameters

You are declaring a class destructor with a parameter list. Class destructor methods cannot have parameters.

Fatal: This construct requires the {$modeswitch objectivec1} mode switch to be active

Objective-Pascal constructs are not supported when {$modeswitch ObjectiveC1} is not active.

Error: Unicodechar/string constants cannot be converted to ansi/shortstring at compile-time

It is not possible to use unicodechar and unicodestring constants in constant expressions that have to be converted into an ansistring or shortstring at compile time, for example inside typed constants. The reason is that the compiler cannot know what the actual ansi encoding will be at run time.

Error: For-in Objective-Pascal loops require {$modeswitch ObjectiveC2} to be active

Objective-C “fast enumeration” support was added in Objective-C 2.0, and hence the appropriate modeswitch has to be activated to expose this feature. Note that Objective-C 2.0 programs require Mac OS X 10.5 or later.

Error: The compiler cannot find the NSFastEnumerationProtocol or NSFastEnumerationState type in the CocoaAll unit

Objective-C for-in loops (fast enumeration) require that the compiler can find a unit called CocoaAll that contains definitions for the NSFastEnumerationProtocol and NSFastEnumerationState types. If you get this error, most likely the compiler is finding and loading an alternate CocoaAll unit.

Error: Typed constants of the type ’procedure is nested’ can only be initialized with NIL and global procedures/functions

A nested procedural variable consists of two components: the address of the procedure/function to call (which is always known at compile time), and also a parent frame pointer (which is never known at compile time) in case the procedural variable contains a reference to a nested procedure/function. Therefore such typed constants can only be initialized with global functions/procedures since these do not require a parent frame pointer.

Fatal: Declaration of generic class inside another generic class is not allowed

At the moment, scanner supports recording of only one token buffer at the time (guarded by internal error 200511173 in tscannerfile.startrecordtokens). Since generics are implemented by recording tokens, it is not possible to have declaration of generic class inside another generic class.

Error: Forward declaration of objcprotocol ”arg1” must be resolved before an objcclass can conform to it

An objcprotocol must be fully defined before classes can conform to it. This error occurs in the following situation:

  Type MyProtocol = objcprotoocl;

      ChildClass = Class(NSObject,MyProtocol)

        …

      end;

where MyProtocol is declared but not defined.

Error: Record types cannot have published sections

Published sections can be used only inside classes.

Error: Destructors aren’t allowed in records or helpers

Destructor declarations aren’t allowed in records or helpers.

Error: Class methods must be static in records

Class methods declarations aren’t allowed in records without static modifier. Records have no inheritance and therefore non static class methods have no sence for them.

Error: Constructors aren’t allowed in records or record helpers

Constructor declarations aren’t allowed in records or record helpers

Error: Either the result or at least one parameter must be of type ”arg1”

It is required that either the result of the routine or at least one of its parameters be of the specified type. For example class operators either take an instance of the structured type in which they are defined, or they return one.

Error: Type parameters may require initialization/finalization — can’t be used in variant records

Type parameters may be specialized with types which (e.g. ansistring) need initialization/finalization code which is implicitly generated by the compiler.

Error: Variables being declared as external cannot be in a custom section

A section directive is not valid for variables being declared as external

Error: Non-static and non-global variables cannot have a section directive

A variable placed in a custom section is always statically allocated so it must be either a static or global variable.

Error: ”arg1” is not allowed in helper types

Some directives and specifiers like ”virtual”, ”dynamic”, ”override” aren’t allowed inside helper types in mode ObjFPC (they are ignored in mode Delphi), because they have no meaning within helpers. Also ”abstract” isn’t allowed in either mode.

Error: Class constructors aren’t allowed in helpers

Class constructor declarations aren’t allowed in helpers.

Error: The use of ”inherited” is not allowed in a record

As records don’t suppport inheritance the use of ”inherited” is prohibited for these as well as for record helpers (in mode ”Delphi” only).

Error: Type declarations are not allowed in local or anonymous records

Records with types must be defined globally. Types cannot be defined inside records which are defined in a procedure or function or in anonymous records.

Error: Duplicate implements clause for interface ”arg1”

A class may delegate an interface using the ”implements” clause only to a single property. Delegating it multiple times is a error.

Error: Interface ”arg1” can’t be delegated by ”arg2”, it already has method resolutions

Method resolution clause maps a method of an interface to a method of the current class. Therefore the current class has to implement the interface directly. Delegation is not possible.

Error: Interface ”arg1” can’t have method resolutions, ”arg2” already delegates it

Method resoulution is only possible for interfaces that are implemented directly, not by delegation.

Topic: illegal expression??? what is the problem?  (Read 15926 times)

Dear friends,

i have another little problem…can you help me please???

the compiler tell me….
«ERROR: Illegal expression»
«Fatal: Syntax Error, «;» expected but «IF» found.

Where is  my fault???
Thanks a lot…
Lestroso :-[

  1. var

  2.       numero1 : integer= 0;

  3.       numero2 : integer= 0;

  4.       risultato:integer=0;

  5. procedure myprog.FormCreate(Sender: TObject);

  6. procedure analisi;

  7. begin  

  8.                NUMERO1+NUMERO2=risultato

  9. IF(risultato>36) then   <stop here on if

  10.               risultato := risultato36 ;

  11. // else uguale

  12. END;          


Logged


Well strange code.  As to the immediate problem, when you get that kind of an error first look for a missing ; (semicolon) just like the compiler is telling you (hint look at the line before where the error occurred).


Logged


  1. begin  

  2.                NUMERO1+NUMERO2=risultato

  3. IF(risultato>36) then   < stop here on if

  4. >>>> then the problem is on the line above it

If the compiler stops on line 5 then the problem is on line 3.
That line (line 3) isn’t even pascal.
What are you trying to do there?


Logged


Dang RVK, you took away the next hint I was going to give him after getting him to learn how to terminate a Pascal statement properly (even one that doesn’t make sense ;) since then he would see the new error alone.


Logged


Dang RVK, you took away the next hint I was going to give him after getting him to learn how to terminate a Pascal statement properly (even one that doesn’t make sense ;) since then he would see the new error alone.

Sorry  :-[
But I imagine there are lots of problems in the rest of the code (outside of what was shown here) for you to point out :)


Logged


@RVK, too many chefs…glad you realized I was being funny (sometimes my humor doesn’t come across).

@lestroso: I’m not trying to make fun of you, we were all beginners once.  Keep working you’ll get there.


Logged


Try this:

  1. procedure myprog.FormCreate(Sender: TObject);

  2. procedure analisi;

  3. begin  // procedure analisi

  4.       risultato:=NUMERO1+NUMERO2;

  5. IF(risultato>36) then  risultato := risultato36;

  6. // else uguale

  7. END;   // procedure analisi

  8. begin // procedure myprog.FormCreate

  9.   analisi; // call of procedure analisi

  10. end;  // procedure myprog.FormCreate  

« Last Edit: October 20, 2015, 02:05:36 am by zbyna »


Logged


Thanks to zbyna and to everybody!! You solved my problem in full…i’m sorry, i’m a pascal beginner…

Thanks a lot again,

Lestroso  :D


Logged


Click here follow the steps to fix Pascal Error Illegal Expression and related errors.

Instructions

 

To Fix (Pascal Error Illegal Expression) error you need to
follow the steps below:

Step 1:

 
Download
(Pascal Error Illegal Expression) Repair Tool
   

Step 2:

 
Click the «Scan» button
   

Step 3:

 
Click ‘Fix All‘ and you’re done!
 

Compatibility:
Windows 7, 8, Vista, XP

Download Size: 6MB
Requirements: 300 MHz Processor, 256 MB Ram, 22 MB HDD

Limitations:
This download is a free evaluation version. To unlock all features and tools, a purchase is required.

Pascal Error Illegal Expression Error Codes are caused in one way or another by misconfigured system files
in your windows operating system.

If you have Pascal Error Illegal Expression errors then we strongly recommend that you

Download (Pascal Error Illegal Expression) Repair Tool.

This article contains information that shows you how to fix
Pascal Error Illegal Expression
both
(manually) and (automatically) , In addition, this article will help you troubleshoot some common error messages related to Pascal Error Illegal Expression error code that you may receive.

Note:
This article was updated on 2023-02-03 and previously published under WIKI_Q210794

Contents

  •   1. What is Pascal Error Illegal Expression error?
  •   2. What causes Pascal Error Illegal Expression error?
  •   3. How to easily fix Pascal Error Illegal Expression errors

What is Pascal Error Illegal Expression error?

The Pascal Error Illegal Expression error is the Hexadecimal format of the error caused. This is common error code format used by windows and other windows compatible software and driver vendors.

This code is used by the vendor to identify the error caused. This Pascal Error Illegal Expression error code has a numeric error number and a technical description. In some cases the error may have more parameters in Pascal Error Illegal Expression format .This additional hexadecimal code are the address of the memory locations where the instruction(s) was loaded at the time of the error.

What causes Pascal Error Illegal Expression error?

The Pascal Error Illegal Expression error may be caused by windows system files damage. The corrupted system files entries can be a real threat to the well being of your computer.

There can be many events which may have resulted in the system files errors. An incomplete installation, an incomplete uninstall, improper deletion of applications or hardware. It can also be caused if your computer is recovered from a virus or adware/spyware
attack or by an improper shutdown of the computer. All the above actives
may result in the deletion or corruption of the entries in the windows
system files. This corrupted system file will lead to the missing and wrongly
linked information and files needed for the proper working of the
application.

How to easily fix Pascal Error Illegal Expression error?

There are two (2) ways to fix Pascal Error Illegal Expression Error:

Advanced Computer User Solution (manual update):

1) Start your computer and log on as an administrator.

2) Click the Start button then select All Programs, Accessories, System Tools, and then click System Restore.

3) In the new window, select «Restore my computer to an earlier time» option and then click Next.

4) Select the most recent system restore point from the «On this list, click a restore point» list, and then click Next.

5) Click Next on the confirmation window.

6) Restarts the computer when the restoration is finished.

Novice Computer User Solution (completely automated):

1) Download (Pascal Error Illegal Expression) repair utility.

2) Install program and click Scan button.

3) Click the Fix Errors button when scan is completed.

4) Restart your computer.

How does it work?

This tool will scan and diagnose, then repairs, your PC with patent
pending technology that fix your windows operating system registry
structure.
basic features: (repairs system freezing and rebooting issues , start-up customization , browser helper object management , program removal management , live updates , windows structure repair.)

Модератор: Модераторы

Illegal expression в if then else (HELP!!!!)

Робяты, помогите убогому, мне. Никак не могу понять чего не нравится лазарусу при сборке dspack. Ругается на ELSE в этой функции:

Код: Выделить всё
function TMediaObjectImpl.Lock(bLock: Longint): HResult; stdcall;
begin
  if (bLock <> 0) then Lock else Unlock;
  Result := S_Ok;
end;
gvido
постоялец
 
Сообщения: 188
Зарегистрирован: 28.03.2012 11:35:31

Re: Illegal expression в if then else (HELP!!!!)

Сообщение Ism » 25.07.2015 01:03:10

Кажись после Lock должно быть ;
Скорее всего при неправильном синтаксисе оно воспринимает чтото как переменную

Ism
энтузиаст
 
Сообщения: 908
Зарегистрирован: 06.04.2007 17:36:08

Re: Illegal expression в if then else (HELP!!!!)

Сообщение vitaly_l » 25.07.2015 02:01:02

Lock(bLock: Longint) и Lock <= конфликтуют? Переименуйте и возможно перестанет ругаться.

Аватара пользователя
vitaly_l
долгожитель
 
Сообщения: 3333
Зарегистрирован: 31.01.2012 16:41:41
  • Профиль
  • Сайт

Re: Illegal expression в if then else (HELP!!!!)

Сообщение gvido » 25.07.2015 09:44:09

Это модуль DirectShow9. Изменил имена protected процедур этого класса Lock и Unlock на pLock и pUnLock. Собралось!!!! Спасибо. Странная логика тут. ругался бы на Lock и unlock, Так ведь нет, ругался else, чтоб его пополам разорвало!!! Попробуй догадайся. :)

Еще раз, СПАСИБО!!!

gvido
постоялец
 
Сообщения: 188
Зарегистрирован: 28.03.2012 11:35:31

Re: Illegal expression в if then else (HELP!!!!)

Сообщение Лекс Айрин » 25.07.2015 11:54:47

Ism, перед else не ставится «;»

gvidoлогика нормальная. Ругается на первый оператор, которые не попадает в текущую (анализируемую) синтаксическую конструкцию. Компилятор же не настолько интеллектуален чтобы понять, что проблема в другом месте.

Аватара пользователя
Лекс Айрин
долгожитель
 
Сообщения: 5723
Зарегистрирован: 19.02.2013 16:54:51
Откуда: Волгоград
  • Профиль
  • Сайт



Вернуться в Lazarus

Кто сейчас на конференции

Сейчас этот форум просматривают: Eprinter, Google [Bot] и гости: 11

Понравилась статья? Поделить с друзьями:
  • Error illegal expression lazarus
  • Error illegal escape character
  • Error illegal character ufeff
  • Error illegal character u00bb
  • Error illegal character u00a0