When you start the Graphical Programming Server, it creates a window containing an input area and a command menu:
Language
button in the Commands menu and select the
desired language from the menu. The available languages are Lisp,
C, C++, Java, and Pascal.
First click on Language and select the desired language. Then click Program; position the box, then select ASSEMBLYC and PARTS. Position the small box to the left of the larger box. Click on the Acc button of the larger box, then select SUM and WEIGHT and position the box to the right of the larger box. Then click Done.
assembly
(assemblyc
for
languages other than Lisp) has a name
and a
linked list of parts
. A part
(partc
for languages other than Lisp) has a
string name
, an integer size
, a float
weight
, a Boolean
flag pretty
, and a link
pointing to
another part
. A part
also has a
linked-list
view predefined.
It is also possible to define your own data structures, as described here. Click the mouse in the input area (the empty box), then enter the description of your data; the input editor is an Emacs subset. After the description of your data structure is complete, click the mouse outside the input area; the system will respond with a confirming message. Repeat the process as needed to define other data types.
After describing your data, you may want to make a view of your data structure as an abstract type; this is described here.
assembly
(or assemblyc
)
can be selected, or a user-defined type name can be entered.
After the inpuut type has been selected, the system will ask for
selection of the sequence over which to iterate. The assembly
type has two sequences: the name
(a string, which is a
sequence of characters) and the parts
, a linked list of
part
records.
assemblyc
as the input and
parts
as the sequence, the screen image will look like this:
The next task is to select one or more accumulators to accumulate
something about the parts. Click on the Acc
button of
the ITER_ACC
box to add an accumulator. The system will
present a menu of accumulators. Many of the accumulators are fairly
obvious; Find-Update and some other accumulators are described below.
SUM
is selected, the system will present a menu of
things about a PART
that could be summed, such as the
WEIGHT
.
It is also possible to accumulate the values of some expression,
similar to the process described below for specifying a test.
There may be other things about the accumulator that can be
specified, e.g. the INITIAL-VALUE
of a SUM
.
SUM
the WEIGHT
only when the
SIZE
is greater than 3. To specify the test, click on
the left button of the SUM
box and select TEST
.
The TEST
can be specified in several ways:
PART
is PRETTY
.
Specify fn
can be used to specify a customized test:
FN-NAME
allows the user to specify the name of a
function to perform the test.
CODE
allows the user to specify a bit of code to
perform the test. This code must be enclosed in parentheses;
it can be in either Lisp prefix form or infix form. A property of
the item is accessed as (
property
self)
, for example:
( (size self) > 3 )
VIP
will use the VIP
system to acquire the code graphically.
RECORD
allows the user to specify
a record to be accumulated.
Find-Update
is an accumulator that finds an item in a
database (using the KEY
feature of the item), inserting
the item if it is not present in the database. Then the information
related to that key (one or more accumulators) is updated.
When Find-Update
is selected, the system will first ask
for the KEY
to be used; this key must be compatible with
the database that is chosen.
Accumulators can be added to the Acc
button of
Find-Update
. In addition, a database must be selected
for the Storage
button of the Find-Update
box.