Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2004-01

What does this mean?

6 messages · 3 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Holger Peters

Hi,

I tried to compile this program:

{$MODE OBJFPC}
program
        DomTest3;
uses
        DOM,
        xmlread,
        Classes;
var
        MyXMLStructure  : TXMLDocument;
        MyFile                  : TFileStream;
begin
MyFile.Create('test.xml',fmopenread);
MyXMLStructure := TXMLDocument.Create;
try
        ReadXMLFile(MyXMLStructure,MyFile);
except
        On EXMLReadError do WriteLn('Did not work out well');
end;
MyFile.Destroy;
end.

I executed it, and it did not work (EAccess violation) so I tried to compile it with -gd to use it with a debugger. But unfortunately it gave the following error:

Free Pascal Compiler version 1.9.2 [2004/01/07] for i386 Copyright (c) 1993-2002 by Florian Klaempfl
Target OS: Linux for i386
Compiling main3.pp
Panic : Internal compiler error, exiting.
main3.pp(22) Fatal: Internal error 9999

PS: Line 22 is the last line of the file.

Is this a bug or is the mistake on my side?

cu,
Holger

Holger Peters

Hi,

I tried to compile this program:

{$MODE OBJFPC}
program
        DomTest3;
uses
        DOM,
        xmlread,
        Classes;
var
        MyXMLStructure  : TXMLDocument;
        MyFile                  : TFileStream;
begin
MyFile.Create('test.xml',fmopenread);
MyXMLStructure := TXMLDocument.Create;
try
        ReadXMLFile(MyXMLStructure,MyFile);
except
        On EXMLReadError do WriteLn('Did not work out well');
end;
MyFile.Destroy;
end.

I executed it, and it did not work (EAccess violation) so I tried to compile it with -gd to use it with a debugger. But unfortunately it gave the following error:

Free Pascal Compiler version 1.9.2 [2004/01/07] for i386 Copyright (c) 1993-2002 by Florian Klaempfl
Target OS: Linux for i386
Compiling main3.pp
Panic : Internal compiler error, exiting.
main3.pp(22) Fatal: Internal error 9999

PS: Line 22 is the last line of the file.

Is this a bug or is the mistake on my side?

cu,
Holger

Michael Van Canneyt
to Holger Peters
Holger Peters wrote 19 lines
Hi, I tried to compile this program: {$MODE OBJFPC} program DomTest3; uses DOM, xmlread, Classes; var MyXMLStructure : TXMLDocument; MyFile : TFileStream; begin MyFile.Create('test.xml',fmopenread);

This is wrong. It should be

  MyFile:=TfileStream..Create('test.xml',fmopenread);

It explains the access violation.

Michael.

Holger Peters
to Michael Van Canneyt

Hi,

thank you, a really stupid mistake from me, but it is still not working when I compile it with fpc main3.pp -gd .

Holger

Show quoted text 40 lines
On Tue, 20 Jan 2004, Holger Peters wrote: >Hi, > >I tried to compile this program: > >{$MODE OBJFPC} >program > DomTest3; >uses > DOM, > xmlread, > Classes; >var > MyXMLStructure : TXMLDocument; > MyFile : TFileStream; > > > >begin >MyFile.Create('test.xml',fmopenread); > > This is wrong. It should be MyFile:=TfileStream..Create('test.xml',fmopenread); It explains the access violation. Michael. _______________________________________________ fpc-pascal maillist - http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Michael Van Canneyt
to Holger Peters
Holger Peters wrote
Hi, thank you, a really stupid mistake from me, but it is still not working when I compile it with fpc main3.pp -gd .

That is unfortunately out of my territory :-/
Did you try simply '-g' ?

Michael.

Matt Emson
to Holger Peters: I tried to compile this program: {$MODE OBJFPC} program DomTest3; uses Classes; var…

Try the following: it's more likely to give you some useful info. Also, you don't call 'Destroy' directly, 'Free' calls it for you.

 program DomTest3;
 {$MODE OBJFPC}

uses
DOM,
xmlread,

   Classes;
 var
   MyXMLStructure  : TXMLDocument;
   MyFile                  : TFileStream;
 begin
   MyFile := TFileStream.Create('test.xml',fmopenread);
   try
     MyXMLStructure := TXMLDocument.Create;
     try
       ReadXMLFile(MyXMLStructure,MyFile);
     except
         On EXMLReadError do WriteLn('Did not work out well');
         On Exception do writeln(E.Message);
     end;
  finally
    MyFile.Free;
  end;
end.