;; | --------------------------------------------------------------------------- ;; | MI_AlphaNext ;; | --------------------------------------------------------------------------- ;; | Function : Returns the next alpha string Id ;; | Argument : 'Id' - Id String to operate on ;; | Returns : The next string 'Id' ;; | Updated : December 6, 2003 ;; | Comments : Works on last character alphabet, ;; | Increments alphabet Id until Z, then replaces it with AA and so on ;; | Do not send integer strings to this function, it will increment ;; | them but it is point-less ;; | e-mail : rakesh.rao@4d-technologies.com ;; | Web : www.4d-technologies.com ;; | --------------------------------------------------------------------------- (defun MI_AlphaNext ( Str / FirstPart LastChar len NextChar ) (setq len (strlen Str)) (if (> len 1) (setq FirstPart (substr Str 1 (1- len))) (setq FirstPart "") ) (setq LastChar (substr Str len 1)) (cond ((= LastChar "Z") (setq NextChar "AA") ) ((= LastChar "z") (setq NextChar "aa") ) (T (setq NextChar (chr (1+ (ascii LastChar)))) ) ) (setq Str (strcat FirstPart NextChar)) )