*/
char *get_input() {
BYTE i = 0;
+ BYTE c, x, y;
static char output[32];
- BYTE c;
+ x = wherex();
+ y = wherey();
memset(output, '\0', 32);
while (1) {
if (i == 31)
c = cgetc();
if (c == 13)
break;
+ /* backspace? */
+ if (c == 20) {
+ /* If you are at the left-most position, do nothing */
+ if (i == 0)
+ continue;
+ output[--i] = '\0';
+ cputcxy(x+i, y, ' ');
+ gotoxy(x+i, y);
+ continue;
+ }
cputc(c);
output[i++] = c;
}
if (len >= maxlen)
return NULL;
// workaround to produce a leading zero for cents.. %0.2d won't work
- sprintf(s, "%2d,%s%dEUR", cent / 100, ((cent%100)<10?"0":""), cent % 100);
+ sprintf(s, "%3d,%s%dEUR", cent / 100, ((cent%100)<10?"0":""), cent % 100);
return s;
}