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

Challenge those pesky wyverns to a dance...
After recently having you do battle against your foes by wildly flailing Hello Kitty and friends at them, GungHo Online has whipped out another surprising collaboration for Puzzle & Dragons. It is now time to beat your opponents by cha-cha... | Read more »
Pack a magnifying glass and practice you...
Somehow it has already been a year since Torchlight: Infinite launched, and XD Games is celebrating by blending in what sounds like a truly fantastic new update. Fans of Cthulhu rejoice, as Whispering Mist brings some horror elements, and tests... | Read more »
Summon your guild and prepare for war in...
Netmarble is making some pretty big moves with their latest update for Seven Knights Idle Adventure, with a bunch of interesting additions. Two new heroes enter the battle, there are events and bosses abound, and perhaps most interesting, a huge... | Read more »
Make the passage of time your plaything...
While some of us are still waiting for a chance to get our hands on Ash Prime - yes, don’t remind me I could currently buy him this month I’m barely hanging on - Digital Extremes has announced its next anticipated Prime Form for Warframe. Starting... | Read more »
If you can find it and fit through the d...
The holy trinity of amazing company names have come together, to release their equally amazing and adorable mobile game, Hamster Inn. Published by HyperBeard Games, and co-developed by Mum Not Proud and Little Sasquatch Studios, it's time to... | Read more »
Amikin Survival opens for pre-orders on...
Join me on the wonderful trip down the inspiration rabbit hole; much as Palworld seemingly “borrowed” many aspects from the hit Pokemon franchise, it is time for the heavily armed animal survival to also spawn some illegitimate children as Helio... | Read more »
PUBG Mobile teams up with global phenome...
Since launching in 2019, SpyxFamily has exploded to damn near catastrophic popularity, so it was only a matter of time before a mobile game snapped up a collaboration. Enter PUBG Mobile. Until May 12th, players will be able to collect a host of... | Read more »
Embark into the frozen tundra of certain...
Chucklefish, developers of hit action-adventure sandbox game Starbound and owner of one of the cutest logos in gaming, has released their roguelike deck-builder Wildfrost. Created alongside developers Gaziter and Deadpan Games, Wildfrost will... | Read more »
MoreFun Studios has announced Season 4,...
Tension has escalated in the ever-volatile world of Arena Breakout, as your old pal Randall Fisher and bosses Fred and Perrero continue to lob insults and explosives at each other, bringing us to a new phase of warfare. Season 4, Into The Fog of... | Read more »
Top Mobile Game Discounts
Every day, we pick out a curated list of the best mobile discounts on the App Store and post them here. This list won't be comprehensive, but it every game on it is recommended. Feel free to check out the coverage we did on them in the links below... | Read more »

Price Scanner via MacPrices.net

Free iPhone 15 plus Unlimited service for $60...
Boost Infinite, part of MVNO Boost Mobile using AT&T and T-Mobile’s networks, is offering a free 128GB iPhone 15 for $60 per month including their Unlimited service plan (30GB of premium data).... Read more
$300 off any new iPhone with service at Red P...
Red Pocket Mobile has new Apple iPhones on sale for $300 off MSRP when you switch and open up a new line of service. Red Pocket Mobile is a nationwide MVNO using all the major wireless carrier... Read more
Clearance 13-inch M1 MacBook Airs available a...
Apple has clearance 13″ M1 MacBook Airs, Certified Refurbished, available for $759 for 8-Core CPU/7-Core GPU/256GB models and $929 for 8-Core CPU/8-Core GPU/512GB models. Apple’s one-year warranty is... Read more
Updated Apple MacBook Price Trackers
Our Apple award-winning MacBook Price Trackers are continually updated with the latest information on prices, bundles, and availability for 16″ and 14″ MacBook Pros along with 13″ and 15″ MacBook... Read more
Every model of Apple’s 13-inch M3 MacBook Air...
Best Buy has Apple 13″ MacBook Airs with M3 CPUs in stock and on sale today for $100 off MSRP. Prices start at $999. Their prices are the lowest currently available for new 13″ M3 MacBook Airs among... Read more
Sunday Sale: Apple iPad Magic Keyboards for 1...
Walmart has Apple Magic Keyboards for 12.9″ iPad Pros, in Black, on sale for $150 off MSRP on their online store. Sale price for online orders only, in-store price may vary. Order online and choose... Read more
Apple Watch Ultra 2 now available at Apple fo...
Apple has, for the first time, begun offering Certified Refurbished Apple Watch Ultra 2 models in their online store for $679, or $120 off MSRP. Each Watch includes Apple’s standard one-year warranty... Read more
AT&T has the iPhone 14 on sale for only $...
AT&T has the 128GB Apple iPhone 14 available for only $5.99 per month for new and existing customers when you activate unlimited service and use AT&T’s 36 month installment plan. The fine... Read more
Amazon is offering a $100 discount on every M...
Amazon is offering a $100 instant discount on each configuration of Apple’s new 13″ M3 MacBook Air, in Midnight, this weekend. These are the lowest prices currently available for new 13″ M3 MacBook... Read more
You can save $300-$480 on a 14-inch M3 Pro/Ma...
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

Jobs Board

Omnichannel Associate - *Apple* Blossom Mal...
Omnichannel Associate - Apple Blossom Mall Location:Winchester, VA, United States (https://jobs.jcp.com/jobs/location/191170/winchester-va-united-states) - Apple 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
IT Systems Engineer ( *Apple* Platforms) - S...
IT Systems Engineer ( Apple Platforms) at SpaceX Hawthorne, CA SpaceX was founded under the belief that a future where humanity is out exploring the stars is Read more
*Apple* Systems Administrator - JAMF - Activ...
…**Public Trust/Other Required:** None **Job Family:** Systems Administration **Skills:** Apple Platforms,Computer Servers,Jamf Pro **Experience:** 3 + years of Read more
All contents are Copyright 1984-2011 by Xplain Corporation. All rights reserved. Theme designed by Icreon.