home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Power-Programmierung
/
CD1.mdf
/
basic
/
library
/
zbasic
/
pia
/
getstrn.bas
< prev
next >
Wrap
BASIC Source File
|
1987-10-30
|
724b
|
40 lines
DEF FNGETSTRN$(MAXLEN)
STATIC RESPONSE$,I2
COLOR K(1,2),K(1,1),1
RESPONSE$=STRING$(MAXLEN,32)
I2=0
20 C$=INKEY$
IF C$="" THEN 20
IF ASC(C$)=13 THEN
FNGETSTRN$=RESPONSE$
PRINT CHR$(13);
IF I2=0 THEN FNGETSTRN$=""
EXIT DEF
END IF
IF ASC(C$)=8 THEN
IF I2=0 THEN
BEEP
GOTO 20
END IF
LOCATE ,POS(0)-1
PRINT CHR$(32);
LOCATE ,POS(0)-1
MID$(RESPONSE$,I2,1)=CHR$(32)
I2=I2-1
GOTO 20
END IF
IF ASC(C$)<32 OR ASC(C$)>127 THEN
BEEP
GOTO 20
END IF
IF I2>=MAXLEN THEN
BEEP
GOTO 20
END IF
PRINT C$;
I2=I2+1
MID$(RESPONSE$,I2,1)=C$
GOTO 20
END DEF