If, on the trial of a person for an offence, it appears that the facts in evidence amount in law to another offence, he or she may notwithstanding be found guilty of and sentenced for the firstmentioned offence, and in that case shall not be liable to be prosecuted for the secondmentioned offence on the same facts but the court may discharge the jury from giving any verdict on the trial, and direct the person to be indicted for the secondmentioned offence.