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

Whitethorn Games combines two completely...
If you have ever gone fishing then you know that it is a lesson in patience, sitting around waiting for a bite that may never come. Well, that's because you have been doing it wrong, since as Whitehorn Games now demonstrates in new release Skate... | Read more »
Call of Duty Warzone is a Waiting Simula...
It's always fun when a splashy multiplayer game comes to mobile because they are few and far between, so I was excited to see the notification about Call of Duty: Warzone Mobile (finally) launching last week and wanted to try it out. As someone who... | Read more »
Albion Online introduces some massive ne...
Sandbox Interactive has announced an upcoming update to its flagship MMORPG Albion Online, containing massive updates to its existing guild Vs guild systems. Someone clearly rewatched the Helms Deep battle in Lord of the Rings and spent the next... | Read more »
Chucklefish announces launch date of the...
Chucklefish, the indie London-based team we probably all know from developing Terraria or their stint publishing Stardew Valley, has revealed the mobile release date for roguelike deck-builder Wildfrost. Developed by Gaziter and Deadpan Games, the... | Read more »
Netmarble opens pre-registration for act...
It has been close to three years since Netmarble announced they would be adapting the smash series Solo Leveling into a video game, and at last, they have announced the opening of pre-orders for Solo Leveling: Arise. [Read more] | Read more »
PUBG Mobile celebrates sixth anniversary...
For the past six years, PUBG Mobile has been one of the most popular shooters you can play in the palm of your hand, and Krafton is celebrating this milestone and many years of ups by teaming up with hit music man JVKE to create a special song for... | Read more »
ASTRA: Knights of Veda refuse to pump th...
In perhaps the most recent example of being incredibly eager, ASTRA: Knights of Veda has dropped its second collaboration with South Korean boyband Seventeen, named so as it consists of exactly thirteen members and a video collaboration with Lee... | Read more »
Collect all your cats and caterpillars a...
If you are growing tired of trying to build a town with your phone by using it as a tiny, ineffectual shover then fear no longer, as Independent Arts Software has announced the upcoming release of Construction Simulator 4, from the critically... | Read more »
Backbone complete its lineup of 2nd Gene...
With all the ports of big AAA games that have been coming to mobile, it is becoming more convenient than ever to own a good controller, and to help with this Backbone has announced the completion of their 2nd generation product lineup with their... | Read more »
Zenless Zone Zero opens entries for its...
miHoYo, aka HoYoverse, has become such a big name in mobile gaming that it's hard to believe that arguably their flagship title, Genshin Impact, is only three and a half years old. Now, they continue the road to the next title in their world, with... | Read more »

Price Scanner via MacPrices.net

B&H has Apple’s 13-inch M2 MacBook Airs o...
B&H Photo has 13″ MacBook Airs with M2 CPUs and 256GB of storage in stock and on sale for up to $150 off Apple’s new MSRP, starting at only $849. Free 1-2 day delivery is available to most US... Read more
M2 Mac minis on sale for $100-$200 off MSRP,...
B&H Photo has Apple’s M2-powered Mac minis back in stock and on sale today for $100-$200 off MSRP. Free 1-2 day shipping is available for most US addresses: – Mac mini M2/256GB SSD: $499, save $... Read more
Mac Studios with M2 Max and M2 Ultra CPUs on...
B&H Photo has standard-configuration Mac Studios with Apple’s M2 Max & Ultra CPUs in stock today and on Easter sale for $200 off MSRP. Their prices are the lowest available for these models... Read more
Deal Alert! B&H Photo has Apple’s 14-inch...
B&H Photo has new Gray and Black 14″ M3, M3 Pro, and M3 Max MacBook Pros on sale for $200-$300 off MSRP, starting at only $1399. B&H offers free 1-2 day delivery to most US addresses: – 14″ 8... Read more
Department Of Justice Sets Sights On Apple In...
NEWS – The ball has finally dropped on the big Apple. The ball (metaphorically speaking) — an antitrust lawsuit filed in the U.S. on March 21 by the Department of Justice (DOJ) — came down following... Read more
New 13-inch M3 MacBook Air on sale for $999,...
Amazon has Apple’s new 13″ M3 MacBook Air on sale for $100 off MSRP for the first time, now just $999 shipped. Shipping is free: – 13″ MacBook Air (8GB RAM/256GB SSD/Space Gray): $999 $100 off MSRP... Read more
Amazon has Apple’s 9th-generation WiFi iPads...
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
Discounted 14-inch M3 MacBook Pros with 16GB...
Apple retailer Expercom has 14″ MacBook Pros with M3 CPUs and 16GB of standard memory discounted by up to $120 off Apple’s MSRP: – 14″ M3 MacBook Pro (16GB RAM/256GB SSD): $1691.06 $108 off MSRP – 14... Read more
Clearance 15-inch M2 MacBook Airs on sale for...
B&H Photo has Apple’s 15″ MacBook Airs with M2 CPUs (8GB RAM/256GB SSD) in stock today and on clearance sale for $999 in all four colors. Free 1-2 delivery is available to most US addresses.... Read more
Clearance 13-inch M1 MacBook Airs drop to onl...
B&H has Apple’s base 13″ M1 MacBook Air (Space Gray, Silver, & Gold) in stock and on clearance sale today for $300 off MSRP, only $699. Free 1-2 day shipping is available to most addresses in... Read more

Jobs Board

Medical Assistant - Surgical Oncology- *Apple...
Medical Assistant - Surgical Oncology- Apple Hill Location: WellSpan Medical Group, York, PA Schedule: Full Time Sign-On Bonus Eligible Remote/Hybrid Regular Apply Read more
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
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
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
Business Analyst | *Apple* Pay - Banco Popu...
Business Analyst | Apple PayApply now " Apply now + Apply Now + Start applying with LinkedIn Start + Please wait Date:Mar 19, 2024 Location: San Juan-Cupey, PR Read more
All contents are Copyright 1984-2011 by Xplain Corporation. All rights reserved. Theme designed by Icreon.