1 CAPI Reference Entries

prompt-for-integer

Function

Summary

Theprompt-for-integer function pops up a text input pane and prompts the user for an integer.

Syntax

prompt-for-integer message
                   &key
                   min max initial-value ok-check
                   pane-args popup-args

Description

This function prompts the user for an integer which is returned, and the initial-value will appear in the input pane. When min or max are specified the allowable result is constrained accordingly, and more complicated restrictions can be applied using the function ok-check which gets passed the currently entered number, and should returnt if it is valid.

Finally, as with all of the prompting functions, the prompter is created by passing an appropriate pane (in this case a text input pane) topopup-confirmer. Arguments can be passed to themake-instance of the pane and the call topopup-confirmer using pane-args and popup-args respectively.

Examples

(capi:prompt-for-integer "Enter an integer:")
(capi:prompt-for-integer "Enter an integer:" :max 10)

(capi:prompt-for-integer "Enter an integer:" :min 100 :max 200)

(capi:prompt-for-integer "Enter an integer:" :ok-check 'evenp)

See Also

prompt-for-string
popup-confirmer
text-input-pane


CAPI Reference Manual, Liquid Common Lisp Version 5.0 - 3 OCT 1997

Generated with Harlequin WebMaker