home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware 1 2 the Maxx
/
sw_1.zip
/
sw_1
/
BUSI
/
SHIPPERS.ZIP
/
PLUS.LZH
/
BASIC.SCR
< prev
next >
Wrap
Text File
|
1992-10-28
|
3KB
|
149 lines
bool Fbypass,
Fedited,
Ffld_in_range,
Fnoneedited,
Fabort;
void rng_init(void)
{
pad(OUTPUT_DEVICE,"CON ",4,Right);
fstr(LINES_PER_PAGE, valu("66"),3,0);
}
void rng_dsp(void)
{
dsp_fld(21,2,OUTPUT_DEVICE,_Ch,"4U",0,0,_av,rw.wa[1]);
dsp_fld(21,4,LINES_PER_PAGE,_Num,"3#",0,0,_av,rw.wa[1]);
strip(iodev,OUTPUT_DEVICE);
pagelength=ival(LINES_PER_PAGE);
}
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 1 : if (!(choice("CON |PRN |LPT1|LPT2",OUTPUT_DEVICE)))
strcpy(estr,(uchar *)choose(_tts, "CON |PRN |LPT1|LPT2|","",OUTPUT_DEVICE)); break;
case 2 : if (!(( valu(LINES_PER_PAGE) >=6) && ( valu(LINES_PER_PAGE) <=100)))
strcpy(estr, "Please enter a Page Length of between 6 and 100"); 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;
winptr edtwin;
bool finished;
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(21,2,0,0,NULL,OUTPUT_DEVICE,_Ch,"4U",1); break;
case 2 : edt_n_chk(21,4,0,0,NULL,LINES_PER_PAGE,_Num,"3#",2); break;
case 3 : {
strip(iodev,OUTPUT_DEVICE);
} break;
case 4 : {
pagelength=ival(LINES_PER_PAGE);
} 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);
}