Contents

As expected, REALbasic was well able to implement the project, and initial development went smoothly. The user interface for the settings panel was simple to set up. REALbasic doesn’t support multiple displays in a single window the way Revolution does, so a tab panel was used. In development, dragging a control onto a tab panel object associates that control with the current tab of the tab panel. This worked well, but a more complex setup would be difficult to implement in REALbasic. The listbox, another standard interface component, served well to display the results. Setting up a thread object to process the files and display results properly was the largest issue.

REALbasic’s development environment can be cumbersome and restrictive. Allowing the user to pause and resume the process required setting up a thread object (described below). Configuring the thread to be able to interact with the application’s main window involved setting up over a dozen custom properties, each of which required going through a dialog to enter their declaration. Likewise, the pushbuttons that start the process had to be coded to set the properties in the thread. Autocompletion helped, but only slightly.

Further complicating the process, the development environment allows only one code window open at a time. The code for the thread object, which does most of the processing, broke down into five main routines. Flipping back and forth repeatedly between the five routines slowed development. The inability to look at two routines together also invites developer error. Creating common variables (the equivalent of globals) for the routines involved more custom properties, which again required going through a dialog to enter their declaration. One final handicap is that REALbasic only checks syntax when a project is run, making it more difficult to spot-check code as it is being written. On the plus side, REALbasic validates object references across the entire project, reducing the risk of runtime errors.

Strict variable typing further slowed development. Whenever a new temporary variable was needed — as a loop counter, for example — it was necessary to scroll back to the top of the code window, add the Dim command for the variable, and then scroll back to where the variable was needed. This provides a strong incentive to keep routines short!

REALbasic has no regular expression support in version 3.2.1, so an alternative was needed for the tag search. The result isn’t as flexible as the example application developed in Revolution, but it works well. (Version 3.5, now available, adds regular expression support, which will allow the REALbasic version of the application to achieve feature parity with the Revolution version. Adding this feature to the REALbasic version would take about two hours and ten additional lines of code.)

REALbasic doesn’t handle paths the same way across platforms16. This was fairly easy to bypass using folderItem objects, although that had an impact on performance.

The actual processing of files, including setup, file processing, display, log file creation, and the ability to stop and resume the process took just over 180 lines of BASIC. Although REALbasic compiles small projects in seconds, it is still necessary to compile, run, and set up the application for each test. To test the example application required seven steps: run the project, click to dismiss the splash screen, switch to the settings panel, choose a folder to process, choose a log file, switch to the processing panel, and click the start button. Developing the example application required going through those seven steps roughly fifty times, adding significantly to the development effort.

The quick reference proved invaluable during development, with enough clear information to avoid having to refer to the general documentation. (However, the quick reference does point out a difficulty with REALbasic’s object-oriented approach: It’s difficult simply to understand one piece of the environment. For example, to understand how a PushButton control works, it is necessary to first read and understand how a Rect control works, and further, how a generic Control works.)

The PC version had minor layout and color issues, and one functional issue: it didn’t work. The same code that ran properly in the development environment and in an application compiled for the Macintosh failed to function when compiled onto Windows, even when given the same directory to operate on. This resulted in several hours of a painstaking development cycle of code/compile/transfer to the PC/run/test, with no debugging tools on Windows to assist. After several modifications unrelated to the debugging effort were made, the application began to function on Windows.

Later in the development process, the Windows problem returned. With no built-in ability to debug on Windows, it was necessary to write additional code specifically to report on the status of variables and on progress through the code; compile an application; transfer the application to a Windows computer; and run the code there.

After an hour of this, the third version of the application with added-on debugging code led to discovery of the issue, which was line delimiters. On the Macintosh, lines end with a carriage return. On Windows, lines end with a carriage return followed by a linefeed. The list of filename extensions to look for is specified in a text field. On Windows, the fact that the filename extensions have a carriage return and a linefeed between them was causing all files to fail to match. It remains unclear why the problem first appeared and then went away.

After code was added to use a carriage return and a linefeed on the PC, the files processed correctly, but the application stalled and failed to complete its work. This turned out to be a consequence of the way work to be done was stored. Converting everything in the application to use a carriage return/linefeed combination on PCs had broken previously functional code. Although the problem only occurred on the PC, knowing what had been changed made it easy enough to find the problem.

Previous

Revolution and REALbasic: A Comparison

Next