Update to fcn tprint:

allow multiple printouts in a single simulation run,
without overwriting the previous printout.
This commit is contained in:
Holger Vogt 2023-01-04 22:44:16 +01:00
parent 1a50ca33cd
commit e8eae7aa85
1 changed files with 5 additions and 2 deletions

View File

@ -7006,9 +7006,12 @@ static void inp_poly_err(struct card *card)
void tprint(struct card *t)
{
struct card *tmp;
static int npr;
char outfile[100];
sprintf(outfile, "tprint-out%d.txt", npr);
npr++;
/*debug: print into file*/
FILE *fd = fopen("tprint-out.txt", "w");
FILE *fd = fopen(outfile, "w");
for (tmp = t; tmp; tmp = tmp->nextcard)
if (*(tmp->line) != '*')
fprintf(fd, "%6d %6d %s\n", tmp->linenum_orig, tmp->linenum,