Prompt Command

Purpose

Displays an input Dialog Box

Syntax

Prompt title$, message$, strvar$

Description

Prompt will provide the user with a "standard" dialog box that has an input-field in it. Basically this can be used instead of Input or Form Input to prompt the user for input, because Input is not well suited for Message-based multi-tasking systems like MS-Windows.

To ensure that the Prompt box is centred on its owner, use the DlgCenter[Hook] command.

Example

Local a$ = "Anonymous"

Prompt "A Prompt example", "Do you want to give your name ?", a$

Print a$

This example prompts the user with a Dialog-box, asking to type in your name. The default text in the edit field will be "Anonymous".

After response of the user, the string A$ will be filled with the text of the edit field at the moment of exiting the Dialog.

Remarks

Basically, the same can be done using Dialog and EditText statements. Of course, the Prompt command is easier to use and provides a kind of standard-Dialog for user input.

Prompt uses Me as a parent and is displayed on Me’s (usually the curernt) monitor, except in GLLs, where Me is unavailable, when MsgBox0 should used instead.

See Also

Dialog,DlgCenter, DlgCenterHook, Form Input, Message, MsgBox.

{Created by Sjouke Hamstra; Last updated: 23/02/2022 by James Gaite}