anchor.diff:    (princ)
   )
   
  -;(defun Setup()
  -;  (ask-int '*pnlLim "Enter number of panels per string" 9001)
  -;  (ask-int '*strLim "Enter number of strings existing" 9001)
  -;  (ask-int '*inv1StrMax "Enter number of strings for inverter #1" 9001)
  -;  (setq *inv1StrMin 1)
  -;  (ask-int '*inv2Str "Enter number of strings for inverter #2" 9001)
  -;  (setq *inv2StrMin (1+ *inv1StrMax)
  -;	*inv2StrMax (+ *inv1StrMax *inv2Str)
  -;  )
  -;  (ask-int '*inv3Str "Enter number of strings for inverter #3" 9001)
  -;  (setq *inv3StrMin (1+ *inv2StrMax)
  -;	*inv3StrMax (+ *inv2StrMax *inv3Str)
  -;  )
  -;)
  -
  -(defun Label (/ mod done)
  -  (prompt
  -    (strcat "\nWhich action would you like to do?"
  -      "\n[R]eplace existing label,"
  -      " [I]ncrement labels,"
  -      " [F]ind identical blocks"
  -      " [S]etup string schedule: "
  -    ); strcat
  -  ); prompt
  -  (while (and (not done) (setq mod (grread T 12 0)))
  -    (cond
  -      ((or (equal opt '(2 82)) (equal mod '(2 114))); typed R or r
  -        (setq done T); [stops (while) loop to end this routine with calling of chosen routine]
  -        (Replace)
  -      ); R condition
  -      ((or (equal opt '(2 73)) (equal mod '(2 105))); typed I or i
  -        (setq done T)
  -        (Increment)
  -      ); I condition
  -      ((or (equal opt '(2 70)) (equal mod '(2 102))); typed F or f
  -        (setq done T)
  -        (FindAll)
  -      ); F condition
  +(defun Label(/ ddiag dcl_id ret)
  +  (setq ret nil)
  +  ;; Try to load the DCL file from disk into memory
  +  (if(not(setq dcl_id (load_dialog "Menu.dcl")))
  +    (progn
  +      (alert "The DCL file could not be loaded.")
  +      (exit)
  +    )
  +    (progn
  +      ;; Try to load the definition inside the DCL file
  +      (if (not (new_dialog "Menu" dcl_id))
  +        (progn
  +          (alert "The definition could not be found inside the DCL file")
  +          (exit)
  +        )
  +
  +	;; If the definition was loaded
  +        (progn
  +	  ;; Generate initial value for variables
  +  	  (set_tile "pnlCur" (cond (*pnlCur (itoa *pnlCur)) (T "1")))
  +	  (set_tile "strCur" (cond (*strCur (itoa *strCur)) (T "1")))
  +	  (set_tile "pnlLim" (cond (*pnlLim (itoa *pnlLim)) (T "1")))
  +	  (set_tile "strLim" (cond (*strLim (itoa *strLim)) (T "1")))
  +	
  +          ;; If an action event occurs, do this function
  +          (action_tile "cancel" "(done_dialog 1)")
  +          (action_tile "accept" "(saveVars)(done_dialog 2)")
  +	  (action_tile "replace" "(saveVars)(done_dialog 3)")
  +	  (action_tile "increment" "(saveVars)(done_dialog 4)")
  +	  (action_tile "findAll" "(saveVars)(done_dialog 5)")
  +
  +	  ;; Execution of action tiles
  +          (setq ddiag(start_dialog))
  +
  +          (if (= ddiag 1)
  +            (princ)
  +          )
  +          (if (= ddiag 2)
  +            (princ)
  +          )
  +	  (if (= ddiag 3)
  +	    (Replace)
  +	  )
  +	  (if (= ddiag 4)
  +	    (Increment)
  +	  )
  +	  (if (= ddiag 5)
  +	    (FindAll)
  +	  )
  +        )
  +      )
  +    )
  +  )
  +)
  +
  +;(defun Label (/ mod done)
  +;  (prompt
  +;    (strcat "\nWhich action would you like to do?"
  +;      "\n[R]eplace existing label,"
  +;      " [I]ncrement labels,"
  +;      " [F]ind identical blocks"
  +;      " [S]etup string schedule: "
  +;    ); strcat
  +;  ); prompt
  +;  (while (and (not done) (setq mod (grread T 12 0)))
  +;    (cond
  +;      ((or (equal opt '(2 82)) (equal mod '(2 114))); typed R or r
  +;        (setq done T); [stops (while) loop to end this routine with calling of chosen routine]
  +;        (Replace)
  +;      ); R condition
  +;      ((or (equal opt '(2 73)) (equal mod '(2 105))); typed I or i
  +;        (setq done T)
  +;        (Increment)
  +;      ); I condition
  +;      ((or (equal opt '(2 70)) (equal mod '(2 102))); typed F or f
  +;        (setq done T)
  +;        (FindAll)
  +;      ); F condition
   ;      ((or (equal opt '(2 83)) (equal mod '(2 115))); typed S or s
   ;        (setq done T)
   ;        (Setup)
   ;      ); S condition
  -    ); cond
  -  ); while
  -); defun
  -
  +;    ); cond
  +;  ); while
  +;); defun
  +
  
positive.code: ;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
  ;Oct 31, 2014 : Improvement on accessing functions
  ;--------------------------------------------------------------
  
  (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.")
  
negative.code: )
  
  (defun Replace(/ term txt entName entType entInfo)
    (setq ret T)
  ;  ;; initialize
  ;  (ask-int '*pnlLim "Enter number of panels per string" 9001)
  ;  (ask-int '*strLim "Enter number of strings existing" 9001)
  ;  (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
        )
      )
      (setq entType 0)
  
      ;; replace the chosen label
      (setq entInfo (entget entName) )
      (setq txt (strcat (itoa *pnlCur) "." (itoa *strCur) ) )
      (setq entInfo (subst (cons 1 txt) (assoc 1 entInfo) entInfo) )
  