!---------------------------------------------
!DBLInputDemo.BAS
!Version: 2017/12/11
!---------------------------------------------
!purpose: Demo program to utilize the new
!  DonsBasicLibrary.bas include file.
!---------------------------------------------
!Library Includes/Setup
INCLUDE DonsBasicLibrary.bas
INCLUDE IncKeyboard.bas
!Add functions here.
L_LibrarySetup(1,0,1,0,0)
L_addscreen(64,20,3)
!Add any graphics setup here.
L_keyboardsetup(225,5)
L_hidescreen(0)
!switch to screen 1
L_changescreen(1)
!----------------------------
!main program

!setcolors/clear the screen.
L_setcolors(1,3)
A$=""

! set foreground/background colors

L_Locate(1,1):L_write("Don's Basic Library Input Demo")

L_locate(1,3):L_write("This does a simple 'input' demo.")
L_write("  It uses a full 'typing'       keyboard.  All the letters, numbers, punctuation,")
L_write(" and a variety of other symbols are present.  The Shift, and Caplock keys,")
L_write(" work like they do on a physical keyboard.  There is also the Hide   and Show keys.")
L_write("  Hide will hide the keyboard, and Show will show it again -- without interupting")
L_write(" the input.  The cursor is a pair of brackets '[]' -- for now.")
L_write("  The arrow keys don't work in this demo.  Press 'Enter' when you are done typing.")


L_locate(17,20):L_write("Tap screen to continue.")
gosub gettouch


!do input
L_clear()

!get an input
L_locate(1,5):L_write("Please type something")
!A$ can be assigned something to be edited. 
L_Input(a$)
GOSUB grabaresult
!grabaresult returns Result$
L=len(result$)
A$="You typed: "+Result$+"."
L_locate(1,7):L_write(a$)
!all numbers must be changed into strings.
A$="It is "+str$(L)+" characters long."
L_locate(1,8):L_write(a$) 


!pause for a screen tap

L_locate(20,20):L_write("Tap the screen to exit.")
gosub gettouch

END

!----------------------------

END
!---------------------------------------------------------
