(4/4) Input routine

 BBS: Inland Empire Archive
Date: 06-14-93 (01:25)             Number: 330
From: JIM LITTLE                   Refer#: NONE
  To: ERIC LOW                      Recvd: NO  
Subj: (4/4) Input routine            Conf: (2) Quik_Bas
'>>> Start of page 4.

SUB GetStroke (keystroke AS INTEGER)
'waits for then returns single character as integer.  Extended keystrokes
' returned as a negative.  (See CONST definitions).

DIM k AS STRING                        'key inputted

DO
   k = INKEY$
LOOP UNTIL LEN(k)
IF LEFT$(k, 1) = CHR$(0) THEN
   keystroke = ASC(MID$(k, 2)) * -1
ELSE
   keystroke = ASC(k)
END IF

END SUB

DEFINT A-Z
SUB Printline (topletter AS INTEGER, text AS STRING, left AS_
 INTEGER, right AS INTEGER)
'prints a line of text, starting with topletter, within the
bounds of left and right

LOCATE , left
PRINT MID$(text, topletter, right - left + 1); SPC(right -_
 POS(0) + 2);

END SUB


'______O_/__________________| SNIP |__________________\_O______
'      O \                  | HERE |                  / O

$$
That's it!
-Jim

---
 * Origin: The Radix Point: Astoria, OR (1:105/330.9)
Outer Court
Echo Basic Postings

Books at Amazon:

Back to BASIC: The History, Corruption, and Future of the Language

Hackers: Heroes of the Computer Revolution (including Tiny BASIC)

Go to: The Story of the Math Majors, Bridge Players, Engineers, Chess Wizards, Scientists and Iconoclasts who were the Hero Programmers of the Software Revolution

The Advent of the Algorithm: The Idea that Rules the World

Moths in the Machine: The Power and Perils of Programming

Mastering Visual Basic .NET