7. Every order made under section 4 or section 5, by the High Court or a Magistrate's Court, for the detention of a person in a Training School, shall be deemed to be a conviction, sentence or order or a judgment or final order pronounced by that court within the meaning of section 320 or section 331, as the case may be, of the Code of Criminal Procedure Act; and the provisions of Chapter XXVIII of that Act shall apply accordingly. *Application of Chapter XXVIII of the Code of Criminal Procedure Act to orders for detention.*