sanbachs.NET
Serving the DataPerfect* Community

Home > Firestorm > Principles of Operation > Command Line Interface
Last updated: December 5, 2000

Firestorm – Command Line Interface

The Firestorm Command Line Interface is created by linking it with the engine and panel byte array (PBA) of a specific database. This is shown and introduced with the first diagram of the Firestorm – Principles of Operation. By convention, the executable file so created is named "fs-<str name>" (on UNIX-like systems) or "FS-<STR NAME>.EXE" (on Windows systems).

Once this program has been created, it can be used on the command line with arguments to direct it in performing many database operations. Batch files (on Windows systems) or shell scripts (on UNIX-like systems) can be written to perform complex series of operations. Some examples will be given later in this document.

The arguments it recognizes are introduced in this list:

-i
Used by itself, this puts the command line interface into "interactive mode" where the various database operations can be entered one per line, with their effect shown immediately.
p
Used to select a panel. Is immediately followed by the panel number. For example, p5 selects panel number 5. This panel remains in effect until another is selected.
i
Once a panel has been selected, this is used to select an index. It is immediately followed by the index number. Once selected, this index remains in effect until another is selected.
s
Once a panel and index have been selected, this is used to identify a "subset" by giving a list of fields that corresponds to the first one or more fields of the selected index. When this has been done, only records that match that subset will be considered by record operations. It is immediately followed by the number of fields in the field list. On the command line, these fields are given in subsequent arguments. In interactive mode, you will be prompted for them. Once a subset has been identified, it remains in effect until another subset is identified, or until s0 is used to turn subsetting off.
#
Used to give the number of records in the current panel, possibly limited by a subset and/or the exception list of the current index.
1
Used to position to the first record of a panel or subset. This becomes the "current record".
$
Used to position to the last record of a panel or subset. This becomes the "current record".
f
Used to find a particular record. Is followed by a field list, with one field value for each field in the current index.
.
Used to print the current record. The record will be printed on a single line, with all the real fields in order by field number and separated by tab characters.
+
Used to position to the next record in the panel or subset. If immediately followed by a number, prints out that many records, starting with the record after the current record.
-
Used to position to the previous record in the panel or subset. If immediately followed by a number, prints out that many records, starting with the record before the current record and working backwards through the index.
A
Used to print all the records in the current panel or subset. Use this one with caution in panels with many records.
:
Used to specify which fields should be printed whenever records are printed. Is immediately followed by a list of field numbers, separated by colons. For example, :16:1:3 will cause only fields 16, 1, and 3 to be printed. Only real fields can be specified.
d
Used to delete the current record. Use with caution.
a
Used to add a record. Is followed by a list of fields, one for each of the real fields in the current panel, in field number order. Fields that contain embedded spaces and/or quotes must be quoted and use operating system specific escapes. In interactive mode, you will be prompted for each field in turn.
e
Used to edit the current record. Is followed by a list of fields, one for each of the real fields in the current panel, in field number order. In interactive mode, you will be prompted for these field values one by one.
u
Used to update one or more fields of the current record. Is immediately followed by one or more field numbers, each one of which is immediately followed by either a colon, a plus sign, or a minus sign. Is followed by a list of field values, one per field number and in the order the field numbers were given. In interactive mode, you will be prompted for these field values one by one. For example, u16:1+3- "New string" 5 31 will replace field 16 with "New string", add 5 to field 1, and subtract 31 from field 3.
q
Used to quit. In non-interactive mode, this must be present as the last argument on the command line.

Some examples follow. STATS.STR and associated data files make up a very simple, one panel, one index database which happens to contain four records. It has been in use since September 17, 1996 counting the number of pages displayed by four Perl scripts operating on the CDI.STR database which belongs to Yates Publishing and which holds the data displayed in the Computerized Ancestor web application.

prompt > fs-stats p1 A q
CDIB01  1169823
CDIB02  209805
CDIL01  6084001
CDIL02  91067
prompt > fs-stats p1 i2 A q
There is no index #2 in panel #1
prompt > fs-stats p1 :1 A q
CDIB01
CDIB02
CDIL01
CDIL02
prompt > fs-stats p1 s1 CDIB A q
CDIB01  1169823
CDIB02  209805
prompt > fs-stats p2 q
There is no panel #2

The command used in the Perl script nfCDIL02.pl uses this command to increment its counter and get the result:

fs-stats p1 i1 f CDIL02 u2+ 1 :2 . q

The commands used in the same Perl script to obtain the number of records, and to obtain the fields to display in the first lookup list are:

fs-cdi p2 # q
fs-cdi p2 :10:9:11 i4 1 - +20 q

The command used to obtain the next twenty records for the lookup list is:

fs-cdi p2 :10:9:11 i4 f 1993/11/25 MLC CRAGG - - - +20 q

Contacting sanbachs.NET

Sign or browse our guest book.

webmaster@sanbachs.com
A. Lewis Bastian, Jr.
Bruce Conrad
Thom Boyer

Disclaimer

*DataPerfect® is a copyright of Novell, Inc. sanbachs.NET is not affiliated with Novell, Inc.

visitors since November 12, 2000.
Copyright © 2001 sanbachs.NET