;; | ---------------------------------------------------------------------------- ;; | MI_GetDate ;; | ---------------------------------------------------------------------------- ;; | Function : Returns the date in a list format (DD MM YYYY) ;; | Auguments : 'Str' - Prompt string to display ;; | 'dflt' - Default value to offer ;; | Return : A list in the format of (list DD MM YYYY) ;; | Updated : July 1, 2007 ;; | Comment : Returns the entered date as a list ;; | e-mail : rakesh.rao@4d-technologies.com ;; | Web : www.4d-technologies.com ;; | ---------------------------------------------------------------------------- (defun MI_GetDate ( Str dflt / More Lst _Str len _dflt ) (if (not dflt) (setq dflt (MI_Today)) ) (setq More T) (while More (setq _dflt (LI_Lst2Str (mapcar 'itoa dflt) "-") _Str (MI_askstrng Str _dflt) ) (if (or (and (setq Lst (ST_Str2Lst _Str "-")) (= (setq len (length Lst)) 3)) (and (setq Lst (ST_Str2Lst _Str "/")) (= (setq len (length Lst)) 3)) (and (setq Lst (ST_Str2Lst _Str ".")) (= (setq len (length Lst)) 3)) ) (progn (setq Lst (mapcar 'atoi Lst)) (if (MI_DateFmtOk (nth 0 Lst) (nth 1 Lst) (nth 2 Lst)) (setq More nil dflt Lst ) ) ) ) ) dflt )