Skip to content

APL+Win Version 4.0

Vector 19:1, page 74

reviews implementations

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

My upgrade copy of APL+Win 4.0 has now arrived and although I have been playing with the beta version for some time it is still exciting to receive the "real" thing.

The installation of the upgrade went very smoothly, automatically registering the new Grid OCX and APL+Win as a COM server. I had one minor problem after the installation when the APL font did not load properly when I started up the APL session. It was easily fixed by resaving the screen font information in the ini file using the "Options/Font for Screen…" menu. The actual APL+Win fonts had installed successfully, it was due to the screen font settings not being updated in the aplw.ini file.

The product appears stable and seems to perform well. To anyone new to APL+Win it is probably best described as a close implementation of APL2 with a VB style interface to the Windows GUI using the system function ⎕wi. There is a lower level C style interface using the system function ⎕wcall but it is normal to use the ⎕wi interface. Occasionally it is useful and sometimes necessary (becoming rarer with each new version) to use the lower level access provided by ⎕wcall. All the GUI objects include their window handles as a property to simplify the use of ⎕wcall. It is now possible to retrieve the APL+Win GUI name from its handle.

The main new features in 4.0 are;

Three volume paper documentation suite;

User Manual
System Function Manual
Windows Reference Guide

New APL grid OCX

Minor changes to the session manager

Enhancements to the standard GUI objects, including a context help facility

Overhaul of the Printer object

Small interpreter/system changes

The paper documentation comes in the slightly larger than A4 size, originally used for the Windows documentation for version 3.6. This is the first time all the manuals have come in printed form as standard since version 1.0. This reprinting has been long overdue as the interim versions have been confusing to new purchasers. I have had to lend out my version 1.0 manuals on several occasions.

The documentation is clear except that the Grid object has been omitted, although it is covered in the online help. This is a serious omission but I’m assured that a printable copy is to be made available on the APL2000 website (www.apl2000.com) as soon as it is ready.

The manuals are useful for someone new to APL, or as a quick reference to the more experienced, as they cover all aspects of the primitives, system functions and variables. I found the explanations they gave were clear and to the point. The only difficulty is sometimes deciding which manual to go to, as, in my opinion, the arrangement is not always the most logical. They contain basic descriptions but also contain other aspects of windows programming which again would prove useful for people new to Windows.

The Grid is a great addition to the system and has been introduced, I suspect, because of the upgrade problems with the Formula One Grid. The F1 grid had previously been the usual solution if a general purpose grid was required. The new Grid appears to be similar to the F1 grid but has several advantages over the F1 grid. These can be summarised as;

Comes as part of the APL+Win product and so does not involve separate (and now expensive) licensing and the upgrade paths of the two should now remain in step.

The ability to allow the editing of frozen cells, in F1 they were protected.

The data cells are accessed in an APL friendly manner using arrays

The setting of attributes are managed with APL arrays rather than by continually changing selections, applying the attributes and resetting the selection.

The grid also seems efficient and fits in very well with the rest of the APL system. It can generate and read data in XML format and is available for use by JAVASCRIPT as well. I have almost finished converting my F1 applications to the new grid and all seems to be fine.

I think the lack of paper documentation and the fact that the Print Preview method is still APL code rather than a method indicates that the grid development was not really finished in time for the release. I hope these deficits will be corrected quickly and that other enhancements like the ability to detect the mouse over the bitmaps in the corners of a cell will be added soon. These are, however, minor complaints in the face of a generally good piece of work from APL2000.

The system itself has been extended so that

replicate now matches the APL2 definition where negative values in the left argument insert the modulo number of fill elements

the size limits on the Sharefile system have been increased.

The GUI system has been enhanced substantially with additions like the noredraw property to reduce the number of redraws (and hence screen flicker). It should be used carefully as it can be confusing, it is not always sufficient to Paint the object itself one needs to Paint the parent instead which in itself can increase the scope of the flicker. It can take a while to become comfortable with this feature but it is worth persevering. It is a tidying up of the system, as it was possible to achieve the same effect with ⎕wcall to change the Windows redraw facility directly.

x ← ⎕wcall'SendMessage'(obj ⎕wi 'hwnd')'WM_SETREDRAW' (×flag) 0

Where flag is the inverse of the setting of the noredraw property and obj is the name of the object affected.

The new equivalent would be

x ← obj ⎕wi 'noredraw' (~×flag)

which is much neater and now uses the standard interface ⎕wi and not ⎕wcall.

However, the example above does show how easy it is to access the underlying Windows API to produce effects that aren’t defined in the standard interface.

Small but extremely useful changes, such as the inclusion of Set and Ref to the system object now allow the chaining of property sets and references on the system object. This brings it into line with the other GUI objects.

The GUI interface has been brought into line with other enhancements made by Microsoft to the basic objects, for example, images are now allowed on menus, in lists and combo boxes.

Printer and context help improvements

The control of the printer has been transformed and APL+Win now gives total control over the default printer and any other printers available either locally or over the network. The printer object was always the weakest part of the application but over the last few releases APL2000 has addressed this problem and in this release have completed the task. The printer object is now easy and straightforward to use.

The new context help is a welcome enhancement but the claimed interface with the Windows Help systems is only partially implemented. The old Winhelp version has the required definitions in the ADF file but the later HtmlHelp definitions have been omitted. To use the HtmlHelp system it is necessary to add the following definitions to the aplw.ini file (or to the adf file by recompiling it – full instructions are in the manuals).

The main entries for the ini file are listed below, the constants were lifted from the .h file provided with the Html Helpfile workshop. I haven’t tried using this extensively yet as I am still using the old Winhelp version but I have checked that the HtmlHelp interface is called successfully once these entries are added.

[Call]
HtmlHelp=U(HW hwndCaller, *C pszFile, U uCommand, D dwData) LIB hhctrl.ocx
  ALIAS HtmlHelpA
[Constant]
HH_DISPLAY_TOPIC=              0x0000
HH_HELP_FINDER=                0x0000
HH_DISPLAY_TOC=                0x0001
HH_DISPLAY_INDEX=              0x0002
HH_DISPLAY_SEARCH=             0x0003
HH_SET_WIN_TYPE=               0x0004
HH_GET_WIN_TYPE=               0x0005
HH_GET_WIN_HANDLE=             0x0006
HH_ENUM_INFO_TYPE=             0x0007
HH_SET_INFO_TYPE=              0x0008
HH_SYNC=                       0x0009
HH_KEYWORD_LOOKUP=             0x000D
HH_DISPLAY_TEXT_POPUP=         0x000E
HH_HELP_CONTEXT=               0x000F
HH_TP_HELP_CONTEXTMENU=        0x0010
HH_TP_HELP_WM_HELP=            0x0011
HH_CLOSE_ALL=                  0x0012
HH_ALINK_LOOKUP=               0x0013
HH_GET_LAST_ERROR=             0x0014
HH_ENUM_CATEGORY=              0x0015
HH_ENUM_CATEGORY_IT=           0x0016
HH_RESET_IT_FILTER=            0x0017
HH_SET_INCLUSIVE_FILTER=       0x0018
HH_SET_EXCLUSIVE_FILTER=       0x0019
HH_INITIALIZE=                 0x001C
HH_UNINITIALIZE=               0x001D
HH_PRETRANSLATEMESSAGE=        0x00fd
HH_SET_GLOBAL_PROPERTY=        0x00fc

The usage of HtmlHelp() and the constants above is documented in the API reference that comes with the free HTML workshop from Microsoft at

Http://msdn.microsoft.com/library/default.asp?url=/library/en-us/htmlhelp/html/hwMicrosoftHTMLHelpDownloads.asp

The main feature of this release is the Grid and much is rightly being made of this by APL2000. However I think the general improvement and polish that has been given to the product is equally important. The packaging of a runtime application is simple. Multi-threading/multi processor use can be introduced by simply using APL+Win as COM objects along side the normal APL workspace.

The clear implementation of the TCP/IP interface (using system function ⎕ni) allows:

the linking of machines over a network
the linking of tasks on the same machine
direct access to the Internet
the building of asp style Web pages

The use of Excel and other Active Object applications has been made simpler with the adoption of the standard Microsoft VB interface in addition to the original method. This means that any VB book can be used to navigate the standard published models. This has made it much easier to utilise all of the office applications. There are some example workspaces and examples in the documentation which show how Excel and APL+Win can be used together with either as a server to the other.

The understated and easily missed events onNew and onAction allow new User defined objects to be created and manipulated. This facility is extremely powerful and aids the system implementation by giving the developer the opportunity to define their own objects, properties and methods. A user defined object behaves in the same manner as a system object. This aids the reuse of code and can simplify the application development process. This facility has introduced a little instability if misused but once the code is right it behaves correctly.

Summary

All of the enhancements, particularly the grid, make this a new product or upgrade worth buying. I can certainly recommend it.