
848 S.W.2d 314 (1993)
Manharlal B. SEDANI, Appellant,
v.
The STATE of Texas, Appellee.
No. 01-91-00839-CR.
Court of Appeals of Texas, Houston (1st Dist).
February 11, 1993.
Opinion Overruling Motion for Rehearing March 25, 1993.
Discretionary Review Refused June 9, 1993.
*315 W.E. Herman, III, Humble, for appellant.
John B. Holmes, Jr., Dist. Atty., Karen A. Clark, Larry McDougal, Bill Stradley, Asst. Dist. Attys., Houston, for appellee.
Before SAM BASS, COHEN and JONES, JJ.

OPINION
SAM BASS, Justice.
A jury convicted Manharlal B. Sedani of carrying a handgun, then assessed punishment of 180 days, probated, and a fine of $500. In three points of error, Sedani asserts the trial court erred in overruling his motion to suppress. We sustain his first two points of error, and reverse and remand the judgment.
On January 12, 1991, at about 1:20 a.m., Officer Treat was on patrol in the Montrose area. He observed Sedani make a right turn without a signal. A few blocks later, he observed Sedani drive in two lanes of traffic. Officer Treat stopped Sedani for these offenses. After asking for his license and proof of insurance, Officer Treat noticed Sedani's eyes were red and "real glassy." He asked Sedani to step out and administered a horizontal gaze sobriety test. Officer Treat determined Sedani was not intoxicated. He then wrote two citations for the traffic violations he observed and explained them to Sedani.
Sedani accused Officer Treat of lying and picking on him, and denied committing the violations. He asked Officer Treat what would happen if he didn't sign the citations. Officer Treat advised him that he would be booked and jailed. Sedani "yanked" Officer Treat's clipboard out of his hands and proceeded to sign the citations. He repeatedly told Officer Treat that this was a day the officer would remember and regret in court. Officer Treat gave Sedani his copies of the citations. Sedani "immediately took it and ripped it up into shreds before, before my very eyes and continues his threats of how I'm gonna regret this."
Officer Treat then opened the car door and asked Sedani to step out. He handcuffed Sedani and put him in the back seat of his patrol car. Pursuant to department policy, Officer Treat called his supervisor for authority to arrest Sedani on a class C misdemeanor. Sergeant Crawford arrived at the scene and approved the arrest.
Officer Treat called a wrecker and completed an inventory search of the cabin. He found a white bank bag under the driver's seat with a .38 revolver loaded with six live rounds, some checks, and assorted papers.
We first address Sedani's third point of error attacking the sufficiency of the evidence to support his conviction "where the evidence was insufficient to [sic] a rational trier of fact to have concluded that Officer *316 Treat has probable cause to believe the appellant would not appear in court as required." Sedani argues that Officer Treat needed probable cause to re-arrest him after he tore up his citation. Since the evidence does not support a finding of probable cause, he argues, the arrest was illegal, and the jury should have ignored the gun and acquitted him. The State counters the charge required only a "reasonable belief that appellant would not appear in court" and the evidence was sufficient to support the charge.
When reviewing sufficiency of the evidence on appeal, a reviewing court must view the evidence in the light most favorable to the prosecution and determine whether any rational trier of fact could have found the essential elements of the crime beyond a reasonable doubt. Jackson v. Virginia, 443 U.S. 307, 319, 99 S.Ct. 2781, 2789, 61 L.Ed.2d 560 (1979). The sufficiency of the evidence must be considered from the charge given. Nickerson v. State, 782 S.W.2d 887, 891 (Tex.Crim.App. 1990). If the evidence does not conform to the instructions given, it is insufficient as a matter of law. Id.
Sedani contends Officer Treat needed probable cause to believe the appellant would not appear in court. He cites the following portion of the charge as the measuring stick for sufficiency of the evidence:
Therefore, if you believe that HPD Officer R.G. Treat had a reasonable suspicion to connect the Defendant with activity related to crime or that the Defendant had commited [sic] an offense and if you believe that HPD Officer R.G. Treat had a reasonable belief that the alleged conduct of the Defendant, if any, in tearing up the traffic citation, if at all, issued by HPD Officer R.G. Treat, if at all, and the Defendant stating, if he did, I'll see you in Court, and that said conduct, if at all, warranted Officer R.G. Treat to believe that the Defendant would not appear in court for the traffic citations for which Defendant had been stopped, if at all, then you shall consider the evidence obtained by the officer as a result of the stop and seizure of the Defendant.
If you do not so find beyond a reasonable doubt, or if you have a reasonable doubt as to such matters, you will disregard such evidence derived from said seizure and not consider it as any evidence whatsoever and say be your verdict not guilty.
Thus, Sedani admits the evidence must support a "reasonable belief." Viewing the evidence in a light most favorable to the verdict, a rational factfinder could have concluded that Sedani's act of tearing up the notice gave Officer Treat reasonable belief that Sedani would not appear in court. That is all the charge required the State to prove on that subject. See Boozer v. State, 717 S.W.2d 608, 610-11 (Tex.Crim. App.1984) (sufficiency of the evidence is measured by the charge that was given). Therefore, the evidence was sufficient to support Sedani's conviction.
Point of error three is overruled.
In points of error one and two, Sedani asserts the trial court erred in overruling his motion to suppress the evidence of his handgun, which was required to support his conviction of carrying a handgun. In point of error one, Sedani asserts reversible error because "[a] peace officer must release a motorist arrested for a traffic offense after he secures a written promise to appear in court." In point of error two, he asserts Officer Treat did not have "probable cause to believe appellant would not appear in court." Sedani does not challenge the legality of the initial arrest for traffic violations.
In summary, Sedani argues that he was illegally arrested because Officer Treat did not have the authority to arrest him after he signed the citations. Since Officer Treat did not have authority to arrest him, Officer Treat did not have the authority to conduct an inventory search of his car, incident to the arrest. Without the inventory search, Officer Treat would not have found the handgun, and Sedani would not have been convicted of carrying a handgun.
The State counters Officer Treat had statutory authority to arrest Sedani for traffic violations under Tex.Rev.Civ.Stat. Ann. art. 6701d, § 148(a) (Vernon Supp. *317 1993) 153 (Vernon 1977), and that until he released Sedani, Officer Treat had the option to arrest him instead of issuing citations. Officer Treat testified that he had not released Sedani from custody because he had not yet reviewed with him the time and place for his court appearance according to departmental policy. The State argues that the arrest was legal because Sedani negated his promise to appear by tearing up his copies of the citations and Officer Treat then had reason to believe Sedani would not appear in court. The State does not contend Sedani committed another violation after the copies of the citations were delivered. See Evers v. State, 576 S.W.2d 46 (Tex.Crim.App. [Panel Op.] 1978) (after a traffic citation was given, an "improper start from a parked position" throwing mud and gravel on the police officer and his car was a traffic violation justifying a second arrest and subsequent inventory search).
The trial court is the sole trier of fact at a hearing on a motion to suppress, and as such, it may choose to believe or disbelieve any or all of the witnesses' testimony. Taylor v. State, 604 S.W.2d 175, 177 (Tex.Crim.App. [Panel Op.] 1980). Even if the trial court gives the wrong reason for its ruling on a motion to suppress evidence, this Court will uphold the ruling if it is correct on any theory of law applicable to the case. Calloway v. State, 743 S.W.2d 645, 651-52 (Tex.Crim.App. 1988).
At the end of the hearing on the motion to suppress, the trial court found that Sedani negated his promise to appear by tearing up his citation:
I find that Officer Treat wrote a traffic citation to the defendant Manharlal B. Sedani on or about January 12, 1991 for two violations of the traffic rules and regulations of the State of Texas. I find that Officer Treat told the defendant that the defendant would go to jail if the defendant did not sign the ticket; that is a citation; that the defendant did in fact receive the citation and that the defendant signed the citation; that the defendant Sedani received a true copy of the citation; that the defendant tore the citation in half and stated that the officer would regret his conduct. Thereafter Officer Treat arrested the defendant and placed the defendant into custody. Thereafter Officer Treat inventoried the interior of the automobile. Whereupon a seizure was made of a zipped bank bag which contained amongst other things a.38 caliber weapon, pistol which was loaded with papers and checks. And that I find that Officer Treat then charged the defendant Sedani with the additional charge, the misdemeanor offense of intentionally and knowingly carrying [on] or about his person a hand gun.
The Court's conclusions of law is that I find that had the defendant Sedani not by his own action and conduct ripped up the traffic citation, that any subsequent search based on that fact assuming that fact, then Officer Treat would have no probable cause to invade the interior of the vehicle under the traffic laws pursuant to Section 147 of Article 6701d. However, by the defendant's actions, in his own conduct and Officer Treat's reliance on that conduct, that the defendant negated his promise to appear in court; that the officer then had reason to believe that the defendant would not appear in court. And based on the officer's reason to believe that the defendant would not appear based on the defendant's conduct thereafter in accordance with Section 147-5 of the traffic regulations of Article 6701d, that he then had the right to place Mr. Sedani, the defendant, into custody and thereafter the inventory of the vehicle was indeed authorized under the laws of the state of Texas in the United States.
(Emphasis added.) Section 147(5) provides that a person arrested for a traffic misdemeanor shall be taken immediately before a magistrate, "In any other event when the person arrested refuses to give his written promise to appear in court as hereinafter provided." Tex.Rev.Civ.Stat.Ann. art. 6701d, § 147(5) (Vernon 1977).
Here, Sedani tore up his copies of the citation. Officer Treat retained the *318 original and other copies reflecting Sedani's written promise to appear. Section 149(a) of the act provides a person is guilty of a misdemeanor if he wilfully violates his promise to appear in court. Tex.Rev.Civ. Stat.Ann. art. 6701d, § 149(a) (Vernon 1977). However, as Sedani points out, the court appearance date must be set 10 days after the arrest. Tex.Rev.Civ.Stat.Ann. art. 6701d, § 148(b) (Vernon 1977). Therefore, he could not possibly have violated his promise to appear on the night of his arrest.
Article 6701d, section 148(d), of the Texas Civil Statutes provides:
The arrested person in order to secure release as provided in this section, must give his written promise so to appear in court by signing in duplicate the written notice prepared by the arresting officer. The original of said notice shall be retained by said officer and the copy thereof delivered to the person arrested. Thereupon, said officer shall forthwith release the person arrested, from custody.
Tex.Rev.Civ.Stat.Ann. art. 6701d, § 148(d) (Vernon 1977) (emphasis added).
Thus, whether Sedani was legally detained after the citations were given to him turns on whether the term "shall forthwith release" allows Officer Treat to re-arrest Sedani. The parties do not cite any case on point.
Statutes should be read as a whole and construed to give meaning to every part. Morter v. State, 551 S.W.2d 715, 718 (Tex.Crim.App.1977) (looking to both civil and criminal case law in construing the Penal Code). The issue in determining the meaning of the word "shall" is "what consequences follow a failure to comply." State v. $435,000, 842 S.W.2d 642, 644 (Tex. 1992).
Section 148(a) provides that when a person is arrested for a traffic violation, and is not immediately taken before a magistrate, the officer shall prepare a "written notice to appear." Tex.Rev.Civ.Stat.Ann. art. 6701d, § 148(a) (Vernon Supp.1993). Section 148(b) specifies the appearance must be set at least 10 days after the arrest. Tex.Rev.Civ.Stat.Ann. art. 6701d, § 148(b) (Vernon 1977). Section 148(d) provides that when a copy of the written notice is delivered to the person arrested, the officer shall forthwith release him. Tex.Rev.Civ. Stat.Ann. art. 6701d, § 148(d) (Vernon 1977). The next section, section 148(e), provides for the penalty when an officer does not adhere to this procedure: "Any officer violating any of the provisions of this section shall be guilty of misconduct in office and shall be subject to removal from office." Tex.Rev.Civ.Stat.Ann. art. 6701d, § 148(e) (Vernon 1977). The following section of the act, section 149(a), provides for the penalty when a person willfully violates his written promise to appear: the person is guilty of a misdemeanor. Tex.Rev.Civ. Stat.Ann. art. 6701d, § 149(a) (Vernon 1977).
Construing section 148(d) in the context of the entire statute, we conclude Sedani was illegally detained after he received his copies of the citation. The fact Sedani tore up his citation and did not have notice of the time and place for his court appearance is of no moment. We hold the statute is mandatory because it penalizes an officer who does not follow its provisions. Since the officer had a mandatory obligation to release Sedani, there was no probable cause to hold him after he signed the promise to appear. Cf. Lewis v. State, 664 S.W.2d 345, 351 n. 4 (Tex.Crim.App.1984) (Clinton, J., dissenting). Because the arrest that led police to the handgun was illegal, the handgun must be suppressed. Tex.Code Crim.P.Ann. art. 38.23(a) (Vernon Supp.1993). Points of error one and two are sustained.
The judgment is reversed, and the cause is remanded.
JONES, J., not participating in the opinion.

OPINION ON REHEARING[1]
COHEN, Justice.
On rehearing, the State contends that appellant's arrest was legal because, by *319 dropping some pieces of the torn traffic ticket to the ground, he committed the crime of littering in the officer's presence; thus, the warrantless arrest was justified by Tex.Code Crim.P.Ann. art. 14.01(b) (Vernon 1977). The State concedes that 1) the arresting officer testified at trial that he arrested appellant not for littering, but for totally unrelated reasons, 2) the trial court prosecutor never contended the arrest was justified by littering, but relied on totally unrelated reasons, and 3) the trial court judge did not find the arrest was for littering, but found it was justified for totally unrelated reasons. Nevertheless, the State contends we should overrule appellant's point of error because a trial judge's ruling, if correct, should be upheld even if it was made for the wrong reasons. For this proposition, the State relies on Calloway v. State, 743 S.W.2d 645, 651-52 (Tex.Crim. App.1988).
Calloway is distinguishable. That decision did not grant the State victory on appeal based on a theory totally different from what it claimed in the trial court. The trial judge in Calloway denied a motion to suppress because the defendant had no standing. The judge incorrectly stated there was no standing because Calloway had no proprietary or possessory interest in the house. The defendant correctly argued on appeal that standing is not determined by proprietary or possessory interest, but by whether he reasonably expected privacy in the place searched. The Court of Criminal Appeals held that although the judge used the wrong legal test to decide the standing issue, appellant was not harmed because no evidence showed he had standing under the correct test, i.e., that he had a reasonable expectation of privacy. Id. at 650-51. Thus, the Calloway court did nothing like what the State requests here. It did not uphold a judgment on appeal based on a theory unheard of at trial. On the contrary, the standing issue was litigated in Calloway in the trial court, in the court of appeals, and in the Court of Criminal Appeals. 743 S.W.2d at 646-49.
The court in Calloway concluded its lengthy discussion by stating,
Further it is well established that the mere fact that a correct ruling is given for the wrong reason will not result in a reversal. If the decision is correct on any theory of law applicable to the case it will not be disturbed.
743 S.W.2d at 651-52 (emphasis added).
Thus, the issue is not whether the decision is correct on any theory of law, but whether it is correct on any theory of law applicable to the case. That requirement makes a significant difference in this case. The State's theory of littering is not applicable to the case because it was not raised in the trial court. Both the State and trial judge expressly relied on totally different grounds. If the State believed the littering theory was applicable to the case, it should have said that in the trial court, when it had the burden of proof to justify a warrantless search and when appellant had a right to be heard, to present evidence, and to argue the relevant facts and law.
The Calloway opinion cited six decisions supporting the proposition that a ruling will not be disturbed if it is correct on any theory of law applicable to the case. Like Calloway, none of them allows the State to invent a new theory on appeal totally unrelated to what it argued in the trial court. O'Neal v. State, 491 S.W.2d 130, 131-32 (Tex.Crim.App.1973) (trial court, in rejecting defendant's plea for probation, erroneously stated that defendant was an accomplice, where evidence showed he was a principal); Miles v. State, 488 S.W.2d 790, 792 (Tex.Crim.App.1972) (trial judge incorrectly stated that defendant's statement was admissible as res gestae of the offense, but it was actually res gestae of the arrest); Smith v. State, 475 S.W.2d 238, 239 (Tex.Crim.App.1971) (trial judge incorrectly stated that prior consistent statement was admissible to determine the truth of the witness' testimony, rather than to *320 rehabilitate the witness after impeachment); Venable v. State, 397 S.W.2d 231, 233 (Tex.Crim.App.1965) (trial judge found DWI defendant was guilty for allowing an intoxicated person to drive his car, where the State alleged and proved that fact, as well as that defendant personally drove while intoxicated); Moreno v. State, 170 Tex.Crim. 410, 341 S.W.2d 455, 456 (1960) (trial judge erroneously ruled that search warrants were partially void, but correctly admitted evidence anyway); Parsons v. State, 160 Tex.Crim. 387, 271 S.W.2d 643, 655-56 (1953) (op. on reh'g) (when trial judge struck defendant's motion for continuance because defendant did not personally swear to it, there was no error because defendant never proved what the missing witnesses would have said).
In Parsons, the Court of Criminal Appeals quoted with approval from Helvering v. Gowran, 302 U.S. 238, 245-47, 58 S.Ct. 154, 158, 82 L.Ed. 224 (1937): "In the review of judicial proceedings the rule is settled that, if the decision below is correct, it must be affirmed, although the lower court relied upon a wrong ground or gave a wrong reason." 271 S.W.2d at 655.
While the Helvering court approved and applied the rule, it did so in a way completely different from the way the State would have us rule. Helvering was a tax case. The taxpayer lost in the board of tax appeals, an administrative appeal, and then appealed to the federal circuit court of appeals. 302 U.S. at 240, 58 S.Ct. at 155. At that point in the litigation, the government raised a new theory it had not urged before the board of tax appeals. The taxpayer, however, did not object; instead, he convinced the court of appeals to reject the government's new theory and to rule for him. Id. at 240-41, 58 S.Ct. at 155-56. The government then appealed to the Supreme Court, raising the same theory. At this point, the taxpayer objected that the government had failed to raise this theory in the board of tax appeals. Id. at 245, 58 S.Ct. at 157-58. The Supreme Court held that the government could assert the theory for the first time on appeal, agreed with the government's new theory, and reversed the judgment of the court of appeals. Id. at 245-47, 58 S.Ct. at 157-59. That is not the end of the story, however. Instead of rendering judgment for the government, the supreme court remanded the case to the board of tax appeals, in order to give the taxpayer the "opportunity to establish before the Board additional facts which would affect the result." Id. at 247, 58 S.Ct. at 158. Thus, the taxpayer, Mr. Gowran, did not lose on appeal based on some new theory the government discovered long after he had lost the opportunity to be heard in opposition to it. The State would have us do the opposite of what the Supreme Court did in Helvering. It would have us rule against appellant based on a theory never mentioned in the trial court, without giving appellant the right to be heard. We decline to do so.
There are two reasons why the Calloway line of cases should not be used as the State urges. First, Texas law requires an appellant to state specific grounds for an objection and to state reasons for any ruling or judgment he desires. Tex.R.App.P. 52(a). This requirement enables the trial judge to know the basis for the objection or motion, and it gives the opposing party the same knowledge so that it may present evidence and argue in opposition. When a party is allowed to hide the reasons for its requested relief until the appeal, both purposes are defeated. It is unfair to make a criminal defendant comply with these reasonable requirements, but exempt the State from them. See State v. Gonzales, 850 S.W.2d 672 (Tex.App.San Antonio 1993, no pet. h.) (refusing defendant's request to apply the Calloway rule to affirm an order suppressing evidence based on new grounds not raised in the trial court). The State should not get to keep its theories of the case a secret, while the courts require the defendant to reveal his in open court so that the State may rebut them. Moreover, if the State is to be allowed to raise new theories of law for the first time on appeal, then, at the very least, the defendant who requests it should be given a remand to the trial court, so that, like Mr. Gowran, "he should have the opportunity to establish before the [finder of *321 fact] additional facts which would affect the result." Helvering, 302 U.S. at 247, 58 S.Ct. at 158. Without that opportunity to establish additional facts, a party is denied due process of law because a judgment has been imposed upon it based on secret reasons not revealed until after it has lost the right to be heard.
We hold that neither Calloway nor the cases cited there allow this case to be affirmed based on the State's new theory of littering.
The State's motion for rehearing is overruled.
NOTES
[1]  In order to give the parties the full time periods for seeking further review, we withdraw our earlier order denying without opinion the State's motion for rehearing and substitute this opinion and order.
