Livecode Wiki
Advertisement

ask gives the programmer the means to get information from the user. When the ask statement is executed, it creates a ready-to-use window with a field and buttons.

Built-in Message handler[]

For example:

ask "What is your name?"

Ask example

The user clicks on the Cancel button or enters text into the field, then clicks on the OK button. Any text entered by the user is stored in the it variable, which can then be incorporated into the operation of the program.

It is also possible to add an icon to the ask window. Livecode has the following predefined icons:

  • information
  • question
  • error
  • warning

Examples:

ask information "Come to Chrome"
AskInformation.jpg
ask question "Come to Chrome"
AskQuestion.jpg
ask error "One the combination"
AskError.jpg
ask warning "One the combination"
AskWarning.jpg

If you use some HTML tag, the text is intepreted as HTMLText. Use this feature to customize text.

Syntax[]

This is the general form of the syntax:

ask [iconType] prompt [with defaultResponse] [titled windowTitle] [as sheet]
Advertisement