home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C!T ROM 5
/
ctrom5b.zip
/
ctrom5b
/
DOS
/
DATABASE
/
DBM112
/
DBM.DOC
< prev
next >
Wrap
Text File
|
1995-05-01
|
60KB
|
1,542 lines
▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
▒ ▒▓
▒ DBM - database manager ver 1.12 ▒▓
▒ ▒▓
▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▓
▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
CONTENTS
────────
General:
■ Introduction
■ Main Features
■ Installation
Basic Topics:
■ Getting Started
■ Exiting DBM
■ Mouse Convention
■ Hot Keys
■ DBM Scratch Files
■ Command Line Options
■ Submenu Hiararchy
■ Keys in PAGEMODE
■ Keys in WINDOWMODE
■ Load Database Files
■ Database Alias Convention
■ Load Screen Format and Print Design
■ How to Create a Format File
■ Write Database
■ Toggle Workareas
■ Edit a Record
■ Create a Record
■ Duplicate a Record
■ Search a Record
■ Create or Edit Database Structure
■ Make, Load and View Database Indexes
■ Set and View Database Filters
■ Set and View Database Relations
■ Load and Edit User Scratch Files
■ Print Workarea
■ Merge a Database File
■ Conversion between Database and Ascii Text
■ Text Dump and Field Summation
■ Text Editing
■ Paste Text
■ DOS Shell
■ External Utility
Advanced Topics:
■ Screen Format Database (*.dbm)
■ Print Design Database (*.dbp)
■ Translation Map Database (*.map)
■ Users' Scratch Public Variables
■ Print Design Examples
■ Other Details
Introduction
────────────
The DBM - database manager is a general-purpose database manager for
IBMPC and compatible computers. It works in text mode screen with
excellent mouse support. DBM also supports user configuration for
user-defined tasks on specific database files.
DBM may be cut down on its power in such a way that only pre-assigned
viewing mode and other tasks are permitted, so that less-privileged
users may be prevented from viewing and/or altering important data
fields.
Robustness is another purpose of DBM.
Main Features
─────────────
■ mouse support, and 25/43/50 x 80/132 screen displays
■ edit/view in page(s)-per-record mode, with user-defined format
■ edit/view in traditional row-per-record mode
■ edit/view record in column mode
■ input via translation maps
■ set/make indexes, filters and relations
■ create/merge/convert database files
■ conversion between database and text, that protects memos
■ execute user-defined action tasks such as printing etc
■ perform user-defined business transaction interface
■ allow cutdown on edit/view power to suit end user
■ command line initialisation of database, index etc
Installation
────────────
Just copy three files DBM.EXE, DBM.OVL and DBM.HLP to your
subdirectory, say C:\DBM. If you want to run DBM from other
directories, then put the DBM subdirectory on the PATH, and set
environmental parameter DBMHELPFILE to the helpfile name, via e.g.
SET DBMHELPFILE=c:\dbm\dbm.hlp
┌──────────────┐
│ Basic Topics │
└──────────────┘
Getting Started
───────────────
To start DBM, just type "DBM" at the DOS command prompt, then you will
get a submenu. You may now load in some existing database files or
create some new database files yourself. Nevertheless you may enter
directly the database filenames etc via the command line, see command
line options for more details.
Once at least one database is loaded/opened, you may generally go
among three sections of the program
I. PAGEMODE
view/edit a single record in one or several pages
II. WINDOWMODE
view/edit a single record as a single line
III. SUBMENU
miscellaneous tasks, with another choice of view/edit mode
in which fields of a single record is list vertically
The keys to move from section to section are as follows
<alt-S>
──────────────────── SUBMENU
<esc> or <num-del>
PAGEMODE
<esc>
──────────────────── WINDOWMODE
<F3>
If you need on-line help at any time, just press <F1>.
Typically, a screen in PAGEMODE would look like
╓──────────────────────────────────────────────────────────────────────────────╖
║ Help░ Submenu░ Window░ Toggle░ Goto░ Append░ Delete░ Recall░ Mark░ Escape░ ║
║ ░░░░ ░░░░░░░ ░░░░░░ ░░░░░░ ░░░░ ░░░░░░ ░░░░░░ ░░░░░░ ░░░░ ░░░░░░ ║
║ ░ ░ ░ ░ ░ ░ ░ ░ «» ░ # ░ ≈ ░ ░ ░ ░ ! ░║
║ ░░░░ ░░░░ ░░░ ░░░ ░░░ ░░░ ░░░ ░░░ ░░░░ ░░░ ░░░ ░░░ ░░░ ░░░ ░░░║
╟──────────────────────────────────────────────────────────────────────────────╢
║ stock.dbf ║
║Page No: 1/1 Rec No: 1/2 STOCK ║
╟──────────────────────────────────────────────────────────────────────────────╢
║ Item▒name▒▒▒▒ LADIES 12 INCH SHOES (super size) ║
║ Barcode▒▒▒▒▒▒ 94/LS-12 Order▒No.▒▒ 1 ║
║ ║
║ Date▒of▒stock 02/14/94 Last▒stocked▒▒ 05/01/94 Tax▒class▒▒ TAX 01 ║
║ Total▒cost▒▒▒ 800.00 Total▒stock▒▒▒ 40 Surname▒▒▒▒ DAVIS ║
║ ║
║ Buy▒price▒▒▒▒ 21.65 Total▒sold▒▒▒▒ 8 Main▒Suppliers▒▒▒▒ ║
║ Sale▒price▒▒▒ 49.95 Sold▒today▒▒▒▒ 0 1▒ Women On Top Limite ║
║ Discount▒▒▒▒▒ 0.00 Sold▒now▒▒▒▒▒▒ 1 2▒ ║
║ ║
║ Notes▒▒▒▒▒▒▒▒ The main suppliers are all women with hugh feet. ║
║ ║
║ ║
║ ║
╙──────────────────────────────────────────────────────────────────────────────╜
Format: stock.dbm,+.dbp <view>
and a screen in SUBMENU would look like
╓──────────────────────────────────────────────────────────────────────────────╖
║ Help░ Submenu░ Window░ Toggle░ Goto░ Append░ Delete░ Recall░ Mark░ Escape░ ║
║ ░░░░ ░░░░░░░ ░░░░░░ ░░░░░░ ░░░░ ░░░░░░ ░░░░░░ ░░░░░░ ░░░░ ░░░░░░ ║
║ ░ ░ ░ ░ ░ ░ ░ ░ «» ░ # ░ ≈ ░ ░ ░ ░ ! ░║
║ ░░░░ ░░░░ ░░░ ░░░ ░░░ ░░░ ░░░ ░░░ ░░░░ ░░░ ░░░ ░░░ ░░░ ░░░ ░░░║
╟──────────────────────────────────────────────────────────────────────────────╢
║ ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒ ║
║ ▒╓────────────────────────────────────────────────────────╖▒ ║
╟───────▒║▒File▒▒Edit▒▒Locate▒▒Structure▒▒Review▒▒Utility▒▒Info▒▒▒║▒───────────╢
║ ▒║▒┌─────────────┐▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒║▒ ║
║ ▒║▒│Load │▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒║▒ ║
║ ▒║▒│Writ┌───────────────┐▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒║▒ ║
║ ▒║▒│save│Database added │▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒║▒ ║
║ ▒║▒│conV│Format file │▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒║▒ ║
║ ▒║▒│db c│Print design │▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒║▒ ║
║ ▒║▒│Remo│New database │▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒║▒ ║
║ ▒║▒│pacK└───────────────┘▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒║▒ ║
║ ▒║▒│Print │▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒║▒ ║
║ ▒║▒│Edit print │▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒║▒ ║
║ ▒║▒│Shell │▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒║▒ ║
║ ▒║▒│Quit │▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒║▒ ║
║ ▒║▒└─────────────┘▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒║▒ ║
║ ▒║▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒║▒ ║
║ ▒║▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒║▒ ║
║ ▒║▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒║▒ ║
║ ▒╙────────────────────────────────────────────────────────╜▒ ║
║ ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒ ║
║ ║
║ ║
╙──────────────────────────────────────────────────────────────────────────────╜
and a screen in WINDOWMODE would look like
STOCK: stock.dbf
┌─[■]────────────────────────────────────────────────────────────────────[?]─┐
│ ░ ╬ ░ + ░ - ░ ° ░ ░ ░ ≈ ░ ░ ░ » ░ « ░ * ░ ░ ! ░ │
│ ░░░ ░░░ ░░░ ░░░ ░░░ ░░░ ░░░ ░░░ ░░░ ░░░ ░░░ ░░░ ░░░ ░░░ ░░░ │
│ <i+f> <dup 2> <tagged> Record 2/2 │
│■->1/address,3/data Idx 1: BARCODE │
│ BARCODE NUMCODE STOCKDATE LASTDATE TOTALCOST │
╞═════════════════════╤════════════╤═══════════╤══════════╤════════════════╤═╡
│ 94/LS-12 │ 1 │ 02/14/94 │ 05/01/94 │ 800.00 │°│
│ 94/MT-50 │ ▒▒▒▒▒▒▒▒▒2 │ 01/01/94 │ 10/10/94 │ 900.00 │░│
│ │ │ │ │ │░│
│ │ │ │ │ │░│
│ │ │ │ │ │░│
│ │ │ │ │ │░│
│ │ │ │ │ │░│
│ │ │ │ │ │░│
│ │ │ │ │ │░│
│ │ │ │ │ │░│
│ │ │ │ │ │░│
│ │ │ │ │ │░│
│ │ │ │ │ │■│
│ │ │ │ │ │°│
├─────────────────────┴────────────┴───────────┴──────────┴────────────────┴─┤
│░░░░░░░░░░░■░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░│
└────────────────────────────────────────────────────────────────────────────┘
NOTES:
■ "■->1/address,3/data" in the above implies
"■" : current workarea is a child of some other workareas
"->" : current workarea also parents some other workareas
1/address : address (workarea 1) is a child of current workarea
3/data : data (workarea 3) is also a child of current workarea.
■ <i+f> : index or/and filter active in the display
■ <dup 2> : record number 2 is tagged for future duplication
■ Idx 1: BARCODE
: index no. 1 (BARCODE) active in display
See later sections Keys in PAGEMODE and Keys in WINDOWMODE for more
details on the mouse buttons.
Exiting DBM
───────────
Since press <esc> key will exit one level, sufficient <esc> keys
will enable you to leave DBM with the original screen.
To exit DBM unconditionally and instantly, just press <alt-X>.
Mouse Convention
────────────────
In a browsing window, pressing mouse buttons has in general the
following effects
┌─ <left>=oneline, <right>=onepage, <left>+<right>=top/farleft
│
▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
└── mouse drag along the line has movement effects
In other area
Left - highlight the item, and make the choice if already
highlighted before the mouse click
Right - often equivalent to pressing <return>
Left+Right - escape
Left+drag - move to highlight the new entry, or move a line
in the dragging direction
Right+drag - move a page in the dragging direction
Hot Keys
────────
F1 - help request at any time
^F1 - text dump of nonmemo fields, with sums on each
numerical field at the end of the dump
F2-F10 - often residential program hot keys, if any
Alt_F10 - choose externally provided tasks in PAGEMODE and
WINDOWMODE, when available
Alt_F1-9 - hot keys for some of the tasks which are also
available via Alt_F10
Alt-<char> - often picks the main menu or button item that has
<char> as its upper case letter
DBM Scratch Files
─────────────────
DBM uses three scratch files _IDX@#$.TMP, _PRN@#$.TMP and
_DBM@#$.TMP. So do not use these three names as your normal
filenames.
Command Line Options
────────────────────
DBM [/?] [/25] [/43] [/50] [/c] [/cc] [/ccc] [/a] [/b]
[/d] [/m] [/n] [/w] [/!] [/!!] [/la] [/lb]
[/l#] [/+help] [/:initial] [//f:num]
[dbfile,format,prndesign,index1,...] [...]
DBM /ab|/ae textfiles [...]
[/25] [/43] [/50] [/c] [/cc] [/ccc] [/d] [/m]
/? - help on command line options
/25 - 25 line screen
/43 - 43 line screen
/50 - 50 line screen
/c - color monitor (default)
/cc - color different from /c option only in pagemode,
useful for removing the background-highlight effect
/ccc - color choice in slightly altered setting, useful for
non-conventional color monitors, so that the text will
still be easily readable
/a - date in American format mm/dd/yy
/b - date in British format dd/mm/yy
/d - disable mouse, useful if your local mouse driver is
unable to support properly such as the 43x132 text screen
/m - monochrome monitor
/n - no initial link via index or filter.
index/filter in pagemode will not be passed on
windowmode initially, unless it is been toggled
explicitly in the windowmode
/w - display initially set to windowmode
/ab - browse ascii text
/ae - edit ascii text files
/la - memoedit line length adjusted to window size
/lb - text edit with borderlines, when combined with /ab or
/ae option
/l# - (40≤ # ≤250) memo line length for editing set to #
characters per line (default=250)
/v - global view only: none of the main databases are allowed
to edit
/! - disable edit mode and submenu for nonformatted databases
/!! - disable edit,submenu and window view
/+help - "help" is the name of the help file
/:initial - "initial" is the number of order of the database
files, which indicates which database is to be
initially displayed
//f:num - max number of open files allowed
dbfile - first database file
format - format filename
prndesign - print design filename
index1,... - index files
You may even run DBM in 43x132 screen mode, if you set your monitor
screen externally to that display mode first. Moreover, if you have
a VGA monitor and set it to simulate CGA, you may actually like the
effects.
We note that sometimes a screen, particularly in the 132 column mode,
may exhibit `weird' color combination. In such cases, the apparently
redundant options "/25" etc often fix the color to the right setting.
Keys in PAGEMODE
────────────────
In this mode, a record occupies one or several pages.
Alt_H - Help
Alt_S - Submenu for services on file, search etc
Alt_W - Window edit/view mode
Alt_T - Toggle view/edit mode
Alt_G - Go a particular record
Alt_A - Append a new record at the end of database (to insert at the
current record position, see edit of submenu)
Alt_D - Delete current record
Alt_R - Recall deleted records
Alt_M - Mark area as scratch text
Alt_E - Escape: once to leave edit mode, twice to quit completely
Alt_X - Brutal exit/abort
Alt_F - First undeleted record
Alt_L - Last undeleted record
Alt_P - Previous record
Alt_N - Next record
PgUp - Previous page if available
PgDn - Next page if available
^Home - First entry in current page
^End - Last entry in current page
Home - Leftmost position
End - Rightmost position
^PgUp - First page
^PgDn - Last page
F1 - Help
F2 # - Check the relative cursor position inside input buffer
F3 Alt_W - Edit or view database in a line-per-record mode.
Note that in the case of limit being exceeded in 50 line
mode, for instance, a 25 line mode may still be within
the limit. Memo edit has largest width in the mode than
in the other ones
F4 Alt_M - Screen-Keyboard-Logfile swapping utility
F5 ≈ - Total number of filtered records, with current record number
F6 - Current date and time
F7 - Workarea toggle
F8 - Select a workarea
F9 «» - Browsing current all records of current field, with search
- algorithm
F10 - Toggle specific filter provided by the related print
- design file
Alt_F10 ! - Choose an external codeblock to execute
Alt_F1 - Alt_F9 - special external codeblocks
^F10 - Call up or create a map, map altered in non-edit mode will
be ignored
Submenu Hiararchy
─────────────────
┌───────────────┐
│Database added │
│Format file │
│Print design │
┌─────────────┐ │New database │
│Load │ └───────────────┘
│Write dbfile │
│save Maps │ ┌────────────┐
│conVert file│ │copy To │ ┌──────────┐
FILE │db cOmmit │ │append From │ │SDF │
│Remove │ │Style │ │deLimited │
│pacK │ │Db2asc │ └──────────┘
│Print │ │Asc2db │ ┌─────────┐
│Edit print │ │Mode │ │Truthful │
│Shell │ └────────────┘ │Dump │
│Quit │ └─────────┘
└─────────────┘
┌─────────────────┐
│Format free │
│Insert record │
│Duplicate record │
│Merge file │
EDIT │Previous record │
│Next record │
│Top record │
│Bottom record │
│Goto record │
│Select workarea │
└─────────────────┘
┌────────────────┐
│Edit string │
│Mark fields │
│Start search │
LOCATE │Continue search │
│Reverse search │
│from Bottom │ ┌──────────┐
│match mOde │ │Substring │
└────────────────┘ │Whole │
└──────────┘
┌────────────────────┐
│New struct │
│Ed struct │
STRUCTURE │Duplicate struct │
│write Format struct │
│Prn design struct │
└────────────────────┘
┌───────────────┐
│Load main log │
│Edit main │
REVIEW │Write main │
│load Sublog │
│Review sublog │
│sub To mainlog │
└───────────────┘
┌─────────────┐
│User defined │
│Field string │
│No filter │
│View filters │
└─────────────┘
┌──────────────┐
│Tmp index │
┌─────────────┐ │index Off │
│Filter │ │Make index │
UTILITY │Index │ │Extra index │
│Relation │ │Load new │
│Dump and sum │ │Pick control │
└─────────────┘ │Rebuild index │
└──────────────┘
┌────────┐
│Add │
│Delete │
│View │
│Parents │
└────────┘
┌─────────┐
│General │
INFO │Program │
│Freeware │
└─────────┘
Keys in WINDOWMODE
──────────────────
In this mode, each record is displayed in a horizontal line.
Enter - Edit/view current entry
TAB - Toggle automatic search mode.
If <seek off>, then an unrecognised key will start
editing the entry immediately. If in <keyseek> mode, then
instead the pressed key will be searched from the current
field of all records.
Upper case letters etc will enable string search (with
SPACE BAR to restart search string), while in other
cases, only letter searching is performed.
Alt_G - Goto record by number
Alt_I - Select controlling index
Alt_F ╬ - Toggle filter mode
Alt_S * - Search for a string
Alt_= - Mark (tag) current record for
duplication into others
F1 ? - Help
F2 - Current cursor position, when editing area is focused
F3 « - Reverse search
F4 - Area marking
F5 - Record number report
F6 - Current time and date
F7 - Toggle workareas
F8 - Select workarea
F9 » - Forward search
F10 - Toggle external filter
Alt_F10 ! - Choose an external codeblock to execute
Alt_F1 - Alt_F9 - execute special external codeblock
Following keys are active in edit mode only.
DEL - - Delete record toggle
INS + - Insert empty record at the end
Alt_= - Mark (tag) current record for duplication into others
^Enter - Append tagged record at the end
Alt_- - Copy tagged record into current record number, pushing
all the existing records behind by 1
Alt_0 - Same as Alt_-, except empty record is inserted
Keys in SUBMENU
───────────────
NUM_DEL - Leave SUBMENU unconditionally, same as click both buttons
on bottom borderline of the box that contains the submenu
choices
ESC - Back to the previous menu level, same as click both buttons
on top borderline of the box that contains the submenu
choices
Enter - Make a choice
Alt_F - File
Alt_E - Edit
Alt_L - Locate
Alt_S - Structure
Alt_R - Review
Alt_U - Utility
Alt_I - Info
Load Database Files
───────────────────
To load in a new database file as into a workarea, choose LOAD option
in the SUBMENU - you can reach the submenu from the main PAGEMODE by
pressing e.g. Alt_S. In the choices given via LOAD option, ADD
DATABASE will add the new database file as a new workarea, while
keeping all the other workarea open. The choice NEW DATABASE will
however first close all the existing workareas and then open the new
database file as the only workarea.
To load database files on the command line, simply put the database
filenames there. Wildcard characters are supported. For instance, to
load database files stock*.dbf and addr.dbf, we could just run the
following command
DBM addr stock*
Database Alias Convention
─────────────────────────
The alias of a database, when loaded, is in general the filename
without the path and extension. However, if such derived alias
duplicates an existing alias or contains characters other than
alphabets, digits and underscore, then _TMP#### in which #### is
a number will be used to denote the alias. The numbers denoted
there will increment sequentially for each thus opened database.
Load Screen Format and Print Design
───────────────────────────────────
A screen format file is a special database file, normally with
extension .DBM, which will direct the display format of the concerned
database. A print design file is another special database file,
normally with extension .DBP, which will direct a print procedure and
offer many externally defined tasks.
By default, when a database is is loaded into a workarea, the same
filename with extension .DBM (if exists and is valid) will be loaded
in as the screen format, while the same filename with extension .DBP
will be loaded in as the print design.
To override the default, pick the format filename and print design
filename before loading a new database. However once a new database is
loaded in, the program resets itself to the default.
Under the formatted display, the prompt does not have to be the name
of the corresponding field. To find out the accurate fieldname, use
either F9 (browsing the field) or F3 (windowmode display).
How to Create a Format File
───────────────────────────
Suppose you have a database file TEST.DBF which has the following
structure
{ { NAME, "C", 10, 0 },
{ MAPLIST, "C", 4, 0 } }
and that you wish to make MAPLIST field a field translated by a
map database file under the name MAPLIST.MAP. Then one way of doing
it is to
1. Use option WRITE FORMAT STRUCT of submenu STRUCTURE to create
an empty format database file under the name TEST.DBM
2. Load in TEST.DBM and add a record for each fieldname in the
original database TEST.DBF. If you don't add a record for
any particular field, then that field is masked: in other words,
that field will not be seen on the screen in pagemode
3. Enter the following two records for the fields NAME and MAPLIST
respectively
--- record 1 --- --- record 2 ---
FNAME NAME FNAME MAPLIST
MODE 1 MODE 4
PAGENO 1 PAGENO 1
MAPFILE MAPFILE c:\dbm\maplist.map
PROMPT Name PROMPT Map Choice
PROW 9 PROW 9
PCOL 3 PCOL 31
PWIDTH 10 PWIDTH 11
ROW 9 ROW 9
COL 14 COL 43
WIDTH 15 WIDTH 20
HEIGHT 0 HEIGHT 0
VIEWMODE 0 VIEWMODE 0
PCOLOR PCOLOR
4. Load in database TEST.DBF with format TEST.DBM. You will see
the MAPLIST entry (under the prompt Map Choice) is given as
"unknown". Use ^F10 to create a map in the editing mode
(togglable via Alt_T). Finally use SAVE MAPS in FILE option of
the SUBMENU to save the newly created/edited map. Since the map
entry editing area is sensible to the maximum width of the
existing entries, a good idea is to edit an entry of typical
widths and then re-enter the map-editing mode.
5. Step 4 may be replaced by directly editing MAPLIST.MAP as a
database file.
Foe details, see the ADVANCED TOPICS.
Write Database
──────────────
To write current workarea into a database file, use SUBMENU. This
option only outputs the current filtered records to the database file
- thus deleted records are not saved.
To remove all the deleted records physically, use PACK in option FILE
of the SUBMENU.
Toggle Workareas
────────────────
If more than one databases files are opened, then we can toggle the
different workareas corresponding to these files by pressing key F7 or
F8. Key F7 will pick the next workarea in the list, while F8 will list
all the workareas to let you choose directly.
Edit a Record
─────────────
A database record may be edited in three different ways - in PAGEMODE,
in WINDOWMODE and via SUBMENU.
■ In PAGEMODE, a record will occupy a single page of screen unless
more pages are needed. Use Alt_T to toggle edit and view. This mode
is ideal for large number of fields and for the case when a general
overview of a single record is more meaningful than the overview of
a single field of a list of records. This mode can also be used to
control the display position and format, and determined which
fields are permitted to view or edit.
■ In SUBMENU mode, choice EDIT will enable one to edit a single record
line by line, similar to vertically browsing all fields of a record.
■ In WINDOWMODE, a more traditional display format, we again use
Alt_T to toggle the edit and view. In this mode, each record
occupies a virtual line of window. This mode offers a better global
view particularly when the number and width of fields are small.
Create a Record
───────────────
To create a record, the general rule is to append an empty record to
the end of a database and then edit the record accordingly. However,
it is possible to insert a record in the middle of a database, via
SUBMENU or in WINDOWMODE. In the former case, just choose the options
listed by EDIT, while in the later case, use Alt_0 (insert blank record)
or Alt_- (insert marked record) instead.
In the PAGEMODE or WINDOWMODE, a new record may be created only if it
is currently in the edit mode, rather than the view only mode.
Duplicate a Record
──────────────────
A record may be duplicated at any physical position of a database. For
duplication inside a same database, it is easiest to perform the task
in WINDOWMODE, in which Alt-= will mark a record for duplication and
Alt_- will insert the marked record at the current record number.
To duplicate a record across different database files or within a same
database, we can use the facilities provided by SUBMENU. The option
DUPLICATE RECORD of EDIT, will enable us to copy current record of
current workarea to any position of any other workarea.
Search a Record
───────────────
All search matchings are case-insensitive.
■ In PAGEMODE, i.e. the default display mode, we can browse the
current field of all the filtered records by pressing F9. Once in
the search/browse state, a lower case key will first try to match a
leading character of the field, then try to match any position if
possible. If a letter is in upper case, then all such characters
will form a single search string, until a space key or direction
keys are pressed.
■ In SUBMENU mode, i.e. if we want to use submenu to locate a
record, we can choose LOCATE, and then enter the substring by
choosing EDIT STRING. The default searches all fields of the
records for a substring match. However we can restrict ourselves to
search some specific fields by marking them via MARK FIELDS.
■ In WINDOWMODE, i.e. each record is displayed as a single line, we
can use Alt_S to bring out a search pad, whose function is similar
to that of LOCATE in SUBMENU, or use F9 to search forward and F3 to
search backward.
All the above cases are interrelated - each has some advantages and
disadvantages.
Create or Edit Database Structure
─────────────────────────────────
Choose options given by STRUCTURE in SUBMENU accordingly, after
editing the structure, use Ctrl_Enter to save the new database
structure.
Two special database structures, i.e. the ones for screen format
(*.DBM) and for print design (*.DBP) respectively, can be output
directly from the options within STRUCTURE in SUBMENU.
Make, Load and View Database Indexes
────────────────────────────────────
The easiest way of loading database indexes is to do it on the command
line. The command line has the format
DBM [/options] [ <workarea-str1> ] [ <workarea-str2> ] [ ... ]
where <workarea-str> is a string (containing no empty space) of
filenames separated by ",". The names are given in the order of
<dbfile>,<format>,<prndesign>,<index1>[,<index2> ...]
in which database filename <dbfile> must be valid, while for others
the program DBM will default accordingly. For example, if a
<workarea-str> is "abc,,,name,order", then it will be defaulted to
"abc.dbf,abc.dbm,abc.dbp,name.ntx,order.ntx"
loading abc.dbf into a workarea, with format given by abc.dbm and
print design by abc.dbp, and with the index files name.ntx and
order.ntx.
Index can also be loaded or completely removed via the use of SUBMENU.
Choose UTILITY from SUBMENU, then choose INDEX. We may load in a new
index via menu choice EXTRA INDEX, on top of the existing indexes -
with the original controlling index remain in control, or we could
load in a new index as the only index - thus closing all the existing
index files in the current workarea first.
To view what indexes are active in current workarea or to choose a new
controlling index, just use menu option PICK CONTROL.
Other functions such as removing all existing indexes or rebuilding all
existing indexes of current workarea, are also supported.
Set and View Database Filters
─────────────────────────────
Database filter may be set, removed and viewed via the use of SUBMENU.
Choose UTILITY of SUBMENU, then choose FILTER.
A condition of logical type can be entered as a filter through the
menu option of USER DEFINED. If matching substrings of some fields are
to be used as the filter, then choose option FIELDS. We note that
while option USER DEFINED will disable existing filter before setting
the new user filter, option FIELDS will add the condition itself to
the user defined filter.
However, substring match via option FIELDS should be used sparingly,
as it may slow down the operations considerably - particularly when
the database is large and the filtered number of records is small.
In PAGEMODE, all displayed records are filtered records, unless the
record number is chosen by such as GOTO (Alt_G).
In WINDOWMODE, display between natural order and indexed or filtered
records, can be toggled by Alt_F. In other words, we can toggle
between the global records and the selected or indexed records.
Set and View Database Relations
───────────────────────────────
When there are more than one workareas, different workareas may be
related to each other, in the form that one workarea being a child or
slave of another workarea. Two workareas may be related through a
common (indexed) field, or through just the physical record number.
If two workareas are related to each other, then when the record in
the parent workarea is moved, the record in the child workarea will be
automatically moved (or sought) so that the common field that is used
to related the two workareas is the same, or the physical record
number of the record is the same in the other case.
Note that when two workareas are related by a common field, the child
workarea must have that field as an active index. Otherwise the record
pointer in child workarea will be moved to LASTREC()+1. If two
workareas are related by the direct physical location, then unless the
child workarea in not indexed, the record pointer in child workarea
will also be moved to LASTREC()+1.
Relations are executed sequentially.
To set a relation is to choose a common field, or just the natural
physical order, and a child workarea. A child workarea is not allowed
to parent any of its parents or grandparents etc.
If a parent workarea is in display, either in PAGEMODE or in WINDOWMODE,
all of its direct child workareas are displayed via
->1st_child,...,last_child
To find out all the parents and grandparents of the current workarea,
just choose PARENT of RELATION of UTILITY in SUBMENU.
Load and Edit User Scratch Files
────────────────────────────────
The LOG files are the scratch files for the user. Scratch files are
particularly useful when one wants to cut a piece of text from another
place. For example, if we want to copy a block of text on screen that
is within on memo field, then we first mark the block text by copying
it to a buffer given by the marking pad activated by key F4, then we
copy the buffer to a scratch file for future use: just get the text
block into mark pad buffer and then play the buffer at the proper new
position of such another memo field.
Two LOG files, main log and minor log, are for the convenience of
doctoring the block text. However, ALWAYS delete them with Alt_Y
whenever you think they are no longer useful, so as to release the
holding computer memory.
These options are still primitive. However they can be used to achieve
surprisingly useful tasks.
Print Workarea
──────────────
For DBM, printing method is to be supplied externally by the print
design database file. A print design file will determine which field
which record and how is to be printed. See the example STOCK.DBF,
STOCK.DBP for more illustrations.
When external printing directives are supplied, EDIT PRINT of FILE in
SUBMENU will first output the printout to a file for viewing and
editing. The user may then save it to a file or send it directly to
the printer PRN, i.e. save it to the file under the name "PRN".
Merge a Database File
─────────────────────
We may merge a new database file into the current workarea, at the
current position (overwrite) or at the end (append). The fields of
same name, type and width will be copied. However in the case of
string type, if the widths is different, then the merged string field
will be padded or truncated on the right.
Conversion between Database and Ascii Text
──────────────────────────────────────────
There are two conversion modes: TRUTHFUL and DUMP. The Ascii text that
are converted from a database will contain in the first few lines its
database structure in the format of
<filename> <type> <width> <dec>
per line until the first character of the line becomes "-" which is
thus used to separate the structure from the records.
To convert database records into Ascii text, DUMP mode will simply dump
every non-empty field as a text line and mark the end of a record by
an empty line -- all empty lines inside a memo field will thus be
removed.
In TRUTHFUL mode, however, the conversion is essentially reversible
under the assumption that no fields other than memo fields will
contain more than a text line, i.e. containing <CR-LF>. Since under
the general usage such an assumption will always hold, the
conversion keeps all the structure and data of the database.
Moreover, memo fields that contain only SPACE and TAB characters
will be nullified as empty memo fields.
In TRUTHFUL mode, there are several special markings which are
meaningful when located at the beginning of a line
%+ - mark start of a new record (must present)
%+* - mark start of a new but deleted record
%- - mark the end of a memo field
Note that memo markings are optional when no confusion is to occur.
Also that an empty line for a particular field represents a value
which is EMPTY for the that particular field type.
With the TRUTHFUL conversion, one can edit a database in text mode
manually or by another program, and then convert it back to true
database format.
The following example explains a typical ASCII text converted truthfully
from a database file.
<---------NOTES ASCII TEXT ------------------------------------->
Field names -> TITLE C 20 0 (TRUTHFUL) mode: A.DBF -> A.ASC
MEMO_ONE M 10 0
STOCKDATE D 8 0
SALEPRICE N 10 2
MEMO_TWO M 10 0
QUIT L 1 0
LASTLINE C 20 0
Leading "-" -> --- end of structure ---
ends structure
Emptylines
before start of
a new record
are ignored ->
"%+" starts new
record -> %+ 1 -----
1st entry -> Normal Rec (1)
2nd entry ->
which is a memo The first (i.e. above) line of this memo field is
field, and is empty. This entry has two paragraphs: the 2nd
ended by the paragraph will be separated by 2 empty lines from
special endmemo the 1st one.
marker "%-"
appearing at
the beginning This is the 2nd paragraph!
of a line -> %-
3rd entry -> 02/14/91
99.95
another memo -> Text of the 2nd memo field.
ended by "%-" %-
.T.
last entry -> all entries shown
2nd (deleted)
record starts-> %+* 2 -----
"%+%+" is %+ -> %+%+ Strange Rec (2)
Special markers %+ and %- at the beginning of a line:
%+%+ - mark start of a new record unconditionally
(unless it is followed IMMEDIATELY by itself so
that the first occurence will be ignored)
"%-%-" is %- -> %-%- - mark the end of a memo field and is optional
when no confusion is to occur.
This record is to be deleted, but not removed.
%-
01/01/01
0.00
Some other combinations:
"%-%+" %-%-%+
"%+%+" %+%+%+
"%-%-" %-%-%-
"%+%-" %+%+%-
%-
.F.
%- effect of markers
3rd record -> %+ 3 -----
Empty Rec (3)
4th record -> %+ 4 -----
Last Rec (4)
%-
/ /
0.00
Last field, last memo field.
end of
converted ascii
text ->
Text Dump and Field Summation
─────────────────────────────
A simple utility via DUMP AND SUM in UTILITY of SUBMENU is provided
to output all non-memo fields, with summation for each numerical
field reported at the end of the text dump.
Text Editing
────────────
DBM carries a simple text editor, so that memo fields can be readily
modified or entered.
To edit separate text files, use EDIT MAIN of REVIEW in SUBMENU. The
text editor supports basic cursor movement and search mechanism.
^W - (ctrl-w) save and return
Esc - quit without save
^BKSP -
^Y - delete current line
^T - delete word right
Alt_Y - delete the whole contents
Alt_U - delete up (all previous text)
Alt_D - delete down (all following text)
^Home - beginning of current window
^End - end of current window
^PgUp - beginning of file
^PgDn - end of file
Home - beginning of current line
Eend - end of current line
Enter - beginning of next line
^A - a work left (^Left_Arrow)
^F - a word right (^Right_Arrow)
^N - insert a line above
Alt_S - edit search string and search forward
Alt_F - forward search
Alt_R - reverse search
Alt_T - toggle case/nocase in string search
Alt_P - toggle showing line/column position
Alt_L - length of current file buffer
Alt_I - insert a file in edit mode
Alt_W - save to a new file in edit mode, otherwise it is
equivalent to ^W
F4 - mark and paste (avoid marking controlling characters)
If you wish to use DBM simply as as a program viewer or editor, then
you could use " DBM /ab files [...] " to view or " DBM /ae files "
to edit. However DBM is not designed to be a good editor.
Paste Text
──────────
Text marking and paste is supported in a limited form in DBM. The
general strategy is to use F4 to mark a portion of text displayed on
the screen then play the text back as if they are keyed in one
character after another. Two log strings or files via SUBMENU are
provided mainly as the scratch pads for this purpose.
Suppose we need to copy a portion of a text file to a memo field, we
could first load the text file into the main log or minor log (see
REVIEW in SUBMENU), the mark the area via F4. After we move to the
cursor position where we want the marked text to be keyed in, use F4
again to dump the marked text.
Another way of doing it is through the use of Alt_U/Alt_D/Alt_W/Alt_I
in text editing, so that a block of text may first be saved to a buffer
file, then load it in later on at a proper place.
DOS Shell
─────────
Leave DBM temporarily to run some other DOS applications. Type EXIT to
return to DBM.
External Utility
────────────────
Two external programs IRON.COM and SCREEN.COM to are used with DBM.
IRON.COM irons any of the four DBM options "/m", "/n", "/!" and "/!!"
into dbm.exe itself. For instance, to make dbm.exe use monochrome
color setting by default, just run " iron dbm.exe m ". Similarly
one can force option "/n" to dbm.exe, thus leaving the windowmode
index/filter state independent of that of the pagemode.
However, ironing option "/!" or "/!!" is to reduce the user's power
on database management, so that only pre-designated databases and
action tasks are allowed to be performed. This way, important database
may be accessed by unprevilidged users, without having to worry about
its secrecy of some of its fields and its being edited accidentally.
Since ironing the options are irreversible (apart from /m), always
make a backup copy before doing it. Or better still, copy dbm.exe
to a file under a new name, and then iron this new executable file.
If so, we could have two DBM programs sharing a same dbm.ovl.
SCREEN.COM is for the use of VGA monitor. It allows you to set your
monitor to 25x132 or 43x132 text mode, so that you could have a much
wider screen. This can be very helpful in using the windowmode or
text editing. Since mouse drivers often can not support such
screen modes, we may have to add option "/d" to disable the mouse
when running DBM.
If you for some reason can't leave your printer ready for your use
all the time, you could always redirect it to a file and send it later
to a printer. To redirect your printer, you could use PRN2FILE.COM
which is a shareware (or freeware ?) from VOL6N21.ARC (PC Magazine,87)
┌─────────────────┐
│ Advanced Topics │
└─────────────────┘
Screen Format Database (*.dbm)
──────────────────────────────
FNAME - field name
MODE - edit strategy mode
1=normal variable
3=memo variable
4=character field masked by interpretation
5=memo display directly via input region,
edit/view in larger normal area
6=memo display directly as in 5, edit or view
in input region specified by four fields
ROW,COL,WIDTH,HEIGHT given below
PAGENO - which page to include the field
MAPFILE - map filename for Mode=4
PROMPT - prompt name for field name
PROW - starting row of prompt
PCOL - starting col of prompt
PWIDTH - width of prompt
ROW - row of input region
COL - col of input region
WIDTH - width of input region
HEIGHT - height of input region for memo, valid for
MODE=5 or 6
VIEWMODE - editmode when under viewonly mode
0=default: view only
1=allow to edit even under viewonly mode
PCOLOR - new color string for the prompt
e.g. "W/R" (""=take the default)
Allowed Structure:
{"FNAME","C",10,0},
{"MODE","N",3,0},
{"PAGENO","N",3,0},
{"MAPFILE","C",160,0},
{"PROMPT","C",100,0},
{"PROW","N",3,0},
{"PCOL","N",3,0},
{"PWIDTH","N",3,0},
{"ROW","N",3,0},
{"COL","N",3,0},
{"WIDTH","N",3,0},
{"HEIGHT","N",3,0}
{"VIEWMODE","N",3,0},
{"PCOLOR","C",10,0}
A database file of structure different from the above will not be
considered as a valid format file.
A format file (*.DBM) pin-points the places for (chosen) fields to be
displayed. This way we may just display partially the database, which
is very useful to curb user's power to alter data unintentionally.
Should format file contains certain fieldnames foreign to the related
database, the format will not be used.
Should format or print design files adopt new database structures for
newer version of DBM due to the extension, then the old files should
be easily convertible to new forms (and vise versa) by just merging
the old file into a new file created by the current version of DBM
program via its submenu.
We note that although PWIDTH=0 will imply that no prompt is to be
displayed, the values of PROW and PCOL will still be used to calculate
the 'clear all' rectangular area. Likewise for other similar fields.
Hence, if for example one entry of a format file contains PROW=0 and
PCOL=0, then the left blanking corner will be the top left screen
corner, which in this case is undesirable because a turning of a
record page would blank out the button displays as well. In other
words, creating format filess need in general some caution and care.
Print Design Database (*.dbp)
─────────────────────────────
PRN_MODE - 0=continue
1-14, 100= ...
H_SKIP - horizontal skip of columns before executing the codeblock,
if prn_mode!=0
MAX_LINES - execute current block will print out max_lines of text,
whenever meaningful
CODE_BLOCK - external code block in a string
CODE_NAME - string name for choosing an external codeblock to execute
Code block specified by CODE_BLOCK field may take three arguments
nLeftSkip - fixed horizontal skip
nLineCount - current line number in current page
nPrintMode - 0=display any informative messages
1=program requests quiet, whenever possible
However, in the PrePrintBlock (Prn_Mode=9), the first two parameters
are automatically passed as 0.
If current print block is non-empty with PRN_MODE!=0, and that the
previous block is also nonempty and returns a non-zero value 1, then
an extra horizontal skip of LEFTSKIP, specified in the case of
PRN_MODE=1, will be done before the execution of the new codeblock. We
note that a nonzero value returned by code block also implies that the
MAX_LINES has been fulfilled by the codeblock.
Allowed Structure:
{"PRN_MODE","N",3,0},
{"H_SKIP","N",3,0},
{"MAX_LINES","N",3,0},
{"CODE_BLOCK","C",300,0},
{"CODE_NAME","C",20,0}
A database file will not be considered as a proper print design file
if its structure is different from the above other than perhaps for
the width of CODE_BLOCK so that long codeblock can be entered.
PRN_MODE:
0 no horizontal skip before executing current codeblock -- current
block regarded as a continuation of a previous block which has a
non-zero mode
1 in this mode, H_SKIP and MAX_LINES are the line width (not in
use) and the horizontal column skip number respectively
2 in this mode, H_SKIP and MAX_LINES are the page height and the
vertical line skip number (not in use)
3 code block for the title of printout
4 code block to print each valid record
5 block to handle end of a pagebreak
6 block to handle start of a new page after a page break (due to
long printout)
7 code block for printing end remark of printout
8 help string to be sought in DBM.HLP
9 codeblock that decides if a printout is to be done at all
(no-zero value to print)
10 codeblock to perform after printout, it will be executed even if
printout is not performed due to zero return of block in mode 9.
11 filter in string or codeblock for filter toggle specific to
related database. If the starting character is "{", then it is a
codeblock, otherwise it will be considered that the string a
already an expression for the filter
12 view/edit mode
0=ignore this entry
1=view only for this database
2=edit allowed
13 external codeblocks for some jobs specific to the related
database. The strings in specified in 8. will be used as the name
of such codeblocks when choosing them. The first 9 executable
blocks will be assigned to keys ALT_F1 to ALT_F9
14 same as mode 13, apart from that they are never assigned to keys
ALT_F1 to ALT_F9. Instead, they must be called via ALT_F10.
100 initialisation codeblocks. It will be run immediately after the
print design file is read in. Only the first block of consecutive
records, which have PRN_MODE equal to either 100 or 0, will be
regarded as the initialisation blocks. Error at running
initialisation will not be reported: so it is the block's job to
report any execution error.
Entries should enter in natural order, apart from 0 and 100.
EXTRA FUNCTIONS:
RecTotal()
- total number of filtered records
PrintView(nWhichArea)
- execute print/view external code
Eject()
- page eject
Pack()
- pack current database
AppendTo(xFile,bCondition,lQuiet)
- append all current records satisfying bCondition, to
database file xFile or workarea number xFile. If lQuiet is
true, no summary will be reported
Z_0(nNum)
- get codeblock of nNum-th position of public block stack
Z_1(nNum)
- get string representation of current last position of the
external-block stack
Translation Map Database (*.map)
────────────────────────────────
The first two fields serves as the mapping
FIELDGET(1)=translated value
FIELDGET(2)=original index
Database of less than two fields are ignored. All map will be
stringfield and maps are applicable to string type fields only.
Users' Scratch Public Variables
───────────────────────────────
The are 31 public scratch variables which can be used inside the
configurable print design files. These variables are X_0, X_1 to X_30
and should be considered as temporary variables. For more permanent
global variables, use the global storage array. If field CODE_BLOCK
starts with character other than "{", then the translated codeblock
will be appended to the storage array. For the position of the last
stored block, Z_1(0) is the number in string format (so that it can
easily be macro expanded via &).
Typically, we could
1. stashblock {|| block1}
2. x_1:=Z_1(0)
- gives the position This operation is again stashed to
Block_list{}, although useless.
3. stashblock {|| block2}
4. stashblock {|| block3}
5. x_2:=Z_1(-1)
6. x_3:=Z_1(-1)
7. {||&x_1,&x_2,&x_3}
We note that once 7. is read in, the code block will no longer need
private/public variables x1,x2,x3. This way, reading external
codeblocks will not exhausts the scratch public variables defined
inside the program. All stashed codeblocks remain available all the
time until a LOAD NEW DATABASE command (which will first close all
workareas) is performed.
Print Design Examples
─────────────────────
1. The following record in a print design file will calculate the
total number of records in related main database file which, under the
current filter, have a nonzero 13-th field. In the case of STOCK.DBP,
a nonzero 13-th field is a request for that item.
PRN_MODE: 10
H_SKIP: 0
MAX_LINES: 0
CODE_BLOCK: {|x,y,z| x_1:=rectotal("fieldget(13)!=0"),;
IF(x_1!=0 .and. z=0, Message(alltrim(str(x_1))+;
" records printed"),)}
BLOCK_NAME: PostPrintBlock
where x=leftskip, y=linenumber and z=messagemode (1=quiet).
2. The following 5 consecutive print design records will set the 13-th
field of the related database to 0 value, under current filter.
PRN_MODE: 13
H_SKIP: 0
MAX_LINES: 0
CODE_BLOCK: if(.f.,, {||fieldput(13,0)})
BLOCK_NAME: <step-1>
■ i.e. save codeblock {||fieldput(13,0)}) to a designated public stack
for future use.
PRN_MODE: 13
H_SKIP: 0
MAX_LINES: 0
CODE_BLOCK: if(.f.,,{||x_1:=fieldget(13)!=0,;
if(x_1,x_3:=x_3+1,),x_1})
BLOCK_NAME: <step-2>
■ i.e. save codeblock {||x_1:= ...} again to the public stack.
PRN_MODE: 13
H_SKIP: 0
MAX_LINES: 0
CODE_BLOCK: if(.f.,, x_1:=z_1(-1))
BLOCK_NAME: <step-3>
■ i.e. get the stack pointer in string that points to the block in
<step-1>
PRN_MODE: 13
H_SKIP: 0
MAX_LINES: 0
CODE_BLOCK: if(.f.,, x_2:=z_1(-1))
BLOCK_NAME: <step-4>
■ i.e. get the stack pointer x_2 that points to the block in <step-2>
PRN_MODE: 13
H_SKIP: 0
MAX_LINES: 0
CODE_BLOCK: {||x_3:=0, dbeval(z_0(&x_1),z_0(&x_2)),;
if(x_3>0, message("Sales on "+;
alltrim(str(x_3))+" items removed"),)}
BLOCK_NAME: Cancel Sale
■ the macro expansion of x_1 and x_2 is done at the time of loading
the above records. Thus x_1 and x_2 are available for other uses
once these print design records are read in. Variable x_3 however
will be active only when the final (visible) block is being
executed.
Other Details
─────────────
See DBM program on-line help.