In grammar, the past perfect progressive is a verb form that indicates an action that went on for a period of time before another event took place. It is also called the past perfect continuous. In English, the past perfect progressive is formed by "had been" plus the progressive participle, as in "had been singing."
English verbs can have both a tense, which tells when an action happened, and an aspect, which indicates the type of action. Strictly speaking, the only two English tenses are present and past; all other indicators of time are formed with auxiliary verbs or through verb aspect. The two English verb aspects are perfect and progressive. "Perfect" refers to a completed action, while "progressive" means that an action continues over a period of time. As the name suggests, the past perfect progressive is in the past tense, and it combines both aspects, perfect and progressive.
The past perfect progressive is often found in sentences with two clauses. One of the clauses is usually in the simple past tense, meaning that it has no aspect. For example, "John had been running for an hour before he fell" contains the past perfect progressive "had been running" and the simple past "fell." This indicates that the action of running was progressive, meaning that it happened over a period of time, but that it was perfected or completed at the time when another action — falling — happened. The clauses could also be reversed, as in, "Before he fell, John had been running for an hour."
Like other verb forms, the past perfect progressive can also be formed in the negative or inverted to a question. To form a negative, the word "not" is inserted between "had" and "been": "John had not been running long before he fell." The question form, "Had John been running long?" is made by putting the subject — in this case "John" — between "had" and "been."