Newer
Older
Microsoft / screendoor / BDEMO2.C
@tundra tundra on 24 May 2012 4 KB Initial revision
#include		<stdio.h>
#include		<system.h>
#include		<t&r.h>
#include		<vstruct.h>
#include		<stdmsgs.h>


uvalid(vptr,fld)

struct	VSTRUCT	*vptr;
int	fld;

{

if ((*((vptr+fld)->rarray)) != '1')
	return(TRUE);
else
	return(FALSE);

}



main()

{

/*
extern	int		errmsg_attr,errmsg_row,errmsg_col,errmsg_on,errmsg_cattr,errmsg_len;
extern	char	*errmsg_rreqd,*errmsg_mfill,errmsg_fill;
static	char	m1[]={"This is the new RREQD!"};
static	char	m2[]={"MFILL Isn't Being Satisfied!"};

errmsg_attr=clrinp;
errmsg_row=0;
errmsg_col=3;
errmsg_rreqd=m1;
errmsg_mfill=m2;
errmsg_len=40;
errmsg_cattr=clrresp;
errmsg_fill='=';
errmsg_on=FALSE;
*/

static	char	prompt0[]={"This Is A Demonstration\n"};
static	char	prompt1[]={"Of The VKEYIN Screen Management System\n"};
static	char	prompt2[]={"Developed By:\n"};
static	char	prompt3[]={"T&R Communications Associates\n"};
static	char	prompt4[]={"Chicago, IL  60625\n"};
static	char	vp1[]={"Alpha Only"};
static	char	vp2[]={"Alpha Only - UC"};
static	char	vp3[]={"Alpha Only - LC"};
static	char	vp4[]={"AlphaNumeric Only"};
static	char	vp5[]={"AlphaNumeric Only - UC"};
static	char	vp6[]={"AlphaNumeric Only - LC"};
static	char	vp7[]={"Binary Digits"};
static	char	vp8[]={"Octal Digits"};
static	char	vp9[]={"Decimal Digits"};
static	char	vp10[]={"Hexadecimal Digits"};

static	char	resp0[16]={"Response #0"};
static	char	resp1[16]={""};
static	char	resp2[16]={"Response #2"};
static	char	resp3[16]={"Response #3"};
static	char	resp4[16]={"Response #4"};
static	char	vr1[16]={""};
static	char	vr2[16]={""};
static	char	vr3[16]={""};
static	char	vr4[16]={""};
static	char	vr5[16]={""};
static	char	vr6[16]={""};
static	char	vr7[16]={""};
static	char	vr8[16]={""};
static	char	vr9[16]={""};
static	char	vr10[16]={""};

static	char	h0[16]={"This Is Help #0"};
static	char	h1[16]={"This Is Help #1"};
static	char	h2[16]={"This Is Help #2"};
static	char	h3[16]={"This Is Help #3"};
static	char	h4[16]={"This Is Help #4"};



static	struct VSTRUCT help[]={

	clrinp,clrprmt,0,0,TRUE,h0,clrresp,7,60,FALSE,NULL,15,'.',TRUE,0,NULL,FALSE,FALSE,TRUE,NULL,TRUE,
	clrinp,clrinp,7,15,TRUE,h1,clrresp,7,60,FALSE,NULL,15,'.',TRUE,0,NULL,FALSE,FALSE,TRUE,NULL,TRUE,
	clrinp,clrbord,8,60,TRUE,h2,clrresp,7,60,FALSE,NULL,15,'.',TRUE,0,NULL,FALSE,FALSE,TRUE,NULL,TRUE,
	clrinp,clrbmsg,11,35,TRUE,h3,clrresp,7,60,TRUE,NULL,15,'.',TRUE,0,NULL,FALSE,FALSE,TRUE,NULL,TRUE,
	clrinp,clrerr,24,15,TRUE,h4,clrresp,7,60,FALSE,NULL,15,'.',TRUE,0,NULL,FALSE,FALSE,TRUE,NULL,TRUE

								};


static	struct VSTRUCT screen0[]={

	clrinp,clrprmt,5,15,TRUE,prompt0,clrresp,5,60,TRUE,resp0,15,'.',TRUE,0,NULL,FALSE,FALSE,TRUE,&help[0],FALSE,
	clrinp,clrprmt,6,15,TRUE,prompt1,clrresp,6,60,TRUE,resp1,15,'.',TRUE,1,NULL,FALSE,FALSE,TRUE,&help[1],FALSE,
	clrinp,clrprmt,7,15,TRUE,prompt2,clrresp,7,60,FALSE,resp2,15,'.',TRUE,2,NULL,FALSE,FALSE,TRUE,NULL,FALSE,
	clrinp,clrprmt,8,15,TRUE,prompt3,clrresp,8,60,TRUE,resp3,15,'.',TRUE,0,uvalid,TRUE,FALSE,TRUE,&help[3],FALSE,
	clrinp,clrprmt,9,15,TRUE,prompt4,clrresp,9,60,TRUE,resp4,15,'.',FALSE,0,NULL,FALSE,TRUE,TRUE,&help[4],FALSE,
	clrinp,clrprmt,11,15,TRUE,vp1,clrresp,11,60,TRUE,vr1,15,'.',TRUE,3,NULL,FALSE,FALSE,TRUE,NULL,FALSE,
	clrinp,clrprmt,12,15,TRUE,vp2,clrresp,12,60,TRUE,vr2,15,'.',TRUE,4,NULL,FALSE,FALSE,TRUE,NULL,FALSE,
	clrinp,clrprmt,13,15,TRUE,vp3,clrresp,13,60,TRUE,vr3,15,'.',TRUE,5,NULL,FALSE,FALSE,TRUE,NULL,FALSE,
	clrinp,clrprmt,14,15,TRUE,vp4,clrresp,14,60,TRUE,vr4,15,'.',TRUE,6,NULL,FALSE,FALSE,TRUE,NULL,FALSE,
	clrinp,clrprmt,15,15,TRUE,vp5,clrresp,15,60,TRUE,vr5,15,'.',TRUE,7,NULL,FALSE,FALSE,TRUE,NULL,FALSE,
	clrinp,clrprmt,16,15,TRUE,vp6,clrresp,16,60,TRUE,vr6,15,'.',TRUE,8,NULL,FALSE,FALSE,TRUE,NULL,FALSE,
	clrinp,clrprmt,17,15,TRUE,vp7,clrresp,17,60,TRUE,vr7,15,'.',TRUE,9,NULL,FALSE,FALSE,TRUE,NULL,FALSE,
	clrinp,clrprmt,18,15,TRUE,vp8,clrresp,18,60,TRUE,vr8,15,'.',TRUE,10,NULL,FALSE,FALSE,TRUE,NULL,FALSE,
	clrinp,clrprmt,19,15,TRUE,vp9,clrresp,19,60,TRUE,vr9,15,'.',TRUE,11,NULL,FALSE,FALSE,TRUE,NULL,FALSE,
	clrinp,clrprmt,20,15,TRUE,vp10,clrresp,20,60,FALSE,vr10,15,'.',TRUE,12,NULL,FALSE,FALSE,TRUE,NULL,TRUE

								};


struct VSTRUCT *vptr;
static	char	time[9],date[9];

scr_setup();
scr_clr();
verset('X','Y','Z');
trbord();
times(time);
dates(date);
dsplylin(2,5,date,clrbmsg);
dsplylin(2,66,time,clrbmsg);
cursorblk(TRUE);
vptr=screen0;
vdsply(vptr);
cursorblk(FALSE);
vkeyin(vptr,0,FALSE);
fill_lin(statlin,0,' ',statlen,clrclr);
fill_lin(23,center(mkstr('.',46)),'.',46,clrerr);

}