>A am preparing to add a "good for 30 days unless you buy it" feature to a VFP applicaion. I'm interested in your experience with this and where you think the best place to store the related information is. I'm thinking about the registry.
>
>Any recommendations appreciated.
>
>Isabel Cabanne
In addition to Alex and Brandon, there is a "cheap and dirty" way.
Your program would need a system DBF with a 10 character field. Leave it blank. Lets call the field cStartUp
First time user runs program, get the system date convert it to a string and replace the "slashes" with "dots" so it appears as
"01.01.2004", and the write it to the (empty character) field (cStartUp)in the "system" dbf.
When your app runs use this house keeping code
select MySystem
if empty(cStartUp)
replace cStartUp with STRTRAN(DTOC(DATE()),[/],[.])
else
if ![.]$cStartUp
messagebox([Time to buy!])
else
if DATE()-CTOD(STRTRAN(cStartUp,[.],[/]))>29
replace cStartUp with STRTRAN(cStartUp,[.],[/])
endif
endif
endif
Typically, if the user has a means to modify the date they will place dashes "-", or slashes "/" to trick the expiration (ex: "02/01/2004", which will STILL kick in the Expiration message!
Of course this doesn't account for re-intstalls or "blanking" the cStartUp field (this could be overcome by putting something in the firld (not leaving it empty).
Imagination is more important than knowledge