home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Usenet 1994 October
/
usenetsourcesnewsgroupsinfomagicoctober1994disk1.iso
/
altsrc
/
articles
/
11426
< prev
next >
Wrap
Text File
|
1994-11-01
|
64KB
|
1,309 lines
Newsgroups: alt.sources
Path: wupost!psuvax1!news.ecn.bgu.edu!willis.cis.uab.edu!ddsw1!panix!news.mathworks.com!europa.eng.gtefsd.com!howland.reston.ans.net!cs.utexas.edu!uunet!zib-berlin.de!math.fu-berlin.de!fub!bitrot!thomas
From: thomas@bitrot.in-berlin.de (Thomas Driemeyer)
Subject: Re: grok - X/Motif database manager and UI builder, part 08/12
Message-ID: <1994Oct31.213600.11052@bitrot.in-berlin.de>
Organization: /usr/lib/news/organi[sz]ation
References: <1994Oct31.212946.10228@bitrot.in-berlin.de>
Date: Mon, 31 Oct 1994 21:36:00 GMT
Lines: 1298
Submitted-by: thomas@bitrot
Archive-name: grok/part08
#!/bin/sh
# this is grok.shar.08 (part 8 of grok)
# do not concatenate these parts, unpack them in order with /bin/sh
# file doc/formedit.tex continued
#
if test ! -r _shar_seq_.tmp; then
echo 'Please unpack part 1 first!'
exit 1
fi
(read Scheck
if test "$Scheck" != 8; then
echo Please unpack part "$Scheck" next!
exit 1
else
exit 0
fi
) < _shar_seq_.tmp || exit 1
if test ! -f _shar_wnt_.tmp; then
echo 'x - still skipping doc/formedit.tex'
else
echo 'x - continuing file doc/formedit.tex'
sed 's/^X//' << 'SHAR_EOF' >> 'doc/formedit.tex' &&
particular card, and it remains accessible if no card is chosen. This
makes it a good place to place form switch buttons that would otherwise
become unavailable when no card is displayed.
X
There are several types of fields. Not all of them store data in the
database; some are decorative or display computed information.
X
\itmindent=2cm
\itm{\bf Input}
This is the main type of field. It displays an editable (unless turned
off) string in the database, along with a label.
Input fields should not be put into the static part of the canvas.
X
\itm{\bf Time}
A variation of the Input field. The database representation is a number
of seconds. It is displayed as a date, as a time, as both date and time,
and as a duration. The first three assume the database string to be a
number of seconds since January 1, 1970; the last simply assumes a
number of seconds up to 86399 (one day minus 1 second). When a string
is entered into a Time field, it is converted to the numeric representation,
reformatted, and reprinted. Time fields are useful because they can be
used in expressions for calculation; expressions always see the numeric
database string.
Time fields should not be put into the static part of the canvas.
X
\itm{\bf Note}
A note is a multi-line Input field. It should be used only for multiline
text input because it cannot be tabbed over, and because pressing Return
when entering data into the card into a Note actually inserts a newline,
rather than skipping to the next field as an Input-type field would.
Note fields should not be put into the static part of the canvas.
X
\itm{\bf Choice}
Unlike all other types, many choice fields reference the same database
string. They all must have the same summary column, the same database
column, and the same internal field name (these three are buttons in the
form editor). They differ only in the Choice/flag code. grok always makes
sure that only one of the choice fields with identical internal field names
can be active at any time; the database string then matches the Choice/flag
code of that field. Most attributes of a {\tt Choice} item, when changed,
are copied to all other {\tt Choice} items that have the same internal name.
Choice fields should not be put into the static part of the canvas.
X
\itm{\bf Label}
Labels are purely decorative. They print an arbitrary one-line string at
a position in the card. There is no associated database string. Labels
are rarely needed because most of the other types come with their own
built-in label parts. The label is static, expressions cannot be used.
X
\itm{\bf Print}
Print fields are like Input fields, but no text can be entered. Unlike
labels, they can display an expression specified in the Input Default
button of the form editor. This can be used to display a running average
or sum in cards, or display other computed information. There is no
associated database string. Print fields are useful in both the static
and card parts of the canvas.
X
\itm{\bf Flag}
Flags are boolean database strings: the string either matches the
predefined string ({\it true}), or it is empty ({\it false}). (In fact,
a string that doesn't match is also considered {\it false}, but this is
not part of the normal operation.) The string that constitutes {\it true}
is specified with the Choice/flag code button in the form editor.
X
\itm{\bf Button}
Buttons have an associated action expression that is executed when the
button is pressed. This action could start a shell script, for example.
Buttons are not associated with any database string, but the expression
can access one. For example, a database of demo programs can have a
button that executes the program. The returned string is executed, there
is no need to use the {\tt system} keyword unless nesting is desired. Note
that the action expression is the only type of expression that may
contain {\tt switch} statements; see the Expression Grammar chapter for
details. It is often a good idea to put buttons in the static part of
the canvas.
X
\itm{\bf Chart}
Charts display data as bar or line charts. The X axis is divided into
one slot per row in the database; the Y axis depends on the values
computed from those rows (X and Y may be exchanged). Each chart contains
one or more {\it components}. A component computes values that is plotted
in the chart; a chart may display more than one value. For example, an
expense account chart may display a stacked bar chart consisting of
different color-coded types of costs, each described by a component.
There are many variations for configuring charts and their components.
Charts should be put into the static part of the canvas.
X
\itmindent=2em
Each field has a number of parameters that depend on the type. The most
important is the internal field name. It must be unique, except for choice
fields which are grouped by assigning common internal field names. If
the field references a database string, the internal field name also
names the database string. The internal field name can be used in
expressions to read the database string. For example, suppose you have a
database of backup tapes, you may have an {\tt Input} field with an
internal field name {\it capacity}, and another {\tt Input} field named
{\it used}. You could then add a {\tt Print} field whose Input Default
expression is {\tt (\_capacity~-~\_used)}. The {\tt Print} field then
displays the remaining free space on each tape, even though the database
only contains total capacity and used capacity. Another {\tt Print}
label may have an expression {\tt (sum(\_used))}, which displays a running
total of all tapes' contents. {\tt sum} is one of a group of functions
that loop over all cards rather than just referencing the current card;
see the Expression Grammar chapter for details. It is also possible to
reference a database field for which there is no field description in
an expression; in this case, the field is referenced by number. Fields
in the database are numbered left to right, beginning with 0.
X
The next button in the form editor is the database column. It needs to
be specified only for field types that display the column and allow
entry into the column. These fields are ``windows'' into the database;
there is normally one field for each database column. All fields that
do not reference a database column are merely decoration, no change of
the database is possible through such a decorative field (although the
decorative field may read the database, as {\tt Print} fields do). This
relation between fields and database columns also serves to give a
symbolic name to database columns; these symbolic names can be used in
expressions by prefixing them with an underscore. (It is also possible
to use the column number in expressions, but that is less convenient).
X
The main window has three parts, a summary, the static area, and the
card. The summary contains one line per card, while the card contains
the entire card's information as defined with the form editor and the
card canvas. The static part is optional and programmed in the same way
as the card. The Summary column and Width in summary buttons in the
form editor determine which fields also appear in the summary; this is
a subset of the fields that reference a database column (decoration
fields can not be put into the summary). The two buttons specify the
order in database column and the width in characters. Two blanks are
inserted between fields in the summary automatically. The summary has a
title; it can not be specified directly but is taken from the Label
text of the field.
X
Here is a brief summary of all buttons in the form editor that specify
a field in the card:
X
\itmindent=5cm
\medskip
\itm{\bf Field type}
The type of a field is entered here. See above for a list of available
types and what they do.
X
\itm{\bf Searchable}
The main window contains a Search input button. It searches through all
cards and puts all cards containing the search string into the summary.
Fields that are not searchable are excluded from the search.
X
\itm{\bf Read only}
The user cannot change the database string referenced by a field that
is read-only. This is useful if there are two forms referencing the
same database, one for you and one for the unwashed masses with lots
of read-only flags set. The read-only flag can also be set for the
entire database with the button near the top of the form editor window;
setting that flag overrides all field read-only flags.
X
\itm{\bf Not sortable}
The field will be omitted from the Sort pulldown in the main menu.
X
\itm{\bf Default sort}
When the file is read in from disk, it is sorted by the field that has
this flag on. Setting it in any field will clear the Default sort flag
in all other items automatically. If no field has the Default sort flag,
the file will not be sorted when it is read. It is possible but not
recommended to have both the Default sort flag and the Not sortable flag
on in the same field.
X
\itm{\bf Internal field name}
All fields have an unique name. Choice names are not unique, choice fields
are grouped by a common name. If the field references a database string,
the internal field name also names the database column, which can then
be accessed in expressions symbolically.
X
\itm{\bf Database column}
If the field references a database column, this button says which one,
0 being the first column. If not, this button is grayed out. The column
number must be unique, except for choice fields which are grouped by
a common database column (and a common internal field name, too).
X
\itm{\bf Width in summary}
If the width is nonzero, the database string referenced by the field will
appear in the summary, with as many characters as specified. Two blanks
are appended. The summary always uses monospaced Courier to make columns
line up vertically.
X
\itm{\bf Summary column}
If the width is nonzero, this value specifies the order of fields in
summary lines. No two fields may have the same summary column number,
but there may be gaps.
X
\itm{\bf Choice/flag code}
The string that Flag and Choice fields store in the database, if active.
No two Choice fields with the same internal name may have the same code.
X
\itm{\bf Shown as}
If this string is set, it will be displayed in the summary in place of the
choice/flag code. Basically, it is a mnemonic name for the choice/flag
code that a user can understand.
X
\itm{\bf Time format}
Time fields have four different formats, as described above. The format
controls what gets printed into the card, and how user input is interpreted.
X
\itm{\bf Label text}
All field types come with some kind of text string that is printed into
the field in the card. This string is always literal, it cannot be an
expression.
X
\itm{\bf Label justification}
Labels can be centered, left-aligned, or right-aligned. This is not
shown in the card canvas, press the Preview button to see the effect.
X
\itm{\bf Label font}
The font used for the label. Five fonts are available.
X
\itm{\bf Max input length}
The maximum number of characters than can be entered into an Input, Time,
or Note field. The default is 100 for Input and Time fields, and 10000
for Note fields. Always make sure that note fields have a sufficient
maximum length. This number is passed to the Motif widget to limit
input length, but does not lead to increased memory usage for the
database.
X
\itm{\bf Input default}
For Input, Time, Flag, and Choice fields, this field provides the defaults
when a new card is added to the database. It can be an expression. For
Print fields, the Input default specifies what gets printed into the inset
area of the field; input default is actually a misnomer because Print
field texts cannot be input and are evaluated whenever the database changes,
not just when a new card is added. In general, Choice fields should always
have a default. If the field has type Time, the input default expression
should evaluate to a number of seconds, not to a string containing
a date. For example, to make the Time field default to today, use
(date), not {date}.
X
\itm{\bf Input justification}
Input can be centered, left-aligned, or right-aligned. This is not
shown in the card canvas, press the Preview button to see the effect.
X
\itm{\bf Input font}
The font used for the input area. Five fonts are available. It is recommended
to use Courier for Note fields (and, by extension, for Input and Time
fields) because printing functions print notes using a fixed-width font.
X
\itm{\bf Grayed out if}
If the named expression evaluates to {\it true}, the field is grayed
out and cannot be used to alter the database. The expression is evaluated
every time the database changes.
X
\itm{\bf Invisible if}
If the named expression evaluates to {\it true}, the field is excluded
from the card. The expression is evaluated only once, when the database
is read from disk. This can be used to hide entries if the wrong user
has read the database. Invisibility does not affect the summary.
X
\itm{\bf Read-only if}
If the named expression evaluates to {\it true}, the field is read-only.
The expression is evaluated only once, when the database is read from
disk.
X
\itm{\bf Skip if}
Normally, pressing Return in an Input or Time field advances the cursor
to the next field (fields are ordered by their bottom left corner, in
Y-major order). If the named expression of the next field evaluates to
{\it true}, the field is skipped and the cursor is put elsewhere. This
expression is evaluated every time return is pressed in the previous field.
A constant expression such as {\tt true} is also useful.
X
\itm{\bf Action when pressed}
If the button is pressed, this expression is evaluated. The result is
ignored. Typically, the expression is the name of a shell script. The
expression may use the {\tt switch} statement, which switches to another
database and/or performs a query on all cards.
X
%%% \itm{\bf Action when added}
%%% This button is not used yet.
%%% \itmindent=2em
%%% \medskip
X
\itm{\bf Chart flags}
Not documented yet. This part of the menu is still under development.
%<<<
\itmindent=2em
\medskip
X
Some of the above accept expressions. An expression begins with a
parenthesis, a brace, or a dollar sign. Everything else is a literal
string. Parentheses and braces are numeric and string expressions,
respectively; a dollar sign followed by an environment variable is a
shortcut for the same sequence enclosed in braces. The {\tt system}
statement should be used sparingly, because some expressions (such
as the grayed-out-if expression) are evaluated frequently. See the
Expression Grammar section for details.
X
\subsection Buttons
X
There is a row of buttons in the form editor for various operations:
X
\itmindent=2.5cm
\itm{\bf Queries}
Starts up a window that allows entry of standard queries, as name/expression
pairs. The name is what will appear in the Query pulldown in the main menu;
the expression is what gets executed if the name is selected in the pulldown.
When a name is selected, the expression is applied to all cards in the
database, and those that return {\it true} are put into the summary. For
example, assuming your database has an Input field with the internal name
{\tt value}, the query expression {\tt (\_value\ >\ avg(\_value))} will
select all cards whose value is above average.One of the queries can
be selected as the default query that will be performed when the database
is read from disk.
X
\itm{\bf Def Help}
The main window has a help button in the lower left corner. This button
pops up a help window with some generic info about grok. With the Def
Help button, more text can be entered that will be appended to the generic
help text. The text should explain the card, how to use it, and what the
fields mean.
X
\itm{\bf Debug}
This button checks the consistency of all fields, and reports conflicts
such as non-unique internal names or redundant choice flags. At this time,
expressions are not checked. If the Debug button reportrs nothing, the
no problems were found. The Done button always does a debugging run first,
and refuses to exit if errors were found.
X
\itm{\bf Preview}
The card canvas shows the layout of fields in the card, as boxes that
show additional information such as type, database column, flag/choice
code, and summary column. This does not reflect the final card that the
user will see very well; in particular, whether a label string fits into
the field on the card canvas does not mean that the same label will fit
into the final card. Preview shows precisely what the card will look like.
X
\itm{\bf Help}
Print general help information.
X
\itm{\bf Cancel}
Discards all operations done with the form editor since it was installed,
and removes the form editor window after asking for confirmation.
X
\itm{\bf Done}
Check all fields for consistency. If no problems are found, the form file
is written. The file name is taken from the Form name button at the top
of the form, with {\tt $\sim$/.grok} prepended and {\tt .gf} appended if
appropriate.
X
\itm{\bf Add}
Adds a new field to the card. Its type, parameters, and position on the
card canvas are chosen based on the currently selected card, so it's a
good idea to select a field that is similar to the new one before pressing
Add. If the card canvas has no free space below the bottom field, the new
field may be placed under the bottom field where it can't be seen; it is
generally a good idea to start with a card canvas that is too large and
resize it to the correct size after all fields have been added and positioned.
X
\itm{\bf Delete}
Delete the currently selected field. There is no Undo function to get it
back.
\itmindent=2em
SHAR_EOF
echo 'File doc/formedit.tex is complete' &&
chmod 0644 doc/formedit.tex ||
echo 'restore of doc/formedit.tex failed'
Wc_c="`wc -c < 'doc/formedit.tex'`"
test 22869 -eq "$Wc_c" ||
echo 'doc/formedit.tex: original size 22869, current size' "$Wc_c"
rm -f _shar_wnt_.tmp
fi
# ============= doc/grammar.tex ==============
if test -f 'doc/grammar.tex' -a X"$1" != X"-c"; then
echo 'x - skipping doc/grammar.tex (File already exists)'
rm -f _shar_wnt_.tmp
else
> _shar_wnt_.tmp
echo 'x - extracting doc/grammar.tex (Text)'
sed 's/^X//' << 'SHAR_EOF' > 'doc/grammar.tex' &&
%
% grammar
%
\def\S{{\it s\ }}
\def\N{{\it n\ }}
\section Expression Grammar
X
Expressions are used for queries, for defaults of card items, and for
printing expressions into cards. They are set in Database Edit mode; a
normal user does not deal with expressions directly.
X
Expressions deal with two data types, {\it strings}\/ and {\it numbers}.
Expressions or sub-expressions returning strings are enclosed in braces;
expressions or sub-expressions returning numbers are enclosed in parentheses.
There are many built-in operators and functions; most of them can be used
only in either string or numeric context.
X
Numbers begin with a numerical digit or a period, and are in standard
integer, floating-point, or exponential notation. String literals are
enclosed in double quotes. Conversions from numbers to strings use the
{\tt \%g} format (unless {\tt printf} is used); conversions from strings
to numbers skips leading blanks and converts like {\tt atof}. Trailing
non-numeric characters are ignored.
X
Expressions are interpreted, not compiled. This means that all parts of
the expression are evaluated, {\tt ?:}, {\tt \&\&}, and {\tt $||$} do not
short-circuit.
X
In the following tables, \N stands for a number ot a numerical expression,
and \S stands for a literal string or a string expression. Note that some
operators, such as {\tt ==} and {\tt date}, appear in both contexts.
X
\subsection Numerical Operations
X
Divisions by zero return $1$. Arithmetic operators
use standard C precedences. Bitwise operations operate on 32 bits only.
X
\cleartabs
\settabs \+ mmmmmmmmmmm & mmmm & mmmmmmmmmmmmmmmmmmmmmmmmm\cr
\medskip
\+ {\it Operator} & {\it Type} & {\it Operation}\cr
\smallskip\hrule\smallskip
\+ {\tt (} \N {\tt )} & \N & Number\cr
\+ {\tt $\{$} \S {\tt $\}$} & \N & In number context, convert string to a number\cr
\+ \N {\tt ?} \N {\tt :} \N & \N & If the first number is nonzero, return the second number;\cr
\+ && otherwise, return the third number\cr
\+ \N {\tt ,} \N & \N & Evaluate both numbers, return second\cr
\+ {\tt -} \N & \N & Unary minus\cr
\+ {\tt !} \N & \N & Unary boolean NOT\cr
\+ $\sim$ \N & \N & Unary bitwise NOT\cr
\+ \N {\tt +} \N & \N & Add two numbers\cr
\+ \N {\tt -} \N & \N & Subtract two numbers\cr
\+ \N {\tt *} \N & \N & Multiply two numbers\cr
\+ \N {\tt /} \N & \N & Divide two numbers\cr
\+ \N {\tt \%} \N & \N & Calculate modulo of two numbers\cr
\+ \N {\tt \&} \N & \N & Calculate bitwise AND of two numbers\cr
\+ \N {\tt \&\&} \N & \N & Calculate boolean AND of two numbers\cr
\+ \N {\tt |} \N & \N & Calculate bitwise OR of two numbers\cr
\+ \N {\tt ||} \N & \N & Calculate boolean OR of two numbers\cr
\+ \N \^ \N & \N & Calculate bitwise XOR of two numbers\cr
\+ \N {\tt <<} \N & \N & Calculate bitwise left shift\cr
\+ \N {\tt >>} \N & \N & Calculate bitwise right shift\cr
\+ \N {\tt ==} \N & \N & 1 if both numbers are equal, 0 otherwise\cr
\+ \N {\tt !=} \N & \N & 1 if both numbers are not equal, 0 otherwise\cr
\+ \N {\tt <} \N & \N & 1 if the first number is less than the second, 0 otherwise\cr
\+ \N {\tt >} \N & \N & 1 if the first number is greater than the second, 0 otherwise\cr
\+ \N {\tt <=} \N & \N & 1 if the first number is less than or equal to the second, 0 otherwise\cr
\+ \N {\tt >=} \N & \N & 1 if the first number is greater than or equal to the second, 0 otherwise\cr
\+ {\tt sqrt (} \N {\tt )} & \N & Square root of a number\cr
\+ {\tt exp (} \N {\tt )} & \N & Exponential function, $e^n$\cr
\+ {\tt log (} \N {\tt )} & \N & Decimal logarithm, $\log_{10} n$\cr
\+ {\tt ln (} \N {\tt )} & \N & Natural logarithm, $\log_e n$\cr
\+ {\tt pow (} \N, \N {\tt )} & \N & First number raised to the second, $n^m$\cr
\+ {\tt sin (} \N {\tt )} & \N & Sine of a number, $\sin x$\cr
\+ {\tt cos (} \N {\tt )} & \N & Cosine of a number, $\cos x$\cr
\+ {\tt tan (} \N {\tt )} & \N & Tangent of a number, $\tan x$\cr
\+ {\tt asin (} \N {\tt )} & \N & Arc sine of a number, $\sin^{-1} x$\cr
\+ {\tt acos (} \N {\tt )} & \N & Arc cosine of a number, $\cos^{-1} x$\cr
\+ {\tt atan (} \N {\tt )} & \N & Arctangent of a number, $\tan^{-1} x$\cr
\+ {\tt atan2 (} \N, \N {\tt )} & \N & Quadrant-aligned arctangent\cr
\+ {\tt len (} \S {\tt )} & \N & Length of a string\cr
\+ {\tt bound (} \N, \N, \N {\tt )} & \N & The first number bounded by a minimum (second number) and\cr
\+ && a maximum (third number)\cr
\bigskip
X
\subsection String Operations
X
Note that string comparisons return strings, and must be enclosed in braces
$\{\}$ if \&\& or || or other numerical operators are used on the result.
X
\medskip
\+ {\it Operator} & {\it Type} & {\it Operation}\cr
\smallskip\hrule\smallskip
\+ {\tt $\{$} \S {\tt $\}$} & \S & String\cr
\+ {\tt (} \N {\tt )} & \S & In string context, convert number to a string\cr
\+ \S {\tt ;} \S & \S & Evaluate both strings, return second\cr
\+ \S {\tt .} \S & \S & Concatenate strings\cr
\+ \S {\tt ?} \S {\tt :} \S & \S & If the numeric value of the first string is nonzero, return the second string;\cr
\+ && otherwise, return the third string\cr
\+ \S {\tt ==} \S & \S & Return {\tt "1"} if the two strings match; otherwise, return {\tt "0"}\cr
\+ \S {\tt !=} \S & \S & Return {\tt "1"} if the two strings do not match; otherwise, return {\tt "0"}\cr
\+ \S {\tt <} \S & \S & Return {\tt "1"} if the first string is lexicographically less than the second\cr
\+ && string; otherwise, return {\tt "0"}\cr
\+ \S {\tt >} \S & \S & Return {\tt "1"} if the first string is lexicographically greater than the second\cr
\+ && string; otherwise, return {\tt "0"}\cr
\+ \S {\tt <=} \S & \S & Return {\tt "1"} if the first string is lexicographically less than or equal to the\cr
\+ && second string; otherwise, return {\tt "0"}\cr
\+ \S {\tt >=} \S & \S & Return {\tt "1"} if the first string is lexicographically greater than or equal to\cr
\+ && the second string; otherwise, return {\tt "0"}\cr
\+ {\tt chop (} \S {\tt )} & \S & Return the string with the trailing newline, if any, removed\cr
\+ {\tt substr (} \S, \N, \N {\tt )} & \S & Return a substring of the first string. The first number is the start index\cr
\+ && and the second the length. A negative index counts from the end.\cr
\+ {\tt printf (} {\it args} {\tt )} & \S & Format and return a string; {\it args} is a comma-separated list of expressions.\cr
\+ && Compound expressions must be enclosed in (~) or $\lbrace~\rbrace$.\cr
\bigskip
X
\subsection Variables
X
Variables are letters {\tt a} through {\tt z} that can hold strings or
numbers. When a variable is assigned to, the result of the assignment is
returned. All variables are reset to the empty string (or 0) when a database
is loaded from disk.
X
\medskip
\+ {\it Operator} & {\it Type} & {\it Operation}\cr
\smallskip\hrule\smallskip
\+ {\it var} & \S,\N & Value of a variable\cr
\+ {\it var} {\tt =} \S & \S & Assign string value to a variable\cr
\+ {\it var} {\tt =} \N & \N & Assign numeric value to a variable\cr
\+ {\it var} {\tt .=} \S & \S & Append string to a variable\cr
\+ {\it var} {\tt +=} \N & \N & Add a number to a variable\cr
\+ {\it var} {\tt -=} \N & \N & Subtract a number from a variable\cr
\+ {\it var} {\tt *=} \N & \N & Multiply a variable by a number\cr
\+ {\it var} {\tt /=} \N & \N & Divide a variable by a number\cr
\+ {\it var} {\tt \%=} \N & \N & Assign modulo with a number to variable\cr
\+ {\it var} {\tt \&=} \N & \N & Perform logical AND with a variable\cr
\+ {\it var} {\tt |=} \N & \N & Perform logical OR with a variable\cr
\+ {\it var} {\tt ++} & \N & Post-increment variable\cr
\+ {\it var} {\tt --} & \N & Post-decrement variable\cr
\+ {\tt ++} {\it var} & \N & Pre-increment variable\cr
\+ {\tt --} {\it var} & \N & Pre-decrement variable\cr
\bigskip
X
\subsection Database Access
X
Database rows (cards) can be accessed by providing an
index in brackets. Without brackets, the current card ({\tt this}) is
assumed. Database columns are named. The name must always be prefixed
with an underscore (\_). In place of the name, the field can be selected
with a column number (which must also be prefixed with an underscore),
beginning at 0. Only fields that store data in the database can be
accessed (types {\it Input}, {\it Time}, {\it Flag}, and {\it Choice});
this excludes fields of type {\it Label}\/ and {\it Print}.
X
The {\tt avg}, {\tt dev}, {\tt min}, {\tt max}, and {\tt sum} operators
differ from all other operators: they don't reference a field in the
current or any single card, they operate on a field in all cards by
accessing an entire column of the database.
X
The {\tt switch} statement is legal only in {\it Action when pressed}
expressions for Button-type fields in the form editor. It does nothing
except as action for a button in a card. It switches grok to a new
form as if the Database pulldown had been used (see the Editing Forms
chapter for details about the difference between {\it databases} and
{\it forms}. The first argument is the new form name, the second argument
is the query expression or search string that determines which cards
are displayed in the summary initially. The possible combinations are:
X
\itm{\tt search("", "")}\hfill\break
Does nothing.
X
\itm{\tt search("", "*")}\hfill\break
Keep the current form, and put all cards in the summary.
X
\itm{\tt search("", "$\{$expr$\}$")}\hfill\break
Keep the current form, and put all cards in the summary for which
{\it expr} returns something other than 0 or the empty string.
X
\itm{\tt search("", "(expr)")}\hfill\break
Equivalent to the previous, except that the returned string is converted
to a number, which is checked for nonzero values.
X
\itm{\tt search("", "string")}\hfill\break
Keep the current form, and put all cards in the summary whose searchable
fields contain {\it string}.
X
\itm{\tt search("name", "")}\hfill\break
Switch to form {\it name}, and display all cards in the summary.
X
\itm{\tt search("name", "xxx")}\hfill\break
Switch to form {\it name}, and then perform a query. {\tt xxx} stands
for any of the above query expressions.
X
Because short-circuiting doesn't work, {\tt switch} can't depend on a
conditional, but its two arguments can. {\tt switch} returns the empty
string, which means that the button won't execute a command as usual;
if this is overridden by appending a semicolon and another string
expression, the command is executed after the database switch. To execute
a script before switching, prepend a {\tt system} statement and a
semicolon to the {\tt switch} statement (the switch is done after the
expression is completely evaluated). To switch back to the previous
form, use the {\tt prevform} statement.
X
\medskip
\+ {\it Operator} & {\it Type} & {\it Operation}\cr
\smallskip\hrule\smallskip
\+ {\it \_field} & \S,\N & A field from the database, of current card\cr
\+ {\it \_field} {\tt [} \N {\tt ]}& \S,\N & A field from the database, from any card\cr
\+ {\tt this} & \N & The number of the current card, 0 is first\cr
\+ {\tt last} & \N & The number of the last card, 0 is first\cr
\+ {\tt avg (} {\it \_field} {\tt )} & \N & Average of a field in all cards\cr
\+ {\tt dev (} {\it \_field} {\tt )} & \N & Standard deviation of a field in all cards\cr
\+ {\tt min (} {\it \_field} {\tt )} & \N & Minimum value of a field in all cards\cr
\+ {\tt max (} {\it \_field} {\tt )} & \N & Maximum value of a field in all cards\cr
\+ {\tt sum (} {\it \_field} {\tt )} & \N & Sum of a field in all cards\cr
\+ {\tt dbase} & \S & The name of the accessed database file\cr
\+ {\tt form} & \S & The name of the accessed form file\cr
\+ {\tt prevform} & \S & The name of the previous accessed form file\cr
\+ {\tt switch (} \S, \S {\tt )} & \S & Database switch and/or query; see above\cr
\bigskip
X
\subsection Operating System Access
X
\+ {\it Operator} & {\it Type} & {\it Operation}\cr
\smallskip\hrule\smallskip
\+ {\tt system (} \S {\tt )} & \S & Execute a shell command and return the result as a string\cr
\+ {\tt \$} {\it envvar} & \S & Return the value of the environment variable {\it envvar}\cr
\+ {\tt host} & \S & The host name of the local host\cr
\+ {\tt user} & \S & The user's login name\cr
\+ {\tt uid} & \N & The user's numeric user ID\cr
\+ {\tt gid} & \N & The user's numeric group ID\cr
\+ {\tt access (} \S, \N {\tt )} & \N & 1 if the file name exists (if the number is 0), or if it can be accessed\cr
\+ && for execution (1), writing (2), and/or reading (4). See access(3).\cr
\+ {\tt beep} & \S & Ring the terminal bell, return a null string\cr
\+ {\tt error (} {\it args} {\tt )} & \S & Format a string like printf, print it in a window, return a null string\cr
\bigskip
X
\subsection Time Conversion
X
Dates and times are stored as number of seconds since
January 1, 1970. Durations are stored as number of seconds. Note that
this means thata time is a significantly larger number than a duration,
even if both have the same hh:mm string representation. The representation
depends on the date and time format selected in the Preferences menu.
X
\medskip
\+ {\it Operator} & {\it Type} & {\it Operation}\cr
\smallskip\hrule\smallskip
\+ {\tt time} & \S & The current time as hh:mm or hh:mm[ap] string\cr
\+ {\tt time (} \N {\tt )} & \S & Extract time part of the number, and format as hh:mm or hh:mm[ap] string\cr
\+ {\tt date} & \S & Today's date as dd.mm.yy or mm/dd/yy string\cr
\+ {\tt date (} \N {\tt )} & \S & Extract date part of the number, and format as dd.mm.yy or mm/dd/yy string\cr
\+ {\tt duration (} \N {\tt )} & \S & Convert a number of seconds to a hh:mm string\cr
\+ {\tt date} & \N & Current time in seconds since January 1, 1970\cr
\+ {\tt year (} \N {\tt )} & \N & Extract the (four-digit) year from a time\cr
\+ {\tt month (} \N {\tt )} & \N & Extract the month 1..12 from a time\cr
\+ {\tt day (} \N {\tt )} & \N & Extract the day 1..31 from a time\cr
\+ {\tt hour (} \N {\tt )} & \N & Extract the hour 0..23 from a time\cr
\+ {\tt minute (} \N {\tt )} & \N & Extract the minute 0..59 from a time\cr
\+ {\tt second (} \N {\tt )} & \N & Extract the second 0..59 from a time\cr
\+ {\tt julian (} \N {\tt )} & \N & Extract the julian date 0..365 from a time\cr
\+ {\tt leap (} \N {\tt )} & \N & 1 if the time is in a leap year, or 0 otherwise\cr
\medskip
SHAR_EOF
chmod 0644 doc/grammar.tex ||
echo 'restore of doc/grammar.tex failed'
Wc_c="`wc -c < 'doc/grammar.tex'`"
test 14408 -eq "$Wc_c" ||
echo 'doc/grammar.tex: original size 14408, current size' "$Wc_c"
rm -f _shar_wnt_.tmp
fi
# ============= doc/macro.tex ==============
if test -f 'doc/macro.tex' -a X"$1" != X"-c"; then
echo 'x - skipping doc/macro.tex (File already exists)'
rm -f _shar_wnt_.tmp
else
> _shar_wnt_.tmp
echo 'x - extracting doc/macro.tex (Text)'
sed 's/^X//' << 'SHAR_EOF' > 'doc/macro.tex' &&
\font\sectionfont=cmbx10 scaled\magstep2
\font\subsectionfont=cmbx10 scaled\magstep1
\font\subsubsectionfont=cmbx10 scaled\magstephalf
X
\parskip=3mm
\parindent=0mm
X
\def\tab#1{ \medskip \leftskip=1cm
{\openup2pt\halign{
##\hfil & ##\hfil & ##\hfil\cr
#1 }} \leftskip=0cm}
X
\def\itm#1{\hangindent\itmindent
X \setbox0=\hbox{#1\quad}%
X \ifdim\wd0<\itmindent \dimen0=\itmindent\advance\dimen0 -\wd0
X \else \dimen0=0pt\fi
X \unhbox0\hskip\dimen0}
X
\newdimen\itmindent \itmindent=2em
X
\def\section#1\par{%
X \vskip0pt plus .35\vsize\penalty-350%
X \vskip0pt plus-.35\vsize\vskip16pt plus5pt minus5pt\vskip\parskip
X \message{#1}%
X \noindent{\sectionfont\ignorespaces#1}\par\nobreak
X \write\mycontentsout{\medskip
X {\bf\ignorespaces#1\hfill\folio\noexpand\par}}%
X \vskip10pt plus4pt minus4pt\noindent}
X
\def\subsection#1\par{%
X \vskip0pt plus .25\vsize\penalty-250%
X \vskip0pt plus-.25\vsize\vskip9pt plus3pt minus3pt\vskip\parskip
X \noindent{\subsectionfont\ignorespaces#1}\par\nobreak
X \write\mycontentsout{%
X {\rm\qquad\ignorespaces#1\mycontentsleaders\folio\noexpand\par}}%
X \vskip6pt plus2pt minus2pt\noindent}
X
\def\subsubsection#1\par{%
X \vskip0pt plus .2\vsize\penalty-200%
X \vskip0pt plus-.2\vsize\vskip5pt plus2pt minus2pt\vskip\parskip
X \noindent{\subsubsectionfont\ignorespaces#1}\par\nobreak
X \write\mycontentsout{%
X {\rm\qquad\ignorespaces#1\mycontentsleaders\folio\noexpand\par}}%
X \vskip4pt plus1pt minus1pt\noindent}
X
\def\mycontentsleaders{{\rm\leaders\hbox to2em{\hss.\hss}\hfill}}
X
\newwrite\mycontentsout
\openout\mycontentsout=\jobname.cont
X
\def\contents{%
X \vfill\break
X \mycontentspageno=\pageno
X \pageno=\contentspageno
X \message{Contents}
X \noindent{\sectionfont Contents}\par\nobreak
X \vskip10pt plus4pt minus4pt\noindent
X \immediate\closeout\mycontentsout
X \openin\mycontentsin=\jobname.cont
X \begingroup
X \parindent=0pt\parskip=3pt
X \catcode`@=11
X \def\myreadcontentsline{\ifeof\mycontentsin%
X \let\myreadcontentsline=\empty
X \else\read\mycontentsin to\mycontentsline\mycontentsline\fi
X \myreadcontentsline}%
X \myreadcontentsline
X \endgroup
X \closein\mycontentsin
X \openout\mycontentsout=jobname.cont
X \vfill\break
X \pageno=\mycontentspageno \advancepageno}
X
\newcount\contentspageno \contentspageno=-1
\newcount\mycontentspageno
\newread\mycontentsin
SHAR_EOF
chmod 0644 doc/macro.tex ||
echo 'restore of doc/macro.tex failed'
Wc_c="`wc -c < 'doc/macro.tex'`"
test 2294 -eq "$Wc_c" ||
echo 'doc/macro.tex: original size 2294, current size' "$Wc_c"
rm -f _shar_wnt_.tmp
fi
# ============= doc/main.tex ==============
if test -f 'doc/main.tex' -a X"$1" != X"-c"; then
echo 'x - skipping doc/main.tex (File already exists)'
rm -f _shar_wnt_.tmp
else
> _shar_wnt_.tmp
echo 'x - extracting doc/main.tex (Text)'
sed 's/^X//' << 'SHAR_EOF' > 'doc/main.tex' &&
%
% grok documentation
%
\input macro.tex
\input formedit.tex
\input grammar.tex
X
\contents
\bye
SHAR_EOF
chmod 0644 doc/main.tex ||
echo 'restore of doc/main.tex failed'
Wc_c="`wc -c < 'doc/main.tex'`"
test 97 -eq "$Wc_c" ||
echo 'doc/main.tex: original size 97, current size' "$Wc_c"
rm -f _shar_wnt_.tmp
fi
# ============= grok.1 ==============
if test -f 'grok.1' -a X"$1" != X"-c"; then
echo 'x - skipping grok.1 (File already exists)'
rm -f _shar_wnt_.tmp
else
> _shar_wnt_.tmp
echo 'x - extracting grok.1 (Text)'
sed 's/^X//' << 'SHAR_EOF' > 'grok.1' &&
.TH GROK 1L
.SH NAME
grok \- Desktop Database Manager and GUI Builder
.SH SYNOPSIS
.B grok
[-h] [-d] [-v] [-t] [-T] [-f] [\fIform\fR \fIquery\fR]]
.SH DESCRIPTION
.B grok
is a database manager that displays two-dimensional databases using a
card file paradigm. A GUI builder is available to create user-defined
applications. Grok comes with a number of pre-built applications such
as a phone directory, todo lists, and a sample country database. The
form to display (\fIphone\fR, \fItodo\fR, \fIcountries\fR, etc.) can
be given as the first parameter. This manual page describes the command
line options of
.BR grok .
For information on how to use
.BR grok ,
refer to the on-line help pages, and to the PostScript or TeX manual.
.LP
.SS OPTIONS
.IP \-h
List available options.
.IP \-d
Print fallback X resources and exit. The output can be appended directly
to the ~/.Xdefaults file for modification of the geometry, color, and font
defaults.
.IP \-v
Print the program version and patchlevel and exit.
.IP \-t
Requires specification of a form. Without a query string, prints all
cards to stdout in the same format that is used for the summary window
in interactive mode. If a query is also specified, print only cards that
satisfy the query expression (see below). The form may have a default
query built in.
.IP \-T
This option is equivalent to -t, but omits the header line.
.IP \-f
Don't fork on startup. This is useful for debugging.
.IP form
Specifies the database to display.
.B Grok
distinguishes forms and databases. Both always come in pairs. The form
defines the representation of the cards and the database provides the raw
data. If no form is specified, one can be chosen in interactive mode. The
-t and -T options require a form argument.
.IP query
If the form has a built-in query, it is used to select which cards in the
database to display initially. If there is no default query, all cards are
displayed. The query argument can be used to override the default query.
This option should always be quoted with single quotes to keep the shell
from interpreting the query string.
.LP
There are different types of queries: '*' selects all cards, '/string'
performs a case-insensitive string search, '{expr}' selects all cards for
which the string expression returns a non-null, non-'f' string, and '(expr)'
selects all cards for which the numerical expression returns nonzero. The
leading '/' in string searches is optional. For a detailed description of
query expressions, refer to the "Expression Grammar" item in the help
pulldown, or to the PostScript user's manual.
.LP
In addition to these options,
.B grok
supports the usual X options such as -iconic. The -geometry option should
not be used to preset a window size; grok determines and frequently adjusts
its own size.
.SH EXAMPLES
.LP
\fBgrok\fR
.LP
Start up grok with no form. The Database pulldown can be used to choose one.
.LP
\fBgrok phone\fR
.LP
Start up grok with the \fIphone\fR form. Perform that form's default query
if it has one.
.LP
\fBgrok phone '/thomas'\fR
.LP
Start up grok with the \fIphone\fR form. Ignore the default query and
select only cards that contain the word "thomas". Case is ignored.
.LP
\fBgrok -t phone '/thomas'\fR
.LP
Print all cards of the form \fIphone\fR to stdout that contain the string
"thomas". Do not start the interactive user interface.
.LP
\fBgrok phone '{_group == "f" && _email}'\fR
.LP
Start up grok with the \fIphone\fR form. Ignore the default query and
select only cards that describe friends that have an email address.
.SH FILES
.LP
Below, GBIN and GLIB refer to the installation directories specified at
the beginning of the Imakefile when the programs were compiled. They are
/usr/local/bin and /usr/local/lib, respectively, by default.
.IP *.gf 18
Files ending with the extension .gf are assumed to contain
.B grok
forms.
.IP *.db 18
Unless the form specifies otherwise, the database that provides the raw
data for a form has the same path and name as the form, but with the
extension .db. Procedural databases have no extension.
.IP . 18
The current directory is searched first for form files.
.IP ./grokdir 18
The grokdir current directory is searched next for form files. This is
done to allow
.B grok
to be started from the source distribution directory for evaluation.
.IP ~/.grok 18
By default, all forms and databases are stored here. By convention, all
private forms and databases are stored here. This directory is searched
after . and ./grokdir.
.IP GLIB/grokdir 18
This directory is searched last. It is supposed to contain forms visible
to all users of a system. Only one user should have write permission.
.IP ~/.grok/.grokrc 18
Preferences and the current configuration of
.B grok.
.IP GBIN/grok
The
.B grok
executable. This should be in the user's search path. Form files are set
up so they can be "executed" by feeding themselves to
.B grok,
as long as
.B grok
is in the search path $PATH.
.IP GLIB/grok.hlp
All help texts used by the
.B grok
help system.
.SS AUTHOR
Thomas Driemeyer <thomas@bitrot.in-berlin.de>
.LP
Please send all complaints, comments, bug fixes, and porting experiences to
me. Always include your
.B grok
version as reported by "grok -v" in your mail. New forms for inclusion in
the distribution are welcome. Make sure that your email address is in the
form's comment field, and that there is some help information attached to
the form with the Def Help function.
SHAR_EOF
chmod 0644 grok.1 ||
echo 'restore of grok.1 failed'
Wc_c="`wc -c < 'grok.1'`"
test 5427 -eq "$Wc_c" ||
echo 'grok.1: original size 5427, current size' "$Wc_c"
rm -f _shar_wnt_.tmp
fi
# ============= grok.1cat ==============
if test -f 'grok.1cat' -a X"$1" != X"-c"; then
echo 'x - skipping grok.1cat (File already exists)'
rm -f _shar_wnt_.tmp
else
> _shar_wnt_.tmp
echo 'x - extracting grok.1cat (Text)'
sed 's/^X//' << 'SHAR_EOF' > 'grok.1cat' &&
X
X
X
X GGGGRRRROOOOKKKK((((1111LLLL)))) UUUUNNNNIIIIXXXX SSSSyyyysssstttteeeemmmm VVVV GGGGRRRROOOOKKKK((((1111LLLL))))
X
X
X
X NNNNAAAAMMMMEEEE
X grok - Desktop Database Manager and GUI Builder
X
X SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
X ggggrrrrooookkkk [-h] [-d] [-v] [-t] [-T] [-f] [_f_o_r_m _q_u_e_r_y]]
X
X DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
X ggggrrrrooookkkk is a database manager that displays two-dimensional
X databases using a card file paradigm. A GUI builder is
X available to create user-defined applications. Grok comes
X with a number of pre-built applications such as a phone
X directory, todo lists, and a sample country database. The
X form to display (_p_h_o_n_e, _t_o_d_o, _c_o_u_n_t_r_i_e_s, etc.) can be given
X as the first parameter. This manual page describes the
X command line options of ggggrrrrooookkkk. For information on how to use
X ggggrrrrooookkkk, refer to the on-line help pages, and to the PostScript
X or TeX manual.
X
X OOOOPPPPTTTTIIIIOOOONNNNSSSS
X -h List available options.
X
X -d Print fallback X resources and exit. The output can be
X appended directly to the ~/.Xdefaults file for
X modification of the geometry, color, and font defaults.
X
X -v Print the program version and patchlevel and exit.
X
X -t Requires specification of a form. Without a query
X string, prints all cards to stdout in the same format
X that is used for the summary window in interactive
X mode. If a query is also specified, print only cards
X that satisfy the query expression (see below). The form
X may have a default query built in.
X
X -T This option is equivalent to -t, but omits the header
X line.
X
X -f Don't fork on startup. This is useful for debugging.
X
X form Specifies the database to display. GGGGrrrrooookkkk distinguishes
X forms and databases. Both always come in pairs. The
X form defines the representation of the cards and the
X database provides the raw data. If no form is
X specified, one can be chosen in interactive mode. The
X -t and -T options require a form argument.
X
X query
X If the form has a built-in query, it is used to select
X which cards in the database to display initially. If
X there is no default query, all cards are displayed. The
X query argument can be used to override the default
X query. This option should always be quoted with single
X
X
X
X Page 1 (printed 10/24/94)
X
X
X
X
X
X
X GGGGRRRROOOOKKKK((((1111LLLL)))) UUUUNNNNIIIIXXXX SSSSyyyysssstttteeeemmmm VVVV GGGGRRRROOOOKKKK((((1111LLLL))))
X
X
X
X quotes to keep the shell from interpreting the query
X string.
X
X There are different types of queries: '*' selects all cards,
X '/string' performs a case-insensitive string search,
X '{expr}' selects all cards for which the string expression
X returns a non-null, non-'f' string, and '(expr)' selects all
X cards for which the numerical expression returns nonzero.
X The leading '/' in string searches is optional. For a
X detailed description of query expressions, refer to the
X "Expression Grammar" item in the help pulldown, or to the
X PostScript user's manual.
X
X In addition to these options, ggggrrrrooookkkk supports the usual X
X options such as -iconic. The -geometry option should not be
X used to preset a window size; grok determines and frequently
X adjusts its own size.
X
X EEEEXXXXAAAAMMMMPPPPLLLLEEEESSSS
X ggggrrrrooookkkk
X
X Start up grok with no form. The Database pulldown can be
X used to choose one.
X
X ggggrrrrooookkkk pppphhhhoooonnnneeee
X
X Start up grok with the _p_h_o_n_e form. Perform that form's
X default query if it has one.
X
X ggggrrrrooookkkk pppphhhhoooonnnneeee ''''////tttthhhhoooommmmaaaassss''''
X
X Start up grok with the _p_h_o_n_e form. Ignore the default query
X and select only cards that contain the word "thomas". Case
X is ignored.
X
X ggggrrrrooookkkk ----tttt pppphhhhoooonnnneeee ''''////tttthhhhoooommmmaaaassss''''
X
X Print all cards of the form _p_h_o_n_e to stdout that contain the
X string "thomas". Do not start the interactive user
X interface.
X
X ggggrrrrooookkkk pppphhhhoooonnnneeee ''''{{{{____ggggrrrroooouuuupppp ======== """"ffff"""" &&&&&&&& ____eeeemmmmaaaaiiiillll}}}}''''
X
X Start up grok with the _p_h_o_n_e form. Ignore the default query
X and select only cards that describe friends that have an
X email address.
X
X FFFFIIIILLLLEEEESSSS
X Below, GBIN and GLIB refer to the installation directories
X specified at the beginning of the Imakefile when the
X programs were compiled. They are /usr/local/bin and
X /usr/local/lib, respectively, by default.
X
X
X
X Page 2 (printed 10/24/94)
X
X
X
X
X
X
X GGGGRRRROOOOKKKK((((1111LLLL)))) UUUUNNNNIIIIXXXX SSSSyyyysssstttteeeemmmm VVVV GGGGRRRROOOOKKKK((((1111LLLL))))
X
X
X
X *.gf Files ending with the extension .gf are
X assumed to contain ggggrrrrooookkkk forms.
X
X *.db Unless the form specifies otherwise, the
X database that provides the raw data for a
X form has the same path and name as the
X form, but with the extension .db.
X Procedural databases have no extension.
X
X . The current directory is searched first
X for form files.
X
X ./grokdir The grokdir current directory is searched
X next for form files. This is done to allow
X ggggrrrrooookkkk to be started from the source
X distribution directory for evaluation.
X
X ~/.grok By default, all forms and databases are
X stored here. By convention, all private
X forms and databases are stored here. This
X directory is searched after . and
X ./grokdir.
X
X GLIB/grokdir This directory is searched last. It is
X supposed to contain forms visible to all
X users of a system. Only one user should
X have write permission.
X
X ~/.grok/.grokrc Preferences and the current configuration
X of ggggrrrrooookkkk....
X
X GBIN/grok The ggggrrrrooookkkk executable. This should be in the
X user's search path. Form files are set up
X so they can be "executed" by feeding
X themselves to ggggrrrrooookkkk,,,, as long as ggggrrrrooookkkk is in
X the search path $PATH.
X
X GLIB/grok.hlp All help texts used by the ggggrrrrooookkkk help
X system.
X
X AAAAUUUUTTTTHHHHOOOORRRR
X Thomas Driemeyer <thomas@bitrot.in-berlin.de>
X
X Please send all complaints, comments, bug fixes, and porting
X experiences to me. Always include your ggggrrrrooookkkk version as
X reported by "grok -v" in your mail. New forms for inclusion
X in the distribution are welcome. Make sure that your email
X address is in the form's comment field, and that there is
X some help information attached to the form with the Def Help
X function.
X
X
X
X
X
X Page 3 (printed 10/24/94)
X
X
X
SHAR_EOF
chmod 0644 grok.1cat ||
echo 'restore of grok.1cat failed'
Wc_c="`wc -c < 'grok.1cat'`"
test 9089 -eq "$Wc_c" ||
echo 'grok.1cat: original size 9089, current size' "$Wc_c"
rm -f _shar_wnt_.tmp
fi
# ============= grokdir/countries.db ==============
if test ! -d 'grokdir'; then
echo 'x - creating directory grokdir'
mkdir 'grokdir'
fi
if test -f 'grokdir/countries.db' -a X"$1" != X"-c"; then
echo 'x - skipping grokdir/countries.db (File already exists)'
rm -f _shar_wnt_.tmp
else
> _shar_wnt_.tmp
echo 'x - extracting grokdir/countries.db (Text)'
sed 's/^X//' << 'SHAR_EOF' > 'grokdir/countries.db' &&
Afghanistan:647500:647500:16095664:2.4:Kabul:afghani, 1 afghani (Af) = 100 puls
Albania:28750:27400:3285224:1.1:Tirane:lek, 1 lek (L) = 100 qintars
Algeria:2381740:2381740:26666921:2.5:Algiers:Algerian dinar, 1 Algerian dinar (DA) = 100 centimes
American Samoa:199:199:51115:3.9:Pago Pago:US currency is used
Andorra:450:450:54428:2.2:Andorra la Vella:French franc and Spanish peseta
Angola:1246700:1246700:8902076:2.7:Luanda:kwanza, 1 kwanza (Kz) = 100 lwei
Anguilla:91:91:6963:0.6:The Valley:East Caribbean dollar, 1 EC dollar (EC$) = 100 cents
Antarctica:14000000:14000000:0:0.0
Antigua and Barbuda:440:440:64110:0.4:Saint John's:East Caribbean dollar, 1 EC dollar (EC$) = 100 cents
Argentina:2766890:2736690:32901234:1.1:Buenos Aires:peso, 1 pesos = 100 centavos
Armenia:29800:28400:3415566:0.8:Yerevan:retaining ruble as currency
Aruba:193:193:64692:0.7:Oranjestad:Aruban florin, 1 Aruban florin (Af.) = 100 cents
Australia:7686850:7617930:17576354:1.4:Canberra:Australian dollar, 1 Australian dollar ($A) = 100 cents
Austria:83850:82730:7867541:0.7:Vienna:Austrian schilling, 1 Austrian schilling (S) = 100
Azerbaijan:86600:86100:7450787:1.6:Baku (Baky):retaining ruble as currency
Bahrain:620:620:551513:3.1:Manama:Bahraini dinar, 1 Bahraini dinar (BD) = 1000 fils
Bangladesh:144000:133910:119411711:2.4:Dhaka:taka, 1 taka (Tk) = 100 paise
Barbados:430:430:254934:0.1:Bridgetown:Barbadian dollars, 1 Barbadian dollar (Bds$) = 100 cents
Belarus:207600:207600:10373881:0.5:Mensk:retaining ruble as currency
Belgium:30510:30230:10016623:0.3:Brussels:Belgian franc, 1 Belgian franc (BF) = 100 centimes
Belize:22960:22800:229143:3.0:Belmopan:Belizean dollar, 1 Belizean dollar (Bz$) = 100 cents
Benin:112620:110620:4997599:3.3:Porto-Novo:Communaute Financiere Africaine franc, 1 CFA franc (CFAF)
Bermuda:50:50:60213:0.8:Hamilton:Bermudian dollar, 1 Bermudian dollar (Bd$) = 100 cents
Bhutan:47000:47000:1660167:2.3:Thimphu:ngultrum, 1 ngultrum (Nu) = 100 chetrum
Bolivia:1098580:1084390:7323048:2.3:La Paz (seat of government):boliviano, 1 boliviano ($B) = 100 centavos
Bosnia and Herzegovina:51233:51233:4364000:0.5:Sarajevo
Botswana:600370:585, 370:1292210:2.6:Gaborone:pula, 1 pula (P) = 100 thebe
Brazil:8511965:8456510:158202019:1.8:Brasilia:cruzeiro, 1 cruzeiro (Cr$) = 100 centavos
British Virgin Islands:150:150:12555:1.2:Road Town:US currency is used
Brunei:5770:5270:269319:2.9:Bandar Seri Begawan:Bruneian dollar, 1 Bruneian dollar (B$) = 100 cents
Bulgaria:110910:110550:8869161:0.5:Sofia:lev, 1 lev (Lv) = 100 stotinki
Burkina:274200:273800:9653672:3.1:Ouagadougou:Communaute Financiere Africaine franc, 1 CFA franc (CFAF)
Burma:678500:657740:42642418:1.9:Rangoon (Yangon):kyat, 1 kyat (K) = 100 pyas
Burundi:27830:25650:6022341:3.2:Bujumbura:Burundi franc, 1 Burundi franc (FBu) = 100 centimes
Cambodia:181040:176520:7295706:2.1:Phnom Penh:riel, 1 riel (CR) = 100 sen
Cameroon:475440:469440:12658439:3.3:Yaounde:Communaute Financiere Africaine franc, 1 CFA franc (CFAF)
Canada:9976140:9220970:27351509:1.3:Ottawa:Canadian dollar, 1 Canadian dollar (Can$) = 100 cents
Cape Verde:4030:4030:398276:3.0:Praia:Cape Verdean escudo, 1 Cape Verdean escudo (CVEsc) = 100
Cayman Islands:260:260:29139:4.4:George Town:Caymanian dollar, 1 Caymanian dollar (CI$) = 100 cents
Central African Republic:622980:622980:3029080:2.6:Bangui:Communaute Financiere Africaine franc, 1 CFA franc (CFAF)
Chad:1284000:1259200:5238908:2.1:N'Djamena:Communaute Financiere Africaine franc, 1 CFA franc (CFAF)
Chile:756950:748800:13528945:1.6:Santiago:Chilean peso, 1 Chilean peso (Ch$) = 100 centavos
China:9596960:9326410:1169619601:1.6:Beijing:yuan, 1 yuan (Y) = 10 jiao
Christmas Island:135:135:929:0.0:The Settlement:Australian dollar, 1 Australian dollar ($A) = 100 cents
Cocos Islands:14:14:597:0.5:West Island:Australian dollar, 1 Australian dollar ($A) = 100 cents
Colombia:1138910:1038700:34296941:1.9:Bogota:Colombian peso, 1 Colombian peso (Col$) = 100 centavos
Comoros:2170:2170:493853:3.5:Moroni:Comoran franc, 1 Comoran franc (CF) = 100 centimes
Congo:342000:341500:2376687:2.9:Brazzaville:Communaute Financiere Africaine franc, 1 CFA franc (CFAF)
Cook Islands:240:240:17977:0.5:Avarua:New Zealand dollar, 1 New Zealand dollar (NZ$) = 100
Costa Rica:51100:50660:3187085:2.4:San Jose:Costa Rican colon, 1 Costa Rican colon (C) = 100 centimos
Croatia:56538:56410:4784000:0.39:Zagreb:Croatian dinar(s)
Cuba:110860:110860:10846821:1.0:Havana:Cuban peso, 1 Cuban peso (Cu$) = 100 centavos
Cyprus:9250:9240:716492:1.0:Nicosia:Cypriot pound and in Turkish area, Turkish lira
Czechoslovakia:127870:125460:15725680:0.2:Prague:koruna, 1 koruna (Kc) = 100 haleru
Denmark:43070:42370:5163955:0.2:Copenhagen:Danish krone, 1 Danish krone (DKr) = 100 re
Djibouti:22000:21980:390906:2.7:Djibouti:Djiboutian franc, 1 Djiboutian franc (DF) = 100 centimes
Dominica:750:750:87035:1.6:Roseau:East Caribbean dollar, 1 EC dollar (EC$) = 100 cents
Dominican Republic:48730:48380:7515892:1.9:Santo Domingo:Dominican peso, 1 Dominican peso (RD$) = 100 centavos
Ecuador:283560:276840:10933143:2.2:Quito:sucre, 1 sucre (S/) = 100 centavos
Egypt:1001450:995450:56368950:2.3:Cairo:Egyptian pound, 1 Egyptian pound (#E) = 100 piasters
El Salvador:21040:20720:5574279:2.2:San Salvador:Salvadoran colon, 1 Salvadoran colon (C) = 100 centavos
Equatorial Guinea:28050:28050:388799:2.6:Malabo:Communaute Financiere Africaine franc, 1 CFA franc (CFAF)
Estonia:45100:43200:1607349:0.7:Tallinn:kroon
Ethiopia:1221900:1101000:54270464:3.2:Addis Ababa:birr, 1 birr (Br) = 100 cents
Falkland Islands (Islas Malvinas):12170:12170:1900:0.2:Stanley:Falkland pound, 1 Falkland pound (#F) = 100 pence
Faroe Islands:1400:1400:48588:0.9:Torshavn:Danish krone, 1 Danish krone (DKr) = 100 ore
Fiji:18270:18270:749946:0.9:Suva:Fijian dollar, 1 Fijian dollar (F$) = 100 cents
Finland:337030:305470:5004273:0.3:Helsinki:markka, 1 markka (FMk) or Finmark = 100 pennia
France:547030:545630:57287258:0.5:Paris:French franc, 1 French franc (F) = 100 centimes
French Guiana:91000:89150:127505:4.6:Cayenne:French franc, 1 French franc (F) = 100 centimes
French Polynesia:3941:3660:205620:2.3:Papeete:Comptoirs Francais du Pacifique franc, 1 CFP franc (CFPF)
Gabon:267670:257670:1106355:1.5:Libreville:Communaute Financiere Africaine franc, 1 CFA franc (CFAF)
Gaza Strip:380:380:681026:3.6::new Israeli shekel, 1 new Israeli shekel (NIS) = 100 new
Georgia:69700:69700:5570978:0.8:T'bilisi (Tbilisi):retaining ruble as currency
Germany (Deutschland):356910:349520:80387283:0.5:Berlin:deutsche mark, 1 deutsche mark (DM) = 100 pfennige
Ghana:238540:230020:16185351:3.1:Accra:cedi, 1 cedi (C) = 100 pesewas
Gibraltar:6.5:6.5:29651:0.1:Gibraltar:Gibraltar pound, 1 Gibraltar pound (#G) = 100 pence
Greece:131940:130800:10064250:0.2:Athens:drachma, 1 drachma (Dr) = 100 lepta
Greenland:2175600:341700:57407:1.1:Nuuk (Godthab):Danish krone, 1 Danish krone (DKr) = 100 re
Grenada:340:340:83556:-0.3:Saint George's:East Caribbean dollar, 1 EC dollar (EC$) = 100 cents
Guadeloupe:1780:1760:409132:2.1:Basse-Terre:French franc, 1 French franc (F) = 100 centimes
Guam:541.3:541.3:142271:2.6:Agana:US currency is used
Guatemala:108890:108430:9784275:2.4:Guatemala:quetzal, 1 quetzal (Q) = 100 centavos
Guernsey:194:194:57949:0.6:Saint Peter Port:Guernsey pound, 1 Guernsey (#G) pound = 100 pence
Guinea:245860:245860:7783926:-1.5:Conakry:Guinean franc, 1 Guinean franc (FG) = 100 centimes
Guinea-Bissau:36120:28000:1047137:2.4:Bissau:Guinea-Bissauan peso, 1 Guinea-Bissauan peso (PG) = 100
Guyana:214970:196850:739431:-0.6:Georgetown:Guyanese dollar, 1 Guyanese dollar (G$) = 100 cents
Haiti:27750:27560:6431977:2.3:Port-au-Prince:gourde, 1 gourde (G) = 100 centimes
Vatican City:0.438:0.438:802:1.2:Vatican City:Vatican lira, 1 Vatican lira (VLit) = 100 centesimi
Honduras:112090:111890:5092776:2.8:Tegucigalpa:lempira, 1 lempira (L) = 100 centavos
Hong Kong:1040:990:5889095:0.6:Victoria:Hong Kong dollar, 1 Hong Kong dollar (HK$) = 100 cents
Hungary:93030:92340:10333327:-0.1:Budapest:forint, 1 forint (Ft) = 100 filler
Iceland:103000:100250:259012:0.9:Reykjavik:krona, 1 Icelandic krona (IKr) = 100 aurar
India:3287590:2973190:886362180:1.9:New Delhi:Indian rupee, 1 Indian rupee (Re) = 100 paise
Indonesia:1919440:1826440:195683531:1.7:Jakarta:Indonesian rupiah, 1 Indonesian rupiah (Rp) = 100 sen
Iran:1648000:1636000:61183138:3.5:Tehran:Iranian rial, 1 Iranian rial (IR) = 100 dinars
Iraq:436245:435292:18445847:3.7:Baghdad:Iraqi dinar, 1 Iraqi dinar (ID) = 1000 fils
Ireland:70280:68890:3521207:0.2:Dublin:Irish pound, 1 Irish pound (#Ir) = 100 pence
Israel:20770:20330:4748059:4.0:Israel proclaimed Jerusalem its capital:new Israeli shekel, 1 new Israeli shekel (NIS) = 100 new
Italy:301230:294, 020:57904628:0.2:Rome:Italian lira, 1 Italian lira (Lit) = 100 centesimi
Ivory Coast:322460:318000:13497153:3.9:Yamoussoukro:Communaute Financiere Africaine franc, 1 CFA franc (CFAF)
Jamaica:10990:10830:2506701:0.9:Kingston:Jamaican dollar, 1 Jamaican dollar (J$) = 100 cents
Japan:377835:374744:124460481:0.4:Tokyo:yen, 1 yen (Y) = 100 sen
Jersey:117:117:85026:0.8:Saint Helier:Jersey pound, 1 Jersey pound (#J) = 100 pence
Jordan:91880:91540:3557304:4.1:Amman:Jordanian dinar, 1 Jordanian dinar (JD) = 1000 fils
Kazakhstan:2717300:2669800:17103927:1.0:Alma-Ata (Almaty):retaining ruble as currency
Kenya:582650:569250:26164473:3.6:Nairobi:Kenyan shilling, 1 Kenyan shilling (KSh) = 100 cents
Kiribati:717:717:74788:2.1:Tarawa:Australian dollar, 1 Australian dollar ($A) = 100 cents
Korea, North:120540:120410:22227303:1.9:P'yongyang:North Korean won, 1 North Korean won (Wn) = 100 chon
Korea, South:98480:98190:44149199:1.1:Seoul:South Korean won, 1 South Korean won (W) = 100 chon
Kuwait:17820:17820:1378613:0.0:Kuwait:Kuwaiti dinar, 1 Kuwaiti dinar (KD) = 1000 fils
Kyrgyzstan:198500:191300:4567875:1.9:Bishkek (formerly Frunze):retaining ruble as currency
SHAR_EOF
true || echo 'restore of grokdir/countries.db failed'
fi
echo 'End of grok part 8'
echo 'File grokdir/countries.db is continued in part 9'
echo 9 > _shar_seq_.tmp
exit 0
--
--
Thomas Driemeyer thomas@bitrot.in-berlin.de voice: +49 30 8924936
Schweidnitzer Str. 6, 10709 Berlin