![]() |
Telelogic TAU (steve huntington) | ![]() |
Topic Title: Unassign an optional element Topic Summary: Created On: 7-Nov-2008 22:08 Status: Read Only |
Linear : Threading : Single : Branch |
![]() |
![]()
|
![]() |
|
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 |
|
![]() |
|
![]() |
|
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 |
|
![]() |
|
![]() |
|
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! |
|
![]() |
Telelogic TAU
» TAU/Developer
»
Unassign an optional element
|
![]() |
FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.