//    Instruction Example :      mesh.light.assign (objectid,objectid)

    Screen.Resolution.Set(512, 384)

        Screen.Set(BACK)
          Pattern.Display("avo\bubble.gif")
    Screen.End()

        @camera   = Camera.Create(0.0, 0.0, -100.0, 0.0, 0.0, 0.0)

        @viewport = Viewport.Create()
        Viewport.Camera.Set(@viewport, @camera)

        @light    = Light.Omni.Create(100.0, 0.0, -100.0)
        Light.Color.Set(@light, 255, 0, 0)

        @light2   = Light.Omni.Create(-100.0, 0.0, -100.0)
        Light.Color.Set(@light2, 64, 192, 0)

    Mesh.Rotation.Stack(-30, 30, 0)
        @mesh = Mesh.Cube.Create(40)
        Mesh.Light.Assign(@mesh, @light)

        Mesh.Display(@mesh)
        Viewport.Display(@viewport)

        Screen.Set(FRONT)
          Text.Display("Press a key to assign another light to the mesh.", CENTER, 10)
        Keyboard.Wait()
          Mesh.Light.Assign(@mesh, @light2)
        Box.Fill.Select()
        Box.Clear(0, 10, 512, 10)
          Text.Display("Press a key to exit.", CENTER, 350)
        Keyboard.Wait()
    Screen.End()

        Mesh.Kill(@mesh)
        Light.Kill(@light2)
        Light.Kill(@light)
        Viewport.Kill(@viewport)
        Camera.Kill(@camera)
    Script.Stop()