Information Science    
   
Table of contents
(Prev) Realaxy ActionScript EditorRealFlow (Next)

Realbasic

Realbasic (RB) is the object-oriented dialect of the BASIC programming language used in Real Studio, a programming environment, developed and commercially marketed by Real Software, Inc of Austin, Texas for Mac OS X, Microsoft Windows, 32-bit x86 Linux[1] and the web.[2][3]

Contents

History

REALbasic was created by Andrew Barry. It was originally called CrossBasic due to its ability to compile the same programming code for Mac OS and Java (although the integrated development environment was Mac only). In 1997 CrossBasic was purchased by FYI Software which renamed it REALbasic as well as renaming the company REAL Software. At this time they dropped the Java target, later replacing it with a Windows target and database support. This was promised for version 1.0 and was eventually pushed back to version 2.0, although it contained many bugs when finally released. The IDE is now available for Microsoft Windows, Mac OS X, and 32-bit x86 Linux and can compile applications for Windows (Windows 2000 and higher), Mac OS X (PowerPC, Intel, and Universal Binary) and 32-bit x86 Linux.

With 2010 Release 1, the IDE was renamed REAL Studio. The programming language itself remained under the name REALbasic.

On August 31, 2010 REAL Software Announced REAL Studio Web Edition. REAL Studio Web Edition is meant to abstract developers from having to know multiple web programming languages and offers a single development tool with a drag and drop web page editor for creating a user interface and a single high-level, object oriented language. REAL Studio Web Edition began shipping on December 14, 2010 with REAL Studio 2010 Release 5.

Language features

Realbasic is a strongly typed, case-insensitive language with minimal automatic type conversion, which supports single inheritance and interfaces, class methods and class properties, automatic memory management via reference counting, and operator overloading. A very important feature is the ability to extend (not just inherit from) existing classes, like Objective-C Categories. This considerably reduces the need for the Abstract Factory Pattern, which complicates using Application Frameworks in Java and C++. Realbasic also includes delegates, introspection, and namespace support, which allows modules to contain classes, interfaces and other modules.

Framework features

As described in the language reference, its built-in framework supports (Real Software 2011):[4]

The framework functionality can also be extended by creating plugins using the Plugin SDK provided by Real Software. Plugins are created using C/C++ with a variety of supported compilers, including Xcode, Microsoft Visual Studio and gcc. Plugins can support any platform Realbasic supports, but are not required to support all platforms.[5]

Example code

This example writes to a new text file:

Dim t as TextOutputStreamDim f as FolderItemf=GetSaveFolderItem(FileTypes1.Text,"Create Example.txt")If f <> Nil then t=TextOutputStream.Create(f) t.WriteLine(TextField1.text) t.CloseEnd if

This example draws a triangle in a Canvas control. It is placed in the Paint event. The parameter g as Graphics is passed into this event:

Dim Points() as IntegerPoints=Array(10,10,100,50,10,200,10,10)g.ForeColor=RGB(100,200,255)g.FillPolygon Points

The following code creates an internal database and uses SQLExecute to create a table:

Dim db as REALSQLdatabaseDim f as FolderItemDim result as Booleanf=New FolderItem("mydb")db=New REALSQLdatabasedb.databaseFile=fresult=db.CreateDatabaseFileIf db.Connect() then db.SQLExecute("create table invoices(id integer,Cust_ID integer,Amount double, Date date)") db.Commitelse MsgBox "Database not created"end if

See also

  • RBScript - related scripting language

Comparable Basic Dialects

Other Programming Languages

References

  1. ^ Barr, Joe (August 4, 2005). "Review: RealBasic 2005 for Linux". Linux.com. http://programming.linux.com/programm ing/05/08/03/1639214.shtml?tid=22. Retrieved 2006-04-11.
  2. ^ Smith, Tony (September 13, 2005). "RealBasic 2005 for Mac, Windows and Linux". The Register. http://www.theregister.co.uk/2005/09/ 13/review_realbasic_2005/. Retrieved 2006-04-11.
  3. ^ Ohlhorst, Frank (June 2011). "3 Tools to Accelerate Web Development". IDG. http://www.itworld.com/software/17543 3/3-tools-accelerate-web-application- development?page=0,0. Retrieved 2011-06-17.
  4. ^ Real Software (May 6, 2008). "Real Studio Language Reference". Real Software. http://docs.realsoftware.com/index.ph p/Main_Page. Retrieved 2011-11-30.
  5. ^ Tejkowski, Erick (2001). REALbasic for Dummies. Hungry Minds. ISBN 0-7645-0793-1.

External links

(Prev) Realaxy ActionScript EditorRealFlow (Next)