Sign in Join

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

Mailing lists / fpc-pascal / 2003-06

Strange error from a simple class

6 messages · 2 people · –

Reply by email Subscribe to this list Your subscription

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

James Mills

Hi,

I get this error from a very simple class:

Runtime error 216 at 0x0805A735
0x0805A735
0x080481FF TCONFIG__PRINT, line 29 of configclass.pas 0x0805BE35 main, line 29 of forum.pas
0x080480B0

Any ideas ?

cheers
James

Reply by email

Michael Van Canneyt
to James Mills
James Mills wrote 11 lines
Hi, I get this error from a very simple class: Runtime error 216 at 0x0805A735 0x0805A735 0x080481FF TCONFIG__PRINT, line 29 of configclass.pas 0x0805BE35 main, line 29 of forum.pas 0x080480B0 Any ideas ?

You should also show the forum.pas file.
The constructor Create should be in the 'public' section of the class, not in the first (private) section.

Michael.

Reply by email

James Mills
to Michael Van Canneyt
Michael Van Canneyt wrote 18 lines
On Sun, 8 Jun 2003, James Mills wrote: > Hi, > > I get this error from a very simple class: > > Runtime error 216 at 0x0805A735 > 0x0805A735 > 0x080481FF TCONFIG__PRINT, line 29 of configclass.pas > 0x0805BE35 main, line 29 of forum.pas > 0x080480B0 > > Any ideas ? You should also show the forum.pas file. The constructor Create should be in the 'public' section of the class,

Ahh I think that's where my error lies. (stupid me)

cheers
James

Show quoted text 8 lines
not in the first (private) section. Michael. _______________________________________________ fpc-pascal maillist - http://lists.freepascal.org/mailman/listinfo/fpc-pascal
- - James Mills Zero Defect Software Engineers Group - ZDSEG

Reply by email

James Mills
to James Mills
James Mills wrote 23 lines
On Sun, Jun 08, 2003 at 04:43:21PM +0200, Michael Van Canneyt wrote: > > > On Sun, 8 Jun 2003, James Mills wrote: > > > Hi, > > > > I get this error from a very simple class: > > > > Runtime error 216 at 0x0805A735 > > 0x0805A735 > > 0x080481FF TCONFIG__PRINT, line 29 of configclass.pas > > 0x0805BE35 main, line 29 of forum.pas > > 0x080480B0 > > > > Any ideas ? > > You should also show the forum.pas file. > The constructor Create should be in the 'public' section of the class, Ahh I think that's where my error lies. (stupid me) cheers James

Actually it makes no difference, so I'll attach all relevant files.

cheers
James

Show quoted text 18 lines
> not in the first (private) section. > > Michael. > > > _______________________________________________ > fpc-pascal maillist - > http://lists.freepascal.org/mailman/listinfo/fpc-pascal -- - - James Mills Zero Defect Software Engineers Group - ZDSEG _______________________________________________ fpc-pascal maillist - http://lists.freepascal.org/mailman/listinfo/fpc-pascal
- - James Mills Zero Defect Software Engineers Group - ZDSEG

Reply by email

Michael Van Canneyt
to James Mills
James Mills wrote 26 lines
On Mon, Jun 09, 2003 at 12:57:24AM +1000, James Mills wrote: > On Sun, Jun 08, 2003 at 04:43:21PM +0200, Michael Van Canneyt wrote: > > > > > > On Sun, 8 Jun 2003, James Mills wrote: > > > > > Hi, > > > > > > I get this error from a very simple class: > > > > > > Runtime error 216 at 0x0805A735 > > > 0x0805A735 > > > 0x080481FF TCONFIG__PRINT, line 29 of configclass.pas > > > 0x0805BE35 main, line 29 of forum.pas > > > 0x080480B0 > > > > > > Any ideas ? > > > > You should also show the forum.pas file. > > The constructor Create should be in the 'public' section of the class, > Ahh I think that's where my error lies. (stupid me) > > cheers > James Actually it makes no difference, so I'll attach all relevant files.

You forget to do a load statement before the print. Actually, I think you swapped init and load. In init you should create the class instance, and in load you should load whatever values are needed.

You skipped the creation step in your code.

Michael.

Reply by email

James Mills
to Michael Van Canneyt
Michael Van Canneyt wrote 34 lines
On Mon, 9 Jun 2003, James Mills wrote: > On Mon, Jun 09, 2003 at 12:57:24AM +1000, James Mills wrote: > > On Sun, Jun 08, 2003 at 04:43:21PM +0200, Michael Van Canneyt wrote: > > > > > > > > > On Sun, 8 Jun 2003, James Mills wrote: > > > > > > > Hi, > > > > > > > > I get this error from a very simple class: > > > > > > > > Runtime error 216 at 0x0805A735 > > > > 0x0805A735 > > > > 0x080481FF TCONFIG__PRINT, line 29 of configclass.pas > > > > 0x0805BE35 main, line 29 of forum.pas > > > > 0x080480B0 > > > > > > > > Any ideas ? > > > > > > You should also show the forum.pas file. > > > The constructor Create should be in the 'public' section of the class, > > Ahh I think that's where my error lies. (stupid me) > > > > cheers > > James > > Actually it makes no difference, so I'll attach all relevant files. You forget to do a load statement before the print. Actually, I think you swapped init and load. In init you should create the class instance, and in load you should load whatever values are needed.

God damn it! You're right. I guess you get that runtime error when trying to access a non-existant class in memory ?

Thank you Michael, I must have been braindead.

cheers
James

Show quoted text 9 lines
You skipped the creation step in your code. Michael. _______________________________________________ fpc-pascal maillist - http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Reply by email