Posted 20 January 2016 - 09:09 PM
Okay, so I'm still learning about how tables and data work as far as using them in programs, so here's what I need help with:
I'm writing a keycard-based lock system, which is admittedly a bit messy and not terribly secure at the moment, but once I get the basics down I can try and make it more secure.
So, the idea right now is that the computer waits for a user to insert a floppy disk into a drive, and if the label on the disk matches a name recognized as either an "employee" or an override passphrase, it'll open the door.
Now, what I want to do is, instead of having the "employee" variable be a single string, I'd like the program to read from a text file that contains a list of employee names, and if the floppy's name matches any of those strings, it unlocks the door. All I can figure out right now is that this probably requires a table or some method of storing a number of variables, but I'm not quite sure how to match it.
While I'm on the subject, there is a secondary thing I need help with - I'm also working on an additional function that allows new people to register as employees - I've got the basics down for how that works, but I need to figure out how to write the user's name to the aforementioned list of employees.
As always, I appreciate the help!
I'm writing a keycard-based lock system, which is admittedly a bit messy and not terribly secure at the moment, but once I get the basics down I can try and make it more secure.
So, the idea right now is that the computer waits for a user to insert a floppy disk into a drive, and if the label on the disk matches a name recognized as either an "employee" or an override passphrase, it'll open the door.
Now, what I want to do is, instead of having the "employee" variable be a single string, I'd like the program to read from a text file that contains a list of employee names, and if the floppy's name matches any of those strings, it unlocks the door. All I can figure out right now is that this probably requires a table or some method of storing a number of variables, but I'm not quite sure how to match it.
While I'm on the subject, there is a secondary thing I need help with - I'm also working on an additional function that allows new people to register as employees - I've got the basics down for how that works, but I need to figure out how to write the user's name to the aforementioned list of employees.
As always, I appreciate the help!