"Its Elementary Watson...REALbasic"
by Gary L. Ratliff Sr.
One of the things about computers and computing which has always been of interest to me is learning to use new computer languages. This desire to program in many languages was one of the things which prompted me to graduate from the Commodore PET of 1978 to A Commodore SuperPET in 1981. The main draw was the five languages it offered: APL, Assembler (6809), Basic, Cobol, and Pascal.
My move to Linux was prompted by learning that it offered compilers for many languages. Those who purchased computers in the late 70's and early 80 were most likely introduced to the BASIC computer language. If you wanted the machine to do anything other than blink and let you know that it was READY, you had to learn to program it to do something and that meant learning to program in BASIC.
PCLinuxOS comes with many languages available in the software repositories. And one of them is remarkable in that it is a commercial product. Unlike most which are offered under a GPL license, this is sold for software development by Real Software, located in Austin, Texas. It is actively developed and has a new release about every three months. The most recent release was REALbasic 2007 release 5 which was released in November of 2007. By the time you read this article the next release REALbasic 2008 release 1 should be available for download.
How to get REALbasic
There are two approaches which might be used to obtain REALbasic for your system: Install it from the PCLinuxOS repositories, or obtain it from REAL Software. Each of these approaches also offers some options.
From the system repositories one may use either the command line or the GUI approach to getting the software. First, let us take the command line route:
Open a terminal by clicking on the terminal icon if it is on your desktop or using the start menu and going to "System", then going to "Terminals", then choose "Konsole" from the sub-menu which appears. Become root so that you may install the software by giving the command:
su <enter root password then press Enter or return>
(you will notice that you are root as the text color should now be red (and the cursor changes from $ to #). This is to warn you that as root you can do some serious damage to the system if you aren't extra careful when entering commands)
Get the software and install it using the command:
apt-get install REALbasic
Now exit from the terminal program (type exit and press Enter or return) as you should be able to read that your new software has been correctly installed.
The GUI approach involves using Synaptic to install the software for you. To use this approach: From the start menu select "System", then select "Configuration", then choose "Packaging", and finally select "Synaptic Package Manager." Now you will be prompted to enter the root password and the program will launch. Select the search item and enter REALbasic as what you desire to find. Once the search is complete, select the item by clicking on the small box to the left of the item name to indicate that you wish to mark this program for installation. Once this is done, select "Apply" and soon your software will be installed.
On the basis of my explorations, installing from synaptic offers these short comings:
First, the release is only REALbasic 2007 release 4. Second. the documentation files which you will need to use to learn to operate the system are not loaded. (This happened on both my 128 meg Dell Dimension 8100 and HP a1253w systems.) The system will guide you toward the Real Software website to get the documentation, but this fails to work. For this reason my recommendation is to obtain the most recent release directly from Real Software.
REALbasic will compile code for either Mac, Windows, or Linux systems. Now the company offers three forms of download of the most recent REALbasic release 5 for Linux: There are .tgz, .rpm, and .deb packages of this software and each is listed as being 39.1 megs in length. Although Ubuntu and Debian systems use apt-get and Synaptic your PCLinuxOS system uses Red Hat Packages commonly known as .rpms. The versions of apt and Synaptic have been specifically tailored to work with rpm type packages.
To install the tgz version you will first become root following the same method outlined in the discussion of apt-get. Once the software has been downloaded from the REAL Software site, you should find it on your desktop. You will use this set of commands:
su <enter root password> cd /home/gary/Desktop <Use your username here> tar xzvf REALbasicLinux.tgz exit
The x just means to extract the file, the z uncompresses it, the v is for verbose so that the program tells you every move, and the f is for file which names the file upon which you wish to operate.
You should now find a folder on your desktop named: "REALbasic2007r5" and by clicking on this file it should open. You can get the program to launch by double clicking the REALbasic icon (the one which looks like a cog.) The system will let you know it is loading the Artwork and the Framework and you will soon be presented with the Project window.
If you opt to download the rpm package the instructions would be similar but you would use the command:
rpm -i REALbasicLinux.rpm
instead of the tar command. If you use the rpm method the package will be added to the menu structure. So to launch REALbasic (if you followed this path) you would use the Start menu and follow this with selecting "More Applications", next select "Development", then follow this with "Development Environments", finally launch the application by clicking the "REALbasic 2007r5" item which appearsd. This will display the same progress reports as the same program launched from the folder.
Learning how to program using REALbasic
You now have the REALbasic program running and are ready to begin programming. However, you now remember that you don't know how to program at all. The "Help" menu is where you should turn. The Real Software team has provided a complete set of manuals and guides to correct this problem. The information is provided in the ubiquitous pdf format. There are programs on the default system or you may chose to install Adobe Reader (this is found in the PCLinuxOS repositories, or you may use Kpdf). Of course, if you are reading this magazine in the pdf format it would be obvious that you already know how to read this type of file.
The logical place to begin is the REAL Basic Quick Start pdf. This shows the construction of a simple application and guides you into learning the items on the menu and the tool bars and other items, which, until you learn their function, will be foreign to you. This guide suggests that the reading and learning may be completed within a single hour.
Follow this with reading the REAL Basic Tutorial pdf. This explains some of the concepts of object oriented programming and builds a more complicated application.
The most complete of the reference materials is the REAL Basic Users' Manual, also in pdf format. This is a 664 page document and it goes in a logical manner through each step. It is best read in order. However, the search facilities would enable one to refresh their memory by taking you directly to the information you need.
Then the Help Menu also enables one to reach The REAL BASIC Language Reference. Also, if you make a mistake in your programming, the REALbasic system immediately comes to your aid with suggestions to solve your problems.
A Sample Application
Almost any computer text, regardless of the language being introduced, will present a program for your very first programming experience. Searching Google for this item should show a site offering the program in over 100 different computer languages. And so, without further ado, we bring you the "Hello World!" application in REALbasic.
With the system just opened, click on the Window. You will note that this creates a new tab. Having read the quick start guide you should recognize the properties pane and the design pane. Move your mouse to the right into the properties pane and click on the name: Window1 and change this to wnMain. While In this same property pane, change the Title from "Untitled" to "Linux app" You will note that the text on the box in your window will change from Untitled to Linux app.
The box will be rather square. There are some little boxes present in the outline of the window. Use the mouse to hold the one on the lower right side and drag the mouse until you achieve a rectangle about 1 inch tall and 3 inches long. Next, on the items portion, locate the "pushbutton" control. Double click on this and it will appear on your 1 by 3 window with the caption untitled. With this selected, your properties pane will read pushbutton1. Here the caption will read "untitled." Click on this and then change the text to read: "Press Me"
This completes the interface. We have a window and a control. Next, the BASIC language enters the picture as we will use the language to tell the system what to do if the control is pressed. By double clicking on the control; we will open the code window and you will notice that the Action item is shaded. Place the cursor into the text entry area and give this command: "MsgBox", as MsgBox (REALbasic will complete this for you.) The completed command would be: MsgBox "Hello World!"
Now place your mouse on the RUN control on the tool bar and click. You will see a blank window and a large blue line as your program is compiled. Then a window will appear on the screen and you will see a push button on this window which says: "Press Me." You will also notice that REALbasic has added a menu bar populated with File and Edit options.
Note that REALbasic adds the menus for us. Here The File menu gives Quit. In the Windows version this menu gives Exit.
Once you press the control another window will pop up and it will say "Hello World!"
This will also have a control which says OK. Clicking this will remove the "Hello World!" window. To exit the program select the File menu and click on the Quit option. (Or pressing Ctrl Q will also exit the program.)
Having the application performing as we desired, we are ready to change it into a stand alone application. In using REALbasic you will use RUN several times to Test and once the system works as expected, Build the program. Here, just click the Build icon. (Your program will only Build for Linux. Purchasing the Professional version would allow you to construct programs for Mac, Windows, or Linux using the same design and code.)
Now the system names the program "MyApplication" To see this run as a stand alone application, issue this sequence from a terminal:
cd /home/gary/Documents <use your name> ./MyApplication
You can also click on "MyApplication" to run it as a stand alone and also you can right click on "MyApplication" and click on rename to rename "MyApplication" to "Hello."
Ok, it works without REALbasic being loaded. The first item is to change the name which is accomplished by giving the move command as:
mv MyApplication Hello
Notice that when in a terminal window you can tell that an item is an application because it will appear in green text. So the end result is that if you list the contents of the Document folder, what once was "MyApplication" in green text now reads "Hello" in green text. Launching is now accomplished with ./Hello now.
In any serious application you will wish to incorporate your master piece into the menu structure so that it may be easily launched. On your System this is accomplished via the sequence from the start menu: "System" ... "Configuration" ..." Menu Editor."
Once the Menu Editor launches, we will install the system to the menu by selecting from the File Menu: "New item." Then we will complete the form with these entries:
name: Hello
Comment: "Hello World!"
Command: /home/gary/Documents/Hello
The other items which are checked for their default behavior may be left alone. We do not wish to run this application in a terminal so the box should be unchecked. "You will now want to update your new menu structure by selecting 'File' then 'Save.' Once the system has saved your altered menu you will find the title "Hello" at the top of the menu list. The application may now be launched by clicking on it."
We have seen how to develop an application, build it into a stand alone product, and install it into our menu system for ease in implementing it. The Build Menu has options to try to build for other systems, but this is only possible if the Professional version is purchased.
REALbasic on the telly
It is said that one picture is worth a thousand words. So for a real quick grasp of some of the capabilities of this system you may want to view all of the episodes of realbasic.tv. This is reached via launching Firefox and entering: www.realbasic.tv.
This is the REALbasic.tv website. Each episode may be downloaded for future viewing and study.
The home page will be a list of the current episodes. These should be viewed in sequence as one builds upon what has been learned in the previous episodes. The first episode makes clear what reading the pdf files may not have explained fully. Actually seeing the application develop reveals just how easy and powerful the system is.
In episode 4, a tic-tac-toe game is started. I well remember creating just such a program about 25 years ago using the graphic character set of my Commodore PET. The ease with which the board is created and the logic used to create the game is similar. However, this version shows just how much object oriented programming has improved the power available to the programmer.
Unfortunately, the host of the program had his production computer stolen and there was a long delay in getting from this episode to the next. The tic-tac-toe game is to be made playable over a network and the conclusion of this project is for a future episode. The show promises that since the host now has a new system, episodes will continue to appear on a more regular schedule.
There are presently five episodes. You may choose to view them online. A more useful way is to just download them to the desktop and use k3b to burn them onto cds. Episodes 1, 2 and 5 will nicely fill one 800 meg cd to capacity. Episodes 3 and 4 may be burned to another.
"The episodes may be viewed using either mplayer or KMplayer on your PCLinuxOS system. If the user made cds of the episodes and also archived the episodes to a usb hard drive such as Mybook as mentioned in my article on Multibooting they may wish to install another player recently added to the PCLinuxOS repositories. This is Miro (once called Democracy player.) Enter Synaptic and search for miro. Then mark it for installation. Now select apply to have the system install this package and any dependencies needed to allow you to use it. The first time you run Miro, setup will ask if you want it to start automatically and also do you want it to search for videos. The videos will be placed in the My Library section and then may be viewed any time by selecting them."
Another resource for the REALbasic programmer is a bi-monthly magazine. One may download a sample issue by visiting their web site. Each issue promises to have more than 50 pages covering all aspects and having material for beginners as well as professionals.
In conclusion, this is a really well developed system, which is evolving. The sample issue contained an interview with the creator of REALbasic and his desire was to create an easy to use system which would let anyone develop professional looking GUI applications easily and have fun doing so. From my experience using it so far, he has accomplished his desire.
I was able to try the Linux version and the Windows version so I must tell that the Windows version clearly states that this will only be usable for 30 days. Also, applications developed for the Windows version would only function for 10 days.
As I mentioned at the beginning, by the time you are reading this issue the very latest version should be at the Real Software website. Also, the direct download has the advantage that the tutorial material is immediately usable.
Resources:
- REAL Software Inc. http://www.realbasic.com
- REALbasic Developer Magazine http://www.rbdeveloper.com
- RBtv http://www.realbasic.tv
- RBLibrary http://rblibrary.com