func Begin() { RecNum = 1; /* initialize a couple of counter */ Traces = 1; } func OnLineHeader() /* read line header */ { output(LH); /* write out the line header */ } func OnTrace() /* read each trace */ { Tr.RecNum = RecNum; /* get the record number */ output(Tr); /* write out the trace */ if(Traces%481)==0){ /* if the trace counter reaches a multiple of 481 */ ++RecNum; /* increase the record counter by 1 */ } Traces++; /* whatever happens increase trace counter by 1 */ }