when the action expressed by the verb began before a particular time in the past and continued up to that time, or stopped just before
it:
|

|
We decided to stop for
the night after we had been walking all day. |
sometimes to express a repeated action in the past perfect:
He had tried five times to catch
his parrot, which had escaped from its cage = He had been trying to
catch his parrot, which had escaped from its cage.