Grassel Guido NRC/Hki wrote:
> {:Application
> ("orefvar0/startup" 0)
> :Items
> (
> {:ObjectRefVar
> 1
> :InitiallyActive true
> :Shared true
> :OrigValue :ObjectRef 100
> }
> {:ObjectRefVar
> 2
> :InitiallyActive true
> :Shared true
> :OrigValue :ObjectRef
> ("orefvar0/scene1" 100)
>
> // ....
>
> }
>
> {:Scene
> ("orefvar0/scene1" 0)
> :Items
> (
> {:Link
> 10
> :InitiallyActive true
> :Shared false
> :EventSource 0
> :EventType UserInput
> :EventData 15
> :LinkEffect
> (
> :TestVariable (("orefvar0/startup" 1) // target
> 1 // equal
> :GObjectRef ("orefvar0/startup" 2) // comparison value
> )
> }
>
> {:Link
> 11
> :InitiallyActive true
> :Shared false
> :EventSource 1
> :EventType TestEvent
> :EventData True
> :LinkEffect
> (
> // ...
> )
> }
> {:Link
> 12
> :InitiallyActive true
> :Shared false
>
> :EventSource 1
> :EventType TestEvent
> :EventData False
> :LinkEffect
> (
> // ...
> )
> }
> // ....
> }
>
> Question:
> Does Link 11 or Link 12 fire, i.e. what is the result of the TestVaribale
> action in the LinbkEffect of Link 10?
>
> I think the question comes down to asking, is it the scope in which the
> TestVaribale action gets executed, or the scope of the ObjectRefVaribale
> object which determins how the value of object 1 is interpreted, hence what
> does the object reference :ObjectRef 10 mean, ("orefvar0/startup" 100) or
> ("orefvar0/scene" 100)?
I think it is fairly clear that the intended meaning is that the
scope of an ObjectReference is determined by the point at which it
is declared, not when it is used. I tend to regard the object
references without group IDs as merely short-hand versions of the
fully-qualified object reference, filling in the group ID from the
group that textually encloses the definition.
Internally, the engine shouldn't store incomplete object references
as this can lead to ambiguities after scene transitions, so in the
example above, ObjectRefVar 1 should not point to any object, even
if scene1 is active.
Actually, this leads on to something I've been pondering:
comparisions with NULL ObjectRefVars.
The ListGroup GetCellItem action can place NULL in an ObjectRefVar.
The example above declares an invalid initial contents to an
ObjectRefVar, and presumably the same could occur for
ContentRefVars. Section 50.3 and 50.4 seem to indicate that
in these cases the variable contents should be set to NULL.
However, the definitions for ObjectRefVar/ContentRefVar don't
indicate that the Value attribute can take NULL. But also, there
is no way to test a reference against NULL. This seems to be a
significant ommision. Shouldn't TestVariable include an isNull
operator for reference types?
Any opinions?
Richard
-- ----------------------------------------------------------------- Richard Houldsworth, Software Engineer, Philips Research Laboratories, Redhill, Daytime phone number: +44 (0)1293 815052 RH1 5HA E-mail: richardh@prl.research.philips.com