Technical Notes Database
TN988D.txt POST-DECLARATION TYPECASTING
Category :Pascal
Platform :All
Product :Turbo Pascal 4.0+
Description:
Q. How can I change the type of a variable to another type?
A. The method is called type casting. Here is the syntax:
Type
RecType = Record
W : Word;
End;
Var
A : Array[1..2] of Byte;
R : RecType;
Begin
...
R := RecType( A ); { Convert the array into a record type }
...
End.
Reference:
7/16/98 4:35:38 PM
Last Modified: 01-SEP-99