home *** CD-ROM | disk | FTP | other *** search
/ C!T ROM 5 / ctrom5b.zip / ctrom5b / DOS / DATABASE / DBM112 / DBM.DOC < prev    next >
Text File  |  1995-05-01  |  60KB  |  1,542 lines

  1.  
  2.  ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
  3.  ▒                                    ▒▓
  4.  ▒ DBM - database manager   ver 1.12  ▒▓
  5.  ▒                                    ▒▓
  6.  ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▓
  7.   ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
  8.  
  9.  
  10.  
  11.   CONTENTS
  12.   ────────
  13.  
  14.   General:
  15.    ■  Introduction
  16.    ■  Main Features
  17.    ■  Installation
  18.  
  19.   Basic Topics:
  20.    ■  Getting Started
  21.    ■  Exiting DBM
  22.    ■  Mouse Convention
  23.    ■  Hot Keys
  24.    ■  DBM Scratch Files
  25.    ■  Command Line Options
  26.    ■  Submenu Hiararchy
  27.    ■  Keys in PAGEMODE
  28.    ■  Keys in WINDOWMODE
  29.    ■  Load Database Files
  30.    ■  Database Alias Convention
  31.    ■  Load Screen Format and Print Design
  32.    ■  How to Create a Format File
  33.    ■  Write Database
  34.    ■  Toggle Workareas
  35.    ■  Edit a Record
  36.    ■  Create a Record
  37.    ■  Duplicate a Record
  38.    ■  Search a Record
  39.    ■  Create or Edit Database Structure
  40.    ■  Make, Load and View Database Indexes
  41.    ■  Set and View Database Filters
  42.    ■  Set and View Database Relations
  43.    ■  Load and Edit User Scratch Files
  44.    ■  Print Workarea
  45.    ■  Merge a Database File
  46.    ■  Conversion between Database and Ascii Text
  47.    ■  Text Dump and Field Summation
  48.    ■  Text Editing
  49.    ■  Paste Text
  50.    ■  DOS Shell
  51.    ■  External Utility
  52.  
  53.   Advanced Topics:
  54.    ■  Screen Format Database (*.dbm)
  55.    ■  Print Design Database (*.dbp)
  56.    ■  Translation Map Database (*.map)
  57.    ■  Users' Scratch Public Variables
  58.    ■  Print Design Examples
  59.    ■  Other Details
  60.  
  61.  
  62.  
  63.  
  64.   Introduction
  65.   ────────────
  66.  
  67.   The DBM - database manager is a general-purpose database manager for
  68.   IBMPC and compatible computers. It works in text mode screen with
  69.   excellent mouse support. DBM also supports user configuration for
  70.   user-defined tasks on specific database files.
  71.  
  72.   DBM may be cut down on its power in such a way that only pre-assigned
  73.   viewing mode and other tasks are permitted, so that less-privileged
  74.   users may be prevented from viewing and/or altering important data
  75.   fields.
  76.  
  77.   Robustness is another purpose of DBM.
  78.  
  79.  
  80.  
  81.   Main Features
  82.   ─────────────
  83.  
  84.    ■  mouse support, and 25/43/50 x 80/132 screen displays
  85.    ■  edit/view in page(s)-per-record mode, with user-defined format
  86.    ■  edit/view in traditional row-per-record mode
  87.    ■  edit/view record in column mode
  88.    ■  input via translation maps
  89.    ■  set/make indexes, filters and relations
  90.    ■  create/merge/convert database files
  91.    ■  conversion between database and text, that protects memos
  92.    ■  execute user-defined action tasks such as printing etc
  93.    ■  perform user-defined business transaction interface
  94.    ■  allow cutdown on edit/view power to suit end user
  95.    ■  command line initialisation of database, index etc
  96.  
  97.  
  98.  
  99.   Installation
  100.   ────────────
  101.  
  102.   Just copy three files DBM.EXE, DBM.OVL and DBM.HLP to your
  103.   subdirectory, say C:\DBM. If you want to run DBM from other
  104.   directories, then put the DBM subdirectory on the PATH, and set
  105.   environmental parameter DBMHELPFILE to the helpfile name, via e.g.
  106.       SET DBMHELPFILE=c:\dbm\dbm.hlp
  107.  
  108.  
  109.  
  110.  ┌──────────────┐
  111.  │ Basic Topics │
  112.  └──────────────┘
  113.  
  114.  
  115.   Getting Started
  116.   ───────────────
  117.  
  118.   To start DBM, just type "DBM" at the DOS command prompt, then you will
  119.   get a submenu. You may now load in some existing database files or
  120.   create some new database files yourself. Nevertheless you may enter
  121.   directly the database filenames etc via the command line, see command
  122.   line options for more details.
  123.  
  124.   Once at least one database is loaded/opened, you may generally go
  125.   among three sections of the program
  126.  
  127.    I.   PAGEMODE
  128.           view/edit a single record in one or several pages
  129.    II.  WINDOWMODE
  130.           view/edit a single record as a single line
  131.    III. SUBMENU
  132.           miscellaneous tasks, with another choice of view/edit mode
  133.           in which fields of a single record is list vertically
  134.  
  135.   The keys to move from section to section are as follows
  136.  
  137.  
  138.                              <alt-S> 
  139.                   ────────────────────  SUBMENU
  140.                    <esc> or <num-del>
  141.  
  142.         PAGEMODE
  143.  
  144.                    <esc>
  145.                   ────────────────────  WINDOWMODE
  146.                                 <F3> 
  147.  
  148.  
  149.   If you need on-line help at any time, just press <F1>.
  150.  
  151.  
  152.  
  153.   Typically, a screen in PAGEMODE would look like
  154.  
  155. ╓──────────────────────────────────────────────────────────────────────────────╖
  156. ║ Help░ Submenu░ Window░ Toggle░ Goto░ Append░ Delete░ Recall░ Mark░ Escape░   ║
  157. ║  ░░░░  ░░░░░░░  ░░░░░░  ░░░░░░  ░░░░  ░░░░░░  ░░░░░░  ░░░░░░  ░░░░  ░░░░░░   ║
  158. ║   ░   ░   ░   ░   ░   ░   ░   ░  «» ░  # ░  ≈ ░   ░   ░   ░  ! ░║
  159. ║  ░░░░  ░░░░  ░░░  ░░░  ░░░  ░░░  ░░░  ░░░  ░░░░  ░░░  ░░░  ░░░  ░░░  ░░░  ░░░║
  160. ╟──────────────────────────────────────────────────────────────────────────────╢
  161. ║                                                                   stock.dbf  ║
  162. ║Page No: 1/1     Rec No: 1/2                                           STOCK  ║
  163. ╟──────────────────────────────────────────────────────────────────────────────╢
  164. ║  Item▒name▒▒▒▒ LADIES 12 INCH SHOES (super size)                             ║
  165. ║  Barcode▒▒▒▒▒▒ 94/LS-12                              Order▒No.▒▒          1  ║
  166. ║                                                                              ║
  167. ║  Date▒of▒stock 02/14/94    Last▒stocked▒▒ 05/01/94   Tax▒class▒▒ TAX 01      ║
  168. ║  Total▒cost▒▒▒     800.00  Total▒stock▒▒▒         40 Surname▒▒▒▒ DAVIS       ║
  169. ║                                                                              ║
  170. ║  Buy▒price▒▒▒▒      21.65  Total▒sold▒▒▒▒          8 Main▒Suppliers▒▒▒▒      ║
  171. ║  Sale▒price▒▒▒      49.95  Sold▒today▒▒▒▒          0 1▒ Women On Top Limite  ║
  172. ║  Discount▒▒▒▒▒       0.00  Sold▒now▒▒▒▒▒▒          1 2▒                      ║
  173. ║                                                                              ║
  174. ║  Notes▒▒▒▒▒▒▒▒ The main suppliers are all women with hugh feet.              ║
  175. ║                                                                              ║
  176. ║                                                                              ║
  177. ║                                                                              ║
  178. ╙──────────────────────────────────────────────────────────────────────────────╜
  179.  Format: stock.dbm,+.dbp                                                <view>
  180.  
  181.  
  182.  
  183.   and a screen in SUBMENU would look like
  184.  
  185. ╓──────────────────────────────────────────────────────────────────────────────╖
  186. ║ Help░ Submenu░ Window░ Toggle░ Goto░ Append░ Delete░ Recall░ Mark░ Escape░   ║
  187. ║  ░░░░  ░░░░░░░  ░░░░░░  ░░░░░░  ░░░░  ░░░░░░  ░░░░░░  ░░░░░░  ░░░░  ░░░░░░   ║
  188. ║   ░   ░   ░   ░   ░   ░   ░   ░  «» ░  # ░  ≈ ░   ░   ░   ░  ! ░║
  189. ║  ░░░░  ░░░░  ░░░  ░░░  ░░░  ░░░  ░░░  ░░░  ░░░░  ░░░  ░░░  ░░░  ░░░  ░░░  ░░░║
  190. ╟──────────────────────────────────────────────────────────────────────────────╢
  191. ║       ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒           ║
  192. ║       ▒╓────────────────────────────────────────────────────────╖▒           ║
  193. ╟───────▒║▒File▒▒Edit▒▒Locate▒▒Structure▒▒Review▒▒Utility▒▒Info▒▒▒║▒───────────╢
  194. ║       ▒║▒┌─────────────┐▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒║▒           ║
  195. ║       ▒║▒│Load        │▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒║▒           ║
  196. ║       ▒║▒│Writ┌───────────────┐▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒║▒           ║
  197. ║       ▒║▒│save│Database added │▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒║▒           ║
  198. ║       ▒║▒│conV│Format file    │▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒║▒           ║
  199. ║       ▒║▒│db c│Print design   │▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒║▒           ║
  200. ║       ▒║▒│Remo│New database   │▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒║▒           ║
  201. ║       ▒║▒│pacK└───────────────┘▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒║▒           ║
  202. ║       ▒║▒│Print        │▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒║▒           ║
  203. ║       ▒║▒│Edit print   │▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒║▒           ║
  204. ║       ▒║▒│Shell        │▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒║▒           ║
  205. ║       ▒║▒│Quit         │▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒║▒           ║
  206. ║       ▒║▒└─────────────┘▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒║▒           ║
  207. ║       ▒║▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒║▒           ║
  208. ║       ▒║▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒║▒           ║
  209. ║       ▒║▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒║▒           ║
  210. ║       ▒╙────────────────────────────────────────────────────────╜▒           ║
  211. ║       ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒           ║
  212. ║                                                                              ║
  213. ║                                                                              ║
  214. ╙──────────────────────────────────────────────────────────────────────────────╜
  215.  
  216.  
  217.   and a screen in WINDOWMODE would look like
  218.  
  219.                               STOCK:  stock.dbf
  220.  ┌─[■]────────────────────────────────────────────────────────────────────[?]─┐
  221.  │   ░  ╬ ░  + ░  - ░  ° ░    ░    ░  ≈ ░   ░   ░  » ░  « ░  * ░   ░  ! ░ │
  222.  │  ░░░  ░░░  ░░░  ░░░  ░░░  ░░░  ░░░  ░░░  ░░░  ░░░  ░░░  ░░░  ░░░  ░░░  ░░░ │
  223.  │ <i+f> <dup 2>    <tagged>                      Record 2/2                  │
  224.  │■->1/address,3/data                             Idx 1: BARCODE              │
  225.  │     BARCODE           NUMCODE      STOCKDATE   LASTDATE   TOTALCOST        │
  226.  ╞═════════════════════╤════════════╤═══════════╤══════════╤════════════════╤═╡
  227.  │     94/LS-12        │          1 │ 02/14/94  │ 05/01/94 │     800.00     │°│
  228.  │     94/MT-50        │ ▒▒▒▒▒▒▒▒▒2 │ 01/01/94  │ 10/10/94 │     900.00     │░│
  229.  │                     │            │           │          │                │░│
  230.  │                     │            │           │          │                │░│
  231.  │                     │            │           │          │                │░│
  232.  │                     │            │           │          │                │░│
  233.  │                     │            │           │          │                │░│
  234.  │                     │            │           │          │                │░│
  235.  │                     │            │           │          │                │░│
  236.  │                     │            │           │          │                │░│
  237.  │                     │            │           │          │                │░│
  238.  │                     │            │           │          │                │░│
  239.  │                     │            │           │          │                │■│
  240.  │                     │            │           │          │                │°│
  241.  ├─────────────────────┴────────────┴───────────┴──────────┴────────────────┴─┤
  242.  │░░░░░░░░░░░■░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░│
  243.  └────────────────────────────────────────────────────────────────────────────┘
  244.  
  245.   NOTES:
  246.   ■  "■->1/address,3/data" in the above implies
  247.        "■"       :  current workarea is a child of some other workareas
  248.        "->"      :  current workarea also parents some other workareas
  249.        1/address :  address (workarea 1) is a child of current workarea
  250.        3/data    :  data (workarea 3) is also a child of current workarea.
  251.  
  252.   ■  <i+f>       :  index or/and filter active in the display
  253.   ■  <dup 2>     :  record number 2 is tagged for future duplication
  254.   ■  Idx 1: BARCODE
  255.                  :  index no. 1 (BARCODE) active in display
  256.  
  257.  
  258.   See later sections Keys in PAGEMODE and Keys in WINDOWMODE for more
  259.   details on the mouse buttons.
  260.  
  261.  
  262.  
  263.   Exiting DBM
  264.   ───────────
  265.  
  266.   Since press <esc> key will exit one level, sufficient <esc> keys
  267.   will enable you to leave DBM with the original screen.
  268.  
  269.   To exit DBM unconditionally and instantly, just press <alt-X>.
  270.  
  271.  
  272.  
  273.   Mouse Convention
  274.   ────────────────
  275.  
  276.   In a browsing window, pressing mouse buttons has in general the
  277.   following effects
  278.  
  279.  
  280.     ┌─ <left>=oneline, <right>=onepage, <left>+<right>=top/farleft
  281.     │
  282.     
  283.  
  284.     ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
  285.  
  286.         
  287.         └── mouse drag along the line has movement effects
  288.  
  289.  
  290.   In other area
  291.  
  292.    Left         - highlight the item, and make the choice if already
  293.                   highlighted before the mouse click
  294.    Right        - often equivalent to pressing <return>
  295.    Left+Right   - escape
  296.    Left+drag    - move to highlight the new entry, or move a line
  297.                   in the dragging direction
  298.    Right+drag   - move a page in the dragging direction
  299.  
  300.  
  301.  
  302.   Hot Keys
  303.   ────────
  304.  
  305.    F1           - help request at any time
  306.    ^F1          - text dump of nonmemo fields, with sums on each
  307.                   numerical field at the end of the dump
  308.    F2-F10       - often residential program hot keys, if any
  309.    Alt_F10      - choose externally provided tasks in PAGEMODE and
  310.                   WINDOWMODE, when available
  311.    Alt_F1-9     - hot keys for some of the tasks which are also
  312.                   available via Alt_F10
  313.    Alt-<char>   - often picks the main menu or button item that has
  314.                   <char> as its upper case letter
  315.  
  316.  
  317.   DBM Scratch Files
  318.   ─────────────────
  319.  
  320.   DBM uses three scratch files _IDX@#$.TMP, _PRN@#$.TMP  and
  321.   _DBM@#$.TMP. So do not use these three names as your normal
  322.   filenames.
  323.  
  324.  
  325.  
  326.   Command Line Options
  327.   ────────────────────
  328.  
  329.   DBM  [/?] [/25] [/43] [/50] [/c] [/cc] [/ccc] [/a] [/b]
  330.        [/d] [/m] [/n] [/w] [/!] [/!!] [/la] [/lb]
  331.        [/l#] [/+help] [/:initial] [//f:num]
  332.        [dbfile,format,prndesign,index1,...] [...]
  333.  
  334.   DBM  /ab|/ae  textfiles [...]
  335.        [/25] [/43] [/50] [/c] [/cc] [/ccc] [/d] [/m]
  336.  
  337.   /?          - help on command line options
  338.   /25         - 25 line screen
  339.   /43         - 43 line screen
  340.   /50         - 50 line screen
  341.   /c          - color monitor (default)
  342.   /cc         - color different from /c option only in pagemode,
  343.                 useful for removing the background-highlight effect
  344.   /ccc        - color choice in slightly altered setting, useful for
  345.                 non-conventional color monitors, so that the text will
  346.                 still be easily readable
  347.   /a          - date in American format mm/dd/yy
  348.   /b          - date in British format dd/mm/yy
  349.   /d          - disable mouse, useful if your local mouse driver is
  350.                 unable to support properly such as the 43x132 text screen
  351.   /m          - monochrome monitor
  352.   /n          - no initial link via index or filter.
  353.                 index/filter in pagemode will not be passed on
  354.                 windowmode initially, unless it is been toggled
  355.                 explicitly in the windowmode
  356.   /w          - display initially set to windowmode
  357.   /ab         - browse ascii text
  358.   /ae         - edit ascii text files
  359.   /la         - memoedit line length adjusted to window size
  360.   /lb         - text edit with borderlines, when combined with /ab or
  361.                 /ae option
  362.   /l#         - (40≤ # ≤250) memo line length for editing set to #
  363.                 characters per line (default=250)
  364.   /v          - global view only: none of the main databases are allowed
  365.                 to edit
  366.   /!          - disable edit mode and submenu for nonformatted databases
  367.   /!!         - disable edit,submenu and window view
  368.   /+help      - "help" is the name of the help file
  369.   /:initial   - "initial" is the number of order of the database
  370.                 files, which indicates which database is to be
  371.                 initially displayed
  372.   //f:num     - max number of open files allowed
  373.   dbfile      - first database file
  374.   format      - format filename
  375.   prndesign   - print design filename
  376.   index1,...  - index files
  377.  
  378.  
  379.   You may even run DBM in 43x132 screen mode, if you set your monitor
  380.   screen externally to that display mode first. Moreover, if you have
  381.   a VGA monitor and set it to simulate CGA, you may actually like the
  382.   effects.
  383.  
  384.   We note that sometimes a screen, particularly in the 132 column mode,
  385.   may exhibit `weird' color combination. In such cases, the apparently
  386.   redundant options "/25" etc often fix the color to the right setting.
  387.  
  388.  
  389.  
  390.   Keys in PAGEMODE
  391.   ────────────────
  392.  
  393.   In this mode, a record occupies one or several pages.
  394.  
  395.   Alt_H      - Help
  396.   Alt_S      - Submenu for services on file, search etc
  397.   Alt_W      - Window edit/view mode
  398.   Alt_T      - Toggle view/edit mode
  399.   Alt_G      - Go a particular record
  400.   Alt_A      - Append a new record at the end of database (to insert at the
  401.                current record position, see edit of submenu)
  402.   Alt_D      -  Delete current record
  403.   Alt_R      - Recall deleted records
  404.   Alt_M      - Mark area as scratch text
  405.   Alt_E      - Escape: once to leave edit mode, twice to quit completely
  406.   Alt_X      - Brutal exit/abort
  407.  
  408.   Alt_F    - First undeleted record
  409.   Alt_L    - Last undeleted record
  410.   Alt_P     - Previous record
  411.   Alt_N     - Next record
  412.   PgUp      - Previous page if available
  413.   PgDn      - Next page if available
  414.   ^Home     - First entry in current page
  415.   ^End      - Last entry in current page
  416.   Home       - Leftmost position
  417.   End        - Rightmost position
  418.   ^PgUp      - First page
  419.   ^PgDn      - Last page
  420.  
  421.   F1         - Help
  422.   F2      #  - Check the relative cursor position inside input buffer
  423.   F3  Alt_W  - Edit or view database in a line-per-record mode.
  424.                Note that in the case of limit being exceeded in 50 line
  425.                mode, for instance, a 25 line mode may still be within
  426.                the limit. Memo edit has largest width in the mode than
  427.                in the other ones
  428.   F4  Alt_M  - Screen-Keyboard-Logfile swapping utility
  429.   F5      ≈  - Total number of filtered records, with current record number
  430.   F6         - Current date and time
  431.   F7        - Workarea toggle
  432.   F8        - Select a workarea
  433.   F9     «»  - Browsing current all records of current field, with search
  434.              - algorithm
  435.   F10       - Toggle specific filter provided by the related print
  436.              - design file
  437.   Alt_F10 !  - Choose an external codeblock to execute
  438.   Alt_F1 - Alt_F9   -   special external codeblocks
  439.   ^F10       - Call up or create a map, map altered in non-edit mode will
  440.                be ignored
  441.  
  442.  
  443.  
  444.   Submenu Hiararchy
  445.   ─────────────────
  446.  
  447.  
  448.                                ┌───────────────┐
  449.                                │Database added │
  450.                                │Format file    │
  451.                                │Print design   │
  452.               ┌─────────────┐  │New database   │
  453.               │Load        │  └───────────────┘
  454.               │Write dbfile │
  455.               │save Maps    │  ┌────────────┐
  456.               │conVert file│  │copy To     │   ┌──────────┐
  457.    FILE       │db cOmmit    │  │append From │   │SDF       │
  458.               │Remove       │  │Style      │   │deLimited │
  459.               │pacK         │  │Db2asc      │   └──────────┘
  460.               │Print        │  │Asc2db      │   ┌─────────┐
  461.               │Edit print   │  │Mode       │   │Truthful │
  462.               │Shell        │  └────────────┘   │Dump     │
  463.               │Quit         │                   └─────────┘
  464.               └─────────────┘
  465.  
  466.  
  467.               ┌─────────────────┐
  468.               │Format free      │
  469.               │Insert record    │
  470.               │Duplicate record │
  471.               │Merge file       │
  472.    EDIT       │Previous record  │
  473.               │Next record      │
  474.               │Top record       │
  475.               │Bottom record    │
  476.               │Goto record      │
  477.               │Select workarea  │
  478.               └─────────────────┘
  479.  
  480.  
  481.               ┌────────────────┐
  482.               │Edit string     │
  483.               │Mark fields     │
  484.               │Start search    │
  485.    LOCATE     │Continue search │
  486.               │Reverse search  │
  487.               │from Bottom     │  ┌──────────┐
  488.               │match mOde     │  │Substring │
  489.               └────────────────┘  │Whole     │
  490.                                   └──────────┘
  491.  
  492.  
  493.               ┌────────────────────┐
  494.               │New struct          │
  495.               │Ed struct           │
  496.    STRUCTURE  │Duplicate struct    │
  497.               │write Format struct │
  498.               │Prn design struct   │
  499.               └────────────────────┘
  500.  
  501.  
  502.  
  503.               ┌───────────────┐
  504.               │Load main log  │
  505.               │Edit main      │
  506.    REVIEW     │Write main     │
  507.               │load Sublog    │
  508.               │Review sublog  │
  509.               │sub To mainlog │
  510.               └───────────────┘
  511.  
  512.  
  513.                               ┌─────────────┐
  514.                               │User defined │
  515.                               │Field string │
  516.                               │No filter    │
  517.                               │View filters │
  518.                               └─────────────┘
  519.                               ┌──────────────┐
  520.                               │Tmp index     │
  521.               ┌─────────────┐ │index Off     │
  522.               │Filter      │ │Make index    │
  523.    UTILITY    │Index       │ │Extra index   │
  524.               │Relation    │ │Load new      │
  525.               │Dump and sum │ │Pick control  │
  526.               └─────────────┘ │Rebuild index │
  527.                               └──────────────┘
  528.                               ┌────────┐
  529.                               │Add     │
  530.                               │Delete  │
  531.                               │View    │
  532.                               │Parents │
  533.                               └────────┘
  534.  
  535.               ┌─────────┐
  536.               │General  │
  537.    INFO       │Program  │
  538.               │Freeware │
  539.               └─────────┘
  540.  
  541.  
  542.  
  543.  
  544.   Keys in WINDOWMODE
  545.   ──────────────────
  546.  
  547.   In this mode, each record is displayed in a horizontal line.
  548.  
  549.   Enter      - Edit/view current entry
  550.   TAB        - Toggle automatic search mode.
  551.  
  552.                If <seek off>, then an unrecognised key will start
  553.                editing the entry immediately. If in <keyseek> mode, then
  554.                instead the pressed key will be searched from the current
  555.                field of all records.
  556.  
  557.                Upper case letters etc will enable string search (with
  558.                SPACE BAR to restart search string), while in other
  559.                cases, only letter searching is performed.
  560.  
  561.   Alt_G      - Goto record by number
  562.   Alt_I     - Select controlling index
  563.   Alt_F    ╬ - Toggle filter mode
  564.   Alt_S    * - Search for a string
  565.   Alt_=          - Mark (tag) current record for
  566.                duplication into others
  567.   F1       ? - Help
  568.   F2         - Current cursor position, when editing area is focused
  569.   F3       « -  Reverse search
  570.   F4         - Area marking
  571.   F5         - Record number report
  572.   F6         - Current time and date
  573.   F7        - Toggle workareas
  574.   F8        - Select workarea
  575.   F9       » - Forward search
  576.   F10       - Toggle external filter
  577.   Alt_F10  ! - Choose an external codeblock to execute
  578.   Alt_F1 - Alt_F9    -  execute special external codeblock
  579.  
  580.   Following keys are active in edit mode only.
  581.  
  582.   DEL      - - Delete record toggle
  583.   INS      + - Insert empty record at the end
  584.   Alt_=          - Mark (tag) current record for duplication into others
  585.   ^Enter     - Append tagged record at the end
  586.   Alt_-      - Copy tagged record into current record number, pushing
  587.                all the existing records behind by 1
  588.   Alt_0      - Same as Alt_-, except empty record is inserted
  589.  
  590.  
  591.  
  592.   Keys in SUBMENU
  593.   ───────────────
  594.  
  595.   NUM_DEL    - Leave SUBMENU unconditionally, same as click both buttons
  596.                on bottom borderline of the box that contains the submenu
  597.                choices
  598.   ESC        - Back to the previous menu level, same as click both buttons
  599.                on top borderline of the box that contains the submenu
  600.                choices
  601.   Enter      - Make a choice
  602.  
  603.   Alt_F      - File
  604.   Alt_E      - Edit
  605.   Alt_L      - Locate
  606.   Alt_S      - Structure
  607.   Alt_R      - Review
  608.   Alt_U      - Utility
  609.   Alt_I      - Info
  610.  
  611.  
  612.  
  613.   Load Database Files
  614.   ───────────────────
  615.  
  616.   To load in a new database file as into a workarea, choose LOAD option
  617.   in the SUBMENU - you can reach the submenu from the main PAGEMODE by
  618.   pressing e.g. Alt_S. In the choices given via LOAD option, ADD
  619.   DATABASE will add the new database file as a new workarea, while
  620.   keeping all the other workarea open. The choice NEW DATABASE will
  621.   however first close all the existing workareas and then open the new
  622.   database file as the only workarea.
  623.  
  624.   To load database files on the command line, simply put the database
  625.   filenames there. Wildcard characters are supported. For instance, to
  626.   load database files stock*.dbf and addr.dbf, we could just run the
  627.   following command
  628.  
  629.       DBM addr stock*
  630.  
  631.  
  632.  
  633.   Database Alias Convention
  634.   ─────────────────────────
  635.  
  636.   The alias of a database, when loaded, is in general the filename
  637.   without the path and extension. However, if such derived alias
  638.   duplicates an existing alias or contains characters other than
  639.   alphabets, digits and underscore, then _TMP#### in which #### is
  640.   a number will be used to denote the alias. The numbers denoted
  641.   there will increment sequentially for each thus opened database.
  642.  
  643.  
  644.  
  645.   Load Screen Format and Print Design
  646.   ───────────────────────────────────
  647.  
  648.   A screen format file is a special database file, normally with
  649.   extension .DBM, which will direct the display format of the concerned
  650.   database. A print design file is another special database file,
  651.   normally with extension .DBP, which will direct a print procedure and
  652.   offer many externally defined tasks.
  653.  
  654.   By default, when a database is is loaded into a workarea, the same
  655.   filename with extension .DBM (if exists and is valid) will be loaded
  656.   in as the screen format, while the same filename with extension .DBP
  657.   will be loaded in as the print design.
  658.  
  659.   To override the default, pick the format filename and print design
  660.   filename before loading a new database. However once a new database is
  661.   loaded in, the program resets itself to the default.
  662.  
  663.   Under the formatted display, the prompt does not have to be the name
  664.   of the corresponding field. To find out the accurate fieldname, use
  665.   either F9 (browsing the field) or F3 (windowmode display).
  666.  
  667.  
  668.  
  669.   How to Create a Format File
  670.   ───────────────────────────
  671.  
  672.   Suppose you have a database file TEST.DBF which has the following
  673.   structure
  674.     { { NAME,     "C", 10, 0 },
  675.       { MAPLIST,  "C", 4,  0 } }
  676.   and that you wish to make MAPLIST field a field translated by a
  677.   map database file under the name MAPLIST.MAP. Then one way of doing
  678.   it is to
  679.     1.  Use option WRITE FORMAT STRUCT of submenu STRUCTURE to create
  680.         an empty format database file under the name TEST.DBM
  681.     2.  Load in TEST.DBM and add a record for each fieldname in the
  682.         original database TEST.DBF. If you don't add a record for
  683.         any particular field, then that field is masked: in other words,
  684.         that field will not be seen on the screen in pagemode
  685.     3.  Enter the following two records for the fields NAME and MAPLIST
  686.         respectively
  687.  
  688.         --- record 1 ---       --- record 2 ---
  689.  
  690.         FNAME     NAME         FNAME     MAPLIST
  691.         MODE      1            MODE      4
  692.         PAGENO    1            PAGENO    1
  693.         MAPFILE                MAPFILE   c:\dbm\maplist.map
  694.         PROMPT    Name         PROMPT    Map Choice
  695.         PROW      9            PROW      9
  696.         PCOL      3            PCOL      31
  697.         PWIDTH    10           PWIDTH    11
  698.         ROW       9            ROW       9
  699.         COL       14           COL       43
  700.         WIDTH     15           WIDTH     20
  701.         HEIGHT    0            HEIGHT    0
  702.         VIEWMODE  0            VIEWMODE  0
  703.         PCOLOR                 PCOLOR
  704.  
  705.     4.  Load in database TEST.DBF with format TEST.DBM. You will see
  706.         the MAPLIST entry (under the prompt Map Choice) is given as
  707.         "unknown". Use ^F10 to create a map in the editing mode
  708.         (togglable via Alt_T). Finally use SAVE MAPS in FILE option of
  709.         the SUBMENU to save the newly created/edited map. Since the map
  710.         entry editing area is sensible to the maximum width of the
  711.         existing entries, a good idea is to edit an entry of typical
  712.         widths and then re-enter the map-editing mode.
  713.     5.  Step 4 may be replaced by directly editing MAPLIST.MAP as a
  714.         database file.
  715.  
  716.   Foe details, see the ADVANCED TOPICS.
  717.  
  718.  
  719.  
  720.   Write Database
  721.   ──────────────
  722.  
  723.   To write current workarea into a database file, use SUBMENU. This
  724.   option only outputs the current filtered records to the database file
  725.   - thus deleted records are not saved.
  726.  
  727.   To remove all the deleted records physically, use PACK in option FILE
  728.   of the SUBMENU.
  729.  
  730.  
  731.  
  732.   Toggle Workareas
  733.   ────────────────
  734.  
  735.   If more than one databases files are opened, then we can toggle the
  736.   different workareas corresponding to these files by pressing key F7 or
  737.   F8. Key F7 will pick the next workarea in the list, while F8 will list
  738.   all the workareas to let you choose directly.
  739.  
  740.  
  741.  
  742.   Edit a Record
  743.   ─────────────
  744.  
  745.   A database record may be edited in three different ways - in PAGEMODE,
  746.   in WINDOWMODE and via SUBMENU.
  747.  
  748.   ■  In PAGEMODE, a record will occupy a single page of screen unless
  749.      more pages are needed. Use Alt_T to toggle edit and view. This mode
  750.      is ideal for large number of fields and for the case when a general
  751.      overview of a single record is more meaningful than the overview of
  752.      a single field of a list of records. This mode can also be used to
  753.      control the display position and format, and determined which
  754.      fields are permitted to view or edit.
  755.  
  756.   ■  In SUBMENU mode, choice EDIT will enable one to edit a single record
  757.      line by line, similar to vertically browsing all fields of a record.
  758.  
  759.   ■  In WINDOWMODE, a more traditional display format, we again use
  760.      Alt_T to toggle the edit and view. In this mode, each record
  761.      occupies a virtual line of window. This mode offers a better global
  762.      view particularly when the number and width of fields are small.
  763.  
  764.  
  765.  
  766.   Create a Record
  767.   ───────────────
  768.  
  769.   To create a record, the general rule is to append an empty record to
  770.   the end of a database and then edit the record accordingly. However,
  771.   it is possible to insert a record in the middle of a database, via
  772.   SUBMENU or in WINDOWMODE. In the former case, just choose the options
  773.   listed by EDIT, while in the later case, use Alt_0 (insert blank record)
  774.   or Alt_- (insert marked record) instead.
  775.  
  776.   In the PAGEMODE or WINDOWMODE, a new record may be created only if it
  777.   is currently in the edit mode, rather than the view only mode.
  778.  
  779.  
  780.  
  781.   Duplicate a Record
  782.   ──────────────────
  783.  
  784.   A record may be duplicated at any physical position of a database. For
  785.   duplication inside a same database, it is easiest to perform the task
  786.   in WINDOWMODE, in which Alt-= will mark a record for duplication and
  787.   Alt_- will insert the marked record at the current record number.
  788.  
  789.   To duplicate a record across different database files or within a same
  790.   database, we can use the facilities provided by SUBMENU. The option
  791.   DUPLICATE RECORD of EDIT, will enable us to copy current record of
  792.   current workarea to any position of any other workarea.
  793.  
  794.  
  795.  
  796.   Search a Record
  797.   ───────────────
  798.  
  799.   All search matchings are case-insensitive.
  800.  
  801.   ■  In PAGEMODE, i.e. the default display mode, we can browse the
  802.      current field of all the filtered records by pressing F9. Once in
  803.      the search/browse state, a lower case key will first try to match a
  804.      leading character of the field, then try to match any position if
  805.      possible. If a letter is in upper case, then all such characters
  806.      will form a single search string, until a space key or direction
  807.      keys are pressed.
  808.  
  809.   ■  In SUBMENU mode, i.e. if we want to use submenu to locate a
  810.      record, we can choose LOCATE, and then enter the substring by
  811.      choosing EDIT STRING. The default searches all fields of the
  812.      records for a substring match. However we can restrict ourselves to
  813.      search some specific fields by marking them via MARK FIELDS.
  814.  
  815.   ■  In WINDOWMODE, i.e. each record is displayed as a single line, we
  816.      can use Alt_S to bring out a search pad, whose function is similar
  817.      to that of LOCATE in SUBMENU, or use F9 to search forward and F3 to
  818.      search backward.
  819.  
  820.   All the above cases are interrelated - each has some advantages and
  821.   disadvantages.
  822.  
  823.  
  824.  
  825.   Create or Edit Database Structure
  826.   ─────────────────────────────────
  827.  
  828.   Choose options given by STRUCTURE in SUBMENU accordingly, after
  829.   editing the structure, use Ctrl_Enter to save the new database
  830.   structure.
  831.  
  832.   Two special database structures, i.e. the ones for screen format
  833.   (*.DBM) and for print design (*.DBP) respectively, can be output
  834.   directly from the options within STRUCTURE in SUBMENU.
  835.  
  836.  
  837.  
  838.   Make, Load and View Database Indexes
  839.   ────────────────────────────────────
  840.  
  841.   The easiest way of loading database indexes is to do it on the command
  842.   line. The command line has the format
  843.  
  844.      DBM [/options]  [ <workarea-str1> ] [ <workarea-str2> ]  [ ... ]
  845.  
  846.   where <workarea-str> is a string (containing no empty space) of
  847.   filenames separated by ",". The names are given in the order of
  848.  
  849.      <dbfile>,<format>,<prndesign>,<index1>[,<index2> ...]
  850.  
  851.   in which database filename <dbfile> must be valid, while for others
  852.   the program DBM will default accordingly. For example, if a
  853.   <workarea-str> is "abc,,,name,order", then it will be defaulted to
  854.  
  855.      "abc.dbf,abc.dbm,abc.dbp,name.ntx,order.ntx"
  856.  
  857.   loading abc.dbf into a workarea, with format given by abc.dbm and
  858.   print design by abc.dbp, and with the index files name.ntx and
  859.   order.ntx.
  860.  
  861.   Index can also be loaded or completely removed via the use of SUBMENU.
  862.   Choose UTILITY from SUBMENU, then choose INDEX. We may load in a new
  863.   index via menu choice EXTRA INDEX, on top of the existing indexes -
  864.   with the original controlling index remain in control, or we could
  865.   load in a new index as the only index - thus closing all the existing
  866.   index files in the current workarea first.
  867.  
  868.   To view what indexes are active in current workarea or to choose a new
  869.   controlling index, just use menu option PICK CONTROL.
  870.  
  871.   Other functions such as removing all existing indexes or rebuilding all
  872.   existing indexes of current workarea, are also supported.
  873.  
  874.  
  875.  
  876.   Set and View Database Filters
  877.   ─────────────────────────────
  878.  
  879.   Database filter may be set, removed and viewed via the use of SUBMENU.
  880.   Choose UTILITY of SUBMENU, then choose FILTER.
  881.  
  882.   A condition of logical type can be entered as a filter through the
  883.   menu option of USER DEFINED. If matching substrings of some fields are
  884.   to be used as the filter, then choose option FIELDS. We note that
  885.   while option USER DEFINED will disable existing filter before setting
  886.   the new user filter, option FIELDS will add the condition itself to
  887.   the user defined filter.
  888.  
  889.   However, substring match via option FIELDS should be used sparingly,
  890.   as it may slow down the operations considerably - particularly when
  891.   the database is large and the filtered number of records is small.
  892.  
  893.   In PAGEMODE, all displayed records are filtered records, unless the
  894.   record number is chosen by such as GOTO (Alt_G).
  895.  
  896.   In WINDOWMODE, display between natural order and indexed or filtered
  897.   records, can be toggled by Alt_F. In other words, we can toggle
  898.   between the global records and the selected or indexed records.
  899.  
  900.  
  901.  
  902.   Set and View Database Relations
  903.   ───────────────────────────────
  904.  
  905.   When there are more than one workareas, different workareas may be
  906.   related to each other, in the form that one workarea being a child or
  907.   slave of another workarea. Two workareas may be related through a
  908.   common (indexed) field, or through just the physical record number.
  909.  
  910.   If two workareas are related to each other, then when the record in
  911.   the parent workarea is moved, the record in the child workarea will be
  912.   automatically moved (or sought) so that the common field that is used
  913.   to related the two workareas is the same, or the physical record
  914.   number of the record is the same in the other case.
  915.  
  916.   Note that when two workareas are related by a common field, the child
  917.   workarea must have that field as an active index. Otherwise the record
  918.   pointer in child workarea will be moved to LASTREC()+1. If two
  919.   workareas are related by the direct physical location, then unless the
  920.   child workarea in not indexed, the record pointer in child workarea
  921.   will also be moved to LASTREC()+1.
  922.  
  923.   Relations are executed sequentially.
  924.  
  925.   To set a relation is to choose a common field, or just the natural
  926.   physical order, and a child workarea. A child workarea is not allowed
  927.   to parent any of its parents or grandparents etc.
  928.  
  929.   If a parent workarea is in display, either in PAGEMODE or in WINDOWMODE,
  930.   all of its direct child workareas are displayed via
  931.  
  932.       ->1st_child,...,last_child
  933.  
  934.   To find out all the parents and grandparents of the current workarea,
  935.   just choose PARENT of RELATION of UTILITY in SUBMENU.
  936.  
  937.  
  938.  
  939.   Load and Edit User Scratch Files
  940.   ────────────────────────────────
  941.  
  942.   The LOG files are the scratch files for the user. Scratch files are
  943.   particularly useful when one wants to cut a piece of text from another
  944.   place. For example, if we want to copy a block of text on screen that
  945.   is within on memo field, then we first mark the block text by copying
  946.   it to a buffer given by the marking pad activated by key F4, then we
  947.   copy the buffer to a scratch file for future use: just get the text
  948.   block into mark pad buffer and then play the buffer at the proper new
  949.   position of such another memo field.
  950.  
  951.   Two LOG files, main log and minor log, are for the convenience of
  952.   doctoring the block text. However, ALWAYS delete them with Alt_Y
  953.   whenever you think they are no longer useful, so as to release the
  954.   holding computer memory.
  955.  
  956.   These options are still primitive. However they can be used to achieve
  957.   surprisingly useful tasks.
  958.  
  959.  
  960.  
  961.   Print Workarea
  962.   ──────────────
  963.  
  964.   For DBM, printing method is to be supplied externally by the print
  965.   design database file. A print design file will determine which field
  966.   which record and how is to be printed. See the example STOCK.DBF,
  967.   STOCK.DBP for more illustrations.
  968.  
  969.   When external printing directives are supplied, EDIT PRINT of FILE in
  970.   SUBMENU will first output the printout to a file for viewing and
  971.   editing. The user may then save it to a file or send it directly to
  972.   the printer PRN, i.e. save it to the file under the name "PRN".
  973.  
  974.  
  975.  
  976.   Merge a Database File
  977.   ─────────────────────
  978.  
  979.   We may merge a new database file into the current workarea, at the
  980.   current position (overwrite) or at the end (append). The fields of
  981.   same name, type and width will be copied. However in the case of
  982.   string type, if the widths is different, then the merged string field
  983.   will be padded or truncated on the right.
  984.  
  985.  
  986.  
  987.   Conversion between Database and Ascii Text
  988.   ──────────────────────────────────────────
  989.  
  990.   There are two conversion modes: TRUTHFUL and DUMP. The Ascii text that
  991.   are converted from a database will contain in the first few lines its
  992.   database structure in the format of
  993.  
  994.       <filename> <type> <width> <dec>
  995.  
  996.   per line until the first character of the line becomes "-" which is
  997.   thus used to separate the structure from the records.
  998.  
  999.   To convert database records into Ascii text, DUMP mode will simply dump
  1000.   every non-empty field as a text line and mark the end of a record by
  1001.   an empty line -- all empty lines inside a memo field will thus be
  1002.   removed.
  1003.  
  1004.   In TRUTHFUL mode, however, the conversion is essentially reversible
  1005.   under the assumption that no fields other than memo fields will
  1006.   contain more than a text line, i.e. containing <CR-LF>. Since under
  1007.   the general usage such an assumption will always hold, the
  1008.   conversion keeps all the structure and data of the database.
  1009.   Moreover, memo fields that contain only SPACE and TAB characters
  1010.   will be nullified as empty memo fields.
  1011.  
  1012.   In TRUTHFUL mode, there are several special markings which are
  1013.   meaningful when located at the beginning of a line
  1014.  
  1015.    %+        - mark start of a new record (must present)
  1016.    %+*       - mark start of a new but deleted record
  1017.    %-        - mark the end of a memo field
  1018.  
  1019.   Note that memo markings are optional when no confusion is to occur.
  1020.   Also that an empty line for a particular field represents a value
  1021.   which is EMPTY for the that particular field type.
  1022.  
  1023.   With the TRUTHFUL conversion, one can edit a database in text mode
  1024.   manually or by another program, and then convert it back to true
  1025.   database format.
  1026.  
  1027.   The following example explains a typical ASCII text converted truthfully
  1028.   from a database file.
  1029.  
  1030.     <---------NOTES    ASCII TEXT ------------------------------------->
  1031.  
  1032.     Field names  ->    TITLE C 20 0         (TRUTHFUL) mode: A.DBF -> A.ASC
  1033.                        MEMO_ONE M 10 0
  1034.                        STOCKDATE D 8 0
  1035.                        SALEPRICE N 10 2
  1036.                        MEMO_TWO M 10 0
  1037.                        QUIT L 1 0
  1038.                        LASTLINE C 20 0
  1039.     Leading "-"  ->    --- end of structure ---
  1040.     ends structure
  1041.  
  1042.     Emptylines
  1043.     before start of
  1044.     a new record
  1045.     are ignored  ->
  1046.  
  1047.  
  1048.     "%+" starts new
  1049.     record       ->    %+ 1 -----
  1050.     1st entry    ->    Normal Rec (1)
  1051.     2nd entry    ->
  1052.     which is a memo    The first (i.e. above) line of this memo field is
  1053.     field, and is      empty. This entry has two paragraphs: the 2nd
  1054.     ended by the       paragraph will be separated by 2 empty lines from
  1055.     special endmemo    the 1st one.
  1056.     marker "%-"
  1057.     appearing at
  1058.     the beginning      This is the 2nd paragraph!
  1059.     of a line    ->    %-
  1060.     3rd entry    ->    02/14/91
  1061.                        99.95
  1062.     another memo ->    Text of the 2nd memo field.
  1063.     ended by "%-"      %-
  1064.                        .T.
  1065.     last entry   ->    all entries shown
  1066.  
  1067.     2nd (deleted)
  1068.     record starts->    %+* 2 -----
  1069.     "%+%+" is %+ ->    %+%+ Strange Rec (2)
  1070.                        Special markers %+ and %- at the beginning of a line:
  1071.                        %+%+  - mark start of a new record unconditionally
  1072.                              (unless it is followed IMMEDIATELY by itself so
  1073.                               that the first occurence will be ignored)
  1074.     "%-%-" is %- ->    %-%-  - mark the end of a memo field and is optional
  1075.                              when no confusion is to occur.
  1076.  
  1077.                        This record is to be deleted, but not removed.
  1078.                        %-
  1079.                        01/01/01
  1080.                        0.00
  1081.                        Some other combinations:
  1082.     "%-%+"             %-%-%+
  1083.     "%+%+"             %+%+%+
  1084.     "%-%-"             %-%-%-
  1085.     "%+%-"             %+%+%-
  1086.                        %-
  1087.                        .F.
  1088.                        %- effect of markers
  1089.  
  1090.     3rd record   ->    %+ 3 -----
  1091.                        Empty Rec (3)
  1092.  
  1093.     4th record   ->    %+ 4 -----
  1094.                        Last Rec (4)
  1095.                        %-
  1096.                        /  /
  1097.                        0.00
  1098.                        Last field, last memo field.
  1099.     end of
  1100.     converted ascii
  1101.     text         ->
  1102.  
  1103.  
  1104.  
  1105.  
  1106.   Text Dump and Field Summation
  1107.   ─────────────────────────────
  1108.  
  1109.   A simple utility via DUMP AND SUM in UTILITY of SUBMENU is provided
  1110.   to output all non-memo fields, with summation for each numerical
  1111.   field reported at the end of the text dump.
  1112.  
  1113.  
  1114.  
  1115.   Text Editing
  1116.   ────────────
  1117.  
  1118.   DBM carries a simple text editor, so that memo fields can be readily
  1119.   modified or entered.
  1120.  
  1121.   To edit separate text files, use EDIT MAIN of REVIEW in SUBMENU. The
  1122.   text editor supports basic cursor movement and search mechanism.
  1123.  
  1124.   ^W        - (ctrl-w) save and return
  1125.   Esc       - quit without save
  1126.  
  1127.   ^BKSP     -
  1128.   ^Y        - delete current line
  1129.   ^T        - delete word right
  1130.   Alt_Y     - delete the whole contents
  1131.   Alt_U     - delete up (all previous text)
  1132.   Alt_D     - delete down (all following text)
  1133.   ^Home     - beginning of current window
  1134.   ^End      - end of current window
  1135.   ^PgUp     - beginning of file
  1136.   ^PgDn     - end of file
  1137.  
  1138.   Home      - beginning of current line
  1139.   Eend      - end of current line
  1140.   Enter     - beginning of next line
  1141.   ^A        - a work left  (^Left_Arrow)
  1142.   ^F        - a word right (^Right_Arrow)
  1143.   ^N        - insert a line above
  1144.  
  1145.   Alt_S     - edit search string and search forward
  1146.   Alt_F     - forward search
  1147.   Alt_R     - reverse search
  1148.   Alt_T     - toggle case/nocase in string search
  1149.   Alt_P     - toggle showing line/column position
  1150.   Alt_L     - length of current file buffer
  1151.  
  1152.   Alt_I     - insert a file in edit mode
  1153.   Alt_W     - save to a new file in edit mode, otherwise it is
  1154.               equivalent to ^W
  1155.   F4        - mark and paste (avoid marking controlling characters)
  1156.  
  1157.  
  1158.   If you wish to use DBM simply as as a program viewer or editor, then
  1159.   you could use  " DBM  /ab files [...] " to view or " DBM /ae files "
  1160.   to edit. However DBM is not designed to be a good editor.
  1161.  
  1162.  
  1163.  
  1164.   Paste Text
  1165.   ──────────
  1166.  
  1167.   Text marking and paste is supported in a limited form in DBM. The
  1168.   general strategy is to use F4 to mark a portion of text displayed on
  1169.   the screen then play the text back as if they are keyed in one
  1170.   character after another. Two log strings or files via SUBMENU are
  1171.   provided mainly as the scratch pads for this purpose.
  1172.  
  1173.   Suppose we need to copy a portion of a text file to a memo field, we
  1174.   could first load the text file into the main log or minor log (see
  1175.   REVIEW in SUBMENU), the mark the area via F4. After we move to the
  1176.   cursor position where we want the marked text to be keyed in, use F4
  1177.   again to dump the marked text.
  1178.  
  1179.   Another way of doing it is through the use of Alt_U/Alt_D/Alt_W/Alt_I
  1180.   in text editing, so that a block of text may first be saved to a buffer
  1181.   file, then load it in later on at a proper place.
  1182.  
  1183.  
  1184.  
  1185.   DOS Shell
  1186.   ─────────
  1187.  
  1188.   Leave DBM temporarily to run some other DOS applications. Type EXIT to
  1189.   return to DBM.
  1190.  
  1191.  
  1192.  
  1193.   External Utility
  1194.   ────────────────
  1195.  
  1196.   Two external programs IRON.COM and SCREEN.COM to are used with DBM.
  1197.  
  1198.   IRON.COM irons any of the four DBM options "/m", "/n", "/!" and "/!!"
  1199.   into dbm.exe itself. For instance, to make dbm.exe use monochrome
  1200.   color setting by default, just run " iron dbm.exe m ".  Similarly
  1201.   one can force option "/n" to dbm.exe, thus leaving the windowmode
  1202.   index/filter state independent of that of the pagemode.
  1203.  
  1204.   However, ironing option "/!" or "/!!" is to reduce the user's power
  1205.   on database management, so that only pre-designated databases and
  1206.   action tasks are allowed to be performed. This way, important database
  1207.   may be accessed by unprevilidged users, without having to worry about
  1208.   its secrecy of some of its fields and its being edited accidentally.
  1209.  
  1210.   Since ironing the options are irreversible (apart from /m), always
  1211.   make a backup copy before doing it. Or better still, copy dbm.exe
  1212.   to a file under a new name, and then iron this new executable file.
  1213.   If so, we could have two DBM programs sharing a same dbm.ovl.
  1214.  
  1215.   SCREEN.COM is for the use of VGA monitor. It allows you to set your
  1216.   monitor to 25x132 or 43x132 text mode, so that you could have a much
  1217.   wider screen. This can be very helpful in using the windowmode or
  1218.   text editing. Since mouse drivers often can not support such
  1219.   screen modes, we may have to add option "/d" to disable the mouse
  1220.   when running DBM.
  1221.  
  1222.   If you for some reason can't leave your printer ready for your use
  1223.   all the time, you could always redirect it to a file and send it later
  1224.   to a printer. To redirect your printer, you could use PRN2FILE.COM
  1225.   which is a shareware (or freeware ?) from VOL6N21.ARC (PC Magazine,87)
  1226.  
  1227.  
  1228.  
  1229.  ┌─────────────────┐
  1230.  │ Advanced Topics │
  1231.  └─────────────────┘
  1232.  
  1233.  
  1234.   Screen Format Database (*.dbm)
  1235.   ──────────────────────────────
  1236.  
  1237.   FNAME      - field name
  1238.   MODE       - edit strategy mode
  1239.                1=normal variable
  1240.                3=memo variable
  1241.                4=character field masked by interpretation
  1242.                5=memo display directly via input region,
  1243.                  edit/view in larger normal area
  1244.                6=memo display directly as in 5, edit or view
  1245.                  in input region specified by four fields
  1246.                  ROW,COL,WIDTH,HEIGHT given below
  1247.   PAGENO     - which page to include the field
  1248.   MAPFILE    - map filename for Mode=4
  1249.   PROMPT     - prompt name for field name
  1250.   PROW       - starting row of prompt
  1251.   PCOL       - starting col of prompt
  1252.   PWIDTH     - width of prompt
  1253.   ROW        - row of input region
  1254.   COL        - col of input region
  1255.   WIDTH      - width of input region
  1256.   HEIGHT     - height of input region for memo, valid for
  1257.                MODE=5 or 6
  1258.   VIEWMODE   - editmode when under viewonly mode
  1259.                0=default: view only
  1260.                1=allow to edit even under viewonly mode
  1261.   PCOLOR     - new color string for the prompt
  1262.                e.g. "W/R" (""=take the default)
  1263.  
  1264.  
  1265.   Allowed Structure:
  1266.  
  1267.           {"FNAME","C",10,0},
  1268.           {"MODE","N",3,0},
  1269.           {"PAGENO","N",3,0},
  1270.           {"MAPFILE","C",160,0},
  1271.           {"PROMPT","C",100,0},
  1272.           {"PROW","N",3,0},
  1273.           {"PCOL","N",3,0},
  1274.           {"PWIDTH","N",3,0},
  1275.           {"ROW","N",3,0},
  1276.           {"COL","N",3,0},
  1277.           {"WIDTH","N",3,0},
  1278.           {"HEIGHT","N",3,0}
  1279.           {"VIEWMODE","N",3,0},
  1280.           {"PCOLOR","C",10,0}
  1281.  
  1282.   A database file of structure different from the above will not be
  1283.   considered as a valid format file.
  1284.  
  1285.   A format file (*.DBM) pin-points the places for (chosen) fields to be
  1286.   displayed. This way we may just display partially the database, which
  1287.   is very useful to curb user's power to alter data unintentionally.
  1288.   Should format file contains certain fieldnames foreign to the related
  1289.   database, the format will not be used.
  1290.  
  1291.   Should format or print design files adopt new database structures for
  1292.   newer version of DBM due to the extension, then the old files should
  1293.   be easily convertible to new forms (and vise versa) by just merging
  1294.   the old file into a new file created by the current version of DBM
  1295.   program via its submenu.
  1296.  
  1297.   We note that although PWIDTH=0 will imply that no prompt is to be
  1298.   displayed, the values of PROW and PCOL will still be used to calculate
  1299.   the 'clear all' rectangular area. Likewise for other similar fields.
  1300.   Hence, if for example one entry of a format file contains PROW=0 and
  1301.   PCOL=0, then the left blanking corner will be the top left screen
  1302.   corner, which in this case is undesirable because a turning of a
  1303.   record page would blank out the button displays as well. In other
  1304.   words, creating format filess need in general some caution and care.
  1305.  
  1306.  
  1307.  
  1308.   Print Design Database (*.dbp)
  1309.   ─────────────────────────────
  1310.  
  1311.   PRN_MODE    - 0=continue
  1312.                 1-14, 100= ...
  1313.   H_SKIP      - horizontal skip of columns before executing the codeblock,
  1314.                 if prn_mode!=0
  1315.   MAX_LINES   - execute current block will print out max_lines of text,
  1316.                 whenever meaningful
  1317.   CODE_BLOCK  - external code block in a string
  1318.   CODE_NAME   - string name for choosing an external codeblock to execute
  1319.  
  1320.   Code block specified by CODE_BLOCK field may take three arguments
  1321.  
  1322.   nLeftSkip   - fixed horizontal skip
  1323.   nLineCount  - current line number in current page
  1324.   nPrintMode  - 0=display any informative messages
  1325.                 1=program requests quiet, whenever possible
  1326.  
  1327.   However, in the PrePrintBlock (Prn_Mode=9), the first two parameters
  1328.   are automatically passed as 0.
  1329.  
  1330.   If current print block is non-empty with PRN_MODE!=0, and that the
  1331.   previous block is also nonempty and returns a non-zero value 1, then
  1332.   an extra horizontal skip of LEFTSKIP, specified in the case of
  1333.   PRN_MODE=1, will be done before the execution of the new codeblock. We
  1334.   note that a nonzero value returned by code block also implies that the
  1335.   MAX_LINES has been fulfilled by the codeblock.
  1336.  
  1337.   Allowed Structure:
  1338.  
  1339.            {"PRN_MODE","N",3,0},
  1340.            {"H_SKIP","N",3,0},
  1341.            {"MAX_LINES","N",3,0},
  1342.            {"CODE_BLOCK","C",300,0},
  1343.            {"CODE_NAME","C",20,0}
  1344.  
  1345.   A database file will not be considered as a proper print design file
  1346.   if its structure is different from the above other than perhaps for
  1347.   the width of CODE_BLOCK so that long codeblock can be entered.
  1348.  
  1349.  
  1350.   PRN_MODE:
  1351.  
  1352.   0  no horizontal skip before executing current codeblock -- current
  1353.      block regarded as a continuation of a previous block which has a
  1354.      non-zero mode
  1355.   1  in this mode, H_SKIP and MAX_LINES are the line width (not in
  1356.      use) and the horizontal column skip number respectively
  1357.   2  in this mode, H_SKIP and MAX_LINES are the page height and the
  1358.      vertical line skip number (not in use)
  1359.   3  code block for the title of printout
  1360.   4  code block to print each valid record
  1361.   5  block to handle end of a pagebreak
  1362.   6  block to handle start of a new page after a page break (due to
  1363.      long printout)
  1364.   7  code block for printing end remark of printout
  1365.   8  help string to be sought in DBM.HLP
  1366.   9  codeblock that decides if a printout is to be done at all
  1367.      (no-zero value to print)
  1368.   10 codeblock to perform after printout, it will be executed even if
  1369.      printout is not performed due to zero return of block in mode 9.
  1370.   11 filter in string or codeblock for filter toggle specific to
  1371.      related database. If the starting character is "{", then it is a
  1372.      codeblock, otherwise it will be considered that the string a
  1373.      already an expression for the filter
  1374.   12 view/edit mode
  1375.      0=ignore this entry
  1376.      1=view only for this database
  1377.      2=edit allowed
  1378.   13 external codeblocks for some jobs specific to the related
  1379.      database. The strings in specified in 8. will be used as the name
  1380.      of such codeblocks when choosing them. The first 9 executable
  1381.      blocks will be assigned to keys ALT_F1 to ALT_F9
  1382.   14 same as mode 13, apart from that they are never assigned to keys
  1383.      ALT_F1 to ALT_F9. Instead, they must be called via ALT_F10.
  1384.   100 initialisation codeblocks. It will be run immediately after the
  1385.      print design file is read in. Only the first block of consecutive
  1386.      records, which have PRN_MODE equal to either 100 or 0, will be
  1387.      regarded as the initialisation blocks. Error at running
  1388.      initialisation will not be reported: so it is the block's job to
  1389.      report any execution error.
  1390.  
  1391.   Entries should enter in natural order, apart from 0 and 100.
  1392.  
  1393.  
  1394.   EXTRA FUNCTIONS:
  1395.      RecTotal()
  1396.            - total number of filtered records
  1397.      PrintView(nWhichArea)
  1398.            - execute print/view external code
  1399.      Eject()
  1400.            - page eject
  1401.      Pack()
  1402.            - pack current database
  1403.      AppendTo(xFile,bCondition,lQuiet)
  1404.            - append all current records satisfying bCondition, to
  1405.            database file xFile or workarea number xFile. If lQuiet is
  1406.            true, no summary will be reported
  1407.      Z_0(nNum)
  1408.            - get codeblock of nNum-th position of public block stack
  1409.      Z_1(nNum)
  1410.            - get string representation of current last position of the
  1411.            external-block stack
  1412.  
  1413.  
  1414.  
  1415.   Translation Map Database (*.map)
  1416.   ────────────────────────────────
  1417.  
  1418.   The first two fields serves as the mapping
  1419.  
  1420.   FIELDGET(1)=translated value
  1421.   FIELDGET(2)=original index
  1422.  
  1423.   Database of less than two fields are ignored. All map will be
  1424.   stringfield and maps are applicable to string type fields only.
  1425.  
  1426.  
  1427.  
  1428.   Users' Scratch Public Variables
  1429.   ───────────────────────────────
  1430.  
  1431.   The are 31 public scratch variables which can be used inside the
  1432.   configurable print design files. These variables are X_0, X_1 to X_30
  1433.   and should be considered as temporary variables. For more permanent
  1434.   global variables, use the global storage array. If field CODE_BLOCK
  1435.   starts with character other than "{", then the translated codeblock
  1436.   will be appended to the storage array. For the position of the last
  1437.   stored block, Z_1(0) is the number in string format (so that it can
  1438.   easily be macro expanded via &).
  1439.  
  1440.   Typically, we could
  1441.    1. stashblock {|| block1}
  1442.    2. x_1:=Z_1(0)
  1443.            - gives the position This operation is again stashed to
  1444.              Block_list{}, although useless.
  1445.    3. stashblock {|| block2}
  1446.    4. stashblock {|| block3}
  1447.    5. x_2:=Z_1(-1)
  1448.    6. x_3:=Z_1(-1)
  1449.    7. {||&x_1,&x_2,&x_3}
  1450.  
  1451.   We note that once 7. is read in, the code block will no longer need
  1452.   private/public variables x1,x2,x3. This way, reading external
  1453.   codeblocks will not exhausts the scratch public variables defined
  1454.   inside the program. All stashed codeblocks remain available all the
  1455.   time until a LOAD NEW DATABASE command (which will first close all
  1456.   workareas) is performed.
  1457.  
  1458.  
  1459.  
  1460.   Print Design Examples
  1461.   ─────────────────────
  1462.  
  1463.   1. The following record in a print design file will calculate the
  1464.   total number of records in related main database file which, under the
  1465.   current filter, have a nonzero 13-th field. In the case of STOCK.DBP,
  1466.   a nonzero 13-th field is a request for that item.
  1467.  
  1468.   PRN_MODE:    10
  1469.   H_SKIP:       0
  1470.   MAX_LINES:    0
  1471.   CODE_BLOCK:   {|x,y,z| x_1:=rectotal("fieldget(13)!=0"),;
  1472.                 IF(x_1!=0 .and. z=0, Message(alltrim(str(x_1))+;
  1473.                  " records printed"),)}
  1474.   BLOCK_NAME:  PostPrintBlock
  1475.  
  1476.   where x=leftskip, y=linenumber and z=messagemode (1=quiet).
  1477.  
  1478.  
  1479.   2. The following 5 consecutive print design records will set the 13-th
  1480.   field of the related database to 0 value, under current filter.
  1481.  
  1482.   PRN_MODE:    13
  1483.   H_SKIP:       0
  1484.   MAX_LINES:    0
  1485.   CODE_BLOCK:   if(.f.,, {||fieldput(13,0)})
  1486.   BLOCK_NAME:   <step-1>
  1487.  
  1488.   ■ i.e. save codeblock {||fieldput(13,0)}) to a designated public stack
  1489.     for future use.
  1490.  
  1491.  
  1492.   PRN_MODE:    13
  1493.   H_SKIP:       0
  1494.   MAX_LINES:    0
  1495.   CODE_BLOCK:   if(.f.,,{||x_1:=fieldget(13)!=0,;
  1496.                 if(x_1,x_3:=x_3+1,),x_1})
  1497.   BLOCK_NAME:   <step-2>
  1498.  
  1499.   ■ i.e. save codeblock {||x_1:= ...} again to the public stack.
  1500.  
  1501.  
  1502.   PRN_MODE:    13
  1503.   H_SKIP:       0
  1504.   MAX_LINES:    0
  1505.   CODE_BLOCK:   if(.f.,, x_1:=z_1(-1))
  1506.   BLOCK_NAME:   <step-3>
  1507.  
  1508.   ■ i.e. get the stack pointer in string that points to the block in
  1509.     <step-1>
  1510.  
  1511.  
  1512.   PRN_MODE:    13
  1513.   H_SKIP:       0
  1514.   MAX_LINES:    0
  1515.   CODE_BLOCK:   if(.f.,, x_2:=z_1(-1))
  1516.   BLOCK_NAME:   <step-4>
  1517.  
  1518.   ■ i.e. get the stack pointer x_2 that points to the block in <step-2>
  1519.  
  1520.  
  1521.   PRN_MODE:    13
  1522.   H_SKIP:       0
  1523.   MAX_LINES:    0
  1524.   CODE_BLOCK:   {||x_3:=0, dbeval(z_0(&x_1),z_0(&x_2)),;
  1525.                 if(x_3>0, message("Sales on "+;
  1526.                 alltrim(str(x_3))+" items removed"),)}
  1527.   BLOCK_NAME:   Cancel Sale
  1528.  
  1529.   ■ the macro expansion of x_1 and x_2 is done at the time of loading
  1530.     the above records. Thus x_1 and x_2 are available for other uses
  1531.     once these print design records are read in. Variable x_3 however
  1532.     will be active only when the final (visible) block is being
  1533.     executed.
  1534.  
  1535.  
  1536.  
  1537.   Other Details
  1538.   ─────────────
  1539.  
  1540.   See DBM program on-line help.
  1541.  
  1542.