Icon Bar Shell with Save
by Ben Avison and Lee Calcraft

This application is an enhanced version of the application from Volume 4 Issue 7. It is a skeleton application which can be used to develop simple applications based on an icon bar icon. Files or directories can then be dragged to the icon, and the user's code can act on them in some way. A save box can then automatically appear, so that the altered file can be saved away. The application is configured to display a Save box containing a file of type Obey when a file is dragged onto the icon bar icon.

To configure the application for your own use, you should insert your own code in PROCaction in the Basic program !IBarShell.!RunImage. The code can use the variables click%, dir%, appl%, filetype% and pathname$. If you wish use the application save box, then you should alter PROCdatasave.

In PROCaction, if the icon is clicked with Select, click% will be TRUE, and the other variables are irrelevant. If a file is dragged to the icon, click% will be FALSE, dir% will be TRUE if the object is a (non-application) directory, appl% will be TRUE if the object is an application directory, filetype% is the filetype of the file, and pathname$ is its full pathname.

For untyped files and directories, filetype% is -1 for untyped files, &1000 for non-application directories and &2000 for application directories.

The application has been enhanced to allow files dragged to the icon bar to be operated on and saved away using a standard save box. Lines 930 and 935 must be altered to the file type which the program should save, and the values of the variables start% and length% should be altered to denote which area of memory should be saved as the altered file. The procedure PROCaction should be changed to alter the file contants, and finally line 2530 should be altered to the default save name given in the save box.

The listings given in the magazine are given as the Basic files 'NewBits' and 'SaveProcs' for reference.

For more details, refer to the article in this month's magazine.
