[fpc-pascal] Type declaration
Damien Gerard
milipili at shikami.org
Fri Dec 21 16:03:01 CET 2007
On Dec 21, 2007, at 3:53 PM, ik wrote:
> Hi,
>
> On Dec 21, 2007 3:23 PM, Damien Gerard <milipili at shikami.org> wrote:
>>
>> Hi !
>>
>> I would like to know if there are any differences between these two
>> following declarations :
>>
>> type
>> TMyType = smallint;
>
> This is an "alias" to smallint, giving it a new way reference it.
>
>>
>> And
>>
>> type
>> TMyType = type smallint;
>
> This is a new type, that have the range of smallint, but they are not
> the same. If you will place a TMyType variable inside a smallint
> paremeter you might have an error or warning of type mismatch.
>
I like it :)
Thanks !
--
Damien Gerard
milipili at shikami.org
People who used magic without knowing what they were doing usually
came to a sticky end. All over the entire room, sometimes.
-- (Terry Pratchett, Moving Pictures)
More information about the fpc-pascal
mailing list