std-inp-getscale


Synopsis

(std-inp-getscale <flag> <kwd> <msg> <def> <bpt>) ; => number

Description

STD-INP-GETSCALE asks for a scale factor, as with the command SCALE.

The user is allowed to use the option Reference and if the user selects this option she is asked for two distances. Otherwise she is asked for one distance.

With option reference the relative scale factor between the two entered distances is returned.

They use the following enhancements:
msg is nicely formatted.

If a lisp function given at the prompt returns a valid type this one is accepted.

The additionally needed INITGET initialization and default value check may be omitted, thus leading to easier looping code.

If the default argument is given (and it is not nil and the flag contains no bitvalue 1), then empty input is allowed as well.

Arguments

flag: integer, same as the INITGET flag or nil

kwd: a initget-like string or a list of strings or nil

msg: a string to be displayed as a prompt or nil.

def: a default value as number.

bpt: a point from which the rubberband is drawn or nil. If not nil only one point or a number is required. If nil a number or two points.

Return Value

Either the default value or any real number.

Side Effects

Interrupts the program flow, prints the formatted message and waits for user input.

Module

(std-require 'STDINPUT)

Defined in STDINPUT