Open Programming Language (OPL) is a
programming language
A programming language is a system of notation for writing computer programs.
Programming languages are described in terms of their Syntax (programming languages), syntax (form) and semantics (computer science), semantics (meaning), usually def ...
for
embedded systems and
mobile device
A mobile device or handheld device is a computer small enough to hold and operate in hand. Mobile devices are typically battery-powered and possess a flat-panel display and one or more built-in input devices, such as a touchscreen or keypad. ...
s that run the
operating system
An operating system (OS) is system software that manages computer hardware and software resources, and provides common daemon (computing), services for computer programs.
Time-sharing operating systems scheduler (computing), schedule tasks for ...
s
EPOC and
Symbian. It was released by the British company
Psion in 1984.
Use
Originally designed for use on their classic
Psion PDAs such as the
Series 3,
5/5mx,
Series 7, and
netBook–netPad, and the Psion produced
MC218, OPL was provided as part of the standard application suite. It can also be installed on the
Nokia
Nokia Corporation is a Finnish multinational corporation, multinational telecommunications industry, telecommunications, technology company, information technology, and consumer electronics corporation, originally established as a pulp mill in 1 ...
9200,
9300 and
9500 Communicator series
mobile telephone and
personal digital assistant
A personal digital assistant (PDA) is a multi-purpose mobile device which functions as a personal information manager. Following a boom in the 1990s and 2000s, PDAs were mostly displaced by the widespread adoption of more highly capable smar ...
(PDA) and the
Sony Ericsson P800,
P900,
P910 series. OPL is also included in Psion Teklogix industrial handhelds such as the Workabout mx, and it also appeared in the lesser known Oregon 'Osaris' organiser, a broadly compatible EPOC32 device that uniquely used version 4 of the OS. OPL is an
interpreted language
In computer science, an interpreter is a computer program that directly executes instructions written in a programming or scripting language, without requiring them previously to have been compiled into a machine language program. An inter ...
similar to
BASIC
Basic or BASIC may refer to:
Science and technology
* BASIC, a computer programming language
* Basic (chemistry), having the properties of a base
* Basic access authentication, in HTTP
Entertainment
* Basic (film), ''Basic'' (film), a 2003 film
...
. A fully
Visual Basic Visual Basic is a name for a family of programming languages from Microsoft. It may refer to:
* Visual Basic (.NET), the current version of Visual Basic launched in 2002 which runs on .NET
* Visual Basic (classic), the original Visual Basic suppo ...
-compatible language OVAL has also been developed.
History
The language was originally named ''Organiser Programming Language'', developed by
Psion Ltd for the
Psion Organiser. Designed by Colly Myers with the first iteration implemented by Richard Harrison and Martin Stamp. The first implementation (without graphics) was for the original Psion Organiser (now referred to as the Psion Organiser I, 1984), and it came bundled with the Science, Finance and Math
data packs. It became truly accessible as built-in software in the
Psion Organiser II (1986), and the language went on to be used in the
Psion Series 3 and later. After Psion retired from the
personal digital assistant
A personal digital assistant (PDA) is a multi-purpose mobile device which functions as a personal information manager. Following a boom in the 1990s and 2000s, PDAs were mostly displaced by the widespread adoption of more highly capable smar ...
market, a project aiming to bring OPL to Symbian came to fruition, when the fledgling Symbian Developer Program released it as
open-source software
Open-source software (OSS) is Software, computer software that is released under a Open-source license, license in which the copyright holder grants users the rights to use, study, change, and Software distribution, distribute the software an ...
. The language is now available on
SourceForge in a project named ''opl-dev''.
The language is currently unavailable for Symbian OS v8 and later. With the subsequent retirement of the Symbian OS, it seems unlikely OPL will be made available for later generations of Symbian devices. As of 2010, Nokia device developers were encouraged to use
Python for S60 instead (See
Python for S60).
Examples
Here is the console version of a
"Hello, World!" program:
PROC main:
PRINT "Hello World!"
PAUSE 40
ENDP
''(Source code taken from the PCDevPrimer in the OPL Wiki.)''
And here is a GUI version for Nokia's Series 80 user interface:
CONST KKeyEnter%=13
PROC hello:
dINIT "Hello"
dTEXT "","Hello World!"
dBUTTONS "OK",KKeyEnter%
DIALOG
ENDP
OPL is a
structured programming Structured programming is a programming paradigm aimed at improving the clarity, quality, and development time of a computer program by making specific disciplined use of the structured control flow constructs of selection ( if/then/else) and repet ...
language. OPL programs contain PROCedures, which are much like functions (
subroutines) in other programming languages.
* The dINIT keyword in this example initializes a dialog box (intuitively enough, all dialog-box related functions begin with a letter 'd'; for clarity, this letter is in lower case, but the language is case independent). The first argument of the dialog is an optional string, which is used for the title of the dialog, displayed in the title bar.
* The dTEXT function displays text, with two compulsory arguments: a left-aligned 'prompt' string, and a main string.
* The dBUTTONS keyword allows you to put buttons on the dialog box - here there is a button with the text "OK". The second argument to each button is both the special notation of the shortcut key for that button and the dialog's return code, in this case the "Enter" key.
* Finally, the DIALOG keyword is required for the previously initialized dialog box to be shown on the screen.
Testing dialog responses
An example:
PROC test:
dINIT "Your Challenge"
dTEXT "","Will your answer to this question be no?"
dBUTTONS "Yes",%y,"No",%n
IF DIALOG=%y
PRINT "No it wasn't!"
ELSE
PRINT "Yes it was!"
ENDIF
GET
ENDP
In this cruel interrogative program, the Yes button is assigned the shortcut of Ctrl+y, while No has Ctrl+n, represented by %y and %n respectively. The user's input from the DIALOG is tested in the IF statement, PRINTing appropriate responses to the screen. Note that the 'GET' keyword, which gets user input without using a dialog box, is here used simply to wait for a keypress before terminating the program (otherwise it would end immediately without giving time for the user to read the text). The output from DIALOG can also be stored in a variable.
Variables specific to a procedure must be declared with the LOCAL keyword; global variables are defined with the GLOBAL keyword.
Variable types
The table below uses an example variable named
var
.
Minutiae
OPL interfaced with advanced Psion Series 3 features by means of
operating system
An operating system (OS) is system software that manages computer hardware and software resources, and provides common daemon (computing), services for computer programs.
Time-sharing operating systems scheduler (computing), schedule tasks for ...
CALLs, but in the later
Psion Series 5mx this was changed to a so-called
OPX
library
A library is a collection of Book, books, and possibly other Document, materials and Media (communication), media, that is accessible for use by its members and members of allied institutions. Libraries provide physical (hard copies) or electron ...
, stored in the system
read-only memory (ROM), termed the Z drive. 'OPX' libraries were also made available for the
Nokia 9210,
Nokia 9300 and
Nokia 9500 Communicators, adding OPXs routines for handling Short Message Service (
SMS) and managing
Bluetooth
Bluetooth is a short-range wireless technology standard that is used for exchanging data between fixed and mobile devices over short distances and building personal area networks (PANs). In the most widely used mode, transmission power is li ...
communication.
Other OPL features include those starting with a letter:
g
for graphical functions,
m
for menus, and
d
for dialogs.
See also
*
Psion Organiser
*
Symbian
References
External links
The ''opl-dev'' projectOPL wikion
Internet Archive
The Internet Archive is an American 501(c)(3) organization, non-profit organization founded in 1996 by Brewster Kahle that runs a digital library website, archive.org. It provides free access to collections of digitized media including web ...
containing documents detailing OPL keywords, OPX interfaces and much other information
OPL Blog by Symbian now dead, bu
old versions are availablefrom the
Internet Archive
The Internet Archive is an American 501(c)(3) organization, non-profit organization founded in 1996 by Brewster Kahle that runs a digital library website, archive.org. It provides free access to collections of digitized media including web ...
Russian site about OPL
{{BASIC
Embedded systems
Free mobile software
Symbian OS
Procedural programming languages
BASIC programming language family
Software using the GNU Lesser General Public License
Computer-related introductions in 1984