An accused who gives evidence at criminal proceedings shall not be asked or required to answer any question tending to show that he has committed or has been convicted of or has been charged with any offence other than the offence with which he is charged, or that he is of bad character, unless—
||he or his legal representative asks any question of any witness with a view to establishing his own good character or he himself gives evidence of his own good character, or the nature or conduct of the defence is such as to involve imputation of the character of the complainant or any other witness for the prosecution;
||he gives evidence against any other person charged with the same offence or an offence in respect of the same facts;
||the proceedings against him are such as are described in section 240 or 241 and the notice under those sections has been given to him; or
||the proof that he has committed or has been convicted of such other offence is admissible evidence to show that he is guilty of the offence with which he is charged.