Hello, I am currently developing a routine that will find the total length of all selected polylines, lines ect, and, if the user would like, estimate how long it will take a machine to cut it. I recently separated the code so that the estimated time was an optional function. But now when I run it Cad, not the build window, tells me I have too few arguments, I've been staring at it all day and surfing the boards for anything that may help but alas I can't figure it out, is there anyone who could point me in the right direction?
Much Thanks!

Code:
 
(defun C:justdoit (ssSelections sngLength runType a)

(setq ssSelections (ssget (list (cons 0 "*POLYLINE,LINE,ARC,CIRCLE,SPILNE")))
     	   sngLength	0
      )
  (initget "Yes No")
  (setq runType (getkword "\n Would you like the Estimated Machining Time to be Calculated? Yes/<No>: "))
  (if (= runType No)    
	(setq a (function <funtype1>))
    	(setq a (function <funtype2>))
    )
	    




  
  (defun funtype1 (/ intCount entItem sngLength objItem)
      
      (repeat (setq intCount (sslength ssSelections))
       (setq intCount  (1- intCount)
     		entItem   (ssname ssSelections intCount)
     		objItem   (vlax-ename->vla-object entItem)
     		sngLength (+ snglength (vlax-curve-getDistAtParam objItem 
     				   (vlax-curve-getEndParam objItem)
     				  );vlax
			     );+sngLength 
       );setq
      );loop
      sngLength
   );function






  
(defun C:GetLength (/ intCount entItem sngLength objItem impSpeed nubTools
		    passDepth materialThickness passNub machTime)


  			(setq 	impSpeed	(getreal "\nWhat is the feedrate (IMP value) of your machine? ")
				nubTools	(getreal "\nHow many cutting heads will be used?")
				passDepth	(getreal "\nWhat is the pass depth (inches value)?")
				materialThickness(getreal "\nWhat is the thickness of the material (inches) ")       				
       				passNub		(/ materialThickness passDepth)       				 
       				machTime	(* (/ sngLength impSpeed) passNub(+ 1.5 (* 1.5 nubTools))) ;assuming it takes 1-1/2 minute to change a bit
	);setq
  


  	(repeat  (setq intCount (sslength ssSelections)
		 intCount  (1- intCount)
       		 entItem   (ssname ssSelections intCount)
     		 objItem   (vlax-ename->vla-object entItem)
     		 sngLength (+ snglength (vlax-curve-getDistAtParam objItem 
     				   (vlax-curve-getEndParam objItem)
     				  );vlax1
			     );+snglength
		 machTime  (* (/ sngLength impSpeed) passNub(+ 1.5 (* 1.5 nubTools))) ;assuming it takes 1-1/2 minute to change a bit
			);setq
	  ); Loop
sngLength
 machTime 
  );function
  );main function