Skip to content

Putting a GUI Interface on Legacy Systems

Vector 12:3, page 61

user interfaces conference reports

Transcribed from the printed issue; not yet reviewed. Read it in the PDF of the issue, page 61

Jim’s talk began with an example of using APL2/OS2 as a subtitute session manager for mainframe applications which used exclusively Quad and Quote-Quad prompting to select from menu choices, and which then output text reports direct to the APL session.

The trick is to use shared variables over AP119 (the TCP/IP processor) to redirect session output to a network socket in place of the mainframe session manager. The mainframe system types a list of options:

Please select one of the following ...

     1. Fish and Chips
     2. Sausage and Beans
     3. Pizza
     4. Lasagne
     0. Exit this menu

⎕:

… and the user types a number. The program then either goes to another menu, or shows some kind of report. There are three things people typically do with the report: (a) read it, (b) print it, (c) type it into Excel. If instead of a mainframe terminal you have the OS/2 session, you can at least use cut and paste to speed up (c), so here is a useful gain in productivity at zero cost.

Stage two is to field the option list, recognise it as a set of choices and let the user click on a list box instead of typing a number. A little programming is required, but the cost is still near to zero, and suddenly the user has a real Gui application!

Jim continued with a brief outline of the shared-variable approach to Gui objects which IBM first showed at San Antonio. This has an appealing simplicity, but I can’t help feeling that it would drive you completely mad if you attempted anything remotely complex with it. It also cries out for namespaces.

The approach is for any Gui object (such as a form) to accept a shared variable for every property or state; for example to set the title and give focus to a form:

title←'My Window'      ⍝ Set the title
see←1                  ⍝ Make it visible
focus←1                ⍝ Set keyboard focus on it

… assuming all the shares have been set up in advance. The process of building a Gui object becomes

handle ← CreateDlg template
⍝ then share a bunch of variables
⍝ then assign them
see←1      ⍝ finally show it

The templates are built by an external designer, copied to the OS/2 clipboard and pulled into the workspace as arbitrary character vectors suitable for the CreateDlg function.

Jim’s closing message was "Windows programming is as simple as ←, so go and tell the boss". I wish he was right!