1. How can a table be the current table if it's parent database is closed?
- Posted by K_D_R Feb 09, 2012
- 1771 views
I have a routine which lists the current database, current table and all other open databases.
If I open a table and then close its parent database db_current_table still reports it as the current table.
If I select or open another database, db_current becomes undefined as expected and the routine likewise performs as expected:
procedure db_banner(sequence operation) set_top_line(" ") text_color(TOP_LINE_TEXT_COLOR) current_db = filebase(db_current()) printf(SCREEN, "%s",{current_db}) text_color(TOP_LINE_DIM_COLOR) puts(SCREEN, ":") current_table = db_current_table() --<<----------------- text_color(TOP_LINE_TEXT_COLOR) printf(SCREEN, "%s", {current_table}) text_color(TOP_LINE_DIM_COLOR) ----- -- snip ----- end procedure
Shouldn't the db_current_table become undefined if its parent db is closed?
Regards, Kenneth Rhodes
2. Re: How can a table be the current table if it's parent database is closed?
- Posted by DerekParnell (admin) Feb 09, 2012
- 1765 views
Shouldn't the db_current_table become undefined if its parent db is closed?
Yes it should. I'll raise an bug report for it.
3. Re: How can a table be the current table if it's parent database is closed?
- Posted by K_D_R Feb 09, 2012
- 1758 views
Shouldn't the db_current_table become undefined if its parent db is closed?
Yes it should. I'll raise an bug report for it.
Ok, thanks.... this was on Linux.
4. EDS: fix for db_close() failure to render current table undefined
- Posted by K_D_R Feb 14, 2012
- 1468 views
While studying the EDS include file std/eds.e
I noticed that the routines which appropriately rendered the current table as "undefined" included these two lines:
current_table_pos = -1 current_table_name = ""
Inserting those two lines in the end of the eds.e routine db_close() at line 1430 after the statement, current_db = -1, and before the statement, key_pointers = {}, seems to correct the problem:
public procedure db_close() -- -- snip -- current_db = -1 current_table_pos = -1 --<--- insert current_table_name = "" --<--- insert key_pointers = {} end procedure
I have not tested this extensively. Please advice if this is not an appropriate "fix".
Regards, Kenneth Rhodes