#include #include void generate_footer(char *left, char *center, int cols) { int center_len,center_count,i,right_count; printf("1000 REM ************\n"); printf("1001 REM PRINT FOOTER\n"); printf("1002 REM ************\n"); /* make text black on white; move to bottom line */ printf("1003 INVERSE : VTAB 24\n"); printf("1005 X$=STR$(P%%)+\"/\":X$=X$+STR$(TP%%)\n"); printf("1007 L%%=LEN(X$)\n"); printf("1010 PRINT \"%s",left); center_len=strlen(center); center_count=(cols-center_len)/2; center_count-=strlen(left); if (center_count<0) { fprintf(stderr,"Error! can't fit text in footer\n"); center_count=0; } for(i=0;i