
104 Ill.2d 369 (1984)
472 N.E.2d 802
J. MICHAEL FITZSIMMONS, State's Attorney, Plaintiff,
v.
CHARLES R. NORGLE, Judge, et al., Defendants.
No. 59749.
Supreme Court of Illinois.
Opinion filed November 30, 1984.
*370 J. Michael Fitzsimmons, State's Attorney, pro se, and Barbara A. Preiner, Assistant State's Attorney, both of Wheaton, for plaintiff.
Thomas E. Callum, of Callum, Anderson & Deitsch, *371 of Wheaton, for defendant Charles R. Norgle.
G. Joseph Weller, Deputy Defender, and John R. Wimmer, Assistant Defender, of the Office of the State Appellate Defender, of Elgin, for defendant Christopher C. Borg.
Writ awarded.
JUSTICE SIMON delivered the opinion of the court:
This original proceeding for mandamus instituted by the State's Attorney of Du Page County calls for the interpretation and application of section 5-5-3(c)(2) of the Unified Code of Corrections (Ill. Rev. Stat. 1981, ch. 38, par. 1005-5-3(c)(2)). That statute precludes probation as a sentence where the defendant is guilty of various felonies, including "[a] Class 2 or greater felony if the offender had been convicted of a Class 2 or greater felony within ten years of the date on which he committed the offense for which he is being sentenced." (Ill. Rev. Stat. 1981, ch. 38, par. 1005-5-3(c)(2)(F).) In such situations, the statute directs that the offender be sentenced to not less than the minimum term of imprisonment set forth in the Unified Code of Corrections for the particular felony.
The State relies on People ex rel. Carey v. Bentivenga (1981), 83 Ill.2d 537, in which this court held that probation was an inappropriate sentence for a defendant who was twice convicted of a Class 2 felony. The defendant suggests that a distinction exists between the rule set out in Bentivenga and the facts in this case, but we do not find this distinction meaningful. In Bentivenga, the offender was an adult at the time of both of his convictions, while the defendant in this case, Christopher C. Borg, was 14 years old when he committed the earlier offense and was transferred by the juvenile court to be tried as an adult under the criminal code. He pleaded guilty to burglary, a Class 2 felony, was sentenced *372 to the Department of Corrections for 6 to 18 years, was paroled after confinement in juvenile detention facilities for 3 years and 8 months and was satisfactorily discharged from parole. In 1981, Borg, by then an adult, entered a guilty plea in the circuit court of Du Page County to another burglary charge.
In the circuit court, after Borg had pleaded guilty after listening to the court's admonishments, which included the possibility of probation, the State contended that, because Borg had been convicted of a Class 2 felony within 10 years of the date of the 1981 offense, the statute referred to above made him ineligible for probation. The circuit judge, Charles R. Norgle, ruled that, because the earlier conviction occurred while Borg was a juvenile, the first conviction was not the type that the statute contemplated as foreclosing probation. He thereupon imposed a sentence of probation. We allowed the State's motion for leave to file a petition for a writ of mandamus to require the circuit judge to vacate the sentence of probation and sentence Borg to a prison term.
This case presents a problem of statutory interpretation requiring us to determine whether the prior conviction required to bring section 5-5-3(c)(2)(F) into play encompasses a conviction under the criminal code while the offender was a juvenile. Conviction is defined in the same way in the general definitions to both the Criminal Code of 1961 and in the Unified Code of Corrections:
"`Conviction' means a judgment of conviction or sentence entered upon a plea of guilty or upon a verdict or finding of guilty of an offense, rendered by a legally constituted jury or by a court of competent jurisdiction authorized to try the case without a jury." (Ill. Rev. Stat. 1981, ch. 38, pars. 2-5, 1005-1-5.)
No distinction is drawn between convictions rendered while the defendant was a juvenile and those which occur after the defendant is no longer subject to the authority *373 of the juvenile court. Following the plain-meaning rule  the first test for statutory interpretation (see, e.g., People v. Brown (1982), 92 Ill.2d 248, 255)  the conviction of Borg while a juvenile in adult court serves as a conviction within 10 years of the second offense. Therefore, the circuit court erred in sentencing Borg to probation.
Borg contends that had it not been for his transfer by a juvenile judge for prosecution under the criminal laws pursuant to the authority of section 2-7(3) of the Juvenile Court Act (Ill. Rev. Stat. 1981, ch. 37, par. 702-7(3)), he would have been eligible for probation. The use of section 5-5-3(c)(2)(F) to preclude probation for Borg results in a double enhancement of a penalty because, according to him, section 2-7(3) of the Juvenile Court Act is an enhancing statute as is section 5-5-3(c)(2)(F) of the Code of Corrections. Therefore, Borg argues, the legislature could not have intended this result.
It is true, of course, that it is "the function of the courts to ascertain and give effect to the intent of the legislature, arriving at such intention not only from the language employed in the legislation, but also from the reason and necessity for the law, the evils to be remedied, and the objects and purposes to be obtained" (Mid-South Chemical Corp. v. Carpentier (1958), 14 Ill.2d 514, 517; see also People ex rel. Cason v. Ring (1968), 41 Ill.2d 305, 309-10; People ex rel. Roan v. Wilson (1950), 405 Ill. 122, 127-28). This rule of statutory interpretation only applies, though, when the statute construed is ambiguous. (See People v. Alejos (1983), 97 Ill.2d 502, 511.) In this case, section 5-5-3(c)(2)(F) plainly states that a conviction within 10 years of the prior conviction precludes probation. The statutory definition of conviction set forth above would clearly include Borg's first offense even though he was a juvenile tried in adult court.
Additionally, this court's recent treatment of double-enhancement *374 provisions  People v. McCarty (1983), 94 Ill.2d 28, 35; People v. Hobbs (1981), 86 Ill.2d 242, 246; People v. Haron (1981), 85 Ill.2d 261, 277  does not conflict with the conclusion we reach. These opinions stand for the proposition that the law does not permit a double enhancement of a penalty without a clear indication of a legislative intent to accomplish that result, and that the slightest ambiguity in any statute which calls for double enhancement requires the application of a rule of lenity and construction of the statute strictly in favor of the defendant. (See People v. Hobbs (1981), 86 Ill.2d 242, 246.) In this case, because the statute's meaning is clear and unambiguous, those precedents are not applicable. The fact that the penalty imposed may be the result of a double enhancement has no bearing on the construction of the plain meaning of the statute.
Finally, defendant contends that application of section 5-5-3(c)(2)(F) would violate due process. This argument rests on the belief that this section is ambiguous and does not afford the defendant proper notice of the consequences of moving from juvenile to adult court. Having determined that the statute clearly applies to Borg's situation, his due process rights were not violated. The statute gave him adequate notice.
The writ sought is therefore granted with instructions to the circuit court to allow the defendant to withdraw his plea of guilty prior to sentencing, if he so chooses, because the admonition to the defendant suggested that he might be eligible for probation and his plea was based on that admonition. As we now hold that admonition improper, we must allow the defendant the option to withdraw his previous plea.
Writ awarded.
