EDB with Fields
- Posted by "C. K. Lester" <cklester at yahoo.com> May 31, 2002
- 464 views
I was wondering if those with EDB viewers could easily modify their programs to do the following: 1. If a key = 0, label that record as "FIELD NAMES" 2. If a record exists where key = 0, use the sequence in that record to NAME the data in other records For instance, if this record exists: key = 0 data = { "Date","Time","User Name","Path" } Then data for this record: key = 879283 data = { "05/10/02","12:15:17","cklester","C:\\Program Files\\Microsoft Office\\Templates"} would display like this: Key: 879283 Date: 05/10/02 Time: 12:15:17 User Name: cklester Path: C:\Program Files\Microsoft Office\Templates (or something similar) I've modified database.e to handle the referencing of data using field names. For instance, I can use the following: data = get_data( {"Date","Time","Path"}, "User Name", "cklester") Basically, this says, "Return the data items of 'Date,' 'Time,' and 'Path' for each record where 'User Name' equals 'cklester.'" The sequence data would then equal { "05/10/02" , "12:15:17" , "C:\Program Files\Microsoft Office\Templates" }. For me, this is an easier way to reference data in a database. Also, I've modified db_insert(x,y) so that if x = DB_UNIQUE_KEY (a new global constant), a random unique key will automatically be generated for that record. I'm planning on making the following additions: key = -1 is an input mask for each field; the db manager could use this to limit input key = -2 is a "Display Name" list of field names; for instance, if I have a field named "DOB," the display name could be "Date of Birth." Again, the db manager would need to utilize this. key = -3 is a relationships sequence; this stores foreign keys (I think) If anybody has any other suggestions or hints/tips/tricks, please let me know. Thanks! ck