home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Software of the Month Club 1995 December
/
SOFM_Dec1995.bin
/
pc
/
dos
/
biz
/
pbase
/
full.scr
< prev
next >
Wrap
Text File
|
1995-10-31
|
5KB
|
169 lines
bool Fbypass,
Fedited,
Ffld_in_range,
Fnoneedited,
Fabort;
void rng_init(void)
{
pad(LAST_NAME,"",20,Right);
pad(FULL_PARTY,"",15,Right);
pad(FULL_PRECINT,"",10,Right);
pad(ISSUE1,"",20,Right);
pad(DISKFILE,"",13,Right);
pad(PMARK,"",1,Right);
pad(OUTPUT,"",10,Right);
pad(FULL_SCH_DIST,"",3,Right);
}
void rng_dsp(void)
{
dsp_fld(14,1,LAST_NAME,_Ch,"20X",0,0,_av,rw.wa[1]);
dsp_fld(14,3,FULL_PARTY,_Ch,"15X",0,0,_av,rw.wa[1]);
dsp_fld(14,5,FULL_PRECINT,_Ch,"10X",0,0,_av,rw.wa[1]);
dsp_fld(14,6,FULL_SCH_DIST,_Ch,"3X",0,0,_av,rw.wa[1]);
dsp_fld(14,8,ISSUE1,_Ch,"20X",0,0,_av,rw.wa[1]);
dsp_fld(15,11,PMARK,_Ch,"X",0,0,_av,rw.wa[1]);
dsp_fld(10,13,OUTPUT,_Ch,"10X",0,0,_av,rw.wa[1]);
dsp_fld(29,13,DISKFILE,_Ch,"13X",0,0,_av,rw.wa[1]);
strcpy(&iodev,strip(_tts,OUTPUT));
strcpy(&dsk_file,strip(_tts,DISKFILE));
}
bool skipfield(int fnum)
{
bool tb;
tb = False;
switch (fnum) {
case 0 : break ;
}
return(tb);
}
bool chk_fld(int chknum)
{
string estr;
*estr = '\0';
switch (chknum) {
case 2 : if (!(choice("REPUBLICAN|DEMOCRATIC|LIBERTARIAN |NA|OTHER",FULL_PARTY)))
strcpy(estr,(uchar *)choose(_tts,"REPUBLICAN|DEMOCRATIC|LIBERTARIAN |NA|OTHER","",FULL_PARTY)); break;
case 5 : if (!(found(12,2,ISSUE1)))
strcpy(estr,(uchar *)list(_tts,12,2,ISSUE1)); break;
case 7 : if (!(choice("PRN|LPT1|LPT2|DSK|CON",OUTPUT)))
strcpy(estr,(uchar *)choose(_tts,"PRN|LPT1|LPT2|DSK|CON","",OUTPUT)); break;
}
if (*estr != '\0') {
if (strcmp(estr,LSC_BaseError) != 0) {
audible(Error);
message(rw.wa[1],estr);
}
}
return ((bool) (*estr == '\0'));
}
void edt_n_chk(int x,int y,int l,int a,winptr h,strptr fld,char typ,strptr pic,int fldno)
{
if (!skipfield(fldno)) {
do {
if (!Fbypass) {
edt_fld(x, y, fld, typ, pic, (byte)(l), (byte)(a), rw.wa[1]);
Fnoneedited = False;
Fedited = True;
Fabort = False;
if (exitcode == HlpKey) disphelp(h);
if (custom_key(1, 1, &fldnum, &exitcode)) exitcode = QitKey;
}
if ((exitcode != QitKey) && (exitcode != UArr) && (exitcode != HlpKey)) {
Ffld_in_range = chk_fld(fldno);
dsp_fld(x, y, fld, typ, pic, 0, (byte)(l), (byte)(a), rw.wa[1]);
if (!Ffld_in_range) {
fldnum = fldno;
Fbypass = False;
}
}
} while ((!Ffld_in_range) && (exitcode != QitKey) && (exitcode != UArr));
message(NULL,"");
}
}
void openedtmnu(winptr *edtwin)
{
string ts;
int l;
strcpy(ts, _EdtHelp);
l = strlen(ts);
if (openwin(0, (byte)(scrwid-l+1), scrhgt, (byte)(l), 1, 0x4F, 0x4F, 0, "\0┐│┘─└│┌", TopCnt, "")) {
*edtwin = curwin;
writewxy(ts, 0, 1, 1, *edtwin);
hidewin(T_ON, *edtwin);
}
else *edtwin = NULL;
}
void rng_edt(void)
{
int last_fld = 0;
winptr edtwin;
bool finished = 0;
openedtmnu(&edtwin);
attrib = _av;
exitcode = Nul;
Fabort = True;
Fbypass = False;
fldnum = 1;
finished = False;
do {
if (fldnum == 1) Fnoneedited = True;
if (last_fld == fldnum && !Fedited) fldnum++;
last_fld = fldnum;
Fedited = False;
switch (fldnum) {
case 1 : { edt_n_chk(14,1,0,0,NULL,LAST_NAME,_Ch,"20X",1); } break;
case 2 : { edt_n_chk(14,3,0,0,NULL,FULL_PARTY,_Ch,"15X",2); } break;
case 3 : { edt_n_chk(14,5,0,0,NULL,FULL_PRECINT,_Ch,"10X",3); } break;
case 4 : { edt_n_chk(14,6,0,0,NULL,FULL_SCH_DIST,_Ch,"3X",4); } break;
case 5 : { edt_n_chk(14,8,0,0,NULL,ISSUE1,_Ch,"20X",5); } break;
case 6 : { edt_n_chk(15,11,0,0,NULL,PMARK,_Ch,"X",6); } break;
case 7 : { edt_n_chk(10,13,0,0,NULL,OUTPUT,_Ch,"10X",7); } break;
case 8 : { edt_n_chk(29,13,0,0,NULL,DISKFILE,_Ch,"13X",8); } break;
case 9 : {
strcpy(&iodev,strip(_tts,OUTPUT));
} break;
case 10 : {
strcpy(&dsk_file,strip(_tts,DISKFILE));
} break;
default : {
if (Fnoneedited) {
finished = True;
if (Fabort) {
exitcode = QitKey;
dberrm(_NoneEdited);
}
}
else if (exitcode == XeptKey) finished = True; else fldnum = 0;
}
}
if (Fbypass || !Fedited)
if (_upward && (fldnum > 1)) fldnum--; else fldnum++;
if (exitcode == XeptKey) Fbypass = True;
if (exitcode == QitKey) finished = True;
if (fldnum > last_fld) _upward = False;
} while (!finished);
if (edtwin != NULL) closewin(&edtwin);
}