[fpc-pascal] OT Turbo Pascal REAL type WAS: Documentation, syntax diagrams

johanns at nacs.net johanns at nacs.net
Thu Jan 9 00:17:43 CET 2014


On Wed, Jan 08, 2014 at 09:01:34PM +0100, Sven Barth wrote:
>On 08.01.2014 19:40, Howard Page-Clark wrote:
>>On 08/01/2014 18:16, Jürgen Hestermann wrote:
>>>
>>>Today I found this type definition in some FreePascal sources:
>>>
>>>TypeReal =type Double;
>>>
>>>I wondered what the second “type” keyword means here (I have never seen
>>>this before).
>>
>>You are being rather obtuse.
>>Ignore the diagrams in the docs if they don't help you.
>>
>>The double use of type here simply means that the "Real" type is being
>>defined as an alias for double. The two type identifiers now mean
>>exactly the same thing as the "=" indicates.
>
>No, an alias would be
>
>=== code begin ===
>type
>  Real = Double;
>=== code end ===
>
>Using the "type" behind the "=" tells the compiler to declare a new 
>type based on the right side. So a "Double" and a "Real" are not 
>assignment compatible and can have different sets of operator 
>overloads.

Is there any way to get support in Free Pascal for the 
old six byte REAL type that was provided by the old 
Borland DOS Turbo Pascal compilers?  There was support for 
the six byte REAL in the old Virtual Pascal compiler, so I 
wondered if there is some obscure unit that can be enabled 
to turn on legacy support for it.

I do understand that a DOUBLE is larger than a six byte 
REAL, so support for the old type is only meaningful when 
reading a typed file of records that include this outdated 
data type.  Some old code here uses the old type REAL 
extensively, even for large whole number values to avoid 
using the signed 32-bit integer type, LONGINT.

I know the documentation does not mention the six byte 
REAL type.  I wondered if there is any support for it.




More information about the fpc-pascal mailing list