Slide 10.15: Line-by-line anatomy of DB.c (cont.) Slide 10.17: Line-by-line anatomy of DB.c (cont.) Home |
DB.c
(Cont.)
StrPrintF( buf, "%ld record(s) still locked.", locks );
sprintf
call, which writes formatted output to a string.
s
:
Pointer to a string into which the results are written
formatStr
:
Pointer to the format specification string
...
:
Zero or more arguments to be formatted as specified by formatStr
DmCloseDatabase( db );
dbP
:
Database access pointer
DmNewRecord( db, &index, sizeof( DBRecordType ) )
dbP
:
DmOpenRef
to open database
atP
:
Pointer to index where new record should be placed.
Specify the value dmMaxRecordIndex
to add the record to the end of the database.
size
:
Size of new record
busy
and dirty
bits are set for the new record and a unique ID is automatically created.
DmReleaseRecord( ) should be called as soon as the caller finishes viewing or editing the record.