anchor.diff:    (setq index 1)
     (setq txt (cdr (assoc 1 entInfo) ) ); (pnlNum).(strNum)
   
  -  ; separate pnlNum and strNum from txt
  +  ; Assign pnlNum and strNum using txt
     (while (or (/= (substr txt index 1) ".") (> index 10))
       (setq index (1+ index) )
  -  ); while
  +  )
     (setq pnlNum (atoi (substr txt 1 (1- index) ) ) )
     (setq strNum (atoi (substr txt (1+ index) ) ) )
  -  ; increment the label
  +  
  +  ; Step up / down
     (setq pnlNum (+ pnlNum jump) )
     (while (> pnlNum *pnlLim)
       (setq pnlNum (- pnlNum *pnlLim) )
       (setq strNum (1+ strNum) )
  -  ); while
  -  ; terminate if the label is outside of the limit
  +  )
  +  (while (< pnlNum 0)
  +    (setq pnlNum (+ pnlNum *pnlLim) )
  +    (setq strNum (1- strNum) )
  +  )
  +  
     (if (> strNum *strLim)
  +    ; Terminate if the label is outside of the limit
  +    ; Otherwise, increment the label
       (progn
         (alert "You have reached the end of the last string.")
         (setq term 1)
  -    ); progn
  +    )
       (progn
         (setq txt (strcat (itoa pnlNum) "." (itoa strNum) ) )
         (setq entInfo (subst (cons 1 txt) (assoc 1 entInfo) entInfo) )
         (entmod entInfo)
  -    ); progn
  -  ); if
  -  (princ)
  -)
  -
  -(defun ask-int (var msg mod lim / tmp)
  -  ;; Asks for an integer value to set into the variable, defaulting to the previous value
  -  (cond
  -    ( (= mod 1)
  -      (set var
  +    )
  +  )
  +  (princ)
  +)
  +
  +(defun ask-int (var msg lim / tmp)
  +  ;; Asks for an integer value to parse into the variable,
  +  ;; defaulting to the previous value
  +  (while
  +    (>(setq tmp
   	(cond
  -	  ( (getint
  -	      (strcat "\n" msg " <"
  -		      (if (eval var) (itoa (eval var) ) "1")
  -		      ">: "
  -	      ); strcat
  -	    ); getint
  -	  )
  +	  ( (getint (strcat "\n" msg " <" (if (eval var) (itoa (eval var) ) "1")
  +			    ">: ")	 ) )
   	  ( (eval (cond ( (eval var) ) (1) ) ) )
  -	); cond
  -      ); set
  -    ); mod1
  -    ( (= mod 2)
  -      (while
  -	(>(setq tmp
  -	    (cond
  -	      ( (getint
  -		  (strcat "\n" msg " <"
  -			  (if (eval var) (itoa (eval var) ) "1")
  -			  ">: "
  -		  ); strcat
  -		); getint
  -	      )
  -	      ( (eval (cond ( (eval var) ) (1) ) ) )
  -	      ); cond
  -	    ); setq
  -	  (eval lim)
  -	); if current input is bigger than the limit
  -	(princ (strcat " must be less than " (itoa (eval lim) ) ) )
  -	); while
  -      (set var tmp)
  -    ); mod2
  -  ); cond
  -)
  -
  -(defun Replace(/ term txt tmpsl tmppl tmpsc tmppc entName entType entInfo)
  +	)
  +      )
  +      (eval lim)
  +    ); if current input is bigger than the limit
  +    (princ (strcat " must be less than " (itoa (eval lim) ) ) )
  +  )
  +  (set var tmp)
  +)
  +
  +(defun Replace(/ term txt entName entType entInfo)
     ; initialize
  -  (ask-int '*pnlLim "Enter number of panels per string" 1 9001)
  -  (ask-int '*strLim "Enter number of strings existing" 1 9001)
  -  (ask-int '*pnlCur "Enter current panel number" 2 *pnlLim)
  -  (ask-int '*strCur "Enter current string number" 2 *strLim)
  -
  -  (setq term 0) 
  +  (ask-int '*pnlCur "Enter current panel number" *pnlLim)
  +  (ask-int '*strCur "Enter current string number" *strLim)
  +
  +  (setq term 0)
     (while (= term 0)
       ; ask user for the label to modify
       (while (and (/= "TEXT" entType) (/= "MTEXT" entType) )
         (setq entName (car (entsel "\nSelect the label: ") ) )
         (cond
  -	(entName (setq entType (cdr (assoc 0 (entget entName) ) ) ) )
  -	(T (princ "No objects selected") )
  -	; read selected entity's type if present; otherwise repeat
  -      ); cond
  -    );while
  +		(entName (setq entType (cdr (assoc 0 (entget entName) ) ) ) )
  +		(T (princ "No objects selected") )
  +		; read selected entity's type if present; otherwise repeat
  +      )
  +    )
       (setq entType 0)
   
       ; replace the chosen label
  
positive.code: ;Sep 25, 2014 : Refactoring program
  ;Sep 26, 2014 : FindAll function added
  ;		Initial menu created
  ;--------------------------------------------------------------
  (defun incrementBy (jump)
    (setq *pnlCur (+ *pnlCur jump) )
    (while (> *pnlCur *pnlLim)
      (setq *pnlCur (- *pnlCur *pnlLim) )
      (setq *strCur (1+ *strCur) )
    )
    (if (> *strCur *strLim)
      (progn
        (alert "You have reached the end of the last string.")
        (setq term 1)
        (setq *strCur nil)
        (setq *pnlCur nil)
      ); progn
    ); if
  )
  
  (defun incrementEntityBy (jump ent / index entInfo txt pnlNum strNum)
  
negative.code:     ( (= funcMod "R") (Replace) )
      ( (= funcMod "I") (Increment) )
      ( (= funcMod "F") (FindAll) )
  ;    ( (= funcMod "S") (Setup) )
    )
  )
  