Author: Kolss
Date: 08:23:09 11/05/04
Go up one level in this thread
On November 05, 2004 at 11:02:33, Andrey Popov wrote:
>>>>>>In Turbo Pascal, if your program has crashed with run-time error,
>>>>>>then the line in the source code where the error occured is highlighted.
>>>>>>In Delphi I cannot learn where is the place of a run-time error.
>>>>>
>>>>>Well, if you set the respective compiler options (Menu Project -> Options ->
>>>>>Compiler -> Runtime Errors and Debugging), you get to the exact line...
>>>>
>>>>I runned the following program. It crashed and Delphi closed the execution
>>>>window immediately. I even could not see the error message in that window.
>>>>No line was highlighted in the source window after that.
>>>>program a;
>>>>uses windows;
>>>>{$APPTYPE CONSOLE}
>>>>{$R+ D+ L+ Y+}
>>>>{Options above are the same as in Runtime Errors and Debugging menus}
>>>>var i:integer;
>>>> ar : array [1..3] of real;
>>>>begin
>>>> i:=1; ar[i]:=1.0;
>>>> inc(i); ar[i]:=2.0;
>>>> inc(i); ar[i]:=3.0;
>>>> inc(i); ar[i]:=4.0;
>>>> writeln(i);
>>>>end.
>>>
>>>I created a new console application (File -> New -> Other -> Console
>>>Application), copied your code into the program, checked the compiler options,
>>>pressed F9 to start, and the program was stopped with the error message "Range
>>>Error" and highlighted the line "inc(i); ar[i]:=4.0;", as it should be.
>>>If I do not check the options in the menu, I do not get to the line either. So
>>>you should really check the compiler options in the menu, which means you can
>>>get rid of the "{$R+ D+ L+ Y+}"... Seems it is not truly equivalent.
>
>Thank you, but it did not help me. It seems that there is another option on
>another place or it is a difference in Delphi versions.
>Which version do you use?
I use Delphi 6 Personal Edition.
Just to try again, here is a program which gives me the line with the error:
program Project1;
{$APPTYPE CONSOLE}
uses
SysUtils;
var i: Integer;
a: array [1..2] of real;
begin
i := 1;
inc(i); a[i] := 1.0;
inc(i); a[i] := 2.0;
WriteLn(i)
end.
I have checked (in compiler options):
1. Runtime Errors:
a) Range checking
b) I/O checking
c) Overflow checking
2. Debugging:
a) Debug information
b) Local symbols
c) Reference info
Definitions only
d) Assertions
Necessary are only 1a, 2a, 2b, 2c.
Now if that does not work for you, I don't know what to do any more... :-)
Best regards - Munjong.
This page took 0 seconds to execute
Last modified: Thu, 15 Apr 21 08:11:13 -0700
Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.