Theme:
v
APL+Win Training Pack 11

Cross Tabulations, Shortcut Keys & Relational Database in APL+Win (part 3)

Download APL+Win Training Pack 11 (603 K)

This 11th APL+Win Training package contains:

  • a powerful generalized Cross-Tabulation function
  • a Cross-Tabulation command for the Relational Database
  • a Chapter on the various ways with which you can implement shortcut keys in an APL+Win application
  • a discussion in Input Forms and an improved Relational Input Forms command: Load

Cross-Tabulations

Chapter 20 contains a thorough study of a very efficient and powerful cross-tabulation function (Xtab) which lets you compute cross-tables of any rank in APL.

Example:

      prods←1 1 1 1 1 2 2 2 3 3 3 3
      month←1 1 1 2 2 1 2 2 2 3 4 2
      cust← 12⍴101 102
      sales←12⍴10

      ⊃cust prods month sales
101 102 101 102 101 102 101 102 101 102 101 102
  1   1   1   1   1   2   2   2   3   3   3   3
  1   1   1   2   2   1   2   2   2   3   4   2
 10  10  10  10  10  10  10  10  10  10  10  10

      Xtab prods month sales
        1    2    3    4  Total
    1  30   20    0    0     50
    2  10   20    0    0     30
    3   0   20   10   10     40
Total  40   60   10   10    120

      prods←('APL+Win' 'APL+Dos' 'APL+Unix')[prods]
      month←('jan' 'feb' 'mar' 'apr')[month]

      1 1 1 (1 0 1) Xtab cust month prods sales
  101 APL+Dos APL+Unix APL+Win Total
  jan       0        0      20    20
  feb      10       10      10    30
  mar       0        0       0     0
  apr       0       10       0    10
Total      10       20     30     60

  102 APL+Dos APL+Unix APL+Win Total
  jan      10        0      10    20
  feb      10       10      10    30
  mar       0       10       0    10
  apr       0        0       0     0
Total      20       20      20    60

This new cross-tabulation utility is then used as the chore cross-tabulation engine for our Relational Database System.

A new Crosstab command is introduced to let you make any cross-tabulation query to the Relational Database.

Example:

      Crosstab 'orlQty×proPrice' From orl By supName proName '⌊ordDate÷100' Where supName Contains'EC'
CATIO ELECTRONIC      199406 199407 199408 Total
BALL-POINT PEN             0      0      0     0
BLACKLEAD PENCIL           0      0      0     0
CALCULATOR               470      0    235   705
COLOR PENCIL               0      0      0     0
DESK                       0      0      0     0
ESSAI                      0      0      0     0
FOUNTAIN-PEN               0      0      0     0
PEN                        0      0      0     0
PENCIL                     0      0      0     0
RULE                       0      0      0     0
SCISSORS                   0      0      0     0
Total                    470      0    235   705

ELECTROLAMP           199406 199407 199408 Total
BALL-POINT PEN             0      0      0     0
BLACKLEAD PENCIL           0      0      0     0
CALCULATOR                 0      0      0     0
COLOR PENCIL               0      0      0     0
DESK                     149      0      0   149
ESSAI                    149      0      0   149
FOUNTAIN-PEN               0      0      0     0
PEN                        0      0      0     0
PENCIL                     0      0      0     0
RULE                     149      0      0   149
SCISSORS                   0    149      0   149
Total                    447    149      0   596

JUMANTEC CORP.        199406 199407 199408 Total
BALL-POINT PEN             0      2      2     4
BLACKLEAD PENCIL          45      0     15    60
CALCULATOR                 0      0      0     0
COLOR PENCIL               0      4      0     4
DESK                       0      0      0     0
ESSAI                      0      0      0     0
FOUNTAIN-PEN              40     25     40   105
PEN                       50      0     20    70
PENCIL                    40     15     20    75
RULE                       0      0      0     0
SCISSORS                   0      0      0     0
Total                    175     46     97   318

Shortcut Keys

Adding well chosen shortcut in a Windows application may make a huge difference for the end user and much enhance your application.

Chapter 21 reviews the various ways available in APL+Win to add shortcut keys to menus, buttons and other controls.

In addition it delivers 2 utilities to help you define your shortcut keys. One, GuiCode, lets you easily find out the virtual key codes necessary for your shortcut property definitions.

Example:


      GuiCode''

Relational Database Input Forms

Chapters 18 and 19 of the APL+Win Training delivered a Relational Database Engine. At the end of Chapter 19, we started to develop this Relational Database Graphical User Interface.

We introduced a Load command which built dynamic relational input forms to add new records to the database tables.

In this Training Pack you will see how the Load command has been enhanced to let you:

  • easily place input fields where you want on the form
  • check for duplicate records
  • browse through existing records to update existing records

Example:


      layout←7 2⍴proName 0 proWght proColor proStock 0 proPurpr proPrice proSupno 0 proSu2no 0 proMemo 0
      Load layout From pro Where proName Contains'S'

We hope you will enjoy this APL+Win Training Pack and that it will help you in your application developments.


Pack 11 Content

File Description
BUTTONS.BMP More than 100 images for your toolbar buttons.
DISK11.DOC An 61 pages Winword document containing Chapters 20,21 & 22 of the APL+Win Training.
CROSSTAB.W3 A workspace with the Xtab cross-tabulation utility
SHORTCUT.W3 A workspace to explore various means of defining shortcut keys in APL+Win
TOOLKIT.W3 The third part of an APL+Win Relational Database Engine.
TOOLKIT.INI The Relational Database .INI file.