|
Sesame Library | Some Handy New Sesame Features
No mistaking the Retrieve Spec
In the early days of Sesames development, we asked a lot of Q&A
users what they liked or disliked about Q&A. A common gripe with Q&A for DOS
was that all the screens looked the same. The worst effect of this is when
users mistakenly overtype previously entered data (or add a new record
comprised of search criteria) because they think they are in the Retrieve
Spec. This results in that familiar phenomenon of a batch of records that
are blank except for company names like New Jersey.. or ..software.
Well, with Sesame, youll have no
excuse for these faux-pas any more, because Sesame will tell you
which mode you are in! Its brilliant yet simple. Sesames Mode
Indicator panel on the toolbar changes colour and
legend. Initially, with no application or form open, the panel is grey and
says Application. Open a form to the Retrieve Spec and the indicator turns
blue and says Search. (See below.)

When you run the search and your form is
showing data, the Mode Indicator turns green and it reads Update. (See
below.)

When youre in Add Data mode, the indicator
colour is deep red and says Add Data. (See below.) As I said, brilliantly
simple.

Sesames dynamic sorting
Sesame incorporates all of Q&As sorting facilitiesand much more.
In Q&A you cannot perform a dynamic sort. That is, to re-sort a set of
sorted records, you must return to the Retrieve Spec, press F8 and
re-specify your sorting criteria, then run the Retrieve again. In Sesame
you can perform a dynamic sort in one of two ways.
1. You can click on the Sort button in the
column heading of Table View. (Well be taking an in-depth look at Sesames
Table View in a forthcoming issue.)
2. Or you can retrieve some records (a
result set), display the Sort Spec window, specify the new sort, and apply it.
Heres how you would do that.The lower left
area of the Sesame screen contains the multi-purpose Spec Window.
(See Figure 4 on next page.) This area of the Sesame screen can
show any of several different specs and is context-sensitive. You switch
specs by clicking on the spec selector buttons (the left and right arrow
icons) at either end of the header bar (currently showing Mass Update
Countries below).

This will take you, for example, from the
Mass Update Spec to the Export Spec, to the Sort Spec, and so forth. You can
establish a sort order either at the Retrieve Specjust as in Q&A for DOSor
after you have retrieved your records.
To sort by a field, you click on the row
selector to the left of the field name in the Sort window. (See below.) That
field jumps to the top of the list and its selector acquires an S to show
it is a sorted field. Alongside it is an A to show ascending sort. If you
click on this A it changes to a D for descending sort.

You can add other fields to the sort list
for second and third sort levels. You click on the S to cancel sort on a
given field. You can also drag fields up and down to change the sort order.
Notice that the header bar in the Sort
window includes a small down-arrow icon. Clicking on it opens a drop down
menu that includes Run the commandin this case, meaning Sort the records.
The same dropdown also includes options for selecting and deselecting all
fields.
When you click on Run..., the data is sorted
as you specified. In the example shown below, the countries are sorted first
on the Continent field (ascending, A-Z), then by the population field
(descending, 9-0). So, the records for Africa will be shown before the
records for America. And within each continent, the countries with the
largest populations will come first.

The resultwhether in Table View or in Form
Viewis that you can see your data presented in any order you choose,
without having to return to the Retrieve Spec.
Copying records between databases
If youve ever used Q&A for DOS to copy records between two databases (File
/ Copy / Selected Records), you may know what a major irritation (or recipe
for disaster) it can be if the two databases are even slightly different.
One might have an extra field or two, or worsea field that was moved to a
different position on the form. This can result in a type of data shiftthat
is, data being copied from the source database to the wrong field(s) in the
target database.
Having determined that such a problem exists
following a copying operation, you need to determine the nature of the
mismatch. You then have two choicesto make the same change to the other
database so its data is in sync or, after somehow reversing out the bad
records in the other database, redo the copy operation, this time filling
out a Merge Spec. This is the screen where you say that you want field A
copied to the 22nd field in the other database, field B copied to the 23rd
field in the other database, and so forth. If there is just one field thats
different between the two databases, then you need to use the Merge Spec to
specify the position of every field. Its aggravating, to say the least.
In Q&A for Windows things are much easier.
You can map fields between the two databases by field names. Sesame
follows this model and allows you to match fields by name rather than by
position on the form. When you open Sesames Copy Spec you see a
list of fields in each of the databases.

You can drag a field from Source Fields to
Destination Fields and position them together. This is useful if the two
databases are not similar and the field names differ. But theres also a
Match Names button that automatically pairs up fields with the same field
name. You can then make manual adjustments if you wish. It will save you
time and frustration when copying data between similar, but not identical,
databases.
Alec Mulvey is a director of Lantica
Software, LLC and also owns Keyword Software & Consultancy in Ascot, near
London, England. Alec has been building Q&A applications and training
clients for 12 years. Keyword Software is the UK distributor for the
International English edition of Q&A. alec@keywordsoftware.com, http://www.keywordsoftware.com.
|