Welcome to Telelogic Product Support
  Home Downloads Knowledgebase Case Tracking Licensing Help Telelogic Passport
Telelogic TAU (steve huntington)
Decrease font size
Increase font size
Topic Title: Unassign an optional element
Topic Summary:
Created On: 7-Nov-2008 22:08
Status: Read Only
Linear : Threading : Single : Branch
Search Topic Search Topic
Topic Tools Topic Tools
Subscribe to this topic Subscribe to this topic
E-mail this topic to someone. E-mail this topic
Bookmark this topic Bookmark this topic
View similar topics View similar topics
View topic in raw text format. Print this topic.
 7-Nov-2008 22:08
User is offline View Users Profile Print this message


HAYSSAM HASSABALLA

Posts: 4
Joined: 30-Jan-2006

Folks,
I am trying to find out how to unassign an optional field in Tau. I can't find it. It's either not there or too obvious. Any help here would be great cause it's Friday

class X
{
Integer [0 .. 1] variable;
}

part X;
X.variable = 1;
//It's now assigned

How can we unassign this so that variablePresent is set to false?
Is there a way to do this in UML?

The only way we can get this is by this
[[#(X).#(variable)->variablePresent = SDL_false;]]

My syntax is not perfect here..just examples.

Thanks,
Hayssam
Report this to a Moderator Report this to a Moderator
 12-Nov-2008 14:32
User is offline View Users Profile Print this message


Brandon Jones

Posts: 20
Joined: 22-Sep-2003

Here is something you can give a try and let us know if it works!

class X
{
Integer [0 .. 1] variable;
-Integer [0..1] unassignedInt;
}

part X;
X.variable = 1;
X.variable = X.unassignedInt; // now it shouldn't be assigned... I think.

_brandon
Report this to a Moderator Report this to a Moderator
 12-Nov-2008 16:05
User is offline View Users Profile Print this message


HAYSSAM HASSABALLA

Posts: 4
Joined: 30-Jan-2006

Hi Brandon.
I tried what you suggested.

That assignment seems to still set the Present field to true in the generated code. And it throws an error because the rhs is unassigned.

We tested this approach and it seems to work:
[[#(X).#(variable)->variablePresent = SDL_false;]]


If you know of an operator or a way to unassign optionals please let us know.

Thanks for the response!
Report this to a Moderator Report this to a Moderator
Statistics
20925 users are registered to the Telelogic TAU forum.
There are currently 0 users logged in.
The most users ever online was 15 on 31-Mar-2008 at 16:22.
There are currently 0 guests browsing this forum, which makes a total of 0 users using this forum.
You have posted 0 messages to this forum. 0 overall.

FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.