+
+int get_slide_number(char init) {
+ int retval = init - '0';
+ char c;
+ // block for tenths of a second when using getch, ERR if no input
+ halfdelay(GOTO_SLIDE_DELAY);
+ while((c = getch()) != ERR) {
+ if (c < '0' || c > '9') {
+ retval = -1;
+ break;
+ }
+ retval = (retval * 10) + (c - '0');
+ }
+ nocbreak(); // cancel half delay mode
+ cbreak(); // go back to cbreak
+ return retval;
+}