Jump to content

RBScript

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by 67.0.72.93 (talk) at 01:21, 8 June 2006 (Edit Content). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
RBScript
Developer(s)REAL Software, Inc.
Operating systemMac OS X, Microsoft Windows, Linux
TypeScripting languages
LicenseProprietary
WebsiteREAL Software, Inc

RBScript is a scripting language similar to REALbasic, which shares some basic features, like to be object oriented, support modules and almost the same datatypes (apart the ones introduced with the last REALbasic version, used mainly for compatibility with some C API). It's a reduced version of REALbasic, which implements just the basic string and number functions, mainly used to script the applications written with REALbasic, and lately used also in the REALbasic IDE (officially from the 2006r1 version).

Compared to the different scripting languages that can still be used with REALbasic (thanks to the ability it offers to call C API), RBScript can be better integrated into REALbasic applications by the possibility it has to call the methods and to use the properties of the object passed to the script parser and compiler.

RBScript cannot be used outside REALbasic applications and cannot be installed separately from an application made with REALbasic.

Example Code

Here's a sample code that asks the host program a number and returns it doubled:

Dim Value As Integer
Value = Val(Input("Which number?"))
Print(Str(Value*2))

It's up to the host program to decide how to implement the callback methods called from Input() and Print(): RBScript just expects the first method to return a string and accept a string parameter, and the second one to accept a string parameter. Usually, the program would prompt the user presenting the string passed from the script, and returning the user input to the hosted script.