malex wrote:
if you only need to set an attribute to a single current ring -
did you try to access it via basering in accessReferencedRing directly (without references) instead?
hope that helps,
O.
Thanks,
bu my minimal example was insufficient.
In my code I expect that 'attrib' works correctly also for non-active rings.
But I do not want to mixture up the two different issues.
This thread is about references across libraries and in my opinion it is a must -
it is possible to give a myriad of minimal examples, which leads to serious restrictions if references across libraries are not supported.
How should a user manipulate data structures which contains multiple references to the same object?
In case there is an existimg library routine for manipulation of that data, is the user forced to replace all (multiple) references
with hard copies? or has he to copy/ all operations into his own library to be able to use references as parameters ??
What are the arguments not to support or not to allow references across libraries?
Jack
Updated minimal failing example:
system("reference");
proc setAttrib( rng, attrubuteName, attributeVal)
{
attrib( rng, attrubuteName, attributeVal);
}
proc setAttribOfRef( pRngRef, attrubuteName, attributeVal)
{
attrib( pRngRef ,attrubuteName, attributeVal);
}
proc minimalExample()
{
string attributeName = "name";
string attributeVal = "it works!";
ring parentRing = integer,(x,y,z),dp;
ring childRing = integer,(x,y),dp;
setring childRing;
setAttrib( parentRing, attributeName, attributeVal );
if ( attrib( parentRing, attributeName )<> attributeVal )
{
print("setting attrubute by passing ordinary copy failed");
}
else {
print("setting attrubute by passing ordinary copy succeeded");
}
reference rngRef = parentRing;
setAttribOfRef( rngRef,attributeName,attributeVal);
if ( attrib( parentRing, attributeName )<> attributeVal )
{
print("setting attrubute by passing reference failed");
}
else {
print("setting attrubute by passing reference succeeded !");
}
}
minimalExample();