home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Fred Fish Collection 1.5
/
ffcollection-1-5-1992-11.iso
/
ff_disks
/
200-299
/
ff254.lzh
/
Etale
/
getdirs.c
< prev
next >
Wrap
C/C++ Source or Header
|
1989-10-19
|
1KB
|
48 lines
/* getdirs.c -- (part of efr) Copyright © 1989 by William F. Hammond */
/* -- get user instructions from reader window */
#ifndef TDM_H
#include "tdm.h"
#endif
/*********************************************************************/
UBYTE getdirs(dstr, skipptr)
UBYTE *dstr; /* prompt string pointer */
WORD *skipptr; /* for return info */
{
struct IntuiMessage *msg;
static UBYTE smallprompt[] = " Skip N = ";
UBYTE gdch;
ULONG flags;
WORD gskip;
int dsl;
gdch = '\0';
savestyle = SetSoftStyle(rp, (ULONG)FS_NORMAL, enable);
while (gdch == '\0') /* this loop enables some input rejection */
{
gskip = 0;
SetDrMd(rp, (LONG)JAM2);
Move(rp, 0L, (LONG)maxrowpix);
ClearScreen(rp);
SetDrMd(rp, (LONG)(JAM2|INVERSVID));
dsl = strlen(dstr);
Text(rp, dstr, (LONG)dsl);
flags = VANILLAKEY;
Wait(1L << mw->UserPort->mp_SigBit);
while(msg = (struct IntuiMessage *)GetMsg(mw->UserPort))
{
if(msg->Class == VANILLAKEY) gdch = (UBYTE)msg->Code;
ReplyMsg(msg);
}
if(gdch == CTRL_C) gdch = 'q';
if ( (gdch | 0x20) == 's')
{
gdch = 's'; /* simplify further testing */
gskip = (WORD)(numget(smallprompt));
}
if ((gdch == 's') && (gskip == 0)) gdch = '\0'; /*refuse zero skip*/
} /*** loop (gdch == '\0') ***/
Move(rp, 0L, (LONG)maxrowpix);
ClearScreen(rp);
*skipptr = gskip;
return gdch;
}