From Liberty BASIC Family
Jump to navigation Jump to search
Supported in Just BASIC Supported in Liberty BASIC Not supported in Liberty BASIC 5 Not supported in Run BASIC


Provides a pre-made confirmation dialog window which displays a "string" message. User responds by selecting "Yes" or "No". The selection is stored in responseVar$ as "yes" or "no" (lowercase values).


  1. confirm "string"; responseVar$
Use this form for multiline message
  1. confirm "line 1" + chr$(13) + "line 2" ...; responseVar$


To test response, be sure to test against lowercase "yes" or "no". Testing against uppercase, or mixed-case, can produce false results.
The "Yes" button is the default; pressing the Enter key returns "yes".
You cannot change the caption on a CONFIRM window.


    ' A basic CONFIRM dialog with multiline message.
    confirm "Are you sure " + chr$(13) + "you want to QUIT?"; answer$

    ' Test against lowercase response
    if answer$ = "yes" then
        print "Yes was selected"
        print "No was selected"
    end if

Useful Procedures

' Place a useful function using this keyword here