Главная страница | назад





Article #27463: My console application generates a Runtime Error when it starts for no apparent reason.

QUESTION:

My Console Application compiles fine, but when I run it I get a Runtime Error 6. What is this error and how do I fix it?

ANSWER:

Runtime error 6 is defined in the online help as:


106 Invalid numeric format Reported by Read or Readln if a numeric value
read from a text file does not conform to the proper numeric format.
The most probable cause of this error is that the compiler directive for APPTYPE has not been set to console. Your console application you should set the APPTYPE to CONSOLE at the beginning of you application. If you are using dcc32 to compile you program you could also pass the /CC command line option. Your console application should look something like this:

program OneCoolDelphiProgram1;
{$APPTYPE CONSOLE} //This tells the compiler that the program is a console type
uses
SysUtils;
begin
//Insert super cool Delphi Code here
end.

Last Modified: 03-JUL-01