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


Become an SDL Forum Society member <http://www.sdl-forum.org/Society/members.htm>
The originator of this message is responsible for its content.
-----From Rick Reed TSE <rickreed#tseng.co.uk> to sdlnews -----

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

--End text from Rick Reed TSE <rickreed#tseng.co.uk> to sdlnews --- For extra SDL Forum Society benefits join at <http://www.sdl-forum.org/Society/members.htm>



This archive was generated by hypermail 2a23 : Thu May 09 2013 - 16:05:49 GMT