Under the Scope
Written by Brad Scharf
Welcome to the utility review column. This is a new column that will review freeware, shareware and commercially available applications intended to aid the development process and initially will be targeted towards beginner OS/2 programmers.
The column will feature one or two utilities each month. I will try and let the reader know in advance which tools will be featured. Also, there will be an index at the end of every column that will include program names and descriptions, which issue of EDM/2 featured the program review and in future issues I will try and let the reader know where the utilities can be found and at what cost.
By the way, if you have any comments or suggestions regarding this column please let me know. If the column is to be a success it will be through the feedback of its readers. Likewise, if you know of a utility that would be beneficial to other programmers please mention it and I'll do what I can to ensure that readers are made aware of it. I may be reached via the internet at email@example.com .
In my own experience, and I imagine most of your own, I have found that despite my best intentions my programs don't always behave as expected. (That must be a first!) Usually this isn't a problem but occasionally I'll compile and run a program which I then can't shut down, even from the Window List.
In addition to the above, sometimes we will write applications that modify system INI files. It's a sad fact of life that the modifications will not always be as expected, or perhaps we just wish to remove them in order to leave things as they were before testing our projects.
To help us deal with both of these issues, I review in this issue a process monitor utility entitled PSPM/2, as well as an INI file editor called EDITINI. So read on!
PSTAT PM/2 v5.10
PSTAT PM/2 (PSPM/2) is a 32-bit PM utility that provides the user with a graphical representation of running processes as well as information about those processes, such as hierarchical relationships, number of threads and thread info.
All of the information that can be obtained from this program is available from the PSTAT program that ships with OS/2. In fact, PSTAT will actually provide more information than PSPM/2. The usefulness of PSPM/2 lies in its ease of use, simple visual representation of running processes, point-and-shoot capabilities, continual refresh (if desired) and perhaps most of all, the ability to terminate running processes. Unlike some other process killers, PSPM/2 works independently from OS/2s PSTAT program.
The need for this type of utility first became apparent to me when, after writing my first PM program, I could not stop it from running. The appearance program icon indicated that it was running but nothing appeared on the screen, nor did the program appear in the window list. The only method available to shut down the application was to reboot my PC. Obviously this is not the preferred method of shutting down applications!. As it turned out, I had declared the window to include a menu item that I failed to provide in a resource file. Everything compiled OK but the system didn't like it very much. In comes PSPM/2...
In cases as I've mentioned PSPM/2 performs very well. It allows one to obtain basic information about a running process and to shut the process down if desired. Of the many times I've used it to do this I have never found any problems. Shutting down an application is simply a matter of clicking on the process name in the main window and selecting "Terminate Process" from the resulting dialog. At this point you have one chance to change your mind when the verification dialog appears. Selecting "Yes" will terminate the process.
Where PSPM/2 does not perform well is during cases of system lockup. Since the program only responds to user requests, it relies on keyboard and/or mouse input. This renders the program useless when user I/O is not possible. As a result, if your new programs locks up the system you need to reboot or make use of a different utility that allows you to recover from these situations if repeated pressing of Ctrl-Esc doesn't work.
Another situation where PSPM/2 can cause problems occurs when it is used (at least on my system) to shut down PMSHELL in an attempt to reboot the Workplace Shell. This caused a blank desktop to appear with a loss of keyboard and mouse response and required a reboot of my system. Its effect on other WPS applications is unknown and would require further testing to determine its suitability for closing misbehaved WPS programs that you may be writing. Since OS/2 can behave quite differently with individual installations other users may get different results and if so I would be interested in hearing about them.
Configuration of PSPM/2 is very simple. The user has one pull- down menu from which settings such as default font, window position and size, colours and refresh rate may be selected. The settings may be changed for a single session only by declining to save the selected options. There is no online help but everything is pretty straight-forward so the lack of built-in documentation should not pose problems.
Overall, PSPM/2 is a nice little utility. The graphical, tree-like display provides an easy and quick way to view which processes are running. Viewing information about or termination of a process is simply a matter of clicking on the process name. As a programming aid, it has saved me much time by allowing me to close test applications by eliminating the need to reboot. While not the only utility of this type, it is a simple and effective tool well worth the storage space it takes up on your disk.
EditINI is a simple tool that may be useful to those who create programs that modify either the OS2.INI or OS2SYS.INI files. Being even less complex than PSPM/2 this review will be short.
EditINI allows the user to view, add, modify or delete information from the OS2 and OS2SYS INI files. The PM interface makes it easy to use. You select which of the INI files you wish use from one of two radio buttons, pick the application (from a drop down list-box) whose entries you wish to act upon, choose the "key name" (also from a list box) and view or modify the data under that key name.
This isn't a bad little utility if your applications make few modifications to the INI files, but for programs that make lots of additions to these files, EditINI, while still useful, can be time-consuming. There can (and probably will) be dozens of application entries and each application in turn can have many more entries in the "key names" and data fields. This isn't a problem when manually changing settings in the INI files, but can be time consuming when deleting all references to a program because the list boxes are of the style "single selection".
To make matters worse, after deleting an entry, the lists are reset to the top. Applications can only be deleted by first removing all "key names" (one at a time) and if an application has made many entries into the INI files it may take a while to remove all references to it because you have to find (again) the application name and then the key name from lists that can be fairly long.
If your program does make lots of entries, it may be best to create a separate INI file for use during the testing phase of development and then, when everything has been debugged, simply change the code to use the system INI files instead of an application-specific one. This won't work in all cases, as you may need to register new objects or data types etc., but placing as many profile items as possible into a separate file during development can save a lot of time. This way, if things don't go as they should, you can simply delete the new INI file and try again. As you can probably tell from this text, I'm a firm believer in the hit-and-miss approach!.
Where this program can be really convenient is when writing your first applications that read and write to the INI files. Since we all know it's safer to read from than to write to a file, you can use EditINI to make INI file entries manually, perfect the code that reads the information first and then worry about the code that writes information. For beginners this is ideal because it allows one to get some experience with the profile functions without the worry of destroying important system files. For the more advanced user, any information contained in the OS2 and OS2SYS INI files can be viewed, modified or deleted. Since there are too many to list, I'll assume you know what INI entries you need to access but rest assured that if it exists in these files, you can get at it with EditINI.
Despite having mentioned more dislikes than likes about this program, I do like it and would have had more good things to say if it weren't so simplistic. As a tool, especially for beginners, it is very useful and should be part of your collection.