heres an example with my input field...
;-----------------------------------------------------------------------------------------------------
; Types
;-----------------------------------------------------------------------------------------------------
;Type To hold scancodes
Type ScanCode
Field code
Field key$
Field upkey$
End Type
;-----------------------------------------------------------------------------------------------------
; InitGetKey()
;-----------------------------------------------------------------------------------------------------
;reads all scancodes into ScanCode type
Function InitGetKey()
;read scancodes
tel = 1
Restore scancodez
Repeat
Read scanc
If scanc = -1 Then Exit
s.ScanCode = New ScanCode
s\code = scanc
s\key$ = Lower$(Mid$("1234567890-=QWERTYUIOP[]ASDFGHJKL;'\ZXCVBNM,./* 789-456+1230.,/", tel, 1))
s\upkey$ = Mid$("!@#$%^&*()_+QWERTYUIOP{}ASDFGHJKL:" + Chr$(34) + "|ZXCVBNM<>?* 789-456+1230.,/", tel, 1)
tel = tel + 1
Forever
End Function
Global oldkdown
;-----------------------------------------------------------------------------------------------------
; iGetKey()
;-----------------------------------------------------------------------------------------------------
;imitates GetKey() using scancodes
Function iGetKey()
;backspace
If KeyDown(14) Then
If oldkdown <> 8 Then oldkdown = 8: Return 8
oldkdown = 8: Return
End If
;enter
If KeyDown(28) Or KeyDown(156) Then
If oldkdown <> 13 Then oldkdown = 13: Return 13
oldkdown = 13: Return
End If
;check what key is down
sel.ScanCode = Null
down = -1
For s.ScanCode = Each ScanCode
If KeyDown(s\code) Then down = s\code: sel = s: Exit
Next
If down = oldkdown Then Return
oldkdown = down
;if no valid key is selected, exit
If sel = Null Then Return 0
;shift for uppercase
If KeyDown(42) Or KeyDown(54) Then
sc$ = sel\upkey$
Else
sc$ = sel\key$
End If
;return ascii value of key
Return Asc(sc$)
End Function
;-------------------------------------------------------------------------------------------------------
; CreateInputBox()
;-------------------------------------------------------------------------------------------------------
Function CreateInputBox$(box_x,box_y,box_w,useable,returnstr$)
Rect box_x, box_y, box_w,20, False
If useable=True
key=iGetKey()
Rect box_x+3+Len(returnstr$)*9,box_y+2,1,17,1
If (key=>48 And key=<57) Or (key>=65 And key<=90) Or (key>=97 And key<=122)
If(Len(returnstr$)<box_w/10)
returnstr$ = returnstr$ + Chr(key)
End If
End If
End If
If useable=True
If KeyHit(14)
If Len(returnstr$)>0 returnstr$=Left(returnstr$,Len(returnstr$)-1)
End If
If KeyHit(57)
returnstr$=returnstr$+" "
End If
End If
Text box_x+3,box_y, returnstr$
Return(returnstr$)
End Function
;-------------------------------------------------------------------------------------------------------
;Data stuff
;-------------------------------------------------------------------------------------------------------
.scancodez
Data 2, 3, 4, 5, 6, 7, 8, 9, 10, 11
Data 12, 13, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25
Data 26, 27, 30, 31, 32, 33, 34, 35, 36, 37, 38
Data 39, 40, 43, 44, 45, 46, 47, 48, 49, 50, 51
Data 52, 53, 55, 57, 71, 72, 73, 74, 75, 76, 77
Data 78, 79, 80, 81, 82, 83, 179, 181, -1
;-----------------------------------------------------------------------------------------------------------------------------------------
; PROGRAM
;-----------------------------------------------------------------------------------------------------------------------------------------
;-----------------------------------------------------------------------------------------------------------------------------------------
;-----------------------------------------------------------------------------------------------------------------------------------------
;Include "FunctionLibary.bb"
Graphics 400,300,16,2
SetBuffer BackBuffer()
InitGetKey()
address$="www.myaddress.com"
active=False
addywindow=False
While Not KeyHit(1)
Cls
Rect 150,50,80,30,1
Color 0,0,0
Text 155,60,"New Addy"
Color 255,255,255
;CreateInputBox(box_x,box_y,box_w,box_h,useable,strng$)
;
;first argument is the boxs X position on the screeen
;Second is the Y position on the screen
;third is the width of the input field
; forth is if its currently active in taking input (true or false)
; last is the same string as the return value, in this case address.
If RectsOverlap(150,50,80,30,MouseX(),MouseY(),10,10) And MouseHit(1)
If addywindow = False
addywindow = True
Else
addywindow = False
End If
End If
If addywindow = True
Rect 0,100,400,180,0
active=True
address$=CreateInputBox(80,160,200,active,address$)
End If
Text 60,250,"Your address is: "+address$
Delay 5
Flip
Wend
End
in your example above your using "Input=Input(blah)" try using "test$=Input$("Enter..")"