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.

 

Community Search:
MacTech Search:

Software Updates via MacUpdate

Latest Forum Discussions

See All

Fresh From the Land Down Under – The Tou...
After a two week hiatus, we are back with another episode of The TouchArcade Show. Eli is fresh off his trip to Australia, which according to him is very similar to America but more upside down. Also kangaroos all over. Other topics this week... | Read more »
TouchArcade Game of the Week: ‘Dungeon T...
I’m a little conflicted on this week’s pick. Pretty much everyone knows the legend of Dungeon Raid, the match-3 RPG hybrid that took the world by storm way back in 2011. Everyone at the time was obsessed with it, but for whatever reason the... | Read more »
SwitchArcade Round-Up: Reviews Featuring...
Hello gentle readers, and welcome to the SwitchArcade Round-Up for July 19th, 2024. In today’s article, we finish up the week with the unusual appearance of a review. I’ve spent my time with Hot Lap Racing, and I’m ready to give my verdict. After... | Read more »
Draknek Interview: Alan Hazelden on Thin...
Ever since I played my first release from Draknek & Friends years ago, I knew I wanted to sit down with Alan Hazelden and chat about the team, puzzle games, and much more. | Read more »
The Latest ‘Marvel Snap’ OTA Update Buff...
I don’t know about all of you, my fellow Marvel Snap (Free) players, but these days when I see a balance update I find myself clenching my… teeth and bracing for the impact to my decks. They’ve been pretty spicy of late, after all. How will the... | Read more »
‘Honkai Star Rail’ Version 2.4 “Finest D...
HoYoverse just announced the Honkai Star Rail (Free) version 2.4 “Finest Duel Under the Pristine Blue" update alongside a surprising collaboration. Honkai Star Rail 2.4 follows the 2.3 “Farewell, Penacony" update. Read about that here. | Read more »
‘Vampire Survivors+’ on Apple Arcade Wil...
Earlier this month, Apple revealed that poncle’s excellent Vampire Survivors+ () would be heading to Apple Arcade as a new App Store Great. I reached out to poncle to check in on the DLC for Vampire Survivors+ because only the first two DLCs were... | Read more »
Homerun Clash 2: Legends Derby opens for...
Since launching in 2018, Homerun Clash has performed admirably for HAEGIN, racking up 12 million players all eager to prove they could be the next baseball champions. Well, the title will soon be up for grabs again, as Homerun Clash 2: Legends... | Read more »
‘Neverness to Everness’ Is a Free To Pla...
Perfect World Games and Hotta Studio (Tower of Fantasy) announced a new free to play open world RPG in the form of Neverness to Everness a few days ago (via Gematsu). Neverness to Everness has an urban setting, and the two reveal trailers for it... | Read more »
Meditative Puzzler ‘Ouros’ Coming to iOS...
Ouros is a mediative puzzle game from developer Michael Kamm that launched on PC just a couple of months back, and today it has been revealed that the title is now heading to iOS and Android devices next month. Which is good news I say because this... | Read more »

Price Scanner via MacPrices.net

Amazon is still selling 16-inch MacBook Pros...
Prime Day in July is over, but Amazon is still selling 16-inch Apple MacBook Pros for $500-$600 off MSRP. Shipping is free. These are the lowest prices available this weekend for new 16″ Apple... Read more
Walmart continues to sell clearance 13-inch M...
Walmart continues to offer clearance, but new, Apple 13″ M1 MacBook Airs (8GB RAM, 256GB SSD) online for $699, $300 off original MSRP, in Space Gray, Silver, and Gold colors. These are new MacBooks... Read more
Apple is offering steep discounts, up to $600...
Apple has standard-configuration 16″ M3 Max MacBook Pros available, Certified Refurbished, starting at $2969 and ranging up to $600 off MSRP. Each model features a new outer case, shipping is free,... Read more
Save up to $480 with these 14-inch M3 Pro/M3...
Apple has 14″ M3 Pro and M3 Max MacBook Pros in stock today and available, Certified Refurbished, starting at $1699 and ranging up to $480 off MSRP. Each model features a new outer case, shipping is... Read more
Amazon has clearance 9th-generation WiFi iPad...
Amazon has Apple’s 9th generation 10.2″ WiFi iPads on sale for $80-$100 off MSRP, starting only $249. Their prices are the lowest available for new iPads anywhere: – 10″ 64GB WiFi iPad (Space Gray or... Read more
Apple is offering a $50 discount on 2nd-gener...
Apple has Certified Refurbished White and Midnight HomePods available for $249, Certified Refurbished. That’s $50 off MSRP and the lowest price currently available for a full-size Apple HomePod today... Read more
The latest MacBook Pro sale at Amazon: 16-inc...
Amazon is offering instant discounts on 16″ M3 Pro and 16″ M3 Max MacBook Pros ranging up to $400 off MSRP as part of their early July 4th sale. Shipping is free. These are the lowest prices... Read more
14-inch M3 Pro MacBook Pros with 36GB of RAM...
B&H Photo has 14″ M3 Pro MacBook Pros with 36GB of RAM and 512GB or 1TB SSDs in stock today and on sale for $200 off Apple’s MSRP, each including free 1-2 day shipping: – 14″ M3 Pro MacBook Pro (... Read more
14-inch M3 MacBook Pros with 16GB of RAM on s...
B&H Photo has 14″ M3 MacBook Pros with 16GB of RAM and 512GB or 1TB SSDs in stock today and on sale for $150-$200 off Apple’s MSRP, each including free 1-2 day shipping: – 14″ M3 MacBook Pro (... Read more
Amazon is offering $170-$200 discounts on new...
Amazon is offering a $170-$200 discount on every configuration and color of Apple’s M3-powered 15″ MacBook Airs. Prices start at $1129 for models with 8GB of RAM and 256GB of storage: – 15″ M3... Read more

Jobs Board

*Apple* Systems Engineer - Chenega Corporati...
…LLC,** a **Chenega Professional Services** ' company, is looking for a ** Apple Systems Engineer** to support the Information Technology Operations and Maintenance Read more
Solutions Engineer - *Apple* - SHI (United...
**Job Summary** An Apple Solution Engineer's primary role is tosupport SHI customers in their efforts to select, deploy, and manage Apple operating systems and Read more
*Apple* / Mac Administrator - JAMF Pro - Ame...
Amentum is seeking an ** Apple / Mac Administrator - JAMF Pro** to provide support with the Apple Ecosystem to include hardware and software to join our team and Read more
Operations Associate - *Apple* Blossom Mall...
Operations Associate - Apple Blossom Mall Location:Winchester, VA, United States (https://jobs.jcp.com/jobs/location/191170/winchester-va-united-states) - Apple Read more
Cashier - *Apple* Blossom Mall - JCPenney (...
Cashier - Apple Blossom Mall Location:Winchester, VA, United States (https://jobs.jcp.com/jobs/location/191170/winchester-va-united-states) - Apple Blossom Mall Read more
All contents are Copyright 1984-2011 by Xplain Corporation. All rights reserved. Theme designed by Icreon.