A defendant who received probation under a plea bargain resulting in dismissal of charges and later violates that probation and is ordered to serve time in jail cannot argue on appeal that he was entitled to treatment under Proposition 36. In exchange for dismissal of a charge of resisting an officer, defendant pled no contest to cocaine possession and entered a Harvey waiver and waived his right to appeal. He was placed on probation with a 90-day jail term; he later violated probation and was reinstated on condition that he serve a 120-day jail term. He appealed, arguing that he should have been sentenced to drug treatment under Proposition 36. The Court of Appeal rejected the argument, holding that even if the trial court acted in excess of its jurisdiction in ordering him to serve a jail term, the plea agreement and the original appellate waiver waived his right to challenge the sentence on appeal.