Category : Files from Magazines
Archive   : WDMAR92.ZIP
Filename : 3N03063B

 
Output of file : 3N03063B contained in archive : WDMAR92.ZIP
/* SPINNER.C */
/* S. Van Dyke, AFAB Ent. */
/* 7918 N. Central */
/* K.C., Mo. 64118 */

/* Spinning cursor for long, quiet applications */

#include
#include /* if following example 2 */

#define BACKSPACE 8 /* BackSpace character */

void main(void)
{
char spinner[] = {"\\|/-"}; /* '\\' yields '\' */
int spinpos;
int i, nrecs;

clrscr();
printf("Spinning cursor demo program\n");

/* Example 1 */
/* For applications that do not print to the screen */

spinpos = 0; /* reset spinner */
printf("Working %c%c", spinner[spinpos++], BACKSPACE);
spinpos &= 0x03; /* limit to valid characters */

for (i=0; i < 100; ++i)
{ /* Long processing loop */

/* Update spinner */
printf("%c%c", spinner[spinpos++], BACKSPACE);
spinpos &= 0x03; /* limit to valid characters */

/* Whatever operation the loop performs */
delay(100); /* approx 1/10th second delay */
} /* end of main processing loop */


/* Example 2 */
/* For applications that may output to the screen and/or */
/* where the total number of iterations is known */
/* Note: gotoxy() and cprintf() are Turbo C specific */

nrecs = 100; /* determine number iterations to perform */

spinpos = 0; /* reset spinner */
gotoxy(1, 3); /* spinner message position */
cprintf("Processing: %c %-5d ", spinner[spinpos++], nrecs);
spinpos &= 0x03; /* limit to valid characters */

for (i=nrecs; i > 0; --i)
{ /* Long processing loop */

/* Update spinner */
gotoxy(13, 3); /* set to spinner position */
cprintf("%c %-5d ", spinner[spinpos++], nrecs--);
spinpos &= 0x03; /* limit to valid characters */

/* Whatever operation the loop performs */
delay(100); /* approx 1/10th second delay */
} /* end of main processing loop */

gotoxy(11, 3);
cprintf(" complete."); /* overwrites spinner */

}

/* End of file */


  3 Responses to “Category : Files from Magazines
Archive   : WDMAR92.ZIP
Filename : 3N03063B

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/