anchor.diff:  ;Sep 25, 2014 : Refactoring program
   ;Sep 26, 2014 : FindAll function added
   ;		Initial menu created
  +;Oct 30, 2014 : General cleanup
  +;		Fixed a bug where increment would not work
  +;			properly if negative number is given
   ;--------------------------------------------------------------
  +
  +(defun *error* ( errormsg )
  +  (if (not (member errormsg '("Function cancelled" "quit / exit abort" "Cancel") ) )
  +    (princ (strcat "\nError: " errormsg) )
  +  )
  +  (princ)
  +)
  +
  +;NOTE: incrementEntityBy terminates AFTER changing the entity,
  +;      whereas incrementBy only assigns values to *pnlCur and *strCur.
   (defun incrementBy (jump)
     (setq *pnlCur (+ *pnlCur jump) )
  +
  +  ; Step up / down
     (while (> *pnlCur *pnlLim)
       (setq *pnlCur (- *pnlCur *pnlLim) )
       (setq *strCur (1+ *strCur) )
     )
  +  (while (< *pnlCur 0)
  +    (setq *pnlCur (+ *pnlCur *pnlLim) )
  +    (setq *strCur (1- *strCur) )
  +  )
  +
  +  ;Terminates if the label is outside of the limit
     (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)
  
positive.code:   (setq index 1)
    (setq txt (cdr (assoc 1 entInfo) ) ); (pnlNum).(strNum)
  
    ; separate pnlNum and strNum from 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
    (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
    (if (> strNum *strLim)
      (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
  	(cond
  	  ( (getint
  	      (strcat "\n" msg " <"
  		      (if (eval var) (itoa (eval var) ) "1")
  		      ">: "
  	      ); strcat
  	    ); getint
  	  )
  	  ( (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)
    ; 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) 
    (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
      (setq entType 0)
  
      ; replace the chosen label
  
negative.code: ;--------------------------------------------------------------
  ;Sep 23, 2014 : Initial commitment
  ;		Fixed a bug where current string & panel number
  