Table of Sizes of Types 
Author Message
 Table of Sizes of Types

The following now appears in
        <URL: http://www.*-*-*.com/ #MT>
the delphi entries (apart from D3) from PhR.

Perhaps some with long memories might check, especially the earlier
columns, and answer the ? characters?

                                    BYTES

           T1  T2  T3  T4  T5  T6  T7    D1  D2  D3  D4  D5  D6?
byte        ?   1   1   1   1   1   1   F 1   1   1   1   1   ?
shortint    -   -   -   1   1   1   1   F 1   1   1   1   1   ?
word        -   -   -   2   2   2   2   F 2   2   2   2   2   ?
smallint    -   -   -   -   -   -   -   F 2   2   2   2   2   ?
integer     2   2   2   2   2   2   2   G 2   4   4   4   4   ?
cardinal    -   -   -   -   -   -   -   G 2   4   4   4   4   ?
longint     -   -   -   4   4   4   4   F 4   4   4   4   4   ?
doubleword  -   -   -   -   -   -   -     -   -   -   4   4   ?

real        6   6   6   6   6   6   6     6   6   6   8   8   ?
single      -   -   -   4   4   4   4     4   4   4   4   4   ?
double      -   -   -   8   8   8   8     8   8   8   8   8   ?
extended    -   -   -  10  10  10  10    10  10  10  10  10   ?
comp        -   -   -   8   8   8   8     8   8   8   8   8   ?
currency    -   -   -   -   -   -   -     -   8   8   8   8   ?
real48      -   -   -   -   -   -   -     -   -   -   6   6   6

boolean     1   1   1   1   1   1   1     1   1   1   1   1   ?
bytebool    -   -   -   -   -   -   -     1   1   1   1   1   1
wordbool    -   -   -   -   -   -   -     2   2   2   2   2   2
longbool    -   -   -   -   -   -   -     4   4   4   4   4   4

char        1   1   1   1   1   1   1     1   1   1   1   1   ?
ansichar    -   -   -   -   -   -   -   F -   1   1   1   1   ?
widechar    -   -   -   -   -   -   -   F -   2   2   2   2   ?

string      ?   ?   ? 256 256 256 256     ?   ?  $H
shortstring -   -   -   -   -   -   -     ?   ? L+1
longstring  -   -   -   -   -   -   -     ?   ? 4,H
widestring  -   -   -   -   -   -   -     ?   ? 4,H

  F = Fundamental   G = Generic   L = Declared Length   H = plus Heap
  t5.5 = T5 ?   BP7 = T7 = TPW7   TPW1,TPW1.5

RSVP with additions or corrections!

Note that the alignment of types depends on the version number in
Delphi.

--

 <URL: http://www.*-*-*.com/ ; TP/BP/Delphi/&c., FAQqy topics & links;
 <URL: ftp://garbo.uwasa.fi/pc/link/tsfaqp.zip> Timo Salmi's Turbo Pascal FAQ;
 <URL: http://www.*-*-*.com/ ; Pedt Scragg: c.l.p.b. mFAQ.



Wed, 18 Jun 1902 08:00:00 GMT  
 Table of Sizes of Types

Quote:

>            T1  T2  T3  T4  T5  T6  T7    D1  D2  D3  D4  D5  D6?
> byte        ?   1   1   1   1   1   1   F 1   1   1   1   1   ?

I suppose that a byte will always be a byte long... hence its name. :-)

Quote:
> real        6   6   6   6   6   6   6     6   6   6   8   8   ?

I wonder why real still exists in 32 bit- Delphi. There are better types (double
and extended), and Delphi programs do not run on processors without an FPU (I
guess).


Wed, 18 Jun 1902 08:00:00 GMT  
 Table of Sizes of Types


Quote:


>>            T1  T2  T3  T4  T5  T6  T7    D1  D2  D3  D4  D5  D6?
>> byte        ?   1   1   1   1   1   1   F 1   1   1   1   1   ?

>I suppose that a byte will always be a byte long... hence its name. :-)

Well, it's barely possible that there won't *be* bytes in D6 !

Quote:
>> real        6   6   6   6   6   6   6     6   6   6   8   8   ?

>I wonder why real still exists in 32 bit- Delphi. There are better types (double
>and extended), and Delphi programs do not run on processors without an FPU (I
>guess).

Real is a standard Pascal type, in Wirth's Pascal, and should continue
to exist.  Note that, from D4, real is 8-byte and equivalent to double;
real48 is provided for compatibility.

Borland has been good about upwards compatibility; few code changes have
been needed on moving to a later release, and AFAIR the language
changes have always been obviously beneficial.

--

 <URL: http://www.merlyn.demon.co.uk/> TP/BP/Delphi/&c., FAQqy topics & links;
 <URL: ftp://garbo.uwasa.fi/pc/link/tsfaqp.zip> Timo Salmi's Turbo Pascal FAQ;
 <URL: http://www.merlyn.demon.co.uk/clpb-faq.txt> Pedt Scragg: c.l.p.b. mFAQ.



Wed, 18 Jun 1902 08:00:00 GMT  
 Table of Sizes of Types

Quote:

> Borland has been good about upwards compatibility; few code changes have
> been needed on moving to a later release, and AFAIR the language
> changes have always been obviously beneficial.

Well, it is sometimes tedious, eg. with the String in Delphi. It
would have been much better for upgraders to name the new "C"-type
string "LongStr", not the original to "ShortString". The same applies
to the SmallInt, thought this conforms to the principles that the
register (accumulator) size is the "integer" size, agreed.

But really angry I am about the hidden pointer thing in Delphi!

Regards,
--
Franz Glaser, Glasau 3, A-4191 Vorderweissenbach Austria +43-7219-7035-0
Muehlviertler Elektronik Glaser.  Industrial control and instrumentation

http://www.geocities.com/~franzglaser/ http://members.xoom.com/f_glaser/



Wed, 18 Jun 1902 08:00:00 GMT  
 Table of Sizes of Types
Added the Borland compatible compiler FPC: (0.99.13 devel snapshot 3 nov 99)

F1 = FPC -So (As TP as possible)
F2 = FPC     (32-bit TP'ish)
F3 = FPC -S2 (Delphi'ish)
F4 = FPC -Sd (As Delphi compat as possible)
F5 = FPC -Gp (GNU Pascal mode. Largely unfinished)

String=AnsiString can be enabled for all modes afaik with {$H+} in source,
or -Sh on the commandline

                                    BYTES

           F1  F2  F3  F4  F5
byte       1    1   1   1  1  
shortint   1    1   1   1  1
word       2    2   2   2  2

smallint   -    -   2   2  -
integer    2    2   4   4  2
cardinal   4    4   4   4  4
longint    4    4   4   4  4

doubleword 4    4   4   4  4

real       8    8   8   8  8
single     4    4   4   4  4
double     8    8   8   8  8
extended   10   10  10  10 10
comp       8    8   8   8  8
currency   STILL  IN ALPHA
real48     -    -   -   -  

boolean    1    1   1   1  1
bytebool   1    1   1   1  1
wordbool   2    2   2   2  2
longbool   4    4   4   4  4

char        1   1   1   1  1
ansichar    -   -   -   -  -
widechar    -   -   -   -  -

string      $H   $H $H  $H  $H
shortstring 256 256 256 256 256
ansistring  4,H 4,H 4,H 4,H 4,h
longstring      ALPHA
widestring      ALPHA  



Wed, 18 Jun 1902 08:00:00 GMT  
 Table of Sizes of Types

Quote:

> Well, it's barely possible that there won't *be* bytes in D6 !

And therefore, there will be no file of byte, array of byte, etc. I doubt that. Bytes
are extremely useful even on 32 bit processors.


Wed, 18 Jun 1902 08:00:00 GMT  
 Table of Sizes of Types


Quote:

>Added the Borland compatible compiler FPC: (0.99.13 devel snapshot 3 nov 99)
> ...

Thanks.  Would you like to check to see that I've transcribed it
correctly, at <URL: http://www.merlyn.demon.co.uk/delphi#MT>?

How about FPC pointers (all 4?) and string[N] (all N+1?)?

--

 Web <URL: http://www.merlyn.demon.co.uk/> - FAQish topics, acronyms, & links.
 Proper 4-line sig. separator is as above, a line exactly "-- " (SonOfRFC1036)
 Do not Mail News to me. Before a reply, quote with ">" or "> " (SonOfRFC1036)



Wed, 18 Jun 1902 08:00:00 GMT  
 Table of Sizes of Types

Quote:

> Thanks.  Would you like to check to see that I've transcribed it
> correctly, at <URL: http://www.merlyn.demon.co.uk/delphi#MT>?

I tried to visit this URL and got:
Quote:
> 404 Not Found

> URL '/delphi' cannot be found.

> Please refer to http://www.homepages.demon.co.uk/errors/404.html for a list of possible causes for this error.

> thttpd/1.00.disbu



Wed, 18 Jun 1902 08:00:00 GMT  
 Table of Sizes of Types

Quote:

>> Thanks.  Would you like to check to see that I've transcribed it
>> correctly, at <URL: http://www.merlyn.demon.co.uk/delphi#MT>?

>I tried to visit this URL and got:

>> 404 Not Found

Try <URL: http://www.merlyn.demon.co.uk/delphi.htm#MT> instead :-)

--
Information on Newsgroup posted weekly on Sunday - read before writing!
Contains links to    |  http://homepages.force9.net/pascal/faq/
helpful information  |  http://www.merlyn.demon.co.uk/clpb-faq.txt
and some guidelines  |  ftp://garbo.uwasa.fi/pc/doc-net/faqclpb.zip



Wed, 18 Jun 1902 08:00:00 GMT  
 Table of Sizes of Types


Quote:



>>> Thanks.  Would you like to check to see that I've transcribed it
>>> correctly, at <URL: http://www.merlyn.demon.co.uk/delphi#MT>?

>>I tried to visit this URL and got:

>>> 404 Not Found

>Try <URL: http://www.merlyn.demon.co.uk/delphi.htm#MT> instead :-)

Sorry about that!

I've filled in a bit more of the table - after being used to BP7, TP1 is
really rather tricky, especially editing - but there are still some
queries for D1 (shortstring); D4+; FPC (pointer, pchar).

TP1, TP3 appear to have types : byte integer real boolean char
string[N], but not pointer or string.

=

Timo, etc. : re TSFAQP #92 (week number) end : dateprox now does the
reverse function, Year & week number to date; also for non-ISO numbers.
Moderately tested.  Also does Easter, as does longcalc.

--

 <URL: http://www.merlyn.demon.co.uk/> TP/BP/Delphi/&c., FAQqy topics & links;
 <URL: ftp://garbo.uwasa.fi/pc/link/tsfaqp.zip> Timo Salmi's Turbo Pascal FAQ;
 <URL: http://www.merlyn.demon.co.uk/clpb-faq.txt> Pedt Scragg: c.l.p.b. mFAQ.



Wed, 18 Jun 1902 08:00:00 GMT  
 
 [ 10 post ] 

 Relevant Pages 

1. type and size of fields are gone in Data desktop

2. Change Size and Type of field

3. Change the Size and the Type of a Field

4. How to find ORACLE number type fields, size

5. Variable size array pointer type definition

6. Paradox table size after record deletions

7. size of an Interbase Table

8. BDE.dbiCreateInMemTable - Record Size Too Large for Table Error

9. Q:Create Table Field Sizes

10. OCTETS SIZE OF EACH TABLE OF INTERBASE DB ???

11. Size of Paradox tables

12. Paradox tables - maximum size?

 

 
Powered by phpBB® Forum Software