SDL-News: casting to parent type ?


Subject: SDL-News: casting to parent type ?
From: Thomas Garsiot (garsiot#st2e.com)
Date: Fri Dec 08 2000 - 08:46:26 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 Thomas Garsiot <garsiot#st2e.com> to sdlnews -----

Hi,

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

This is what I'm trying to do :

there is a built-in Octet_String type with a substring axiom (coming
from ASN-1 String0 generator).

This is a type we created :

newtype Frame inherits Octet_String operators all;
    adding operators ...
endnewtype Frame;

I want to extract data from a frame using :
Data := substring(sdu,24,48) where Data is an Octet_String and sdu a
Frame (for example)

if sdu is of type Frame, I get (using Telelogic Tau SDL-Suite):

Type mismatch for variable, formal_parameter, literal or synonym.
Data := substring(?sdu,24,48)

if I try to cast sdu to Octet_String (Data:=<<Type Octet_String>>
substring(sdu,24,48)) I get the same error message.

What I'd like to do is something like
Data:=substring((Octet_Sring)sdu,24,48).

Does anybody know the SDL equivalent for this ?

Thanks in advance.

    Regards,

    Thomas

--End text from Thomas Garsiot <garsiot#st2e.com> 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