Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 01/19/2019 in all areas

  1. A good suggestion, and you're welcome.
    1 point
  2. The easiest way is to use the contiguous Julian date system, e.g.: ( (lambda ( date expdate / dif ) (if (cond ( (not (or dtoj (and (load "julian.lsp" nil) dtoj)))) ( (<= (setq dif (- (fix (dtoj expdate)) date)) 0) (alert "Program has expired.") ) ( (progn (alert (strcat "Program will expire in " (itoa dif) " day" (if (= 1 dif) "." "s."))) t)) ) (progn (defun c:test ( ) (alert "Hello World!") (princ) ) ) ) ) (fix (getvar 'date)) 20190131 ) Here, the Express Tools' dtoj function is only used to make it easier to specify the expiration date in the code - you can easily remove this reliance by specifying the expiration date as a Julian date directly in the code. Note that this approach is still susceptible to the user changing the system clock - hence the suggestion to use my Internet Time function above.
    1 point
×
×
  • Create New...