TweetFollow Us on Twitter

Runtime Revolution: Programming for Mere Mortals

Volume Number: 20 (2004)
Issue Number: 5
Column Tag: Review

Review: Runtime Revolution, Programming for Mere Mortals

by Dan Shafer

This program has its roots in HyperCard, but its reach is stratospheric (First in a series of four articles)

Who Cares?

I can hear you now. "Oh, goodie. Yet another programming language. Just what we need. What do I need with another language? Isn't [insert your personal favorite language du jour here] good enough?" Leaving aside for the moment the question of why any serious software developer would confine him or herself to a single programming language, let's just say that if you want to develop Mac Classic and OS X applications that also happen to run virtually unchanged on Windows and *nix platforms, Revolution may just be the sweetest thing that's happened to you in a long, long time.

If you're a seasoned professional programmer who writes only for the Macintosh, you may still find Revolution a useful tool. You can use it to prototype user interfaces quickly, turn those prototypes into demos for users to evaluate as you rapidly modify the UI in response to user feedback.

If you're one of perhaps hundreds of thousands of people I call Inventive Users, you're going to love the ease of programming and application design in Revolution as well as the way it gets along with corporate databases, the Web, and rich media. (Inventive Users are people who don't program for a living but who are willing to take time to learn an accessible scripting language and use it to create applications they or their departments need or want.)

What Is Revolution?

Revolution, a product of Edinburgh, Scotland-based Runtime Revolution Ltd., grows out of HyperCard, a much-beloved and widely used Apple Computer product that the company abandoned a few years ago, much to the chagrin of tens of thousands of its customers, including some of the biggest companies in the world. HyperCard ran only on Macintoshes and was a strictly black-and-white application for most of its life. When color was added, near the end of the HyperCard life cycle, it was not well thought out and never worked very well.

Scott Raney loved HyperCard but he needed something like it to run on Unix. So he set about to develop a HyperCard-like product for his platform of choice and wound up creating the MetaCard engine, about 10 years ago. Kevin Miller and his Scottish cohorts licensed the MetaCard engine, put a more robust and attractive programming UI on it and extended it in some other crucial ways, marketing the result as Revolution. Recently, Runtime Revolution acquired MetaCard and Raney now works for the engine's new owners.

Revolution combines a powerful, graphical IDE (integrated development environment) with a highly accessible programming language called Transcript to create a platform for developing a broad range of software applications that will run virtually unchanged on Mac Classic, OS X, every flavor of Windows currently supported by Microsoft (and some that aren't) and many versions of *nix, including the widely popular Linux. Applications are in color, take full advantage of native UI widgets as much as possible, and offer performance comparable to Java and Basic applications.

In fact, I like to call Revolution Java without the Java. Revolution delivers on the promise of true cross-platform development better than Java in my experience, and does so at a fraction of the programming time and effort.

A Quick Tour

Over the next four months, I'll give you a pretty good handle on Revolution and the Transcript programming language. In this starter piece, I'll walk through an overview of both the IDE and Transcript, just to give you a flavor for it. By the time we're done with the series, you'll be able to develop fairly complex -- or at least interesting and useful -- applications on your own.

(You can download a 30-day free trial version of Revolution at the company's Web site at http://www.runrev.com. That version will be perfectly suited for this set of articles, but, of course, it will expire before all the articles have run. Revolution offers an inexpensive version of the product, however, that you can use to complete your tour.)

Walking Through the IDE

When you launch Revolution, you will see a desktop much like the one shown in Figure 1.


Figure 1. Default opening Revolution desktop showing standard IDE

I've rearranged the elements of the screen from the way they may appear on your system, to accommodate a smaller figure. You can see three of the most important tools in the Revolution IDE:

the toolbar, which appears at the top of the screen in a fixed location and houses buttons to access commonly needed tools in the IDE

the tools palette, a floating window shown on the left of the screen in Figure 1, from which you choose tools to lay out windows and create graphics

the Application Browser, which can be resized and relocated and which acts as a way to navigate within and inspect the objects in a Revolution application or window

There are several other tools in the IDE but two are particularly worth a few moments' time at the outset of your learning experience. One is the message window, which you can cause to appear by typing Command-M, selecting the Message Box tool from the toolbar, or selecting the Message Box item from the Tools menu. The other interesting tool is the extensive online documentation in Revolution.

The Message Box is an interactive programming window. Any Transcript code you type into the top portion of the Message Box will execute exactly as it will in your finished application. I love programming environments that provide this kind of support; in fact, I do not enjoy coding in development tools that don't allow me to try out code quickly and interactively.

Open the Message Box and type put "Hello, Universe" into the top portion. Press Return. Your result should look something like Figure 2.


Figure 2. Revolution's Message Box is an interactive programming window

The put command places its argument into the bottom portion of the Message Box, even when the command is executed from inside a Revolution script. You can type multiple commands into the Message Box and the result, if you create one, will still appear in the bottom pane of the Message Box, as you can see in Figure 3. You just have to separate commands with semicolons.


Figure 3. Multiple lines of code in Message Box

The Message Box is actually fairly powerful in its own right but I don't want to take time to go into all of its features here or we'll run out of room for the rest of this overview.

Online documentation in Revolution is better than that in any programming environment I've worked with in a long time. Click on the Documentation icon in the Tool Bar and you'll see the interactive table of contents for the online documentation, shown in Figure 4.


Figure 4. Table of Contents for online Revolution documentation

As you can see, the online documentation includes a full-text search capability, a product overview, several tutorials, a complete dictionary of Transcript, a cookbook of ready-made code examples, and a number of other useful elements. Click on the Transcript Language Dictionary option and you'll see a window something like Figure 5.


Figure 5. Opening page of Transcript Language Dictionary

Selecting a Transcript language element from the scrolling list opens another window with complete documentation (see Figure 6) including syntax, examples, and detailed explanations of when and how to use the element and what to expect when you do. Each such window also has a "See Also" menu which is often quite useful in helping you locate the precise command or other language element you need.


Figure 6. Sample documentation page

Figure 6 shows the full syntax for the put command, provides five examples of its use, tells you when and where to use it, defines its parameters, and offers comments that describe details of its use in certain situations. Using the printer icon in the upper right corner of this window prints a nicely formatted set of pages containing the documentation.

Let's take a quick look at how to use the interactive documentation to learn to do something a bit more conventional for our first Transcript program. Click the "Roadmap" button near the bottom right corner of the open documentation window. This takes you back to the table of contents. Now click on the Search the Documentation link. We want to put the "Hello, Universe" message in a dialog box rather than having it appear in the Message Box. Type "dialog box" (without the quotation marks) into the search box and click on the Search button. The result looks like Figure 7.


Figure 7. Documentation search for "dialog box"

We want to learn how to do something, so let's scroll down to where the "How To" items are sorted together. Sure enough, there's an entry called "How to display a dialog box." Click on that entry and you see the documentation shown in Figure 8.


Figure 8. Documentation describing how to display a dialog box

A quick read of the first paragraph tells us we want to use the answer command because we're not asking the user for any text when we display our greeting message. Now, click on the word "answer" in the documentation (the fact that the term is bolded means it's a link to further documentation). Sure enough, up pops the Transcript dictionary entry for the answer command, shown in Figure 9.


Figure 9. Documentation for answer command

Reading the comments, we find that if we don't supply any button names after a with key word, Revolution supplies the user with a simple "OK" button. That's exactly what we want, so let's try using the Message Box again. Enter the command answer "Hello, Universe!" and press Return. The result is shown in Figure 10.


Figure 10. An answer dialog box created from the Message Box

(You can control the icon displayed in the dialog box, but we don't have time to go into that in this article.)

The Tools Palette and Window Layout

One of the coolest features in Revolution -- which is not dissimilar in this respect to other graphical IDEs -- is the ability to lay out and design windows using simply drag-and-drop or select-and-click operations starting in the Tools Palette.

The Tools Palette includes tools for the quick and easy creation of the following UI elements:

  • four types of buttons (standard push buttons, tabbed buttons, radio buttons, and checkbox buttons)

  • five types of fields (regular, scrolling, list, scrolling list, and uneditable labels)

  • scrollbars (vertical and horizontal)

  • report objects (for compiling and generating printed reports)

  • three types of menus (popup, pulldown and option/combo-box)

  • menu items

  • seven basic graphical shapes as well as polygons

  • image objects

  • QuickTime player objects

This does not, by the way, exhaust the types of UI components Revolution supports. The New Control submenu of the Object menu lists a number of specialized versions of some of these controls.

To use these controls, you need a window in which to work. In Revolution, you create the first window in each application by selecting New Mainstack from the File menu. A new, blank window appears. Now you can click on an object in the Tools Palette and then click in the window to create an object of the chosen type using its default size. There are other ways of creating new components in the window, but we'll stay with this one for this article.

Figure 11 shows a window with a single button and a single field. You can create this, if you're following along, simply by clicking on the button tool in the Tools Palette and then clicking in the window. Drag the newly created button to its desired location, then do the same with a field.


Figure 11. Sample window with one button and one field

Quick Overview of the Transcript Language

Now that we have a window with two objects in it and we know a little about how to display a dialog box with information for the user, let's take a very quick peek at the Transcript language and turn our little window into an application that has at least some marginal utility.

Programming in Transcript consists of creating scripts that are associated with objects. Scripts, in turn, contain one or more handlers, each of which is designed to respond to a particular message sent around the Revolution system. A handler always begins with the keyword on, followed by the name of the message to which the handler is designed to respond. For example, if you want to write a script with a handler that does something when the user clicks the mouse, you write a handler that starts with the words on mouseUp, since mouseUp is the name of the Revolution message that gets sent when the user releases the mouse over the same object he pressed the mouse. The handler must close with the keyword end followed by the message name, in this case end mouseUp. Between those two lines you put the code you want Revolution to execute when the object whose script you are writing receives the message.

That's really almost all there is to the Revolution programming model. There is a hierarchy of objects through which messages travel so that you can decide at what level to intercept and respond to a message, and you can create your own custom messages with corresponding handlers, but those are refinements of the basic idea.

OK, back to our little window. We know how to use an answer dialog to display some hard-coded text to the user. Let's shift the design just a bit and make the process more dynamic. We'll design this little application so that, whatever the user types into the field, gets displayed in an answer dialog box.

First, we need to know the name of the field so we can tell Transcript where to get the contents to display in the answer dialog. Select the field and double-click on it. That opens its Property Inspector (see Figure 12), which is where you can control virtually every property or aspect of the field's appearance. The information we want, the name of the field, is right there for us to read. It's called "Field 1."


Figure 12. Property Inspector for field

Now we just need to write a handler in the button's script that will display the contents of the field when the mouse is clicked on the button. To do so, we have to open a script editor for the button. There are a number of ways to do this, but for now, just select the button and then hold down the Option and Command keys simultaneously. The editing window opens, ready for us to write a handler in the button's script.

Just as a guess, let's try this handler:

on mouseUp
   answer field 1
end mouseUp

In the script editing window, when you type on mouseUp, notice that Transcript supplies the handler-ending statement and positions your cursor correctly for the first line of executable code.

When you're done, hit the Apply button and close the script editor.

Now, switch from the selection tool to the browse tool (the hand in the upper left of the Tools Palette), type some text into the field, and press the button. The result should look something like Figure 13.


Figure 13. Dialog box containing text of field in sample window

You can insert carriage returns into the text in Field 1 and the dialog box will format it exactly as you enter it.

Many objects you create in Revolution applications will have more than one handler in their scripts. The Transcript editor provides you with tools to focus on one handler at a time, see all the handlers in a script, navigate directly to the one you want, and several other helpful tools that make scripting even fairly complex objects simple and approachable.


Revolution at a Glance for HyperCard Scripters

If you have experience developing Mac "stackware" using HyperCard, you'll be right at home in Revolution and Transcript. But you'll feel like your "home" got a huge upgrade. Here are some of the key features in Revolution that HyperCard developers will welcome with open arms, it not joyous weeping.

  • True, native color

  • High-performance script execution that removes the need for most XCMD and XFCN resources you needed with HyperCard

  • Cross-platform delivery; you can create applications on your beloved Mac and sell them to people who are still stuck with Windows. Linux is supported as well.

  • External database access. While you can still store data in your Revolution stacks (with a slight twist in design), you can also interact directly with SQL databases, information stored in external files, and the entire Internet.

  • Great support for Internet protocols makes it possible for you to build Web-aware software without mastering the intricacies of the protocols themselves.

  • A scripting language that contains about five times as many commands, keywords, and other language elements as HyperTalk, yet retains the approachable syntax and much of the forgiveness of HyperTalk.

  • Conversion of existing HyperCard stacks. With a little preparation, almost any HyperCard stack that doesn't use window-management externals can be ported to run in Revolution.

  • Virtually every HyperTalk command works as you expect it to in Transcript. There's even support for some language elements that are no longer relevant so that those commands won't break if you use them in new or imported stacks.

There's a lot more. The Revolution folks have thoughtfully provided a special document that delineates in great detail the similarities and differences for HyperCard and SuperCard developers. I highly recommend reading those documents before you attempt any work in Revolution; it'll save you a lot of fumbling around with things that almost work as you expect, but not quite.


Dan Shafer is a freelance writer and software developer who wrote some of the most widely read books about HyperCard and other Macintosh programming technologies over the past 15 years. He is the author of more than 60 books on computing and high technology. His most recent title is Revolution: Software at the Speed of Thought, published by Revolution Press and designated the product's official third-party book. The first of the three-volume set was released at MacWorld Expo in San Francisco earlier this year. He also hosts RevolutionPros.com, a members-only Web site for Revolution users. You can reach him at dan@shafermedia.com.

 
AAPL
$517.96
Apple Inc.
-3.72
MSFT
$39.75
Microsoft Corpora
+0.57
GOOG
$536.44
Google Inc.
+3.92

MacTech Search:
Community Search:

Software Updates via MacUpdate

Starcraft II: Wings of Liberty 1.1.1.180...
Download the patch by launching the Starcraft II game and downloading it through the Battle.net connection within the app. Starcraft II: Wings of Liberty is a strategy game played in real-time. You... Read more
Sibelius 7.5.0 - Music notation solution...
Sibelius is the world's best-selling music notation software for Mac. It is as intuitive to use as a pen, yet so powerful that it does most things in less than the blink of an eye. The demo includes... Read more
Typinator 5.9 - Speedy and reliable text...
Typinator turbo-charges your typing productivity. Type a little. Typinator does the rest. We've all faced projects that require repetitive typing tasks. With Typinator, you can store commonly used... Read more
MYStuff Pro 2.0.16 - Create inventories...
MYStuff Pro is the most flexible way to create detail-rich inventories for your home or small business. Add items to MYStuff by dragging and dropping existing information, uploading new images, or... Read more
TurboTax 2013.r17.002 - Manage your 2013...
TurboTax guides you through your tax return step by step, does all the calculations, and checks your return for errors and overlooked deductions. It lets you file your return electronically to get... Read more
TrailRunner 3.8.769 - Route planning for...
Note: While the software is classified as freeware, it is actually donationware. Please consider making a donation to help support development. TrailRunner is the perfect companion for runners,... Read more
Flavours 1.1.10 - Create and apply theme...
Flavours is a Mac application that allow users to create, apply and share beautifully designed themes. Classy Give your Mac a gorgeous new look by applying delicious themes! Easy Unleash your... Read more
Spotify 0.9.8.296. - Stream music, creat...
Spotify is a streaming music service that gives you on-demand access to millions of songs. Whether you like driving rock, silky R&B, or grandiose classical music, Spotify's massive catalogue... Read more
SlingPlayer Plugin 3.3.20.475 - Browser...
SlingPlayer is the screen interface software that works hand-in-hand with the hardware inside the Slingbox to make your TV viewing experience just like that at home. It features an array of... Read more
S.M.A.R.T. for USB and FireWire Drives 0...
S.M.A.R.T. for USB and FireWire Drives is a kernel driver for OS X external usb or firewire drives. It extends the standard driver behaviour by providing access to drive smart data. The interface to... Read more

Latest Forum Discussions

See All

148Apps Live on Twitch: Pivvot’s Looper...
On our latest Twitch stream, we’ll be playing a pair of minimalist arcade games, one that just got a big content update in Pivvot, and another that was inspired by it in 15 Coins. Whitaker Trebella, creator of Pivvot, will discuss the new modes... | Read more »
Word Cubes Review
Word Cubes Review By Jordan Minor on April 15th, 2014 Our Rating: :: SQUARESVILLEUniversal App - Designed for iPhone and iPad Word Cubes is fine, but it is barely any different from any other word game.   | Read more »
PAX East 2014 – Desert Fox: The Battle o...
PAX East 2014 – Desert Fox: The Battle of El Alamein is Coming to iOS Soon Posted by Rob Rich on April 15th, 2014 [ permalink ] Shenandoah Studio has become one of the go-to developers for war games on iOS, with | Read more »
Tank of Tanks Review
Tank of Tanks Review By Carter Dotson on April 15th, 2014 Our Rating: :: TANKS A LOT!iPad Only App - Designed for the iPad This multiplayer game played on a single iPad is simple, chaotic fun.   | Read more »
PAX East 2014 – Dungeon of the Endless J...
PAX East 2014 – Dungeon of the Endless Just Might Have a Shot at an iPad Release Posted by Rob Rich on April 15th, 2014 [ permalink ] I think it’s fair to say that | Read more »
SideSwype Review
SideSwype Review By Carter Dotson on April 15th, 2014 Our Rating: :: ON YOUR SIDEUniversal App - Designed for iPhone and iPad SideSwype is a puzzler that takes inspiration from Threes, but becomes its own incredibly fun game.   | Read more »
PAX East 2014 – Bigfoot Hunter Invites P...
PAX East 2014 – Bigfoot Hunter Invites Players on a Wild and Wooly Photo Safari Posted by Rob Rich on April 15th, 2014 [ permalink ] Yeti. Sasquatch. Wendigo. | Read more »
Dungeon Quest Review
Dungeon Quest Review By Cata Modorcea on April 15th, 2014 Our Rating: :: NO STORY, BUT GOOD FUNUniversal App - Designed for iPhone and iPad Dungeon Quest does a lot of things right, but ultimately forgets about one of the core... | Read more »
Tempo AI and Speek Join Forces to “Kill...
Tempo AI and Speek Join Forces to “Kill the Conference Call PIN” Posted by Rob Rich on April 15th, 2014 [ permalink ] Today Tempo AI, makers of Tempo Smart Calendar, and | Read more »
Fighting Fantasy: Starship Traveller Rev...
Fighting Fantasy: Starship Traveller Review By Jennifer Allen on April 15th, 2014 Our Rating: :: A SIGNIFICANT VOYAGEUniversal App - Designed for iPhone and iPad Continuing the release of Fighting Fantasy titles, Starship Traveller... | Read more »

Price Scanner via MacPrices.net

Save $50 on Mac mini Server
B&H Photo has the 2012 Mac mini Server on sale for $949 including free shipping plus NY sales tax only. Their price is $50 off MSRP. Read more
PhatWare’s “Ultimate Writing App For iOS” Ren...
PhatWare Corp. has announced it has renamed its new WritePro word processing app for iPhone and iPad: WritePad Pro. The decision to change the app’s name to leverages the strong brand awareness and... Read more
Full Resolution Photo Editor Tint Mint 1.0 Re...
California based independent developer, Jeffrey Sun, creator of the iOS app Modern Editor, has released Tint Mint, a new photography app for editing enthusiasts. The app costs a dollar, and it packs... Read more
16GB iPad mini (Apple refurbished) available...
The Apple Store has refurbished 1st generation 16GB iPad minis available for $249 including free shipping. Both black and white models are available. Read more
Save $120 on the 27-inch 3.2GHz Haswell iMac
B&H Photo has the 27″ 3.2GHz iMac on sale for $1679.99 including free shipping plus NY sales tax only. Their price is about $120 off MSRP. Read more
Using a Mac Doesn’t Eliminate The Heartbleed...
Low End Mac’s Dan Knight notes that any time you visit a website with an https: prefix or see that secure lock icon on your browser, some type of security software is busy trying to protect your data... Read more
AirPrint Basics Tutorial Posted
A new Apple Knowledge Base article helps get you started using AirPrint, the Apple protocol that enables instant printing from iPad, iPhone, iPod touch, and Mac without the need to install drivers or... Read more
Speed Tips For Running LibreOffice On The Mac
LibreOffice is my favorite of several free, open-source application suites, and the one I have configured on my Mac as my default app for Word documents that one frequently has to deal with. It also... Read more
Snag a 15-inch Retina MacBook Pro for $115 of...
B&H Photo has 2013 15″ Retina MacBook Pros on sale for up to $115 off MSRP for a limited time. Shipping is free, and B&H charges NY sales tax only: - 15″ 2.3GHz Retina MacBook Pro: $2489.99... Read more
MacBook Airs on sale for $50 to $100 off MSRP
Several resellers are offering $50-$100 discounts on 11″ and 13″ MacBook Airs today, including Amazon, Best Buy, B&H, and others. See the breakdown of deals on our MacBook Air Price Tracker,... Read more

Jobs Board

*Apple* Retail - Manager - SoHo - Apple (Uni...
Job SummaryKeeping an Apple Store thriving requires a diverse set of leadership skills, and as a Manager, you're a master of them all. In the store's fast-paced, dynamic Read more
Position Opening at *Apple* - Apple (United...
**Job Summary** Every day, business customers come to the Apple Store to discover what powerful, easy-to-use Apple products can do for them. As a Business Leader, Read more
Position Opening at *Apple* - Apple (United...
…challenges of developing individuals, building teams, and affecting growth across Apple Stores. You demonstrate successful leadership ability - focusing on excellence Read more
Position Opening at *Apple* - Apple (United...
…Summary** As a Specialist, you help create the energy and excitement around Apple products, providing the right solutions and getting products into customers' hands. You Read more
Position Opening at *Apple* - Apple (United...
**Job Summary** The Apple Store is a retail environment like no other - uniquely focused on delivering amazing customer experiences. As an Expert, you introduce people Read more
All contents are Copyright 1984-2011 by Xplain Corporation. All rights reserved. Theme designed by Icreon.