其下加 (if (not startnum ) (setq startnum DefVal) ) or 类似 uint 的函数 ;* UINT User interface integer function ;* BIT (0 for none) and KWD key word ("" for none) are same as for INITGET. ;* MSG is the prompt string, to which a default integer is added as <DEF> (nil ;* for none), and a : is added. ;* (defun uint (bit kwd msg def / inp) (if def ;test for a default (setq msg (strcat "\n >> " msg " < " (itoa def) " >: ") ;string'em with default bit (* 2 (fix (/ bit 2))) ;a default and no null bit code conflict so ) ;this reduces bit by 1 if odd, to allow null (if (= " " (substr msg (strlen msg) 1)) ;no def, if last char is space (setq msg (strcat "\n >> " (substr msg 1 (1- (strlen msg))) " : ")) ;then strip space (setq msg (strcat "\n >> " msg " : ")) ;else msg OK ) );if,if (initget bit kwd) (setq inp (getint msg)) ;use the GETINT function (if inp inp def) ;compare the results, return appropriate value );defun ureal ustr upoint .... 皆可比照 (from Google ...) |