Tim Cole Posted September 14, 2004 Posted September 14, 2004 Is there anyway to import a date from a text file and check and see if that date is greater than 90 days. I have an application and I want a shut off procedure that exits the program if the date text file they have is greater than 90 days. Does anyone have any ideas and the code if possible.
QuinTech Posted September 14, 2004 Posted September 14, 2004 Yes, but i'd recommend against that. I imagine you are distributing a solution and want an easy way to make the product expire. Using the method you suggest, a savvy user could just open the text file and change the date. It's slightly more complicated to do this completely within FM--you'd basically need a global field called "PurchaseDate" which you could set to auto-fill with the current date the first time the file is opened, then check that field against Status ( CurrentDate ) to check for the 90-day limit. Unless that text file has other significance or is somehow auto-generated... Jerry
Tim Cole Posted September 14, 2004 Author Posted September 14, 2004 Thanks for your help. I having to come in behind someone and take over a product that has already been created. So what you are saying is import the text file into a global field and check and see if that field and the current date is greater than 90 days. We are looking at changing the text file date every day, the user will be able download their data(there are 4 txt files including the txt we are talink about) as long as they are active user with us they can download the txt with the date. Does this sound like the best way to do this?
QuinTech Posted September 14, 2004 Posted September 14, 2004 So you are saying there is other data in this or other text files that users will need to refresh daily? The system you seem to be suggesting is still not very secure, as it seems the user could just download the text files, change the date in the appropriate text file, and steal your data. I would change the point of restriction to wherever they download from, and just prevent the remote user from even getting the 4 txt files you speak of if they are not currently licensed. How does that download occur? Do they download from an ftp site or what? J
Tim Cole Posted September 15, 2004 Author Posted September 15, 2004 The program imports the data from a file that they download, once they download the txt file, the program automatically deletes the file.
QuinTech Posted September 15, 2004 Posted September 15, 2004 Your best, most secure option will definitely be to restrict access to the downloadable files. But if i were going to implement a system where the user is authorized based on the contents of the text file you described, i would create a script called Opener and set your file to run this script upon opening. The steps in Opener: Import Date From Text File If ( Status ( CurrentDate ) - DateImportedFromFile ) > 90 Exit Application End If where DateImportedFromFile is the field into which your data has been imported. J
Tim Cole Posted September 20, 2004 Author Posted September 20, 2004 Thanks for your help. I live in Alabama and with the Hurricane coming through we were closed Thur and Friday. I will try this, Thanks again.
Recommended Posts
This topic is 7438 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now