Database

Database -- the class of all database files.

i1 : filename = tmpname "test.dbm"

o1 = /tmp/8346test.dbm

o1 : String
i2 : x = openDatabaseOut filename

o2 = --database /tmp/8346test.dbm--

o2 : Database
i3 : x#"first" = "hi there"

o3 = hi there

o3 : String
i4 : x#"first"

o4 = hi there

o4 : String
i5 : x#"second" = "ho there"

o5 = ho there

o5 : String
i6 : scanKeys(x,print)
first
second
i7 : close x

o7 = 0
i8 : run ("rm -f " | filename)

o8 = 0

Functions:
  • openDatabase -- open a database file
  • openDatabaseOut -- open a database file for writing
  • close -- close a database file
  • # -- fetch or store in a database file
  • #? -- query a database file
  • firstkey -- get the first key
  • mutable -- whether changes can be made
  • nextkey -- get the next key
  • reorganize -- compactify a database file
  • scanKeys -- apply a function to each key

  • topindexpreviousupnext