StaticInput
StaticInput Prompt$
 
Parameters:

    Prompt$ = The Input prompt the request should use.
Returns: NONE
 

      StaticInput is a more traditional input function. Where the function halts the programs execution and waits for the user to enter a string. Nothing else can occur while your getting input. Hitting enter key will make StaticInput return the text that user typed.




FACTS:


      * The StaticInput function is part of the "Input" expansion library. Therefore in order to use StaticInput in program you need to include that library in your project. To do so, place I.e. #include "Input" at the top of the your program.

      * The StaticInput function halts your programs execution. It will not exit until the user presses Enter! This is the same behavior as found in traditional "ANSI" basic compilers using the Input command (ie. Input "Message";A$. If you want input while your game/program is running, then you'll need to use an input handler which gives you asynchronous input. See (Input)




Mini Tutorial:


  
  
; Include the Input Library
  #Include "input"
  
  
; load a font
  LoadFont  "Courier New",20,40,0
  
  
; Dim an array to hold the text you type
  Dim Stuff$(10)
  
; Get 10 lines of input  (enter to skip to the next line)
  For lp=0 To 10
   ; Call get Input and use the
     Stuff$(lp)=StaticInput(Digits$(lp,3)+" >")
  Next
  
; Force PB to wait until there's absolute no input from the user
  WaitNoKey
  
; display the text
  Print "---------------------------"
  For lp=0 To 10
     Print "Line:"+Str$(lp)+"  "+Stuff$(lp)
  Next
  Print "---------------------------"
  
  
; show the screen and wait for a key press
  Sync
  WaitNoKey
  WaitKey
  
  
  




This example would output.

  
  ---------------------------
  Line:0  This the first Line of input
  Line:1  And here's another
  Line:2  And another
  Line:3  And another
  Line:4  And another.............
  Line:5  aaaaaaa
  Line:6  xxxxx
  Line:7  zxczxcxzcxc
  Line:8  zxczxczxc
  Line:9  zxczxczxczxczx
  Line:10  And this is the last Line of Text
  ---------------------------
  
  
  

 
Related Info: KeyState | Mouse | Scancode :
 


(c) Copyright 2002 - 2024 - Kevin Picone - PlayBASIC.com