Type casting_(re)

Sat, 14 Jun 1997 23:00:32 +0200 (MET DST)


According to Orlando Llanes:
> 
> Oh :} Sorry :} I briefly glanced at it, and what I saw was, for example:
> 
> TYPE
>   ShortInt = __byte__ Integer;
>   Byte = __unsigned__ ShortInt;
> VAR
>   AVar : Integer;
>   ASmallVar : Byte;
> BEGIN
>   ASmallVar := BytePtr(AVar)^;
> END.
> 
> Something like that...

Your program compiles well, if you add `Type BytePtr = ^Byte'.
(But it crashes at run-time because you are accessing an uninitialized
pointer variable.)

> What I meant was type casting using custom types, not with built-in or
> pre-defined types. If it already does this, sorry again :}

It already does. ;-)

    Peter

 Dipl.-Phys. Peter Gerwinski, Essen, Germany, free physicist and programmer
peter.gerwinski@uni-essen.de - http://home.pages.de/~peter.gerwinski/ [970201]
 maintainer GNU Pascal [970510] - http://home.pages.de/~gnu-pascal/ [970125]


Peter Gerwinski (peter@agnes.dida.physik.uni-essen.de)

HTML conversion by Lluís de Yzaguirre i Maura
Institut de Lingüística Aplicada - Universitat "Pompeu Fabra"
e-mail: de_yza@upf.es