hi, could have a little help w/ my while loop. This is to convert hours-min-sec to decimal and to check that 6 digits have been entered in the case of eg. 5.4352 would be 6 digits and continue to the rest of the program. But someone may try to enter .0045 leaving the preceding 0 out and thereby screwing up the substr count. Then the code continues for the case of 7 digits which would be eg. 45.5634 and substr picks the corresponding text out. I know this is a little shaky, maybe there's a better way to approach this? But right now the while loop doesn't work, it should continue if the getstring variable contains 6 characters if it doesn't it should print "not enough digits" and loop unitl satisfactory. TIA Shawn (defun dms () (while (or (setq deg1 (getstring " Enter Bearing in Deg Mins Sec: ")) (setq strl (strlen deg1)) (if (= strl 6) (progn (setq deg (atof (substr deg1 1 2)) mins (atof (substr deg1 3 2)) sec (atof (substr deg1 5 2)) ang_degs (+ deg (/ mins 60.0) (/ sec 3600.0)))) (print "not enuff digits")))))