sota@fluke.UUCP (Bruce White) (10/19/85)
{}
Several people have responded to my initial query regarding Sidekick coming up
when the host program was executing a "gets()" function. The general opinion
was that lower level I/O calls should be used to allow Sidekick to come up.
Taking that advice, I then wrote a primitive version of gets() using putch(),
getch(), and kbhit(). This lower level I/O function seems to work just fine
with Sidekick.
As an added comment, "HOMEBASE", another memory resident desktop-type program
came up just fine through the original program.
The new gets, (getsraw), follows:
getsraw (string)
char *string;
{
int i = 0;
char ch;
while (1) {
if (!kbhit()) {
if ((ch = getch()) == '\r') {
string[i] = '\0';
putch ('\r');
putch ('\n');
return(0);
}
else if (ch == '\b') {
putch ('\b');
putch (' ');
putch ('\b');
i--;
}
else {
string[i++] = ch;
putch(ch);
}
}
}
}
--
Bruce T. White
John Fluke Mfg. Co., Inc.
{uw-beaver,decvax!microsof,ucbvax!lbl-csam,allegra,ssc-vax}!fluke!sota