Category : C Source Code
Archive   : WIND.ZIP
Filename : CUSTOMIO.C

 
Output of file : CUSTOMIO.C contained in archive : WIND.ZIP
/* customio.c -- demo of field input features of windows package
*/

#include "windows.h"

main() /* driver for a test ride */
{
static char name[21], addr[38], city[26], stat[3], zip[6];
static Field fld[] = {
{name,"NAME:", 20," .,'-()&/",YES,NO, NORMAL,REVERSE,2,10,2,20,0,0},
{addr,"ADDRESS:",37," .,'-()&/",YES,YES,NORMAL,REVERSE,3,10,3,20,0,0},
{city,"CITY:", 25," .,/'()", YES,NO, NORMAL,REVERSE,4,10,4,20,0,0},
{stat,"STATE:", 2,"", YES,NO, NORMAL,REVERSE,5,10,5,20,0,0},
{zip, "ZIP:", 5,"", NO, YES,NORMAL,REVERSE,5,25,5,32,0,0}
};
int i, done = NO;
Window *instructions, *data;
w_init();
thinCursor();
beepFlag = OFF;
instructions = w_create(1,1,6,78,single,"INSTRUCTIONS");
data = w_create(16,5,23,75,doubl,"STUDENT DATA");
setup(instructions, data);
for (i = 0; i < 5; i++) showField(&fld[i], data);
i = 0;
while (!done)
switch (getField(&fld[i], data)) {
case CTRL_W:
case ESC:
done = YES;
break;
case '\r':
case '\t':
case DOWN:
case PGDOWN:
if (i == 4) done = YES;
else i++;
break;
case UP:
case PGUP:
i = i ? i - 1 : 4;
break;
}
w_close(data);
w_close(instructions);
w_putcrs(main_w);
printf("\n\n\n\n\n%15s\n\n%10s%s\n%10s%s\n%10s%s, %s %s\n\n\n",
"MAIL TO:", " ", fld[0].str, " ", fld[1].str, " ",
fld[2].str, fld[3].str, fld[4].str);
thinCursor();
}

setup(instructions, data)
Window *instructions, *data;
{
w_open(instructions);
w_open(data);
w_center("Press END or CTRL-W when finished entering data",
instructions, 0);
w_center("INSERT key toggles insert mode", instructions, 1);
w_center("Press CTRL-END to clear from cursor to end of line",
instructions, 2);
w_center("HOME key moves to beginnging of field", instructions, 3);
w_center("END key moves to end of field", instructions, 4);
w_center("ALT+'B' keys turn bell on/off", instructions, 5);
w_select(instructions);
w_select(data);
}


  3 Responses to “Category : C Source Code
Archive   : WIND.ZIP
Filename : CUSTOMIO.C

  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/