On 1/8/17, Dmitry Boyarintsev <skalogryz.li...@gmail.com> wrote:

> Think about something like a var-type variable, where the actual type of Y
> might vary.
>
> procedure XX(var Y; YType: integer);
> begin
>   case YType  of
>     T_INT: PInteger(@Y)^:= 3;
>     T_SINGLE: PSingle(@Y)^:=3;
>     T_DOUBLE: PDouble(@Y)^:=3;
>   end;
> end;

OK, I can imagine more complex examples where this may come in handy.

And thanks for the rest of the explanation.

Bart
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply via email to