Languages A Review of REALBasic

A Review of REALBasic

REALBasic is tool that allows programmers to develop applications using the BASIC programming language. Unlike Microsoft’s Visual Basic, in addition to Windows, REALBasic will also create applications for MAC OS Classic and MAC OS X. We reviewed the Windows version with the understanding that the Mac versions worked the same. Even with the Windows version, you can set your target platform within the development environment.

Startup

If you start REALBasic you will see an IDE (Integrated Development Environment).
This IDE contains several windows: an interface builder, a code editor,
a properties window, and more. As you need these windows to create a fully functional application; they are all open at the same time. Additional windows like menus can be also opened. In addition to these windows, a “tooltip” window
appears automatically when you enter code in the code editor. This window provides useful tips about classes and methods.

The Interface Builder

The interface is one of the important parts of developing an application. The interface builder allows you to easily create your interface by dragging and dropping controls. It contains many useful controls. In other languages you would have to write some of this controls on your own. By dropping a control into your working window a dotted horizontal and vertical line appears automatically, which helps you to align your control at the correct position (See Figure 1). As shown in the figure below, a useful tooltip appears when you hover your mouse over the control. Through the properties window you can set the property of any control. This window also contains a number of useful features for a control. For example you can easily set the tooltip of any control via the property window.


Figure 1 – Interface Builder  Control alignment help

This screenshot displays the standard controls that are installed. You can download additional controls from the REALSoftware Web site. Several third party controls are also available on the Internet. If you install these additional controls, they will appear in the last row of the controls window.

The Code Editor

The Code Editor allows you to enter your code, which is executed on any event. As seen in Figure 2, this window is divided in two panes. The left pane of the window shows a tree with several subtrees. One of the important tree items is the Control, which displays each control in the application. Each control itself contains several event items, which can be added to the application.

Figure 2 – The code editor &tooltip window

By entering any code in the code editor ( right pane ), another “Tips” window
appears that provides some useful tips about the typed keyword. The “Tips”
window contains a small bug, while resizing the window, the tip dissapears. If
you do a minimize and maximize of the whole application, the tip appears again.
However its a useful feature. Another nice feature while typing is the autocomplete, when you type any known keyword, REALBasic tries to complete the word with a light gray shaded color. The completed word from REALBasic can be chosen with TAB key. If there is more than one suggestion, you see the ellipsis (…).

The Compiler

The REALBasic compiler does not work like other known compilers. Other compiler
do not stop before the whole code is compiled, it does not matter whether you
have any errors in your code or not. The REALBasic compiler stops immediately when
it has encountered an error. This can save your time, while developing software.

Figure 3 – The Compiler help

When any error is found, it leads you directly to the position of the error with
a short description in the tooltip. Figure 3 displays how it looks.

Giving REALBasic a Trial Run

When working with a new development tool, one the first thing to do is to create a same very basic program. The program we generally create has a label, an entry box, and a button. In pulling up REALBasic, windows are presented all over the place. While we would have preferred to have these scattered windows docked to the main Windows, such a feature couldn’t be found. After moving the windows to different areas (See Figure 4 below), we were ready to begin the creation of the simple application.

The dragging of controls from the toolbox to the untitled form was simple. Once over the form, guide lines helped me to position the control These guide lines seemed to work easier than the standard grid of dots that can be seen in other applications. The overall placement, sizing, and aligning of controls seemed to work smoothly. Repositioning and resizing all operated as you would expect in a WYSIWYG development tool.

As each control is selected, the standard GUI development action of setting properties can be done. For example, to change the size of the text, you can simply increased the TextSize value in the Properties window. To make the text bold, you would check a box in the properties Window. One item was a surprised. I expected to be able to get to the properties of the primary window being created by simply clicking on an area of the window where there were no controls. This, however, did nothing. Instead, you have to select the form from a different window in the IDE.

Because adding the buttons was simple, we also dragged a Timer control onto the form along with another static text field. Using code, we tied the time to the text field. We set the static text field to initially display the number 0 as its text. We then added code to change this text field to count off seconds as the program runs. To add this code, simply double click on the timer control. This pulls up the Code Editor (See Figure 5).

RealBasic Screen Shot
Figure 1 – The REALBasic Code Editor

Using the Code Editor, you can enter your basic code. When you add code, you add it to a specific event. With REALBasic you are doing event-based programming, so don’t expect to see a full listing of all your code. Rather, you can see code for any specified event.

In clicking on the Timer control, the code editor pulls up the Action event for the timer. As you can see in Figure 5, there are other events associated with each item on the form. Code can be added into any of these areas. For example, we added the following code to the button’s Action event:

Text1.Text = Edit1.Text

This single line of code copies the text within the edit field over to the text that is displayed in the static text field. This command is similar to what you would see in other development tools as well. This one line of code along with the single line of code shown in Figure 2 are all the code in the application. Clicking the Debug menu’s Run option causes my application to be compiled and executed. Figure 6 shows my executing application.

RealBasic Screen Shot
Figure 6 – The running test application.

Not bad for two lines of code. A few additional seconds of clicking and we added color to the text and included an icon on the application. This resulted in the application that is included here:

# # #

Latest Posts

Related Stories