Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 5 Current »

Name

*qgetdouble — input dialog for decimal numbers

Syntax

qgetdouble caption label initialvalue

Description

The qgetdouble command displays a dialog for double precision numberical input. The dialog contains an entry field, OK and Cancel buttons. Extra arguments provide the dialog with a caption, a descriptive label, and an initial value.

The command returns either the number entered by the user or, when Cancel is pushed, an empty string "".

The dialog is modal, meaning script execution is halted until the user closes the dialog.

Arguments

label

Read-only text to appear above the input area. This text typically explains the purpose of the dialog.

initial value

This number will appear in the input area when the dialog is displayed, thus providing a default answer.

Examples

Ex.1: Numerical input dialog

# Ask user for a number, suggesting 100 as initial value
set d [qgetdouble "Get Double" "Please Enter number" 100]

In the example script shown above an input dialog is displayed asking the user for a number. The chosen number will be assigned to the variable 'd', or, if the user pressed Cancel, an empty string.

  • No labels