Database: 3.6 Using Database Routines: Setting and Using the Map Item

Up: GEOS SDK TechDocs| Up | Prev: 3.5 Resizing DB Items | Next: 3.7 Routines for Ungrouped Items
DBSetMap(), DBGetMap(), DBLockMap()

A VM file can have a map block and a map item . The map can be retrieved with a special-purpose routine, even if you don't know its handle (or handles); thus, the map usually keeps track of the handles for the rest of the file. The map can be retrieved even if the file is closed and re-opened. To set a map block, use the routine VMSetMap() (see the VM chapter). To set a map item, use the routine DBSetMap() . DBSetMap() takes three arguments: the file handle, the item's group-handle, and the item's item-handle. The routine sets the file's map item to the DB item specified. A VM file can have both a map block and a map item; these are set independently.

Once you have set a map item, you can retrieve its handles with the command DBGetMap() . This routine takes one argument, namely the file's handle. It returns a DBGroupAndItem value containing the map item's handles. You can break this value into its constituent handles with DBGroupFromGroupAndItem() and DBItemFromGroupAndItem() (see Routines for Ungrouped Items). You can also lock the map directly without knowing its handles by calling the routine DBLockMap() . This routine takes one argument, namely the file handle. It locks the map item and returns the map's address. When you are done with the map item, unlock it normally with a call to DBUnlock() .


Up: GEOS SDK TechDocs| Up | Prev: 3.5 Resizing DB Items | Next: 3.7 Routines for Ungrouped Items