Removing dictionary specifications (OpenInsight Specific)
At 12 FEB 1998 04:40:46AM Peter Richards wrote:
I cannot delete 3 dictionary symbolics. They have been saved as lower case (naughty me ) and no matter what I try, I cannot get rid of them. Have tried renaming, changing the symbolic name to uppercase, etc, etc.
The %FIELDS% row for the dictionary has these items defined as lowercase, but I cannot change this row (protected).
Peter
At 12 FEB 1998 07:37AM Cameron Revelation wrote:
Peter,
I cannot delete 3 dictionary symbolics. They have been saved as lower case (naughty me )
No comment on the naught part.
![]()
Removing those dictionary items is very easy in BASIC+. The following code should do it (but I haven't tested it):
<code> function RemoveLowerCaseKeys(Table) open Table to f else return "Unable to open ": quote(Table) select f eof=0 c=0 loop readnext key else eof=1 until eof test=key convert @lower.case to "" in test if "*":test # "*":key then delete f, key else return "unable to delete ": quote(key) c += 1 end repeat return c: " rows deleted."</code>
Run it as follows:
run RemoveLowerCaseKeys "DICT."
Please make a backup copy of your dictionary and table before running it just in case.
Alternatively you could rename the keys to their uppercase equivalents:
<code> function RenameLowerCaseKeys(Table) open Table to f else return "Unable to open ": quote(Table) select f eof=0 c=0 loop readnext key else eof=1 until eof new=key convert @lower.case to @upper.case in new if "*":new # "*":key then read rec from f, key else return "unable to read ": quote(key) write rec to f, new else return "unable to write ": quote(new) delete f, key else return "unable to delete ": quote(key) c += 1 end repeat return c: " rows renamed."</code>
Cameron Purdy
info@revelation.com
At 12 FEB 1998 05:29PM Peter Richards wrote:
Cameron,
Thanks for the code, I was tearing my hair out, and becoming quite frustrated because I am rather bald.
Peter