[top][index]
search for:

Database -- the class of all database files

The type Database is a member of the class Type. Each object of class Database is called a database.

A database file is just like a hash table, except both the keys and values have to be strings.

i1 : filename = temporaryFileName () | ".dbm"

o1 = /tmp/M2-24760-1.dbm
i2 : x = openDatabaseOut filename

o2 = /tmp/M2-24760-1.dbm

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

o3 = hi there
i4 : x#"first"

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

o5 = ho there
i6 : scanKeys(x,print)
first
second
i7 : close x

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

o8 = 0

See also:

  • HashTable -- the class of all hash tables
  • String -- the class of all strings
  • Functions and methods returning a a database :

  • openDatabase String
  • openDatabaseOut String
  • Methods for using a database :

  • Database # String -- get value from database
  • Database #? String -- check for value in database
  • expression Database
  • Manipulator Database
  • net Database
  • scanKeys(Database,Function)

  • [top][index]
    search for: