我的2美分:
- (setq inc (getint "\Enter increment with + / decrement with - : "))
- (setq
- strRep (vl-string-left-trim "0123456789" oldLabel))
- (setq strFst
- (vl-string-trim strRep oldLabel))
- (setq strEnd (vl-string-left-trim
- "+0123456789" strRep))
- (setq sign
- (if (minusp inc) "-" "+"))
- (setq
- decs
- (if (= "-" sign)
- (- (atoi strRep) (abs inc) )
- (+ (atoi
- strRep) (abs inc) ) ))
- (setq newLabel
- (if (= (fix (/ decs 100)) 1)
- (strcat (itoa (+
- (atoi strFst) (fix (/ decs 100)))) sign "00" strEnd)
- (strcat strFst
- sign (itoa decs) strEnd)))
|