Liberty BASIC Help Online

PROMPT
Image prompt.GIF
 
PROMPT "string expression"; responseVar$
 
Description:
The PROMPT statement opens a dialog box, displays the message contained in "string expression", and waits for the user to type a response in the textbox and press the ENTER key,  or press the OK or Cancel button on the dialog.  The entered information is placed in responseVar$.  If Cancel is pressed, then a string of zero length is returned.  If responseVar$ is set to some string value before PROMPT is executed, then that value will become the "default" or suggested response that is displayed in the textbox contained in the PROMPT dialog.  This means that when the dialog is opened, the contents of responseVar$ will already be entered as a response for the user, who then has the option to either type over that 'default' response, or to press 'Return' and accept it.
 
Caption for the Prompt Window
"string expression"
Two forms are allowed.  If "string expression" has no carriage return character (ASCII 13), then the caption or title on the dialog box is blank and "string expression" is the message displayed inside the dialog box.  If "string expression" does have a Chr$(13), then the part of "string expression" before Chr$(13) is used as the title for the dialog box, and the part of "string expression" after Chr$(13) is displayed as the message inside.
 
Usage:
 
  response$ = "C:"
  prompt "Search on which Drive? A:, B:, or C:"; response$
[testResponse]
  if response$ = "" then [cancelSearch]
  if len(response$) = 2 and instr("A:B:C:", response$) > 0 then [search]
  response$="C:"
  prompt "Unacceptable response.  Please try again. A:, B:, or C:"; response$
  goto [testResponse]
 
[search]
  print "Starting search . . . "
 
Specify a Caption:
 
  response$ = "C:"
  prompt "Please Specify" + chr$(13) + "Search on which Drive? A:, B:, or C:"; response$
 
 
  .
  .
 
 
 
 


Copyright (C) 2003 Shoptalk Systems
Liberty BASIC - http://www.libertybasic.com/