Next Prev Up Top Contents Index

prompt-for-integer

Function
Summary

The prompt-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 return t 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) to popup-confirmer . Arguments can be passed to the make-instance of the pane and the call to popup-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


LispWorks CAPI Reference Manual - 14 Dec 2001

Next Prev Up Top Contents Index