Working on the Database behind the scenes

In all of the examples so far, the command language manipulated or accessed the database, but also changed the user interface of the database. For example, the #VIEW Weapons command will change the current database to the Weapons view. zMUD also has a powerful way to perform scripts in the background without effecting the user interface. The user can be editing a different view of a different database while your script is running. Only if your script accessing the same record that the user is editing does a conflict occur, with whoever saves the record last taking priority.

To work in the background, use the #DBOFFLINE command. Now, all database commands and functions will work as normal, but no changes will be displayed in the database user interface. To return to "live" mode, use the #DBONLINE command.

The %find and %query commands already work in Offline mode so you don't have to worry about them. Also, the column functions: %sum, %average, %stdev, %count, %dblist, %dbmin, and %dbmax already work in Offline mode.

Contents Creating New Records