
199 Va. 727 (1958)
W. FRANK SMYTH, JR., SUPERINTENDENT, &C.
v.
WILLIAM G. MIDGETT.
Record No. 4746.
Supreme Court of Virginia.
January 20, 1958.
Thomas M. Miller, Assistant Attorney General (Kenneth C. Patty, Attorney General,    on brief), for the plaintiff in error.
on brief), for the defendant in error.
Present, Hudgins, C.J., and Eggleston, Spratley, Buchanan, Whittle and
1.  Where the record on appeal was sufficient for the Court to pass on the question of law raised, the writ of error would not be dismissed for failure to include in the record a transcript of the evidence.  All questions of fact resolved by the court below would, however, be taken as conclusively settled.
2.     Habeas corpus    is a writ of inquiry granted to determine whether a person is being illegally detained and cannot be used in place of a writ of error or to secure determination of a question which, even though determined in the prisoner's favor, could not affect the lawfulness of his immediate detention.
3.  Midgett was sentenced to two years confinement on each of eight indictments, sentences to run consecutively.  While serving the fourth sentence he brought    habeas corpus    proceedings in which it was held the convictions were void.  The court, having found that Midgett had served more than three years under the void sentences, ordered the time so served to be credited against three one year sentences for escape, hence that he be released.  This was error.  The court lacked jurisdiction to determine the validity of the sentences already served.  A prisoner detained under a valid sentence is not entitled to credit for time served on a void sentence fully served before the proceeding for writ of    habeas corpus    is instituted.
Writ of error to an order of the Hustings Court of the city of Richmond, Part II.  Hon. M. Ray Doubles, judge presiding. The opinion states the case.
Frederick T. Gray (T. Brooke Howard; Williams, Mullen, Pollard & Rogers,
HUDGINS
HUDGINS, C.J., delivered the opinion of the court.
On July 13, 1942, William G. Midgett, hereinafter designated petitioner, was convicted in the Circuit Court of Princess Anne County on eight indictments, six charged him with grand larceny and two with housebreaking.  He was sentenced on each indictment to two years' confinement in the penitentiary, the sentences to run consecutively, making his total period of confinement 16 years.
On March 20, 1956, petitioner filed a petition in the lower court for a writ of    habeas corpus    against W. Frank Smyth, Jr., Superintendent of the State Penitentiary, hereinafter designated respondent.  It was alleged in the petition that the eight judgments of conviction, pronounced against petitioner by the Circuit Court of Princess Anne County, were invalid because in each of the eight trials he was denied rights guaranteed him by the Fifth and Fourteenth Amendments to the Federal Constitution.
The lower court entered an order requiring respondent to show cause why a writ of    habeas corpus    should not be entered.  Respondent answered the rule to show cause and after a writ of    habeas corpus    had been issued, filed an additional answer, together with certain exhibits, denying that any of the eight convictions pronounced against petitioner by the Circuit Court of Princess Anne County was void.  The exhibits included the following report of Curtis R. Mann, Director of the Bureau of Records and Criminal Identification:
"Re:  William C. Midgett, Va. Pen. #46994"
"The six (6)  Grand Larceny charges, the two (2) Housebreaking charges, and the three (3) Escape charges expired or will expire in the following manner: TABLE OMITTED $729"
The lower court heard the evidence introduced by the respective parties on the issues raised by the pleadings and entered an order releasing petitioner from custody.  From that order respondent obtained this writ of error.
  At the threshold of the case we are confronted with petitioner's motion to dismiss the writ of error on the ground that respondent did not have the evidence introduced at the hearing transcribed and made a part of the record before this Court.
When the evidence introduced in the lower court is not made a part of the record on appeal, all questions of fact resolved by that court must be accepted as conclusive.  But this Court will consider any question of law properly raised as to matters appearing on the face of the record.  In this case the record consists of the pleadings, exhibits filed therewith and the orders of the lower court, which record is sufficient for the Court to pass on the questions of law raised by respondent.  The motion to dismiss is overruled.
The court stated in its order that, "* * * it appearing from the exhibit filed with the petition [answer] that the petitioner has been three times convicted of escape and sentenced to a term of one year in the Virginia State Penitentiary for each such offense and it further appearing from said exhibit that subsequent to the date of each such conviction the petitioner has served at least one year's confinement in said institution allegedly upon a conviction declared void by this order, the Court doth ADJUDGE, ORDER and DECREE that the several trials had on July 13, 1942, in the Circuit Court of Princess Anne County are null and void and that the petitioner has served sufficient time to satisfy each of the said escape convictions and should be credited with time served subsequent to such convictions and the respondent is therefore ordered to release the petitioner from custody; * * *."
The legal question presented is whether a court has jurisdiction in a habeas corpus    proceeding to give a prisoner credit on valid sentences, *730  which he had not begun to serve when the petition was filed, for time he had served on void sentences.
     Habeas corpus    is a writ of inquiry granted to determine whether a person is illegally detained.  Code, | 8-596.  It can not be used to perform the function of an appeal or writ of error, to review errors, or to modify or revise a judgment of conviction pronounced by a court of competent jurisdiction.  It can not be used to secure a judicial determination of any question which, even if determined in the prisoner's favor, could not affect the lawfulness of his immediate custody and detention.  In other words, a prisoner is entitled to immediate release by    habeas corpus    if he is presently restrained of his liberty without warrant of law.     Buchanan     Buchanan,    170 Va. 458, 197 S.E. 426; 9 Michie's Jur., Habeas Corpus, | 14, p. 316 and cases there cited; 25 Am. Jur., Habeas Corpus, | 55, p. 184; 10 Va. & W. Va. Digest, Habeas Corpus, | 1, p. 475.
A person convicted on a criminal charge is entitled to have deducted from his sentence of confinement all time actually spent by him in jail or in the penitentiary awaiting trial, or pending an appeal of that conviction.  "No such credit, however, shall be given to any person who shall break jail or escape." Code, | 53-208;    Hale     Commonwealth,    137 Va. 774, 119 S.E. 49.  See Stonebreaker     Smyth,    187 Va. 250, 46 S.E.2d 406.
  A court does not have jurisdiction to determine the validity of a sentence under which the prisoner is not being detained.  It follows that where a prisoner is being detained under a valid sentence he is not entitled to credit for time served on a void sentence fully served before the proceeding for writ of    habeas corpus    is instituted.     McDorman     Smyth,    187 Va. 522, 47 S.E.2d 441;    Smyth     Holland,    199 Va. 92, 97 S.E.2d 745.  However, he may attack in a    habeas corpus    proceeding the validity of a sentence he has completely served when he is detained under Code, | 53-296 as a repeater.  And if he is being detained under a void sentence, he is entitled to credit for the time served under such sentence on a valid sentence, or sentences, entered against him prior to the time he began serving the void sentence.     Fitzgerald Smyth,    194 Va. 681, 74 S.E.2d 810;    McDorman     Smyth,    188 Va. 474, 50 S.E.2d 423.
The facts in the    Holland    case,    supra,    were that Holland, the prisoner, had been convicted of three felonies, two by the Corporation Court of the City of Norfolk in January 1935, one of which was for armed robbery, and sentenced to confinement in the penitentiary *731 for a period of 25 years, and the other for theft of an automobile for which he was sentenced to serve one year in the penitentiary, making a total of 26 years.  On March 5, 1935, Holland was tried in the Corporation Court of the City of Danville upon an indictment charging grand larceny and sentenced to six years in the penitentiary.  On December 5, 1955, he filed a petition in the lower court for a writ of    habeas corpus    on the ground that the three judgments of conviction were void.  It appeared from the answer filed to the petition that Holland had fully served the two sentences imposed on him by the Corporation Court of the City of Norfolk and that he was then serving the six year sentence imposed by the Corporation Court of the City of Danville.  The lower court in its order held that the judgment of conviction for armed robbery in the Corporation Court of the City of Norfolk was void and that the time served thereunder by Holland should be credited upon the valid conviction pronounced against him by the Corporation Court of the City of Danville, which he was then serving.  In reversing this order, Mr. Justice Spratley, speaking for the Court, said:
"We find no statute or authority, nor have we been cited to any, which authorized or empowered the Hustings Court of the City of Richmond, Part II, to order that the time of the sentence for armed robbery, fully served by the petitioner, prior to the institution of this proceeding, be credited as served upon other sentences, under which he is being presently held in custody."  199 Va., at page 99.
In    McDorman     Smyth,    188 Va. 474,    supra,    McDorman, the prisoner, in a    habeas corpus    proceeding attacked the validity of a sentence pronounced against him on March 9, 1932, as a third offender which he began serving on May 24, 1948.  His attack was based on the ground that while he had fully served the time imposed upon him by the former convictions, each of two convictions for housebreaking was void.  The Commonwealth conceded that if either of these two convictions was void then the conviction as a third offender was likewise void.  We held that the first conviction of McDorman for housebreaking was void and therefore his conviction as a third offender was also void.  There was pending against him a valid conviction whereby he was sentenced to one year in the penitentiary for escape that he had not begun to serve.  In holding that McDorman was entitled to credit on his escape conviction for time served under the void third offender conviction for which he was then being held, we said:  *732 
"We conclude that while petitioner is entitled to be released from custody under the sentence of March 9, 1932, he is not entitled to be released from detention until he has completed the sentence of one year imposed on him on March 12, 1947.  However, on the last mentioned sentence, he should receive proper credit for the time he has served since May 24, 1948, the expiration of the valid sentence for which he had been held, and allowance for good conduct if, under pertinent rules and regulations of State authorities, he is entitled to such credit.  It is so ordered."  188 Va., at page 484.
Where it appears from judgments of conviction that different sentences are to run consecutively, and not concurrently, a prisoner serves only one sentence at a time.  From the exhibit filed with respondent's answer and the order of the court, it appears that petitioner had completely served three of the sentences imposed for grand larceny and that the third sentence expired on May 2, 1955. When the petition for writ of    habeas corpus    was filed on March 20, 1956, petitioner was being detained under the fourth conviction for grand larceny, which began to run on May 3, 1955 and was due to expire on September 2, 1956.
The lower court did not have jurisdiction in this proceeding to determine the validity of the three convictions that petitioner had completely served before filing his petition.  It follows that the lower court erred insofar as it gave petitioner credit for the time served under the completed sentences. However, petitioner is entitled to credit on the three valid escape convictions for the time served since May 2, 1955, the date he began serving the void sentence under which he was being detained at the time he filed his petition for a writ of    habeas corpus.     In other words, when the lower court determined that petitioner was being detained under a void conviction he was entitled to his immediate release from custody on that sentence.  But when respondent proved that there were other valid sentences which petitioner had not served, he was not entitled to be released until these had been served, or unless he had served sufficient time under the void sentence that began on May 3, 1955 to satisfy the valid sentences.
Since it appears from the order of the court that it gave petitioner credit on his valid convictions for time served under the convictions that had been completely served prior to March 20, 1956, the date of filing his petition, the order will be modified by disallowing this credit, and the case remanded for the lower court to determine the *733 proper credit to be given for the time served by petitioner since May 2, 1955, including allowance for good conduct time to which he may be entitled.  If such credit is sufficient to satisfy the three convictions for escape, petitioner should be released forthwith from custody thereunder.  It is so ordered.
Modified and remanded.
