InputQuery
UserText$ = InputQuery(Title$, Prompt$, [Input$])
 
Parameters:

    Title$ = The TITLE this message dislog should use
    Prompt$ = The message/Question to be shown to the user
    [Input$] = Optional current state Of the Inputs Text Field.
Returns:

    UserText$ = The text that the user entered.
 

     InputQuery pops a windows input query dialog. The dialog allows the user to enter a row of text. It could be used to ask the player their name, age etc.



FACTS:


      * Since InputQuery returns the input data as a string. It's perfectly possible for the user to enter a NULL string and press the YES or NO buttons. To make the user didn't Cancel (select NO), we use the DialogNotCanceled function.



      * InputQuery is not asynchronous, so the PlayBasic application will halt while the dialog is open.


 
Example Source: Download This Example
; Include the Dialogs library in this program
  #Include "PBDialogs"
  
; Clear the Screen to Blue
  Cls RGB(0,0,255)
  
; Init the dialogs TItle and heading message
  Title$="Play Dialog Input Query Box"
  Text$="Enter A New Name"
  
  
; Call the Dialog Function.  This box will
; have a YES & NO option for the users
  Name$=InputQuery(Title$,Text$)
  
; Check if the USER clicked the cancel button
; while using this dialog ? - If they didn't cancel
; then whatever they entered we accept
  If DialogNotCanceled()=true
     
   ;
     Print "You Selected To Change Names To"
     Print Name$
     
  Else
     Print "You Selected to Cancel This input query"
     
  EndIf
  
  
  Sync
  WaitKey
  
  
  
  
  
 
Related Info: DialogNotCanceled | ShowMessage :
 


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