Section 37. If a plaintiff discontinues his action or becomes nonsuit, and another action is afterward commenced for the same cause between the same parties or their respective representatives, depositions lawfully taken for the first action may be used in the second in the same manner and subject to the same conditions and objections as if originally taken for the second action, if the deposition was duly filed in the court in which the first action was pending and has remained in the custody of the court from the termination of the first action until the commencement of the second.