Without studying it too deeply, I suspect the problem may be in the location of
(SETQ ALPH T)
in the ANIT function. Would I be correct in assuming that you would only want that set if you're using letters? I think maybe you want that to be part of the 'else' argument to the (if) function, and not *after* the (if) function is over, where it gets set every time, regardless of which style labels you're using. That would make later code convert text back and forth every time. If I'm correct, try it this way:
{code}
(defun ANIT (); for Alpha-Numeric Integer Toggle
(setq NUMBER
(if (zerop (atoi NUMBER)); if alphabetic
(itoa (- (ascii (strcase NUMBER)) 64))
; then - change to number
(progn ; else
(chr (+ (atoi NUMBER) 64)); change to letter
(SETQ ALPH T); and set marker
); end progn
); end if
); end setq
); end defun
{code}
Or, if I've misunderstood, maybe that setting needs to be grouped with the 'then' argument, changing to a number, instead:
{code}
(defun ANIT (); for Alpha-Numeric Integer Toggle
(setq NUMBER
(if (zerop (atoi NUMBER)); if alphabetic
(progn ; then - change to number
(itoa (- (ascii (strcase NUMBER)) 64))
(SETQ ALPH T); and set marker
); end progn
(chr (+ (atoi NUMBER) 64))
; else - change to letter
); end if
); end setq
); end defun
{code}
--
Kent Cooper
Kent Cooper, AIA