(defun daysold (d / sc cmd result) (setq sc (vlax-create-object "ScriptControl")) (vlax-put-property sc 'Language "vbscript") (setq cmd (strcat "DateDiff(\"d\", \"" d "\", Now)" )) (setq result (vlax-invoke-method sc 'Eval cmd)) (vlax-release-object sc) (eval result) ) (setq age (daysold "12/1/2010"))
You can do the same with JavaScript (actually JScript) as well.
No comments:
Post a Comment