Slide 10.14: Line-by-line anatomy of DB.c (cont.)
  Slide 10.16: Line-by-line anatomy of DB.c (cont.)
  Home


Line-by-line Anatomy of DB.c (Cont.)


DmDatabaseProtect( dbCard, dbID, (locks > 0) ? false : true );
This function Err DmDatabaseProtect( UInt16 cardNo, LocalID dbID, Boolean protect ) increments or decrements the database's protection count. Returns errNone if no error, or one of the following if an error occurs:
  • memErrCardNotPresent
  • dmErrROMBased
  • dmErrCantFind
  • memErrNotEnoughSpace
  • dmErrDatabaseNotProtected
This routine can be used to prevent a database from being deleted (by passing true for the protect parameter). All true calls should be balanced by false calls before the application terminates. Use this function if you want to keep a particular record or resource in a database locked down but don't want to keep the database open. This information is kept in the dynamic heap, so all databases are “unprotected” at system reset.

FrmCustomAlert( ErrorAlert, buf, "...", "..." );
This function UInt16 FrmCustomAlert( UInt16 alertId, const Char *s1, const Char *s2, const Char *s3 ) creates a modal dialog from an alert resource and displays the dialog until the user taps a button in the alert dialog.