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 |
[edit] Language features
Realbasic is a strongly typed 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.
[edit] Framework features
As described in the language reference, its built-in framework supports (Real Software 2011) [4]:
- dictionaries,
- declarations to external libraries (dll, dylib)
- Visual Basic datatypes compatibility,
- full Unicode support,
- regular expressions,
- application programming interface calls to compiled C libraries on all supported platforms,
- ActiveX and basic OLE support (on Windows); COM objects are supported,
- Notification icons (on Windows),
- Windows registry (on Windows),
- cooperative threads,
- scripting language embedded in Realbasic programs through RBScript,
- XML parsing and generation,
- console and service application support (Professional & Enterprise editions only)
- Apple events (on Mac),
- Keychain (on Mac),
- Spotlight (on Mac),
- QuickTime (on Mac and Windows),
- sound,
- real-time 3D graphics,
- serial communications,
- sockets (both TCP, UDP and IPC),
- SSL (Professional edition only),
- HTTP, POP3, SMTP and SOAP
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]
[edit] Example code
This example writes to a new text file:
Dim t as TextOutputStream Dim f as FolderItem f=GetSaveFolderItem(FileTypes1.Text,"Create Example.txt") If f <> Nil then t=TextOutputStream.Create(f) t.WriteLine(TextField1.text) t.Close End 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 Integer Points=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 REALSQLdatabase Dim f as FolderItem Dim result as Boolean f=New FolderItem("mydb") db=New REALSQLdatabase db.databaseFile=f result=db.CreateDatabaseFile If db.Connect() then db.SQLExecute("create table invoices(id integer,Cust_ID integer,Amount double, Date date)") db.Commit else MsgBox "Database not created" end if
[edit] See also
- RBScript - related scripting language
[edit] Comparable Basic Dialects
- Gambas - a free approach to object basic
- Visual Basic
[edit] Other Programming Languages
[edit] References
- ^ Barr, Joe (August 4, 2005). "Review: RealBasic 2005 for Linux". Linux.com. http://programming.linux.com/programming/05/08/03/1639214.shtml?tid=22. Retrieved 2006-04-11.
- ^ 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.
- ^ Ohlhorst, Frank (June 2011). "3 Tools to Accelerate Web Development". IDG. http://www.itworld.com/software/175433/3-tools-accelerate-web-application-development?page=0,0. Retrieved 2011-06-17.
- ^ Real Software (May 6, 2008). "Real Studio Language Reference". Real Software. http://docs.realsoftware.com/index.php/Main_Page. Retrieved 2011-11-30.
- ^ Tejkowski, Erick (2001). REALbasic for Dummies. Hungry Minds. ISBN 0-7645-0793-1.