SDL-News: Need help with Choice


Subject: SDL-News: Need help with Choice
From: Yair Lahav (lahavyair#yahoo.com)
Date: Wed Oct 22 2003 - 08:32:36 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 "Yair Lahav" <lahavyair#yahoo.com> to sdlnews -----

Hello Anders,

I am trying to use 'choice' as C union.

I have the following declarations (I am using Cinderella:

SYNTYPE bs_t = Bitstring constants size (24)
ENDSYNTYPE bs_t;

NEWTYPE c_t CHOICE {
        i Integer,
        bs bs_t
} endnewtype;

When initializing this:

        DCL a c_t := bs:'000000000000000000000000'B;

BUT I am getting error when doing this:

        DCL b c_t := i:0;

Q1: Why?
Q2: How can I change the activation of fields?

Another way to do what I need is to convert Bitstring to Integer (or "cast"
...)
Q3: How can I do it?

Thanks in advance,
Yair

------------------------------------
Yair Lahav
lahavyair#yahoo.com
tel: +972 (3) 5346180
mobile: +972 (54) 346180
------------------------------------

--End text from "Yair Lahav" <lahavyair#yahoo.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:50 GMT