Free Pascal错误一览表
- 格式:doc
- 大小:23.50 KB
- 文档页数:7
Pascal错误对照表一、Pascal编译错误信息中英文对照表下面列出在编译程序时可能出现的错误,在集成环境下,Turbo Pascal将自动加载源程序并定位于出错处:错误代码及错误信息错误释义error1:Out of memory内存溢出error2:Identifier expected缺标识符error3:Unknown identifier未定义的标识符error4:Duplicate identifier重复定义的标识符error5:Syntax error语法错误error6:Error in real constant实型常量错误error7:Error in integer constant整型常量错误error8:String constant exceeds line字符串常量超过一行error10:Unexpected end of file文件非正常结束error11:Line too long行太长error12:Type identifier expected未定义的类型标识符error13:Too many open files打开文件太多error14:Invalid file name无效的文件名error15:File not found文件未找到error16:Disk full磁盘满error17:Invalid compiler directive无效的编译命令error18:Too many files文件太多error19:Undefined type in pointer def指针定义中未定义类型error20:Variable identifier expected缺变量标识符error21:Error in type类型错误error22:Structure too large结构类型太长error23:Set base type out of range集合基类型越界error24:File components may not be files or objectsfile分量不能是文件或对象error25:Invalid string length无效的字符串长度error26:Type mismatch类型不匹配error27:error27:Invalid subrange base type无效的子界基类型error28:Lower bound greater than upper bound下界超过上界error29:Ordinal type expected缺有序类型error30:Integer constant expected缺整型常量error31:Constant expected缺常量error32:Integer or real constant expected缺整型或实型常量error33:Pointer Type identifier expected缺指针类型标识符error34:Invalid function result type无效的函数结果类型error35:Label identifier expected缺标号标识符error36:BEGIN expected缺BEGINerror37:END expected缺ENDerror38:Integer expression expected缺整型表达式error39:Ordinal expression expected缺有序类型表达式error40:Boolean expression expected缺布尔表达式error41:Operand types do not match操作数类型不匹配error42:Error in expression表达式错误error43:Illegal assignment非法赋值error44:Field identifier expected缺域标识符error45:Object file too large目标文件太大error46:Undefined external未定义的外部过程与函数error47:Invalid object file record无效的OBJ文件格式error48:Code segment too large代码段太长error49:Data segment too large数据段太长error50:DO expected缺DOerror51:Invalid PUBLIC definition无效的PUBLIC定义error52:Invalid EXTRN definition无效的EXTRN定义error53:Too many EXTRN definitions太多的EXTRN定义error54:OF expected缺OFerror55:INTERFACE expected缺INTERFACEerror56:Invalid relocatable reference无效的可重定位引用error57:THEN expected缺THENerror58:TO or DOWNTO expected缺TO或DOWNTOerror59:Undefined forward提前引用未经定义的说明error61:Invalid typecast无效的类型转换error62:Division by zero被零除error63:Invalid file type无效的文件类型error64:Cannot read or write variables of this type不能读写此类型变量error65:Pointer variable expected缺指针类型变量error66:String variable expected缺字符串变量error67:String expression expected缺字符串表达式error68:Circular unit reference单元UNIT部件循环引用error69:Unit name mismatch单元名不匹配error70:Unit version mismatch单元版本不匹配error71:Internal stack overflow内部堆栈溢出error72:Unit file format error单元文件格式错误error73:IMPLEMENTATION expected缺IMPLEMENTATIONerror74:Constant and case types do not match常量和CASE类型不匹配error75:Record or object variable expected缺记录或对象变量error76:Constant out of range常量越界error77:File variable expected缺文件变量error78:Pointer expression expected缺指针表达式error79:Integer or real expression expected缺整型或实型表达式error80:Label not within current block标号不在当前块内error81:Label already defined标号已定义error82:Undefined label in preceding statement part在前面未定义标号error83:Invalid@argument无效的@参数error84:UNIT expected缺UNITerror85:";"expected缺“;”error86:":"expected缺“:”error87:","expected缺“,”error88:"("expected缺“(”error89:")"expected缺“)”error90:"="expected缺“=”error91:":="expected缺“:=”error92:"["or"(."Expected缺“[”或“(.”error93:"]"or".)"expected缺“]”或“.)”error94:"."expected缺“.”error95:".."expected缺“..”error96:Too many variables变量太多error97:Invalid FOR control variable无效的FOR循环控制变量error98:Integer variable expected缺整型变量error99:Files and procedure types are not allowed here该处不允许文件和过程类型error100:String length mismatch字符串长度不匹配error101:Invalid ordering of fields无效域顺序error102:String constant expected缺字符串常量error103:Integer or real variable expected缺整型或实型变量error104:Ordinal variable expected缺有序类型变量error105:INLINE error INLINE错误error106:Character expression expected缺字符表达式error107:Too many relocation items重定位项太多error108:Overflow in arithmetic operation算术运算溢出error112:CASE constant out of range CASE常量越界error113:Error in statement表达式错误error114:Cannot call an interrupt procedure不能调用中断过程error116:Must be in8087mode to compile this必须在8087模式编译error117:Target address not found找不到目标地址error118:Include files are not allowed here该处不允许INCLUDE文件error119:No inherited methods are accessible here该处继承方法不可访问error121:Invalid qualifier无效的限定符error122:Invalid variable reference无效的变量引用error123:Too many symbols符号太多error124:Statement part too large语句体太长error126:Files must be var parameters文件必须是变量形参error127:Too many conditional symbols条件符号太多error128:Misplaced conditional directive条件指令错位error129:ENDIF directive missing缺ENDIF指令error130:Error in initial conditional defines初始条件定义错误error131:Header does not match previous definition和前面定义的过程或函数不匹配error133:Cannot evaluate this expression不能计算该表达式error134:Expression incorrectly terminated表达式错误结束error135:Invalid format specifier无效格式说明符error136:Invalid indirect reference无效的间接引用error137:Structured variables are not allowed here该处不允许结构变量error138:Cannot evaluate without System unit没有System单元不能计算error139:Cannot access this symbol不能存取符号error140:Invalid floating point operation无效的符号运算error141:Cannot compile overlays to memory不能编译覆盖模块至内存error142:Pointer or procedural variable expected缺指针或过程变量error143:Invalid procedure or function reference无效的过程或函数调用error144:Cannot overlay this unit不能覆盖该单元error146:File access denied不允许文件访问error147:Object type expected缺对象类型error148:Local object types are not allowed不允许局部对象类型error149:VIRTUAL expected缺VIRTUALerror150:Method identifier expected缺方法标识符error151:Virtual constructors are not allowed不允许虚构造函数error152:Constructor identifier expected缺构造函数标识符error153:Destructor identifier expected缺析构函数标识符error154:Fail only allowed within constructors只能在构造函数内使用Fail标准过程error155:Invalid combination of opcode and operands操作数与操作符无效组合error156:Memory reference expected缺内存引用指针error157:Cannot add or subtract relocatable symbols不能加减可重定位符号error158:Invalid register combination无效寄存器组合error159:286/287instructions are not enabled未激活286/287指令error160:Invalid symbol reference无效符号指针error161:Code generation error代码生成错误error162:ASM expected缺ASMerror166:Procedure or function identifier expected缺过程或函数标识符error167:Cannot export this symbol不能输出该符号error168:Duplicate export name外部文件名重复error169:Executable file header too large可执行文件头太长error170:Too many segments段太多二、Pascal运行错误信息中英文对照表运行错误是指程序运行时出现的错误,当发生时,Turbo Pascal显示如下信息:RUNTIME ERROR NNNN AT XXXX:YYYY其中,NNNN是运行错误代码,XXXX是错误发生的程序段,YYYY是错误地址偏移。
第14周 Freepascal错误代码一览表任何一个天才都不敢说,他编的程序是100%正确的。
几乎每一个稍微复杂一点的程序都必须经过反复的调试、修改,最终才完成。
所以说,程序的调试是编程中的一项重要技术。
Free Pascal IDE提供了很强大的调试功能,能很方便的找出程序的错误。
1、程序错误(1)编译错误:即语法错误。
如:命令错写,少分号等等。
此种错误在程序编译执行就能发现,而把光标停留在错误行上,并显示出错误信息,由用户修改。
(2)运行错误:如果没有语法错误。
则程序可以运行,但在运行过程中也有可能出现错误,如程序结构不合理,打印语句错误等。
此时,程序将中止运行,光标停留在错误语句处,并显示错误信息,等待用户修改。
(3)逻辑错误:如:程序递归出口设置不正确,逻辑判断设置错误,这样程序虽然能够正常运行,但运行结果却不正确,这是用户最难发现有错误,也是最难查找的错误,此时计算机也无任何错误信息。
一、程序调试根据下面的错误代码表,检查Demo1.pas、Demo2.pas、Demo3.pas、Demo4.pas程序运行过程中的错误代码,并尝试解决。
二、实验设计。
编制程序,尝试模拟下面运行错误代码出现的情况。
205 Floating point overflow浮点数上溢你试图使用或产生一个太大实数.206 Floating point underflow你试图使用或产生一个太小实数.207 Invalid floating point operation错误的浮点数操作可能是你开平方根或者对数时使用负数.Free Pascal Run Time Errors 运行错误对照表1 Invalid function numberY ou tried to call a DOS function which doesn't exist.2 File not foundY ou can get this error when you tried to do an operation on a file which doesn't exist.3 Path not foundY ou can get this error when you tried to do an operation on a file which doesn't exist, or when you try to change to, or remove a directory that doesn't exist, or try to make a subdirectory of a subdirectory that doesn't exist.4 Too many open filesWhen attempting to open a file for reading or writing, you can get this error when your program has too many open files.5 File access deniedY ou don't have access to the specified file.6 Invalid file handleIf this happens, the file variable you are using is trashed; it indicates that your memory is corrupted.12 Invalid file access codeThis will happen if you do a reset or rewrite of a file when FileMode is invalid.15 Invalid drive numberThe number given to the Getdir function specifies a non-existent disk.16 Cannot remove current directoryY ou get this if you try to remove the current diirectory.17 Cannot rename across drivesY ou cannot rename a file such that it would end up on another disk or partition.100 Disk read errorDOS only. An error occurred when reading from disk. Typically when you try to read past the end of a file.101 Disk write errorDOS only. Reported when the disk is full, and you're trying to write to it.102 File not assignedThis is reported by Reset, Rewrite, Append, Rename and Erase, if you call them with an unassigne function as a parameter.103 File not openReported by the following functions : Close , Read, Write, Seek, EOf, FilePos, FileSize, Flush, BlockRead, and BlockWrite if the file isn't open.104 File not open for inputReported by Read, BlockRead, Eof, Eoln, SeekEof or SeekEoln if the file isn't opened with Reset. 105 File not open for outputReported by write if a text file isn't opened with Rewrite.106 Invalid numeric formatReported when a non-numerice value is read from a text file, when a numeric value was expected. 150 Disk is write-protected(Critical error, DOS only.)151 Bad drive request struct length(Critical error, DOS only.)152 Drive not ready(Critical error, DOS only.)154 CRC error in data(Critical error, DOS only.)156 Disk seek error(Critical error, DOS only.)157 Unknown media type(Critical error, DOS only.)158 Sector Not Found(Critical error, DOS only.)159 Printer out of paper(Critical error, DOS only.)160 Device write fault(Critical error, DOS only.)161 Device read fault(Critical error, DOS only.)162 Hardware failure(Critical error, DOS only.)200 Division by zeroY ou are dividing a number by zero.201 Range check errorIf you compiled your program with range checking on, then you can get this error in the following cases:An array was accessed with an index outside its declared range. 数组越界访问Y ou're trying to assign a value to a variable outside its range (for instance a enumerated type). 超出变量范围,例如i:=32768;其中i为integer类型202 Stack overflow errorThe stack has grown beyond itss maximum size. This error can easily occur if you have recursive functions.203 Heap overflow errorThe heap has grown beyond its boundaries, ad you are rying to get more memory. Please note that Free Pascal provides a growing heap, i.e. the heap will try to allocate more memory if needed. However, if the heap has reached the maximum size allowed by the operating system or hardware, then you will get this error.204 Invalid pointer operationThis you will get if you call dispose or Freemem with an invalid pointer (notably, Nil)205 Floating point overflowY ou are trying to use or produce too large real numbers.206 Floating point underflowY ou are trying to use or produce too small real numbers.207 Invalid floating point operationCan occur if you try to calculate the square root or logarithm of a negative number.210 Object not initializedWhen compiled with range checking on, a program will report this error if you call a virtal method without having initialized the VMT.211 Call to abstract methodY our program tried to execute an abstract virtual method. Abstract methods should be overridden, and the overriding method should be called.212 Stream registration errorThis occurs when an invalid type is registered in the objects unit.213 Collection index out of rangeY ou are trying to access a collection item with an invalid index. (objects unit)214 Collection overflow errorThe collection has reached its maximal size, and you are trying to add another element. (objects unit)215 数字超出范围(例如3000000000超出长整形范围)216 General Protection faultY ou are trying to access memory outside your appointed memory.217 Unhandled expetion occurredAn exception occurred, and there was no exception handler present. The sysutils unit installs a default exception handler which catches all excpetions and exits gracefully.。
Pascal运行错误对照表运行错误是指程序运行时出现的错误,当发生时,Turbo Pascal显示如下信息:RUNTIME ERROR NNNN A T XXXX:YYYY其中,nnnn是运行错误代码,xxxx是错误发生的程序段,yyyy是错误地址偏移。
'';'' not allowed before ''ELSE'' ElSE前不允许有“;”'''' clause not allowed in OLE automation section 在OLE自动区段不允许“”子句'''' is not a type identifier 不是类型标识符'''' not previously declared as a PROPERTY前面没有说明PROPERTY''GOTO '' leads into or out of TRY statement GOTO 进入或超出TRY语句的范围clause expected, but found 要求子句,但出现16-Bit fixup encountered in object file '''' 在对象文件遇到16位修复486/487 instructions not enabled 不能用486/487指令Abstract methods must be virtual or dynamic 抽象方法必须为虚拟的或动态的Array type required 需要数组类型Assignment to FOR-Loop variable '''' 给FOR循环变量赋值Bad argument type in variable type array constructor 在变量类型数组结构中不正确的参数类型Bad file format '''' 错误的文件格式Bad file format: 错误的文件格式Bad global symbol definition: '''' in object file '''' 对象文件''''中错误的全局符号定义''''Bad unit format: 错误的单元格式BREAK or CONTINUE outside of loop BREAK或CONTINUE超出循环Cannot add or subtract relocatable symbols 不能增加或减少可重置的符号Cannot assign to a read-only property 不能指定只读属性Cannot BREAK, CONTINUE or EXIT out of a FINALLY c lause 超出FINALLY子句的范围,不能使用BREAK,CONTINUE或EXIT语句Cannot initialize local variables 不能初始化局部变量Cannot initialize multiple variables 不能初始化多个变量Cannot initialize thread local variables 不能初始化线程局部变量Cannot override a static method 不能覆盖静态方法Cannot read a write-only property 不能读取只写属性Case label outside of range of case expression CASE标号超出了CASE表达式的范围Circular unit reference to 对单元循环引用Class already has a default property 类已具有默认的属性Class does not have a default property 类没有默认的属性Class or object types only allowed in type section 在类型区段只允许有类或对象类型Class type required 需要类类型Close error on 文件关闭错误Compile terminated by user 用户中止编译Constant expected 要求常量Constant expression expected 要求常量表达式Constant expression violates subrange bounds 常量表达式超出子界范围Constant object cannot be passed as var parameter 常量对象不能作为变量参数传递Constant or type identifier expected 要求常量或类型标识符Constants cannot be used as open array arguments 常量不能用作打开数组参数Constructing instance of '''' containing abstract methods 构造的实体包含抽象的方法Could not compile used unit '''' 不能用单元编译Could not create output file 不能建立输出文件Could not load RLINK32.DLL 不能加载RLINK32.DLLData type too large: exceeds 2 GB 数据类型太大:超过2GBDeclaration of differs from previous declaration 的说明与先前的说明不同Default property must be an array property 默认的属性必须为数组属性Default values must be of ordinal, pointer or small set type 默认的值必须为序数、指针或小集类型Destination cannot be assigned to 目标不能指定Destination is inaccessible 目标不能存取Dispid '''' already used by '''' DISPID标识号已被使用Dispid clause only allowed in OLE automation section DISPID子句只能在OLE自动区段中使用Division by zero 除数为零Duplicate case label CASE标号重复Duplicate tag value 重复的标志值Dynamic method or message handler not allowed here 这里不允许有动态方法或信息处理程序Dynamic methods and message handlers not allowed in OLE automation section在OLE自动区段不允许有动态方法或消息处理程序Element 0 inaccessible - use ''Length'' or ''SetLength'' 元素0不能存取-使用LENGTH或SETLENGTHError in numeric constant 数值常量错误EXCEPT or FINALLY expected 要求EXCEPT或FINALLYEXPORTS allowed only at global scope EXPORTS只允许在全局范围使用Expression has no value 表达式没有值Expression too complicated 表达式太复杂Field definition not allowed in OLE automation section 在OLE自动区段中不允许域定义Field definition not allowed after methods or properties 在方法或属性后不允许域定义Field or method identifier expected 要求域或方法标识符File not found: 文件没有找到File type not allowed here 这儿不允许文件类型For loop control variable must be simple local variable FOR循环控制变量必须为简单局部变量For loop control variable must have ordinal type FOR循环控制变量必须为序数类型FOR or WHILE loop executes zero times - deleted FOR或WHILE循环执行零次-删除FOR-Loop variable '''' cannot be passed as var parameter FOR循环变量不能作为参数传递FOR-Loop variable '''' may be undefined after loop 在循环后的FOR循环变量是不确定的Function needs result type 函数需要结果类型Identifier redeclared: '''' 标识符重复说明Illegal character in input file: '''' ($) 在输入文件中的非法字符''''Illegal message method index 非法的消息方法指针Illegal reference to symbol '''' in object file '''' 在对象文件中对符号的非法引用Illegal type in OLE automation section: '''' 在OLE自动区段中的非法类型Illegal type in Read/Readln statement 在Read/Readln语句中的非法类型Illegal type in Write/Writeln statement 在Write/Writeln语句中的非法类型Inaccessible value 不可存取的值Incompatible types: '''' and '''' 不兼容的类型和Incompatible types: 不兼容的类型Inline assembler stack overflow 内联汇编溢出Inline assembler syntax error 内联汇编语法错误Instance variable '''' inaccessible here 实体变量在这里不能存取Integer constant or variable name expected 要求整形常量或变量名Integer constant too large 整型常量太大Internal error: 内部错误Invalid combination of opcode and operands 操作码与操作对象的无效组合Invalid compiler directive: '''' 无效的编译指令Invalid function result type 无效的函数值类型Invalid message parameter list 无效的消息参数列表Invalid register combination 无效的寄存器组合Invalid typecast 无效的TYPECASELabel '''' is not declared in current procedure 在当前的过程中没有说明标号Label already defined: '''' 标号已经定义Label declaration not allowed in interface part 在界面部分不允许标号说明Label declared and referenced, but not set: '''' 标号被说明及引用,但不能设置Label expected 要求标号Left side cannot be assigned to 左边不能赋值Line too long (more than 255 characters) 行太长(超出255个字符)Local class or object types not allowed 不允许局部的类或对象类型Local procedure/function '''' assigned to procedure variable 局部过程/函数赋给过程变量LOOP/JCXZ distance out of range LOOP/JCXZ距离超出范围Low bound exceeds high bound 下界超过上界Memory reference expected 要求内存引用Method '''' hides virtual method of base type '''' 方法隐藏了基类型为的虚拟方法Method '''' not found in base class 在基类中没有找到方法Method identifier expected 要求方法标识符Missing ENDIF directive 缺少ENDIF指令Missing operator or semicolon 缺少操作符或分号Missing or invalid conditional symbol in ''$'' directive 在$指令中缺少或无效的条件符号Missing parameter type 缺少参数类型Necessary library helper function was eliminated by linker 必要的库帮助函数被连接程序删除No definition for abstract method '''' allowed 抽象方法没有定义Not enough actual parameters 没有足够的实际参数Number of elements differs from declaration 元素数与说明不同Numeric overflow 数值溢出Object or class type required 需要对象或类类型Object type required 需要对象类型Only register calling convention allowed in OLE automation section 在OLE自动区段中只允许寄存器调用约定Operand size mismatch 运算对象大小匹配Operator not applicable to this operand type 运算符不使用于这一运算对象类型Order of fields in record constant differs from declaration 在记录常量中的域次序与说明不同Ordinal type required 需要序数类型Out of memory 内存溢出Overflow in conversion or arithmetic operation 转换或算术操作溢出Overriding automated virtual method '''' cannot specify a dispid 覆盖的自动虚拟方法不能指定DISPIDPACKED not allowed here 这里不允许PACKEDPointer type required 需要指针类型Procedure cannot have a result type 过程不能有结果类型Procedure DISPOSE needs destructor 过程DISPOSE需要destructorProcedure FAIL only allowed in constructor 过程FAIL只允许在constructor方法中Procedure NEW needs constructor 过程NEW需要constructor方法PROCEDURE or FUNCTION expected 要求PROCEDURE或FUNCTIONProcedure or function name expected 要求过程或函数名Program or unit '''' recursively uses itself 程序或单元递归Property '''' does not exist in base class 在基类中属性不存在Published property '''' cannot be of type Published属性不能具有类型Published Real48 property '''' must be Single, Double or Extended Published REAL属性必须为Single, Double或ExtendedRe-raising an exception only allowed in exception handler 在意外处理中只允许重新引起意外处理Read error on 文件读出错Record, object or class type required 需要记录,对象或类类型Redeclaration of '''' hides a member in the base class 的重新说明隐藏了基类中一个元素Redeclaration of property not allowed in OLE automation section 在OLE自动区段中不允许属性重复说明Return value of function '''' might be undefined 函数的返回值可能没有定义Seek error on 在中搜索错误Segment/Offset pairs not supported in Borland 32-bit Pascal 在Borland 32位的PASCAL中不支持Segment/Offset对Sets may have at most 256 elements 集至少有256个元素Size of published set '''' is >32 bits published集的大小大于32字节Slice standard function only allowed as open array argument Slice标准函数只允许作为打开数组参数Statement expected, but expression of type '''' found 要求语句,但出现类型的表达式Statements not allowed in interface part 在界面中不允许的语句String constant too long 字符串常量太长String constant truncated to fit STRING[] 字符串常量截取到适合STRING[]Strings may have at most 255 elements 字符串至少255个元素Structure field identifier expected 要求结构域标识符Syntax error in real number 实数语法错误System unit out of date or corrupted: missing '''' 系统单元超出日期或损坏:缺少Text after final ''END. 编译器忽略END.后的文本This form of method call only allowed for class methods 该方法的窗体只允许类方法This form of method call only allowed in methods of derived types 该方法的窗体只允许在导出类型的方法中This type cannot be initialized 这一类型不能初始化Thread local variables cannot be ABSOLUTE 线程局部变量不能是ABSOLUTEThread local variables cannot be local to a function or procedure 线程局部变量对函数不能是局部的Too many actual parameters 太多的实际参数Too many conditional symbols 太多的条件符号Type '''' has no type info 类型没有类型信息Type '''' is not yet completely defined 类型至今没有定义Type '''' must be a class to have a PUBLISHED section 类型必须是在PUBLISHED区段中的类Type '''' must be a class to have OLE automation 类型必须是具有OLE自动的类Type '''' needs finalization - not allowed in file type 类型需要初始化-不允许在文件类型中Type '''' needs finalization - not allowed in variant record 类型需要初始化-不允许在变体记录Type expected 要求TYPEType not allowed in OLE Automation call 在OLE自动调用中不允许的类型Type of expression must be BOOLEAN 表达式的类型必须为BOOLEAN型Type of expression must be INTEGER 表达式的类型必须为INTEGER型TYPEINFO standard function expects a type identifier TYPEINFO标准函数要求类型标识符TYPEOF can only be applied to object types with a VMT TYPEOF只能用于具有VMT的对象类型Types of actual and formal var parameters must be identical 形参与实参必须一致Undeclared identifier: '''' 未说明的标识符Unexpected end of file in comment started on line 以行开始的注释中出现不应有的文件结束Unit was compiled with a different version of 单元与不同版本的编译Unit name mismatch: '''' 单元名不匹配Unknown directive: '''' 未知的指令Unnamed arguments must precede named arguments in OLE Automation call 在OLE自动调用中未命名的参数必须在命名的参数前Unsatisfied forward or external declaration: '''' 不满足的向前或外部说明Unterminated string 未结束的字符串V alue assigned to '''' never used 赋给的值从未使用过V ariable '''' inaccessible here due to optimization 由于优化,变量名在这里不能存取V ariable '''' is declared but never used in '''' 变量名已说明,但不曾使用V ariable '''' might not have been initialized 变量名可能没有初始化V ariable required 需要变量Virtual constructors are not allowed 不允许虚拟的constructors方法Write error on 文件写错误Wrong or corrupted version of RLINK32.DLL RLINK32.DLL版本错误或不能用******************************************************************************************************************************* 运行错误信息** 运行时出现的错误信息形式为: ** Run-time error nnn at xxxx ** 其中nnn 是运行时的错误编号** xxxx 是运行时的错误地址********************************运行时的错误分为以下三类:* I/O错误:错误编号为100-149编号说明---------------------------------------------------------100 磁盘读错误,若要对超过格式文件尾进行读取时101 磁盘写错误,若磁盘满时,由CloseFile,Write,Writeln或Flush报告102 没有指定文件,若文件变量没有由Assign或AssignFile赋值,由Reset,Rewrite,Append,Rename和Erase报告103 文件没有打开,若文件未打开,由CloseFile,Read,Write,Seek,Eof,FilePos,FileSize,Flush,BlockRead或BlockWrite报告104 输入文件未打开,由Read,Readln,Eof,Eoln,SeekEof或SeekEoln报告有关输入的文本文件未打开105 输出文件未打开,由Write和Writeln报告有关文本文件没有用Console应用程序生成106 无效的数据格式,由Read或Readln报告从文本文件读取的数据格式不正确* 致命错误:错误编号为200-255编号说明---------------------------------------------------------200 被零除201 范围检查错误202 栈上溢203 栈上溢错误204 无效的指针操作205 浮点上溢206 浮点下溢207 无效的浮点操作215 算术上溢错误216 存取非法217 控制-C218 授权指令219 无效的TYPECAST220 无效的变体TYPECAST221 无效的变体操作222 没有变体方法调用DISPA TCHER223 不能建立变体数组224 变体不包含数组225 变体数组边界错误226 TLS初始化错误。
win10下FreePascal使⽤⽅法(从安装、消除乱码、编写个简单的hello谈起)⽬录⼀、安装1 、Whatis Pascal?2 、Frequently used compilers or IDE3、ChooseFPC and download it4、安装FPC5、确认是否安装成功⼆、消除乱码三、编写程序四、卸载FPC(选看)五、总结遇到的问题有限的思考:闲来⽆事,突然想“学”⼀门新的语⾔Pascal,不要求精通,只要求能安装、运⾏⼀些简单程序就⾏。
所以,抽出⼀个上午的时间来了解Pascal的历史,以及编译器以及它的IDE。
再⽤⼀个下午的时间来整理⼀下上午的所获所得,希望可以帮到⼀些⼊门者,能让他们少⾛弯路。
同时,我也要感谢那些给我帮助过的⽹友们。
来,开始正题。
⼀、安装1 、Whatis Pascal?⾸先,来看下什么是Pascal程序设计语⾔。
参考:(1) 维基百科:Pascal(2) 百度百科:Pascal⼩结:Pascal由Niklaus Wirth(不认识这⼈?他说过:程序=算法+数据结构。
有印象了吧-:))创建,纪念法国数学家Blaise Pascal。
Pascal起初是⼀个⾯向过程的程序设计语⾔,之后发展出Object Pascal。
Delphi是⼀个IDE,使⽤的核⼼就是Object Pascal。
2 、Frequently used compilers or IDE任何⼀个程序设计语⾔,都要有个编译器。
接下来,来看看Pascal常⽤的compilers有哪些。
当然,还有其他编译器,这⾥就不再过多介绍。
⾄于三者⽐较,有兴趣的⾃⼰百度。
3、ChooseFPC and download it考虑到我们⽤的是win10的兼容性、稳定性、⼝碑等因素,我们选择fpc3.0.0Free Pascal Compiler(pascal语⾔编译器) v3.2.2 64位类型:软件编辑⼤⼩:91MB语⾔:英⽂软件时间:2021-11-16查看详情如果下载的是,fpc2.4.0,则会出现⿊屏报错,同时,其它程序也跟着报错[6]。
Pascal运行错误对照表运行错误是指程序运行时出现的错误,当发生时,Turbo Pascal显示如下信息:RUNTIME ERROR NNNN AT XXXX:YYYY其中,nnnn是运行错误代码,xxxx是错误发生的程序段,yyyy是错误地址偏移。
DOS 错误代码:1无效DoS功能号2文件末找到3路径未找到4打开文件过多5禁止文件存取6无效文件句柄12无效文件存取代码15无效驱动器号16不能删除当前日录17不能跨驱动器改文件名I/O错误100磁盘读错误101磁盘写错误102文件变量末赋值103文件未打开104文件未用输入方式打开105文件末用输出方式打开106无效数字格式严重错误150磁盘写保护151未知单元152驱动器未准备好153未知命令154数据CRC校验错155驱动器请求的结构长度错156磁盘定位错157未知媒介类型158扇区末找到159打印机缺纸160设备写失败161设备读失败162硬件故障致命错误200被零除201范围检查错202堆栈溢出错203堆溢出错204无效指针操作205浮点上溢出206浮点下溢出207无效浮点运算208未安装覆盖管理程序209覆盖文件读错210对象未初始化211调用抽象方法212流登计错213集合下标越界214集合溢出215 算术上溢错误216 存取非法217 控制-C218 授权指令219 无效的TYPECAST220 无效的变体TYPECAST221 无效的变体操作222 没有变体方法调用DISPATCHER223 不能建立变体数组224 变体不包含数组225 变体数组边界错误226 TLS初始化错误Pascal编译错误对照表下面列出在编译程序时可能出现的错误,在集成环境下,Turbo Pascal将自动加载源程序并定位于出错处。
1内存溢出2缺标识符3标识符未定义4标识符重定义5语法错误6实型常量错7整型常量错8字符串常量跨行9文件嵌套过多10非正常文件结束11行过长12缺类型标识符13打开文件过多14无效文件名15文件未找到16磁盘满17无效编译指示18文件过多19指针定义中未定义类型20缺变量标识符21类型错误22结构过长24文件分量不能为文件25无效字符串长度26类型不匹配27无效子界基类型28下界大于上界29缺有序类型30缺整型常数31缺常数32缺整型或实型常数33缺指针类型标识符34无效的函数结果类型35缺标号标识符36缺BEGIN37缺END38缺整型表达式39缺有序表达式40缺布尔表达式41操作数类型与操作符不匹配42表达式错43非法赋值44缺字段标识符45目标文件过长46未定义外部标识符47无效*.OBJ文件记录48代码段过长49数据段过长50缺DO51无效PUBLIC定义52无效EXTRN定义53EXTRN定义过多54缺0F55缺INTERFACE56无效重定位引用57缺THEN58缺T0或DOWNTO59未定义的向前引用60过程过多61无效类型转换62被零除D63无效文件类型64不能读写该类型的变量65缺指针变量66缺字符串变量67缺字符串表达式68单元循环引用69单元名不匹配70单元版本不匹配71单元重名72单元文件格式错误73缺IMPLEMENTATl0N74常数与CASE类型不相匹配75缺记录变量76常数越界77缺文件变量78缺指针变量79缺整型或实型表达式80标号不在当前块中81标号已定义82标号未定义83无效参数84缺UNIT85缺“;”86缺“:”87缺“,”88缺“(”89缺“)”90缺“=”91缺“:=”92缺“[”或“(.”93缺“]”或“.)”94缺“.”96变量过多97无效FOR控制变量98缺整型变量99此处不允许用文件和100字符串长度不匹配101无效字顺序102缺字符串常数103缺整型或实型变量104缺有序变量105INLINE错106缺字符表达式107重定位项过多112CASE常量越界113语句错114不能调用中断过程116必须在8087方式下编译117末找到目标地址118此处不允许包含文件120缺NIL121无效限定符122无效变量引用123符号过多124语句部分过长126文件必须为变量参数127条件符号过多128条件指令错位130初始条件定义错131过程和函数头与前面定义的不匹酉132严重磁盘错误133不能计算该表达式134表达式错误结束135无效格式说明符136无效间接引用137此处不允许结构变量138无SYSTEM单元不能计算139不能存取该符号140无效浮点运算141不能将覆盖编译至内存142缺过程和函数变量143无效过程或函数引用144不能覆盖该单元147缺对象类型148不允许局部对象类型149缺VIRTUAL150缺方法标识符151不允许虚拟构造方法152缺构造方法标识符153缺释放方法标识符154FAIL只允许在构造方法内使用155无效的操作符和操作数组合156缺内存引用157不能加减可重定位符号158无效寄存器组合159未激活286/287指令160无效符号引用161代码生成错162缺ASM。
PASCAL程序编译错误信息PASCAL程序编译、运行过程中的出错信息PASCAL程序有两种类型的错误,一种是在编译时出现的错误,叫编译时错误,另一种是运行时出现的错误,叫运行时错误。
一、编译时错误:如果程序编译过程中出现错误,一般会在PASCAL窗口菜单下出现红色错误信息条,以“ERRORXX:……”形式出现,按“ESC”键取消后,光标会停在可能出错的物理或逻辑位置。
具体的错误语句如下:1、“;”EXPECTED含义是是:缺少“;”----分号。
2、“:=”EXPECTED把赋值号“:=”写成了等号“=”或冒号“:”3、“)”EXPECTED表达式缺少“)”4、“(”EXPECTED表达式缺少“(”5、“[”EXPECTED表达式缺少‘[’6、“]”EXPECTED表达式缺少‘]’7、“.”EXPECTED表达式缺少“.”8、“..”EXPECTED表达式缺少“..”9、“END”EXPECTED表达式缺少‘END[’10、“DO”EXPECTED表达式缺少‘DO’11、“OF”EXPECTED表达式缺少“OF”12、“PROCEDURE”OR“FUNCTION”EXPECTED缺少“procedure”或“function”13、“THEN”EXPECTED缺少“then”;14、“TO”OR“DOWNTO”EXPECTED缺少“TO”或“DOWNTO”15、BOOLEAN EXPRESSION EXPECTED布尔表达式存在错误16、file variable expected文件型变量使用错误17、integer constant expected没有对整型常量进行说明18、integer expression expected将整型表达式写成了其他类型19、integer variable expected应该用整型变量20、integer or real constant expected应该用整型或实型变量21、integer or real expression expected应该用整型或实型表达式22、integer or real variable expected应该用整型或实型变量23、pointer variable expected应该用指针变量24、record variable expected应该用记录变量25、simple type expected应该用简单数据类型26、simple expression expected应该用简单数据类型构成的表达式27、string constant expected应该用字符串常量28、string expression expected应该用字符串表达式29、string variable expected应该用字符串变量30、textfile expected使用的文本文件未定义31、type indetifier expected使用了未定义的类型名32、untyped file expected使用了未定义文件33、unknow identifier or syntax error未知的标号、常数、变量、标识符34、undefined label一个语句中引用了未定义的标号35、undefined pointer type in preceding type definitions指针类型定义中包含了对一个未知类型的标识符引用36、duplicate identifier or label标识符或标号已经出现过了37、type mismatch类型不匹配38、constant out of range常量超出范围39、constant and case selector type does not match CASE语句中的枚举分量不匹配40、operand type does not match operator操作数类型不和要求41、invalid result type不合法的结果类型42、invalid string length字符串长度越界,必须在1..25之间43、string constant length does not match type字符串常量的长度不匹配44、invalid subrange base bound基类型不允许是实型数45、lower bound>upper bound子界型的下界大于上界了46、reserved word保留字不许用来作标识符47、illegal assignment非法任务48、string constant exceeds line字符串常数不许跨行49、error in integer constant整型常数错误50、error in real constant实型常数错误51、illegal character in identifier在标识符中出现了不合法的字符52、constants are not allowed here变量不能在这儿使用53、files and pointers are not allowed here文件和指针不能在这儿使用54、structured variables are not allowed here结构体不能在这儿使用55、textfiles are not allowed here文本文件不能在这使用56、untyped files are not allowed here未定义的文件类型不能在这儿使用57、i/o not allowed here这种类型的变量不能输入/输出58、files must be var parameters文件类型必须在变量部分说明59、files components may not be files file of file这种构造类型不允许60、invalid ordering of fields域的引用顺序不对61、set base type out of range集合的基类型必须是意义个不多于256个可能值的标量或子界,其界值范围在0..255之间62、invalid goto GOTO语句不允许在一个FOR循环外引用其内的标号63、label not within current block GOTO语句不能引用当前分程序外的标号64、undefined forward procedure一个子程序已经向前定义了,但其子程序没有出现65、inline error行错误66、illegal use of absolute绝对变量说明不合法67、overlays can not be forwarded:FORWARDED说明不能与覆盖一起使用68、overlays not allowed in direct mode只有将程序编译到一个文件时才能用覆盖69、file not found指定的文件不存在70、unexpected end of source程序不能这样结束,一般是因为程序中的END比BEGIN少71、unable to create overlay file建立的新文件不能覆盖已存在的文件72、invalid compile directive不正确的编译方向73、too many nested withs嵌套的WITH语句太多74、memory overflow需要的内存空间太多,无法分配75、compiler overflow没有足够的内存空间运行你的程序,可以把源程序分成几个小的部分,并使用包括文件除了编译时错误外,在程序的运行过程中,可能会发生很多意想不到的错误,往往会导致程序终止运行甚至死机,有时会在屏幕下显示一些出错信息,如RUN-TIME ERROR XX等,要注意查找出错原因,一般有以下几种情况:01、浮点溢出;02、零做除数;03、SQRT(X)的自变量为负数;04、LN(X)的自变量为负数;05、字符串长度>255,或者想把长度大于1的字符串转成字符类型;06、非法串下标,主要是在用COPY,DELETE,INSERT等字符串函数时下标表达式的范围超出1..25;07、数组下标越界;08、标量或子界越界;09、整数越界,如在传给TRUNC(X)或ROUND(X)的不在-32768至32767之间;10、覆盖文件未找到;11、堆栈冲突;12、文件不存在:如用reset erase,rename,execute,chain等操作的文件名字不存在;13、输入/输出文件未打开,未用reset,rewrite预先打开文件就试图对文件进行操作;14、文件过大:记录数大于65535;15、打开文件太多;16、文件已消失:用CLOSE关闭一个并不存在的文件。
Free Pascal错误一览表1、 Run Time Errors 运行错误(A)DOS 错误代码:
1:无效DoS功能号
2:文件末找到3:路径未找到4:打开文件过多
5:禁止文件存取
6:无效文件句柄
12:无效文件存取代码
15:无效驱动器号
16:不能删除当前日录
17:不能跨驱动器改文件名(B)I/O错误100:磁盘读错
误
101:磁盘写错
误
102:文件变量
末赋值
103:文件未打
开
104:文件未用
输入方式打开
105:文件末用
输出方式打开
106:无效数字
格式
(C)严重错误
150:磁盘写保
护
15l:未知单元
152:驱动器未
准备好
153:未知命令
154:数据CRC
校验错
155:驱动器请
求的结构长度
错
156:磁盘定位
错
157:未知媒介
类型
158:扇区末找
到
159:打印机缺
纸
160:设备写失
败
161:设备读失败
162:硬件故障(D)致命错误200:被零除20l:范围检查错
202:堆栈溢出错
203:堆溢出错204:无效指针操作
205:浮点上溢出
206:浮点下溢出
207:无效浮点运算208:未安装覆
盖管理程序
209:覆盖文件
读错
210:对象未初
始化
211:调用抽象
方法
212:流登计错
213:集合下标
越界
214:集合溢出
215:算术上溢
错误
216:存取非法
217:控制-C
218:授权指令
219:无效的TY
PECAST
220:无效的变
体TYPECAST
221:无效的变
体操作
222:没有变体
方法调用DISPA
TCHER
223:不能建立
变体数组
224:变体不包
含数组
225:变体数组
边界错误
226:TLS初始化
错误
2、编译错误对照表
下面列出在编译程序时可能出现的错误,在集成环境下,Pascal将自动加载源程序并定位于出错处。
1:内存溢出2:缺标识符3:标识符未定义
4:标识符重定义
5:语法错误6:实型常量错7:整型常量错8:字符串常量跨行
9:文件嵌套过多
10:非正常文件结束
11:行过长12:缺类型标识符
13:打开文件过多14:无效文件名
15:文件未找到
16:磁盘满
17:无效编译指
示
18:文件过多
19:指针定义中
未定义类型
20:缺变量标识
符
21:类型错误
22:结构过长
24:文件分量不
能为文件
25:无效字符串
长度
26:类型不匹配
27:无效子界基
类型
28:下界大于上
界
29:缺有序类型
30:缺整型常数
31:缺常数
32:缺整型或实
型常数
33:缺指针类型
标识符
34:无效的函数
结果类型
35:缺标号标识
符
36:缺BEGIN
37:缺END
38:缺整型表达
式
39:缺有序表达式
40:缺布尔表达式
41:操作数类型与操作符不匹配
42:表达式错43:非法赋值44:缺字段标识符
45:目标文件过长
46:未定义外部标识符
47:无效*.OBJ 文件记录
48:代码段过长49:数据段过长50:缺DO 51:无效PUBLI
C定义
52:无效EXTRN
定义
53:EXTRN定义
过多
54:缺0F
55:缺INTERFA
CE
56:无效重定位
引用
57:缺THEN
58:缺T0或DO
WNTO
59:未定义的向
前引用
60:过程过多
61:无效类型转
换
62:被零除D
63:无效文件类
型
64:不能读写该
类型的变量
65:缺指针变量
66:缺字符串变
量
67:缺字符串表
达式
68:单元循环引
用
69:单元名不匹
配
70:单元版本不
匹配
71:单元重名
72:单元文件格
式错误
73:缺IMPLEME
NTATl0N
74:常数与CAS
E类型不相匹配
75:缺记录变量
76:常数越界77:缺文件变量
78:缺指针变量
79:缺整型或实型表达式
80:标号不在当前块中
81:标号已定义82:标号未定义
83:无效参数84:缺UNIT 85:缺“;” 86:缺“:” 87:缺“,” 88:缺“(” 89:缺“)” 90:缺“=” 91:缺“:=”92:缺“[”或
“(.”
93:缺“]”或
“.)”
94:缺“.”
96:变量过多
97:无效FOR控
制变量
98:缺整型变量
99:此处不允许
用文件和
100:字符串长
度不匹配
101:无效字顺
序
102:缺字符串
常数
103:缺整型或
实型变量
104:缺有序变
量
105:INLINE错
106:缺字符表
达式
107:重定位项
过多
112:CASE常量
越界
113:语句错
114:不能调用
中断过程
116:必须在80
87方式下编译
117:末找到目
标地址
118:此处不允
许包含文件
120:缺NIL
121:无效限定
符
122:无效变量
引用
123:符号过多
124:语句部分过长
126:文件必须为变量参数127:条件符号过多
128:条件指令错位
130:初始条件定义错
13l:过程和函数头与前面定义的不匹酉132:严重磁盘错误
133:不能计算该表达式134:表达式错误结束
l35:无效格式说明符136:无效间接
引用
137:此处不允
许结构变量
138:无SYSTEM
单元不能计算
l39:不能存取
该符号
140:无效浮点
运算
141:不能将覆
盖编译至内存
142:缺过程和
函数变量
143:无效过程
或函数引用
144:不能覆盖
该单元
147:缺对象类
型
148:不允许局
部对象类型
149:缺VIRTUA
L
150:缺方法标
识符
151:不允许虚
拟构造方法
152:缺构造方
法标识符
153:缺释放方
法标识符
154:FAIL只允
许在构造方法
内使用
155:无效的操
作符和操作数
组合
156:缺内存引
用
l57:不能加减
可重定位符号
158:无效寄存
器组合
159:未激活28 6/287指令160:无效符号引用161:代码生成错
162:缺ASM。