The main purpose of Article 8 of the Code of Criminal Procedure is to avoid the problems of several courts having jurisdiction over the same case. Based on the petition, having been prosecuted for grand larceny in County X, A later committed larceny in County Y. There is no issue of whether this Article should apply since the public prosecution in County Y was not relevant to the case in County X*s court. If the court in County Y is the lexi fori of the defendant, in accordance with Article 5 of the same Code, it may combine and try A*s previous, untried criminal act in County X [with the present case]. Once the judgment [in County Y] is affirmed, the court in County X should then issue a dismissal judgment in accordance with Article 294, Section 1, of the same Act.