R: A simple input box

dlgInput {svDialogs} | R Documentation

## A simple input box

### Description

Enter one (textual) value with this input box.

### Usage

    dlgInput(message = "Enter a value", default = "", ..., gui = .GUI)

    ## These should not be called directly
    ## S3 method for class 'gui'
    dlgInput(message = "Enter a value", default = "", ..., gui = .GUI)
    ## S3 method for class 'textCLI'
    dlgInput(message = "Enter a value", default = "", ..., gui = .GUI)
    ## S3 method for class 'nativeGUI'
    dlgInput(message = "Enter a value", default = "", ..., gui = .GUI)

### Arguments

`message` | the message to display in the dialog box. Use `\n` for line break, or provide a vector of character strings, one for each line.
`default` | the default value in the text box. Single string or `NULL`.
`...` | pass further arguments to methods.
`gui` | the 'gui' object concerned by this dialog box.

### Value

The modified 'gui' object is returned invisibly. The text entered by the user at the input box, or an empty string if the dialog box was cancelled can be obtained from `gui$res` (see example).

### Author(s)

Philippe Grosjean (phgrosjean@sciviews.org)

### See Also

`dlgMessage`

### Examples

    ## Ask something...
    user <- dlgInput("Who are you?", Sys.info()["user"])$res
    if (!length(user)) { # The user clicked the 'cancel' button
        cat("OK, you prefer to stay anonymous!\n")
    } else {
        cat("Hello", user, "\n")
    }

[Package svDialogs version 0.9-57 Index]