...
Code Block |
---|
|
try
...
catch ex
if ex.optionalMember ~= Ice.Unset
fprintf('optionalMember = %s\n', ex.optionalMember);
else
fprintf('optionalMember is unset\n');
end
end |
The Ice.Unset
marker value has different semantics than an empty array. Since an empty array is a legal value for certain Slice types, the Ice run time requires a separate marker value so that it can determine whether an optional value is set. An optional value set to an empty array is considered to be set. If you need to distinguish between an unset value and a value set to an empty array, you can do so as follows:
Code Block |
---|
|
try
...
catch ex
if ex.optionalMember == Ice.Unset
fprintf('optionalMember is unset\n');
elseif isempty(ex.optionalMember)
fprintf('optionalMember is empty\n');
else
fprintf('optionalMember = %s\n', ex.optionalMember);
end
end |
...