TweetFollow Us on Twitter

REALbasic Release 1

Volume Number: 14 (1998)
Issue Number: 10
Column Tag: Tools Of The Trade

Review: REALbasic Release 1

by Scott J. Anchin
Edited by the MacTech Magazine Editorial Staff

The Power and Simplicity of BASIC

For some time now, Macintosh developers have been searching for a Mac OS equivalent to Microsoft's popular Visual Basic. Enter REAL Software's REALbasic, a visual object-oriented development environment well suited for a variety of tasks ranging from RAD to full-scale commercial application development.

The Basics

REALbasic uses an object-oriented implementation of the BASIC (Beginners All-purpose Standard Instruction Code) language. Like all modern object-oriented programming languages such as C++ and Java, REALbasic uses classes, inheritance, properties and methods. This allows a simplified approach to programming by allowing code to be reused throughout a project. REALbasic's syntax is also highly compatible with that of Microsoft's Visual Basic, a similar (but in this author's opinion inferior) development tool. This allows developers accustomed to writing software on the PC to feel at home with REALbasic, a definite advantage to cross-platform software authors.

REALbasic supports automatic garbage collection, much like Java. This frees the developer from having to worry about memory management, which in and of itself takes up much of the development time when working with many other languages.

The IDE

The Interface

The IDE (Integrated Development Environment) contains all of the expected features in a small streamlined package. Occupying as little as 1.5 Mbytes of RAM, the IDE is blazing fast and incredibly simple to use. The IDE consists of six main components: the Toolbar, the Properties window, the Colors window, the Project window, the Code Editor, and the Debugger

Figure 1. The Toolbar and the Properties window.

The toolbar (see Figure 1) is located by default on the left side of the screen and contains a large number of colorful icons. Each icon designates a Control, which can be best described as an interface object such as a button, a tab panel, or a contextual menu. To add a Control to your project, simply drag the desired Control from the Toolbar to the desired window. Once the desired Control is positioned in the desired window, editing the code for a Control is as simple as double clicking on it.

The Properties window (see Figure 1) is located by default on the right side of the screen, opposite the Toolbar. It contains a variety of changeable settings that pertain to the operation, location, and appearance of the selected Control or window. While many of the settings can also be modified through code, the Properties window provides a convenient central location to specify default values for each of the specific Controls.

The Colors window provides the developer with a single location to store colors frequently used throughout the project. The Colors window is a small floating palette consisting of sixteen small squares, arranged in a four by four grid. Clicking on any one of these brings on screen the standard Mac OS color picker, from which one can then choose the desired color. At that point, the developer can drag the color from the Colors window into the Properties window to change the colors of various interface elements. This small but useful feature can save a great deal of time when dealing with application-wide custom colors.

Figure 2. The Project window.

The Project window (see Figure 2) provides the central location to view all of the elements comprising one's project, i.e. windows, classes, modules, AppleScripts, pictures, movies, shared libraries, and XCMD/XFCNs. To enhance organization, folders can be added to the Project window, and the aforementioned elements can then be placed inside of them. In order to access one of the listed elements of one's project, all that is required is a double click. As an added convenience, clicking once on the element concurrently displays pertinent information in editable form in the Properties window.

Figure 3. The Code Editor.

While much of the REALbasic developer's time is spent visually creating interfaces, a great deal of it is also spent in the Code Editor (see Figure 3), writing and tweaking code in order to attain perfection. The Code Editor is a two-paned window. The left pane is a hierarchical listing of all Controls along with their related events, the events for the window, menu handlers, methods, and properties. With the exception of properties, clicking on any one of these items displays its source in the right pane; properties can be edited by double clicking on their specific names. The Code Editor supports auto indenting, keyword highlighting, and auto completion, resulting in code that is easy to read as well as easy to write. The Code Editor also supports contextual menus which serve the same function as the left pane and are often more convenient. The two panes in the Code Editor are also resizable, allowing the developer to tailor the display to their unique tastes.

The final main component of the REALbasic IDE is the Debugger. Just as with all powerful debuggers, REALbasic's supports breakpoints, step over, step in, and step out. When running your application in the IDE, two windows are displayed in the background: a Variables window and a Stack window. The Variables window displays the current values of one's variables and has a simple object viewer. The Stack window displays the current stack so as to help the developer detect any memory leaks or other memory-related bugs. The debugger is a solid and necessary portion of the REALbasic IDE and is truly useful in tracking down and squashing bugs.

Its Runtime!

After spending hours developing your interface and code, it is time to test your budding killer app. When the developer chooses to run their application from within the IDE (with a simple "Run" menu command), REALbasic brings its advanced, dynamically recompiling compiler into action. This is described as having "all the benefits of an interpreter, while running at fully compiled speed," i.e. every time the developer runs his or her application, REALbasic recompiles it instantly. This provides the speed and versatility of a HyperCard-like interpreter, while allowing the application to run just as any compiled C++ application would.

If You Build It, They Will Come

When it comes time to compile an application and show it to the world (or at least to some beta testers), REALbasic's Build dialog (see Figure 4) comes into play. This dialog houses all information relevant to a final application, including its name, icon, and version information. It also lets one specify whether they want a 68k app, a PowerPC app, or a FAT app. Compiling a PowerPC app also has an additional option: Compress. Compressing a PowerPC app applies a proprietary resource compression scheme which cuts the size of the application dramatically while allowing it to retain full speed despite requiring only an additional 600 kbytes of RAM. Clicking on the Build button compiles the application and places it in the same folder as the project file.

Figure 4. The Build dialog.

It should be noted that, unlike many similar languages, REALbasic compiles applications to machine code; it does not use an interpreter. Thus, REALbasic applications require less RAM, less hard disk space, and run considerably faster than one might expect.

Create Truly Powerful Mac OS Apps

Advanced Features

REALbasic allows the developer access to a wide variety of features without the need to delve into the toolbox. With support for a number of industry and Apple standard features, REALbasic makes it easy to create truly powerful Mac OS apps.

Game developers will appreciate REALbasic's advanced sprite engine. Based on SpriteWorld, it is fast, efficient, and simple to use. With complete control over virtually every aspect of sprites, the developer is freed of virtually all creative limitations. Using the sprite engine also creates animations which are flicker free, thereby creating a professional appearance.

REALbasic's graphics support is also very powerful. With support for off screen drawing areas, developers can modify information displayed on the screen without flicker, and can preload images for enhanced speed. Text drawn with the graphics object can support automatic word wrapping, and can be drawn with varying fonts, sizes, styles, and colors. REALbasic also supports drawing various simple shapes. Additionally, it can display any graphic supported by QuickTime, giving the developer convenient access to a wide variety of file formats.

Still another advanced feature of REALbasic is its text handling. It is second to none. By using the WASTE text engine, fields can contain greater than 32 kbytes of data, a limitation imposed by standard TextEdit. Fields can contain varying fonts, sizes, styles, and colors, all of which can be changed on the fly through code. Fields also have a number of filters which can be applied to them in order to limit input to a specified type of data.

Getting information in and out of an application is essential to many programs. Thus, REALbasic provides excellent support for file i/o. REALbasic can retrieve and change almost every aspect of a file, and can read and write to them with a great deal of speed.

REALbasic also allows for transferring data through the serial ports or via TCP/IP. The Serial Port Control makes communicating with custom pieces of hardware a breeze. The OpenTransport native TCP/IP Socket Control allows the developer to add support for various Internet protocols to their applications quickly and efficiently.

For added speed and efficiency, REALbasic supports the use of threads. This allows code to be running in the background, will still allowing the user access to the program's interface.

Support For Key Mac OS Technologies

REALbasic embraces virtually all technologies that have made the Mac OS such an excellent platform. With built-in support for such technologies as QuickTime, AppleEvents, Drag and Drop, Contextual Menus, and the Appearance Manager, REALbasic applications can be as advanced as the developer desires.

Using the MoviePlayer Control, the developer has access to a wide variety of QuickTime features. Users can specify how a movie will be played, as well as when it begins to play. One particular benefit of the MoviePlayer Control is that it supports the display of any media type that the currently installed version of QuickTime allows. For example, an animated GIF can be played back from within a REALbasic application with the presence of QuickTime 3.

REALbasic includes extensive built in support for AppleEvents. AppleEvents, the Mac OS standard method of interapplication communications, provides a way in which developers can send messages between their applications and others in order to perform such tasks as transferring data. For example, data could be entered into a REALbasic app which could then be transferred to FileMaker Pro for subsequent addition into a database.

With Drag and Drop becoming more and more standard throughout the software industry, REALbasic's support for Mac OS standard Drag and Drop is a most welcome feature. Developers have full control over drag regions and the contents of the drag data. As an added bonus, Multiline EditFields support Drag and Drop without the need for any code. REALbasic also provides a mechanism for easily adding these capabilities to ListBoxes with very little code.

It is also a comfort to know that REALbasic-built applications will look at home in future versions of the Mac OS. With built in support for Apple's Appearance Manager, all of the Controls are Appearance-savvy. With the release of Mac OS 8.5 and switchable themes, the Controls will alter their appearance to fit in with the current theme.

REALbasic's support for the latest Mac OS technologies does not stop there. It allows you to quickly and easily apply balloon help to any control or menu item, and allows placement of items in the Help menu. This allows for the creation of custom help systems, such as HTML help viewers. Also supported is the creation of Contextual Menus which, through a custom implementation, are displayed regardless of whether or not Mac OS 8 is installed.

Extending REALbasic

While REALbasic's built-in capabilities are generally sufficient for virtually all tasks, one occasionally needs access to an unsupported feature or the Macintosh toolbox. For this reason, REALbasic is easily expandable through the use of AppleScript, XCMD/XFCNs, shared libraries, and REALbasic native plug-ins.

Compiled AppleScripts and XCMD/XFCNs can be incorporated into a REALbasic project by dragging and dropping it from the Finder to the Project window. Once added to the project, they can be called just as a built-in method would be called.

Shared libraries can be added to a project in the same fashion as AppleScripts and XCMD/XFCNs. Double clicking a shared library once it is in the Project window displays a window, from which one can define entry points for the shared library. The entry points can be accessed through code with support for such items as MemoryBlocks, enabling one to store data returned from the libraries.

Perhaps the best way to add functionality to REALbasic is through a REALbasic native plug-in. Plug-ins have full access to the toolbox, and can add either methods or Controls to REALbasic. Placing a Control plug-in into REALbasic causes the Control to appear in the Toolbar just as any built-in control would, and is used in the same way. Developers wishing to create plug-ins can download the SDK directly from REAL Software's web site, free of charge.

Port Your Windows Apps

The high level of compatibility between REALbasic and Visual Basic's syntax makes REALbasic the perfect tool for porting Windows-based Visual Basic applications to the Mac OS. By dragging any Visual Basic 2.0 or later form (.frm file) into REALbasic's project window, it is automatically converted into a REALbasic window, and incorporated into your project. Additionally, REALbasic supports dragging and dropping Visual Basic Code Modules (.bas files) into the project. This too incorporates the file into your project. The extensive Visual Basic support provides an excellent opportunity for Windows software developers to expand their market, while adding to the growing number of Mac OS applications on the market. This approach is also extremely cost-effective, as it requires very little time on the part of the software developer to perform this porting.

Community

The center of the large REALbasic community is the REALbasic NUG mailing list. From here users of any level can ask questions, request features, and hold discussions on almost any aspect of REALbasic programming. The members of the list are helpful, and for the most part courteous. As one of the first members of the list, I have seen it grow from a small resource to an essential aspect of REALbasic programming.

On the web, REALbasic users have set up the REALbasic Webring. With a fairly large number of members, this is another excellent resource for any developer. Pages on the webring range from companies which utilize REALbasic in their development, to individuals offering code snippets, to extensive FAQ listings. REALbasic users have also set up a Hotline server, the REALbasic Café, as a place to discuss the language, ask questions, share ideas, and upload your programs for others to see. When visiting the Café you will notice that the people there are always willing to help you out, and during discussions, will even create programs for you to illustrate their points.

Overall, members of the REALbasic community are an enthusiastic, helpful, and pleasant bunch. They hail from many countries across the globe, and together make up an indispensable programmer's resource.

What Will The Future Hold?

Quite appropriately, a primary concern of those interested in purchasing a new development environment is whether the company is planning a future for the software. It seems clear indeed that REALbasic has a long and bright future ahead. As of this writing, REAL Software is in the early development stages of Release 2. As of this release, REAL Software will be producing two versions of REALbasic: a standard version and an extended version.

The standard version of Release 2 will be similar to the current version, with the addition of numerous features, including improvements in such features as QuickTime support, Sprite support, and the Socket Control. Release 2 will also feature a Java compiler, which will allow Java applets to be compiled just as easily as standard Mac OS applications are compiled.

The extended version will be identical to the standard version, with two important differences. The first is the addition of ODBC and SQL database support, with the inclusion of a single user database. The second of these differences is the addition of a Windows compiler. Much like the Java compiler, the Windows compiler will create applications that will run on Windows 95/98/NT as easily as creating a Mac OS application. This will give developers the exciting capability to create a single code base, and deploy their applications on the Mac OS, Windows, and on the web.

Documentation

REALbasic's documentation is extremely thorough. Consisting of over six hundred pages, the printed documentation is divided into three parts. The first of these parts is the tutorial. As step-by-step guide to creating your first application, the tutorial assumes absolutely no prior programming experience, making REALbasic accessible to the beginner. The second portion of the documentation is the developer's guide. Made up of fourteen chapters, this guide covers everything from the basics of object-oriented programming to the complexities of interapplication communication. Finally, REALbasic provides a comprehensive language reference indexing every part of the language. The documentation is bound with a spiral binding so that it can lay flat on any surface, a convenience that should not be underestimated.

Though printed documentation is essential, it is often inconvenient to attempt to locate a volume while deeply engrossed in coding. For this reason REALbasic includes an online reference. Simply select any Control or word in the Code Editor, open the online reference (through either a menu selection or command-1), and it will automatically display the proper help topic. This feature proves to be indispensable over the course of the development process while working on a given project.

Conclusions

Being a first release and having so many features, it is almost inevitable that REALbasic would contain a few of minor bugs and inconsistencies. Though numerous work arounds exist, they are often bothersome nonetheless. To their credit, REAL Software has pledged to release free updates to the software in an effort to fix all outstanding bugs.

REALbasic is without a doubt a solid new entry into the Mac programming world. With HyperCard-like simplicity, C++-like power, and compatibility with Visual Basic, REALbasic is a most powerful tool. Whether you are involved in RAD, building front ends for AppleScripts, or developing custom software, shareware, and/or commercial software, REALbasic has the tools for you. In short, REALbasic is worth many times its $99 price.

Online Resources


Scott Anchin, scott@psrsoft.com is the founder of Precise Sales & Research, http://www.psrsoft.com, a software development company. He is also associated with Fisher, Towne & Associates, a national developer of electronic catalog and commerce systems for several Fortune 500 companies. Additionally, he is an online support editor for MacTech Magazine.

 

Community Search:
MacTech Search:

Software Updates via MacUpdate

Latest Forum Discussions

See All

Tokkun Studio unveils alpha trailer for...
We are back on the MMORPG news train, and this time it comes from the sort of international developers Tokkun Studio. They are based in France and Japan, so it counts. Anyway, semantics aside, they have released an alpha trailer for the upcoming... | Read more »
Win a host of exclusive in-game Honor of...
To celebrate its latest Jujutsu Kaisen crossover event, Honor of Kings is offering a bounty of login and achievement rewards kicking off the holiday season early. [Read more] | Read more »
Miraibo GO comes out swinging hard as it...
Having just launched what feels like yesterday, Dreamcube Studio is wasting no time adding events to their open-world survival Miraibo GO. Abyssal Souls arrives relatively in time for the spooky season and brings with it horrifying new partners to... | Read more »
Ditch the heavy binders and high price t...
As fun as the real-world equivalent and the very old Game Boy version are, the Pokemon Trading Card games have historically been received poorly on mobile. It is a very strange and confusing trend, but one that The Pokemon Company is determined to... | Read more »
Peace amongst mobile gamers is now shatt...
Some of the crazy folk tales from gaming have undoubtedly come from the EVE universe. Stories of spying, betrayal, and epic battles have entered history, and now the franchise expands as CCP Games launches EVE Galaxy Conquest, a free-to-play 4x... | Read more »
Lord of Nazarick, the turn-based RPG bas...
Crunchyroll and A PLUS JAPAN have just confirmed that Lord of Nazarick, their turn-based RPG based on the popular OVERLORD anime, is now available for iOS and Android. Starting today at 2PM CET, fans can download the game from Google Play and the... | Read more »
Digital Extremes' recent Devstream...
If you are anything like me you are impatiently waiting for Warframe: 1999 whilst simultaneously cursing the fact Excalibur Prime is permanently Vault locked. To keep us fed during our wait, Digital Extremes hosted a Double Devstream to dish out a... | Read more »
The Frozen Canvas adds a splash of colou...
It is time to grab your gloves and layer up, as Torchlight: Infinite is diving into the frozen tundra in its sixth season. The Frozen Canvas is a colourful new update that brings a stylish flair to the Netherrealm and puts creativity in the... | Read more »
Back When AOL WAS the Internet – The Tou...
In Episode 606 of The TouchArcade Show we kick things off talking about my plans for this weekend, which has resulted in this week’s show being a bit shorter than normal. We also go over some more updates on our Patreon situation, which has been... | Read more »
Creative Assembly's latest mobile p...
The Total War series has been slowly trickling onto mobile, which is a fantastic thing because most, if not all, of them are incredibly great fun. Creative Assembly's latest to get the Feral Interactive treatment into portable form is Total War:... | Read more »

Price Scanner via MacPrices.net

Early Black Friday Deal: Apple’s newly upgrad...
Amazon has Apple 13″ MacBook Airs with M2 CPUs and 16GB of RAM on early Black Friday sale for $200 off MSRP, only $799. Their prices are the lowest currently available for these newly upgraded 13″ M2... Read more
13-inch 8GB M2 MacBook Airs for $749, $250 of...
Best Buy has Apple 13″ MacBook Airs with M2 CPUs and 8GB of RAM in stock and on sale on their online store for $250 off MSRP. Prices start at $749. Their prices are the lowest currently available for... Read more
Amazon is offering an early Black Friday $100...
Amazon is offering early Black Friday discounts on Apple’s new 2024 WiFi iPad minis ranging up to $100 off MSRP, each with free shipping. These are the lowest prices available for new minis anywhere... Read more
Price Drop! Clearance 14-inch M3 MacBook Pros...
Best Buy is offering a $500 discount on clearance 14″ M3 MacBook Pros on their online store this week with prices available starting at only $1099. Prices valid for online orders only, in-store... Read more
Apple AirPods Pro with USB-C on early Black F...
A couple of Apple retailers are offering $70 (28%) discounts on Apple’s AirPods Pro with USB-C (and hearing aid capabilities) this weekend. These are early AirPods Black Friday discounts if you’re... Read more
Price drop! 13-inch M3 MacBook Airs now avail...
With yesterday’s across-the-board MacBook Air upgrade to 16GB of RAM standard, Apple has dropped prices on clearance 13″ 8GB M3 MacBook Airs, Certified Refurbished, to a new low starting at only $829... Read more
Price drop! Apple 15-inch M3 MacBook Airs now...
With yesterday’s release of 15-inch M3 MacBook Airs with 16GB of RAM standard, Apple has dropped prices on clearance Certified Refurbished 15″ 8GB M3 MacBook Airs to a new low starting at only $999.... Read more
Apple has clearance 15-inch M2 MacBook Airs a...
Apple has clearance, Certified Refurbished, 15″ M2 MacBook Airs now available starting at $929 and ranging up to $410 off original MSRP. These are the cheapest 15″ MacBook Airs for sale today at... Read more
Apple drops prices on 13-inch M2 MacBook Airs...
Apple has dropped prices on 13″ M2 MacBook Airs to a new low of only $749 in their Certified Refurbished store. These are the cheapest M2-powered MacBooks for sale at Apple. Apple’s one-year warranty... Read more
Clearance 13-inch M1 MacBook Airs available a...
Apple has clearance 13″ M1 MacBook Airs, Certified Refurbished, now available for $679 for 8-Core CPU/7-Core GPU/256GB models. Apple’s one-year warranty is included, shipping is free, and each... Read more

Jobs Board

Seasonal Cashier - *Apple* Blossom Mall - J...
Seasonal Cashier - Apple Blossom Mall Location:Winchester, VA, United States (https://jobs.jcp.com/jobs/location/191170/winchester-va-united-states) - Apple Read more
Seasonal Fine Jewelry Commission Associate -...
…Fine Jewelry Commission Associate - Apple Blossom Mall Location:Winchester, VA, United States (https://jobs.jcp.com/jobs/location/191170/winchester-va-united-states) Read more
Seasonal Operations Associate - *Apple* Blo...
Seasonal Operations Associate - Apple Blossom Mall Location:Winchester, VA, United States (https://jobs.jcp.com/jobs/location/191170/winchester-va-united-states) - Read more
Hair Stylist - *Apple* Blossom Mall - JCPen...
Hair Stylist - Apple Blossom Mall Location:Winchester, VA, United States (https://jobs.jcp.com/jobs/location/191170/winchester-va-united-states) - Apple Blossom 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.