Here are a few
tips from your
fellow Hardhats about how to use FileMan better.
Avoiding
the "Save changes?" ScreenMan prompt
When a ScreenMan user finishes a page, and the cursor is in the
COMMAND LINE at the bottom of the screen, he types "E" if he wants
to ""save and "exit". He is then asked
Save changes before leaving form (Y/N)?
There is a very small patch that can eliminate this question.
At E+3^DDS3, add
a line that says:
SET Y=1 GO EX
Auto-numbering
FileMan ".01" fields
Greg Kreis offers a technique to "permit the user to enter a + symbol
when they are at the 'Select Prompt'. They are then presented
with
the next available number in the question that asks if they want to add
this new record. Presto chango, the + is transformed into the
next
number..".
1. Set up a 7.5 pre-lookup transform on the .01 field,
as shown
below:
^DD(<file number>,.01,7.5) =
I X="+" S X=""""_$$AUTONUM^<routinename>(X)_""""
2. Write the logic that you use to derive record names:
AUTONUM(X) ; generate a unique number for a record
N %,NUM
I X="+" D
.S %=$$PARAM ; derive the site
parameter
record number
.I % D
..L +^XYZ(%,10)
..S
NUM=1+$S($D(^XYZ(%,10)):$P(^(10),U,1),1:0)
..F NUM=NUM:1
Q:'$D(^XYZ("B",NUM))
..S $P(^XYZ(%,10),U,1)=+NUM
..L -^XYZ(%,10)
Q NUM
3. As a little trick, define the field that holds the
'next number'
as the only field on the node - a FM feature that is not often
used.
In this case, node 10.
NODE;PIECE: 10;E1,245
The advantage of this lone field on the node, is that it is
easier to
lock the
node, etc. and know that it has no other purpose.
Alternatively, store the counter in a node among the
xrefs. For
example,
^XYZ("AUTONUM")= 6
The advantage of the above is that it stores the count with
the file.
The first approach requires a site parameter file and a node for every
file being "auto-numbered".
Sorting
in the order the developer wanted
Marianne Follingstadt discovered that the FileMan output module may
sometimes change the sorting order of a Template that you have
created.
It does this because it has "computed a better search
efficiency".
But it may happen that you, the developer, absolutely need the Sort
Logic
to work just as you specify.
Marianne discovered a solution. It is just a matter of
editing
two fields that pertain to any Sort Template:
Select OPTION: 1 ENTER OR EDIT FILE ENTRIES
INPUT TO WHAT FILE: SORT TEMPLATE//
EDIT WHICH FIELD: 1621 SORT FIELD DATA
(multiple)
EDIT WHICH SORT FIELD DATA SUB-FIELD: ALL//
SEARCH
EFFICIENCY RATING
THEN EDIT SORT FIELD DATA SUB-FIELD: PROBABILITY
RATING
THEN EDIT SORT FIELD DATA SUB-FIELD:
THEN EDIT FIELD:
Select SORT TEMPLATE: <Your Template name>
Select FILE OR SUBFILE NO.: <The file number>
SEARCH EFFICIENCY RATING: 999
PROBABILITY RATING: 999
Crosstabs
in FileMan V22
Many FileMan users need to produce cross-tabulations of data.
FileMan's "PRINT" option has always offered a powerful sub-totalling
capability,
but no way to "pretty-print" the resulting subtotals.
For example, let's take the DIALOG file that comes
pre-installed with
FileMan. Suppose we want to do a two-way breakdown of all the
entries:
by the PACKAGE each belongs to, and by TYPE of Dialogue.
We do this in the following FileMan interaction:
Select OPTION: 2 PRINT FILE
ENTRIES
OUTPUT FROM WHAT FILE:
DIALOG
(513 entries)
SORT BY: DIALOG NUMBER// +PACKAGE
START WITH PACKAGE: FIRST// @
GO TO PACKAGE: LAST//
WITHIN PACKAGE, SORT BY: +TYPE
START WITH TYPE: FIRST//
WITHIN TYPE, SORT BY:
FIRST PRINT FIELD: !.01 DIALOG
NUMBER
THEN PRINT FIELD:
Heading (S/C): DIALOG STATISTICS//
START AT PAGE: 1//
DEVICE:
CONSOLE
Right Margin: 80//
The resulting output would look something like --
DIALOG
STATISTICS FEB
8,2000
16:48 PAGE 1
DIALOG NUMBER
------------------------------------------------------
PACKAGE: EMPTY
TYPE: ERROR
SUBCOUNT
14
TYPE: GENERAL MESSAGE
SUBCOUNT
138
SUBCOUNT
152
PACKAGE: MAILMAN
TYPE: ERROR
SUBCOUNT
23
TYPE: GENERAL MESSAGE
SUBCOUNT
17
SUBCOUNT
40
PACKAGE: VA FILEMAN
TYPE: ERROR
SUBCOUNT
176
TYPE: GENERAL MESSAGE
SUBCOUNT
103
TYPE: HELP
SUBCOUNT
42
SUBCOUNT
321
COUNT
513
|
Not too easy to read. But with the release of a recent
FileMan
patch, sequence
#10 of the VA releases of FileMan V22.0, these results can be
prettied
up enough to be entered into a spreadsheet:
Select OPTION: OTHER OPTIONS
Select OTHER OPTION: STATISTICS
Select STATISTICAL ROUTINE: 1
DESCRIPTIVE
STATISTICS
and voila --
DIALOG
FILE:
COUNTS
FEB 8,2000 Page 1
PACKAGE
TYPE
ERROR GENERAL
MESSAGE
HELP TOTAL
----------------------------------------------------------------------
EMPTY
14
138
0 152
MAILMAN
23
17
0 40
VA FILEMAN
176
103
42 321
--------
------------
------------ ----
TOTALS
213
258
42 513
|
Note that, as usual, statistics need to be printed out from
the same
terminal that called for the output. Single-level and
triple-level
subtotals can also be pretty-printed using the newly-revised
DESCRIPTIVE
STATISTICS option.
The patch enabling these outputs is part of our FileMan
download, and also part of the Hardhats'
distribution of "Diamond 2.0" for Cache.
|