home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC Press 1997 July
/
Sezamfile97_1.iso
/
msdos
/
c
/
cbase11.a03
/
CBASE11.ZIP
/
MAN
/
ROLODECK.MAN
< prev
next >
Wrap
Text File
|
1993-01-01
|
2KB
|
53 lines
NAME
rolodeck - card file
SYNOPSIS
rolodeck
DESCRIPTION
rolodeck is an example program for the cbase library. In order
to allow it to be compiled without requiring a specific screen
management library, only a minimal user interface has been
implemented.
NOTES
Below are listed a few of the more important points to note when
examining the rolodeck source code.
o White space is significant in string data. For
instance, " data" != "data". Leading and
trailing white space is therefore usually
removed before storing a string in a database.
Also, embedded white space may be reduced to a
single space. The cvtss function included with
cbase will perform these string operations.
o Names are often input and displayed
first-name-first. For them to sort correctly in
a database, however, they must be stored
last-name-first. The functions fmltolfm and
lfmtofml are included with cbase to convert
between these two formats.
o To prevent loss of buffered data, blkio buffers are
flushed on exit either by registering the function
bcloseall with atexit, or by using bexit in place of
exit.
The following notes concern locking.
o Single-tasking applications can simply lock
a cbase and leave it locked.
o Locks are held for shortest time possible; a
lock is never held during user input.
o A write lock should not be used when only a read
lock is required.
o When a database file is unlocked, it may be
modified by another process. A record at a
given file position may be deleted, and the
empty slot possibly reused for a new record.
Because of this, each time a file is locked,
the current record must be located by performing
a search on a unique key.
o If locking multiple cbases, deadlock must be
avoided (see The cbase Programmer's Guide).