Sections 17.1-612 to 17.1-616, inclusive, shall apply to a person attending as a witness, under a recognizance or summons in a criminal case, as well as to a person attending under a summons in a civil case, except that a person residing out of this Commonwealth, who attends a court therein as a witness, shall be allowed by the court a proper compensation for attendance and travel to and from the place of his abode, the amount of the same to be fixed by the court.
Code 1950, § 19.1-312; 1960, c. 366; 1975, c. 495; 1977, c. 483.