| Open (programming Language) |
Article Index for Open |
Website Links For Open |
Information AboutOpen (programming Language) |
|
The language was originally called Organiser Programming Language developed by Psion Ltd for the Psion Organiser . The first implementation (without graphics) was for 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 PDA market, the project was changed to Open Source and the Acronym was re-interpreted. The language is now developed on SourceForge in the ''opl-dev'' project. To the grievance of the large OPL developer community, the language is not available from Symbian OS v8 and later, mainly due to lack of interest and support from major Symbian licencees Nokia and Sony Ericsson. Hence, OPL will most likely never be made available for the newer generation of Symbian OS phones such as Sony Ericsson P990, M600, W950, P1i and Nokia E61i and E90. 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.)'' A screenshot of the translation under Nokia's Series 80 user interface (1 pixel wide border added into each side of the image so the screenshot wouldn't be mixed with the Wikipedia background color): 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 A screenshot of the translation under Nokia's Series 80 v2.0 user interface (1 pixel wide border added into each side of the image so the screenshot wouldn't be mixed with the Wikipedia background color): OPL is a Structured Programming language. OPL programs contain PROCedures, which are much like Functions in other programming languages.
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 called 'var'. MINUTIAE OPL interfaced with advanced Psion Series 3 features by means of Operating System CALLs, but in the later Psion Series 5mx this was changed to a so-called 'OPX' library, stored in the system ROM (the Z drive). Other OPL features include those with a letter 'g' at the beginning, for graphical functions; and those with a letter 'm', for menus. SEE ALSO Psion Organiser EXTERNAL LINKS
|
|
|