The issue presented is whether mandamus is available to plaintiff to direct defendant Trustees to reconsider his application for service-connected disability retirement benefits after defendant Trustees denied plaintiff’s application on June 6,1991. Can the petition for writ of mandamus withstand defendant’s demurrer?
A brief redaction of the facts relating to the issue follows.
Plaintiff began employment with the Arlington County, Virginia, Fire Department as a firefighter in or about July, 1978. On or about January 21, 1988, plaintiff was involved in a work-related traffic accident and sustained physical injuries to his back and other areas of his body. Thereafter, plaintiff continued to work while undergoing physical therapy. Plaintiff alleges in his Bill of Complaint that the effects of his injuries were exacerbated, forcing him to miss various periods of work over the next two years. He stopped working altogether as an Arlington County firefighter on or about December 21, 1988. In 1990 and 1991, plaintiff was examined by several physicians who concluded that due to the physical injuries he sustained in January, 1988, plaintiff'was no longer capable of performing the duties required of an Arlington County firefighter.
Plaintiff became eligible in 1978 and thereafter filed a written application seeking service-connected disability retirement benefits pursuant to § 21-45 of the Arlington County Code, which states in part:
*167(a) Permanent disability. Any member in service or on authorized leave without pay may at any time retire on account of service-connected disability that is not due to the employee’s willful misconduct if he is permanently disabled for duty, upon written application to the board made by the member ....
At a regular monthly meeting on March 7, 1991, defendant Trustees considered plaintiff’s application for service-connected disability retirement benefits. In lieu of making a decision, defendant Trustee adopted a motion to have plaintiff examined by an accredited pain specialist so that they could be better informed about plaintiff’s condition before acting on his application. Pursuant to vested authority, the staff Administrator arranged for plaintiff to be examined by a physician at Work Rehab Center. Plaintiff contends that the Work Rehab Center physician was appointed as the sixth (temporary) member of the retirement system’s Medical Examining Board in accordance with the § 21-10, et seq. of the Arlington County Code.
The physician at Work Rehab Center submitted a written report to the Administrator of the retirement system on May 10,1991, and on June 6,1991, a majority of defendant Trustees voted to deny plaintiff’s application.
Plaintiff contends that defendant’s action was taken without actually considering the medical opinion of the Work Rehab center physician since defendants believed they were legally prohibited from following that opinion.
Plaintiff further argues that defendant Trustees violated the express mandate contained in § 21-22 of the Arlington County Code by failing to choose between conflicting medical opinions of duly-appointed physicians of the Medical Examining Board. Instead, they only considered the opinion of one such physician.
The defendant, The Board of Trustees of the Arlington county Employees’ Supplemental Retirement System I, demurred. On November 1,1991, both parties presented argument on the demurrer to the Court. The Court has carefully considered the arguments of counsel and memoranda of law and sustains the demurrer.
The Demurrer admits the truth of all material facts that are properly pleaded. The facts admitted as those expressly alleged, those which are impliedly alleged, and those which may be fairly and *168justly inferred from the facts alleged. Bowman v. State Bank of Keysville, 229 Va. 534, 331 S.E.2d 797 (1985). A demurrer tests the legal sufficiency of the motion for judgment. The trial court is confined to the facts alleged when analyzing the pleadings; no consideration properly can be given to additional facts that may be asserted on brief or during oral argument. Elliott v. Shore Stop, Inc., 238 Va. 237 (1989).
Section 21-22 of the Arlington County Code states:
(a) The board shall designate six (6) physicians who shall be known as the “medical examining board.” Unless otherwise directed by the board, one (1) physician shall be assigned to a member’s case pursuant to regulation established by the board, and the physician shall conduct medical examinations required under the provisions of this chapter and shall investigate all essential statements and certificates by or on behalf of a member in connection with application for disability retirement. The physician of the medical examining board assigned to a case shall report in writing to the board his or her conclusions and recommendations upon all matters referred to the physician.
(b) In the event that there is a disagreement between the medical opinions of the physicians of the medical examining board, the board of trustees shall determine which medical opinion it shall follow.
Section 21-22 provides the mechanics and procedure for a member in service to have his claim considered and acted upon pursuant to all sections of the relevant Arlington County Code. Whether Dr. Marath was or was not a member of the Medical Examining Board is not crucial to a determination of the demurrer. A demurrer admits the truth of all material facts that are properly pleaded. Bowman v. State Bank of Keysville, supra.
In order for mandamus to issue, a clear right to the relief sought must be demonstrated. Plaintiff has exercised his right and the Retirement Board has already acted in denying his application for service-connected disability retirement. Mandamus is to be applied prospectively only; it will not be granted to undo an act already done. Richlands Medical Association v. Commonwealth, 230 Va. 384, 387 (1985). As such, mandamus may not be used to revise the Retirement Board’s decision.
*169Mandamus is an extraordinary remedy used to compel a public official to perform a purely ministerial act imposed upon him by law. A ministerial act is one which a person performs in obedience to the mandate of legal authority, without regard to, or the exercise of, his own judgment upon the propriety of the act being done. When a public official is vested with discretion or judgment, his actions are not subject to review by mandamus. The trial court exceeds its function and usurps the authority granted to a public official when it undertakes such review.
The function of a trial court in a mandamus proceeding is to “command and execute, and not to inquire and adjudicate.” Richlands Medical Association v. Commonwealth, supra, quoting Railroad Co. v. Fugate, 206 Va. 159, 164, 142 S.E.2d 546, 550 (1965). “Where the official duty in question involves the necessity on the part of the officer of making some investigation, and of examining evidence and forming his judgment thereon,” mandamus will not lie.
“One of the marked characteristics of a proceeding by mandamus is that if the functionary whose conduct is complained of is by law to exercise any discretion, that discretion will not be controlled by a writ of mandamus; for that would be to transfer the discretion which the law commits to the functionary to the court which undertakes to award the writ.” Broaddus v. Supervisor, 99 Va. 370, 372, 38 S.E. 177, 178 (1901). Mandamus will not lie to control manners in which public official exercises discretion. Funeral Directors’ Association v. Groth, 202 Va. 792, 120 S.E.2d 467 (1961).
The extraordinary remedy of mandamus may not be used as a substitute for an appeal. Moon’s Administration v. Welford, Judge, 84 Va. 34, 4 S.E. 572 (1887). Mandamus “lies to compel, not to revise or correct action, however erroneous it may have been, and is not like a writ of error on appeal, which is a remedy for erroneous decisions.” Board of Supervisors v. Combs, 160 Va. 487 at 498, 169 S.E. 589 at 593 (1933).