Code Red > AutoLISP (Vanilla / Visual)
Time bomb
matrix2005in:
hi i need to set current date + 30 for expiry date how can i do that?? i tried to add +30 to start date but it gives error..
--- Code: ---(defun bomb ()
(setq bombif (getvar "cdate"));;getsthe current date
(if (> 20010829.00000000 bombif);i need to set expiry date as start date+30
(alert "you are in")
(princ "\Version Expired!")
)
)
--- End code ---
Bob Wahr:
add 100
matrix2005in:
thanks
but where and how that will work
if you dont mind can you explain little...
Bob Wahr:
You should actually check the 3rd and 4th digits to the left of the decimal. If they are 2 and 1 respectively then instead of adding 100, you need to add 8900.
The number CDATE gives you isn't actually a number, it just looks like one. it is YYYYMMDD.HHMMSSSS
You're probably better off using DATE instead of CDATE. There's a thread around here somewhere, I'll try to turn it up.
Bob Wahr:
http://www.theswamp.org/index.php?topic=10405.0
Navigation
[0] Message Index
[#] Next page
Go to full version