Re: SDL-News: casting to parent type ?


Subject: Re: SDL-News: casting to parent type ?
From: Rick Reed TSE (rickreed#tseng.co.uk)
Date: Mon Dec 11 2000 - 14:02:23 GMT


Thomas Garsiot at garsiot#st2e.com wrote on 08/12/2000 08:46:

> Is there any way of casting a variable to its parent type ?

SDL does not directly support type casting.

However, SDL supports EXTERNAL procedures and EXTERNAL operators.

The SDT tool supports EXTEERNAL procedures but not EXTERNAL operators.

Therefore any type casting needed can be written as an EXTERNAL procedure,
provided you understand the way that the data is encoded for the two types
concerned.

Such a procedure is defined in a text box:

PROCEDURE castType1Type2 FPAR t1 Type1; RETURNS Type2; EXTERNAL;

(See section 8 of Addendum 1 to Z.100).

--
Rick Reed - rickreed#tseng.co.uk
Tel:+44 1455 55 96 55 Fax:+44 1455 55 96 58 Mob.:+44 7970 50 96 50



This archive was generated by hypermail 2a23 : Mon May 05 2008 - 20:30:55 GMT