Issue 56 * September 12 2008

Revolution 3.0 Favorite Features
A Users Perspective on Revolution 3

by David Simpson

This article lists some of my favorite new features and enhancements which have been incorporated into Revolution 3.0. I put together this little list because there are a few tips I have picked up while testing Revolution 3.0 (bernard) which might not be readily apparent. I am being specific by saying that these are some of my favorite features, knowing that each person has their own ideas of their own favorite features. So if there are some helpful new features which I have missed, please feel free to write an article and send it to the editor. I am sure that we can all benefit from seeing what other people think of as their own favorite features too.

David Simpson
www.fmpromigrator.com

New Script Editor

Script EditorWhen I first learned that the script editor was due for a rework, I didn't think too much about it. I understood the logic that the editor is where Revolution developers spend much of their time so that improvements to the editor pay big dividends for each user. I tend to be rather focused on my own development efforts so I previously didn't have complaints about the old editor. I have generally focused on new commands to the Revolution language and revDB functionality.

As I have used the new editor, it has become a real treat for me to experience these new features, which I wasn't even expecting or requesting.
You can see that I have annotated this screenshot using ScreenSteps by Blue Mango Learning Systems (a terrific documentation tool created with Revolution which I use continuously).
(1) Hander/Function list - It is helpful to be able to see at a glance all of the handlers and functions available within the context of the current editor tab. Clicking on a handler or function takes you directly to the the first line of code with a single click.

(2) Tabbed editing - I generally haven't been a big fan of the tabbed editing interface either in editors or web browsers. I guess you can call me old fashioned or something like that! But now that I have actually been using the new Revolution 3.0 editor for my production applications, I like the tabs quite a bit. There are some subtle and very helpful user interface elements working for us too in regards to the icons for the tabs. The colored dots give an idea whether a script is All Ok (and compiled), by displaying a green dot. The dot changes to yellow (3) if the handler/function has changes which haven't been compiled. And the dot changes to red(4) if the code has been compiled with an error. When you get the cursor close to one of the dots, a little "x" appears inside the dot to let you know that if you click the dot, and it will close the tab for you.

(5) Did you know that you can press the TAB key to reformat your code? Actually this feature existed in the 2.9 editor and I didn't even know it. I have used Jerry Daniels' GLX2 editor and I thought that using the TAB key for this task had originated with GLX2. And to think, that for a number of years I had kept selecting the "Format This Handler" menu item under the Script menu, when I could have simply pressed the TAB key. The "Format This Handler" menu item is no longer in the Scripts menu, but pressing the TAB key instantly reformats and indents the code so you have a better idea whether you are within a conditional block of code.

(6) The row of tabs at the bottom of the editor window provide info about Errors, Variables, Documentation, Breakpoints and Search Results. I have mainly used the first 3 of these tabs. I use the Variables tab extensively when debugging, and I frequently will click on a keyword in my code to bring up the dictionary entry for it so that I don't have to type it manually in the dictionary.

Syntax Coloring Improvements

Syntax ColoringAs you can see in this screenshot, the script is now properly indented and colorized after I pressed the TAB key.

Script colorization now occurs within the engine, and you can change the color scheme in the Revolution Preferences. With previous versions of Revolution, you had to select Colorize from the Script menu, and if you had thousands of lines of code, it would take some time to complete. But now the colorization is lightning fast, and in fact it is so fast that it happens in real-time as you are opening the scripts. Even with thousands of lines of code which I have in some sections of my applications, the process typically only takes a fraction of a second on a dual core CPU.
This also means that Revolution no longer has to store an htmlText colorized version of the script in the stack either. You never had to worry about your compiled apps getting larger as a result of htmlText versions of scripts, because the stand-alone builder removed them automatically. But if you had a lot of code in a stack and just wanted to email it to a friend as a stack file, then you might have seen a difference in size due to the extra copy of the script code.

Debugger Window Colorization

Debugger WindowBy default, Revolution sets the Debug background color to white. This means that if you set a breakpoint and then run your code, you won't see a difference in background color, it will still be white. But if you set the Debug background color to something like "Custard Yellow" then you will see an immediate visual clue as soon as you see your script displayed by the debugger. This can be a nice help as you are debugging to insure that you realize that you still stopped at a breakpoint, and not just seeing your script in regular editing mode.

Debugger in Use - with Custard Yellow Background

Debugger In Use(1) I have put a breakpoint statement into the mouseUp handler shown, and then clicked the button containing this handler. The breakpoint command has unconditionally entered the debugger and you can see that the editor window is Custard Yellow, as I set it in the Revolution Preferences. There are buttons across the top of the window to Continue, Stop, View Next Statement, Step Into Next Statement, Step Over Next Statement and Step Out of Current Handler.

(3) I have the Documentation tab selected below the editor window, so if I want to read more about the displayed command, I can either click the Full Document checkbox at the lower right corner (4) or click the Launch Documentation button.

Documentation Enhancements - Commands by Library

Commands by LibraryI feel that one of the important enhancements to Revolution 3.0 is the Dictionary part of the documentation. As an experienced developer, I spend most of my time using just one part of the Revolution documentation, and that is the Dictionary. The new Dictionary has not only been modernized with a whole new look and feel, but has also been reorganized to make the information more useful to new and experienced developers.

Lets say for instance, that I want to work with the database library, but I am not quite sure exactly which command I want to use. Or maybe I just want to browse the database library commands to get a general idea of the types of commands which are available. Previously, I needed to have an idea that most database commands start with "revDatabase" and then type this command in the search box. Well, that would have found many of the database library commands, but not all of them, because I would have missed revCloseCursor for instance.
Now, with Revolution 3.0, this is no longer a problem, because I can simply click on the disclosure triangle for the Library item and select the Library commands I want to browse, without missing any commands because I didn't get the prefix of the command correct.

But there is more.

Documentation Enhancements - Properties and Messages by Object Type

Properties by Object TypeFor many development environments, companies often print large wall posters listing properties, messages or attributes. I have wondered about whether a poster like this might also be helpful for Revolution developers, but never could find anything available. Well, wall posters be gone - they aren't needed now!

Clicking on the Object disclosure triangle, displays additional icons for each major object type in Revolution. Clicking on any object type, displays a list of the properties and messages available for the object. If there are a lot of items in the list, you can still filter the results with the search box in the upper right corner. For instance if you only want to see messages and not properties, just start typing "message" in the search box and the results will be filtered accordingly.
So this feature is much, much better than the analog equivalent in the form of a printed poster, as you can quickly bounce around, click on any object type and instantly see the information which is relevant to that particular object type. And you don't end up with sticky tape marks on your walls either.

Documentation Enhancements - Revolution Language Features

Language FeaturesHave you ever wondered which constants are available in Revolution? I usually just look at other pieces of example code and have learned what other people are using. Actually you could have typed the word "constant" into the old dictionary, but I didn't think about that until I was writing this article. Remember, I have my mind focused on developing my products! But now it is so easy to just click on the Constant item under the Language section and instantly have a list of all of the constants defined in Revolution - with no typing required. This section will likely be popular with new users who are coming to Revolution from other development environments and want to make a quick comparison with other programming languages. It is easy to see at a glance which Control Structures, Keywords, and built-in Functions are available.

Also, if you want to simulate the operation of the Revolution 2.9 Dictionary, just click the "All" item at the top of the list, and enter search text to filter the results.
Multi-Dimensional Arrays

I haven't yet used the new Multi-Dimensional array feature, but I am looking forward to using this feature in the future. I have occasionally had a need to implement an array of arrays type of data structure within my applications, and now I will be able to do this. To read more details about this welcome addition to the Revolution toolkit, please see the article by Trevor Devore in revUp #53.

Bug-Fixes

As with each updated version of Revolution, there have been many bug-Fixes which I greatly appreciate. In fact the few fixes I am listing here represented issues which were so important to my product's functionality that I compiled and shipped updated versions with the Revolution release candidate builds.

I have been making use of Revolution 3.0 revDatabase Library improvements which have been made for ODBC database connections. With Revolution 2.9, there was an issue writing data into ODBC databases, but reading data from ODBC database connections worked fine. This improvement in Revolution 3.0 means that I am able to start removing some of my work-around code from the FmPro Migrator application, which will eventually result in a savings of several Mb of program size. For my customers, it will mean a better user interface experience since I will be able to keep all of my database processing within Revolution without having to pop open an external window running a separate compiled data transfer application. The interface will be more user friendly and will give my users the opportunity to cancel the processing dialog, which is something I can't do when handing off control to an external application.

There was also a fix to an issue with MySQL database connections defaulting to Port 3306.

The launch URL command was having issues escaping some characters found in URLs like the "#" character which defines an anchor point on a web page. I use this feature to direct customers to the anchor point for a particular product on my ordering page. Ever since I added this feature to the trial versions of my software I noticed a significant drop in customers calling me to ask how to buy my software. The trial software opens a browser window and takes them directly to the exact place on the order page for them to place an order for the product, so that they can easily make a purchase.

For more details concerning the changes within this or any release of Revolution, check the Engine Change Log.txt and IDE Change Log.txt files within your Revolution installation directory.

Conclusion and Thanks...

In conclusion, I just want to say thanks to Kevin Miller, Mark Waddingham and the entire Revolution development team for all of their hard work delivering Revolution 3.0. In appreciation for their hard work, I am now using Revolution 3.0 full-time for all of my development projects. Yes, it really is that stable, and worthy to be used for production builds.

So a gentle reminder, to anyone who has allowed their updates subscription lapse, download Revolution 3.0 and see what you think. Revolution 3.0 is great reason to buy a new license or renew an updates subscription. I like to keep my subscription current because I realize how important this revenue is for continuing the development of each new version of Revolution.

Main Menu What's New