Board index » delphi » Symbol table overflow?

Symbol table overflow?

I have experienced a curious problem, which might be related to a
symbol table overflow.  I wanted to create a TStringlist, so I tried
the following code:

VAR
     Test       : TStringList;

begin
    Test := TStringList.Create;

On compiling this, I got an error ~ "expecting Type" at the variable
declaration (or alternatively at the assign line).  I got this code
directly from the Developer's Guide book, so was a bit perplexed.

However, after some experimentation, I got the following code to work:

Original File:
VAR
   Test : QList;
begin
  Test := QList.Create;

and in a second file, containing my global declarations, "use"d by
Original:

TYPE
   QList = TStringList;

(Note: if the line above was placed in the original file, I got an
"expecting type" error in the declaration. )  I presume that by the
time my original file is handled by the compiler, it has lost its
memory for the TStringList type...

Can anyone explain what is going on here?

Jim

 

Re:Symbol table overflow?


Quote
In article <4b51uq$...@alterdial.UU.NET> thugw...@rapidramp.com (Jim Schwaiger) writes:
>Path: news.primenet.com!nntp.news.primenet.com!news.texas.net!news.kei.com!newsfeed.internetmci.com!in2.uu.net!alterdial.uu.net!not-for-mail
>From: thugw...@rapidramp.com (Jim Schwaiger)
>Newsgroups: comp.lang.pascal.delphi.misc
>Subject: Symbol table overflow?
>Date: Tue, 19 Dec 1995 02:37:07 GMT
>Lines: 42
>Message-ID: <4b51uq$...@alterdial.UU.NET>
>NNTP-Posting-Host: ppp22.rapidramp.com
>X-Newsreader: Forte Free Agent 1.0.82
>Xref: news.primenet.com comp.lang.pascal.delphi.misc:16994
>I have experienced a curious problem, which might be related to a
>symbol table overflow.  I wanted to create a TStringlist, so I tried
>the following code:
>On compiling this, I got an error ~ "expecting Type" at the variable
>declaration (or alternatively at the assign line).  I got this code
>directly from the Developer's Guide book, so was a bit perplexed.
>However, after some experimentation, I got the following code to work:
>(Note: if the line above was placed in the original file, I got an
>"expecting type" error in the declaration. )  I presume that by the
>time my original file is handled by the compiler, it has lost its
>memory for the TStringList type...

You are correct that Delphi did not at that point recognize the type-name,
probably because the unit-name in which it is declared was not correctly
"use"d, but you should not attribute the cause to symbol-table overflow.

/mr/

Re:Symbol table overflow?


Quote
thugw...@rapidramp.com (Jim Schwaiger) writes:
> I have experienced a curious problem, which might be related to a
> symbol table overflow.  I wanted to create a TStringlist, so I tried
> the following code:

> VAR
>      Test  : TStringList;

> begin
>     Test := TStringList.Create;

> On compiling this, I got an error ~ "expecting Type" at the variable
> declaration (or alternatively at the assign line).  I got this code
> directly from the Developer's Guide book, so was a bit perplexed.

> However, after some experimentation, I got the following code to work:

> Original File:
> VAR
>    Test    : QList;
> begin
>   Test := QList.Create;

> and in a second file, containing my global declarations, "use"d by
> Original:

> TYPE
>    QList = TStringList;

> (Note: if the line above was placed in the original file, I got an
> "expecting type" error in the declaration. )  I presume that by the
> time my original file is handled by the compiler, it has lost its
> memory for the TStringList type...

> Can anyone explain what is going on here?

Did you have the CLASSES module in your "uses" section? Otherwise
Delphi won't be able to resolve the type.

Re:Symbol table overflow?


Quote
John Harlow <jhar...@richmond.infi.net> wrote:

... lines deleted...

Quote
>> (Note: if the line above was placed in the original file, I got an
>> "expecting type" error in the declaration. )  I presume that by the
>> time my original file is handled by the compiler, it has lost its
>> memory for the TStringList type...

>> Can anyone explain what is going on here?
>Did you have the CLASSES module in your "uses" section? Otherwise
>Delphi won't be able to resolve the type.

In fact, I did have Classes included in the first "use" section at the
top of this unit.  Being confused about why it did not find
TStringList, I even went so far as to check the source for the Classes
unit to be sure that TStringList was actually declared there - which
it is.

Ultimately, I got around the problem in the way I described by
declaring a dummy variable type (QList) but I am just curious to know
what is going on.

Jim

Other Threads