TIP: Click on subject to list as thread! ANSI
echo: power_bas
to: ALL
from: DAVE NAVARRO
date: 1995-05-03 12:10:00
subject: Generic Input Routine

'Generic "simple" input routine.
'Posted in QuickBASIC Fido Conference by Robert Kennedy
'Converted (and enhanced) to PowerBASIC by Dave Navarro, Jr.
DEFINT A-Z
PRINT "Enter Your Name: ";
GetInput N$, 40
PRINT "Hi! "; N$
SUB GetInput( Default$, BYVAL MaxLength ) PUBLIC
  Row       = CSRLIN                'use the current cursor position
  Col       = POS                   '  to mimic INPUT.
  CharCount = LEN(Default$)
  DO
    LOCATE Row, Col, 1              'be sure to turn the cursor on
    PRINT Default$;
    DO
      C$ = INKEY$
    LOOP UNTIL LEN(C$)
    SELECT CASE C$
      CASE CHR$(8)
        IF CharCount > 0 THEN       'If more than zero characters, delete one
          DECR CharCount
          Default$ = LEFT$( Default$, LEN( Default$ ) - 1 )
          LOCATE Row, Col, 0
          PRINT Default$;" ";
        END IF
      CASE CHR$(13)                 'Return was pressed so end loop.
        EXIT LOOP
      CASE ELSE
        IF (ASCII(C$)>31) AND (LEN(Default$) * Origin: Nitelog BBS Monterey CA (408) 655-1096 (1:216/303) (1:216/303)

SOURCE: echomail via exec-pc

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.