Sign up on the Revelation Software website to have access to the most current content, and to be able to ask questions and get answers from the Revelation community

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

View this thread on the forum...

  • third_party_content/community/commentary/forums_nonworks/5f288bcddfe08716852565a900352c1b.txt
  • Last modified: 2024/01/04 21:00
  • by 127.0.0.1