Mark_D
11-08-2008, 00:18
Ok - I know its pretty easy to grasp with out a sample, but because I am playing around, and I already made it - I figured 'might as well put it in the help file' and make thinbasic a just a little more 'noob' friendly. :D
' InputBoxExample.tbasic
' ----------------------
DIM s AS STRING VALUE = ""
DIM Prompt AS STRING VALUE = "Enter Some thing here"
DIM Title AS STRING VALUE = "InputBox Example" 'Optional, can be left out
DIM DefaultText AS STRING VALUE = "press keyboard keys to change me" 'Optional, can be left out
DIM sMsg AS STRING VALUE = ""
' Assign the variable 's' to what is entered in the INPUTBOX
s = InputBox$(Prompt ,Title, DefaultText )
' Prepare the 'sMsg' variable
sMsg = " You entered: " & $CRLF
sMsg += s & $CRLF
'Display a MessageBox to show what the user entered in the INPUTBOX
msgbox 0, sMsg
' InputBoxExample.tbasic
' ----------------------
DIM s AS STRING VALUE = ""
DIM Prompt AS STRING VALUE = "Enter Some thing here"
DIM Title AS STRING VALUE = "InputBox Example" 'Optional, can be left out
DIM DefaultText AS STRING VALUE = "press keyboard keys to change me" 'Optional, can be left out
DIM sMsg AS STRING VALUE = ""
' Assign the variable 's' to what is entered in the INPUTBOX
s = InputBox$(Prompt ,Title, DefaultText )
' Prepare the 'sMsg' variable
sMsg = " You entered: " & $CRLF
sMsg += s & $CRLF
'Display a MessageBox to show what the user entered in the INPUTBOX
msgbox 0, sMsg