Object References

Ian Medland (Ian.Medland@s-and-t.com)
Thu, 24 Dec 1998 10:34:55 +0000

I understand it is Christmas Eve, so let's bash this about for a while.

A code snippet:

****** application *******

{:Application
( '~/startup' 0 )
:Items (
{:ObjectRefVar
103
:Shared true
:OrigValue :ObjectRef ( '~/scene1.mhg' 23 )
}
{:Link
1
:EventSource 0
:EventType IsRunning
:LinkEffect (
:TransitionTo (( '~/scene1.mhg' 0 ) )
)
}
)
}

********** scene ***************

{:Scene
( '~/scene1.mhg' 0 )
:Items (
{:Text
23
:CHook 1001
:OrigContent '-'
:OrigBoxSize 585 30
:OrigPosition 260 300
:FontAttributes 'plain.24.30.0'
}
{:ObjectRefVar
103
:OrigValue :ObjectRef 0
}
{:Link
1010
:EventSource 0
:EventType IsRunning
:LinkEffect (
// ObjectRef
:SetVariable ( 103 :GObjectRef :IndirectRef ( "~/startup" 103 ) )
:SetData ( :IndirectRef 103 'ObjectRef' )
)
}
)
:InputEventReg 1
:SceneCS 720 576
}

You should be able to see the logic of the code:
- The application has an objectrefvariable that holds the reference to a
text object in a scene. Note that the reference is to an object that is
out of scope at this time.
- When we transition to the scene we put the value of this variable into
a variable in the scene (103). We then use this as an indirect target to
change the content of the target. The value is now a target that is in
scope.

What is at issue is the requirements that an object reference variable
hold at all times a valid reference.

It could be argued that the variable in the application can not hold a
reference to an object that is not in scope (hence it can only hold
references to objects in the application or current scene) - to do
otherwise is not valid.

Otherwise it could be suggested that references are "dumb". They are
just placeholders. As long as the reference is syntacticaly correct this
is enough. IF the reference is then used to target a non existant object
- well that's a different matter altogether.

Can people confirm the validity of this code or argue against it please
(the more votes the better).

I'm sorry that some of us have gone round this before, but in the spirit
of MHEG I am trying to get the group consensus. It has been suggested
that the spec is not suitably strict about this.

Oh, and have a great Christmas too :-)
Ian

-- 
Ian Medland - Senior Software Engineer : Strategy & Technology Ltd.

Email: Ian.Medland@s-and-t.com Tel: +44 117 950 0634, Fax: +44 117 950 0727, GSM: +44 468 426 326