OPXs from the OPL view
An OPX procedure behaves like an OPL language keyword and looks like a user defined OPL procedure. For example:
This is an OPX procedure from the System OPX which is present in the ER5 device's ROM. The procedure takes a file name as a string argument, file$, and returns a long integer, as specified by the &. This long integer would be -1 if the file specified is read only or 0 if it isn't.
To use this procedure you would need to include System OPX's header file at the very top of your OPL program, as follows:
This is all the knowledge that is needed to use OPX procedures.
There are many OPX procedures in the four different OPXs which can be found in a Symbian OS v5 device's ROM. All of these procedures have been documented in the SDK in the same manner as OPL language keywords.
The OXH (header) files are Symbian OS text files which can be written in the Series 5 Program Editor. The System.oxh header file contains approximately 80 definitions. If you wished to use only the ISREADONLY&:(file$) procedure then you could write an alternative header file like this:
DECLARE OPX SYSTEM,&1000025C,$100 IsReadOnly&:(file$) : 17 END DECLARE
You could even just type this code into the top of your OPL program.
Not using the standard header file, System.oxh, would merely save time during translation.
&1000025c is the OPX's unique id and $100 is the OPX's version number.
The number 17 is an ordinal which is necessary in locating this procedure in the System.opx DLL. The name of the procedure is not important but the & and file$ are important as these tell the OPL translator which data types are passed and returned.
Back to opl-dev project homepage