FB II Compiler

PG PRO

Debugging

Memory

System

Mathematics

Resources

Disk I/O

Windows

Controls

Menus

Mouse

Keyboard

Text

Fonts

Drawing

Sound

Clipboard

Printing

Communication

ASM

Made with FB

KEYBOARD

Filter keys for numbers


I have edit fields intended for user input of numbers only...
LOCAL FN doEdit
 char$ = TEKEY$
 SELECT CASE ASC(char$)
  CASE 28,29,30,31                                '<--LET arrow keys work
  CASE 8                                          ' <--delete key
   char$ = CHR$(8)
  CASE 127                                        ' <-- forward delete key
   char$ = CHR$(29) + CHR$(8)                     ' right arrow + backspace
  CASE
   ' rest of your filtering here
  CASE ELSE
 END SELECT
 TEKEY$ = char$
END FN

ON EDIT FN doEdit


Al Staffieri Jr.