CleanOPL Version 1.3 Copyright: Marcel Uithoof, 1996 All rights reserved. 1. INTRODUCTION 1.1 What is CleanOPL? CleanOPL is a tool for developers of OPL-programs for the Psion 3A. Keywords, procedures, variables and labels in any OPL source file will be given the correct case. There is also the possibility to give an OPL source file the correct indentation. 1.2 Decide-Ware CleanOPL is Decide-Ware. This means that the runtime program is hereby released to the public domain. The sources however are not released to the public domain. If you like the program and use it on a regular basis, it would be appreciated if you send small tokens to the author (whose address can be found at the bottom of this file) just to encourage him to develop the program furthermore and add more options to the program. But as the name implies, the decision is up to you. 1.3 Installation The CleanOPL program package should contain the following files: CLEANOPL.OPA The program file CLEANOPL.TXT This text file These files should be installed in the following directories: CLEANOPL.OPA in \APP\ on any drive CLEANOPL.TXT in \WRD\ on any drive (optional) The file CLEANOPL.TXT is not necessary for the program to run. Install the file CLEANOPL.OPA via Psion-I After installation and running the program, the following file will automatically be created: CLEANOPL.CFG in M:\OPD\ (always on the internal disk) This file will contain the configuration options. In earlier versions the file CLEANOPL.ODB was distributed as well. This file is not necessary anymore. If it is installed on the Psion, the file will automatically be deleted when the new CleanOPL program is run. 1.4 Memory Requirements CleanOPL requires about 15K of disk space for installation and a minimum of 52K is required to run the program. When running CleanOPL, a complete copy of the OPL source file which is processed will be created on disk, so this memory space should also be available. 1.5 The legal stuff The author and distributor shall not be liable for any loss of data or damage arising from the use of this software, either direct or indirect. This software is provided as is, without any warranty of any kind. The runtime program is released as decide-ware, but the sources and the name CleanOPL are protected by copyright. 2. The Program 2.1 Important Although the program has been tested extensively and everything seems to be ok, there is always a change that data could be damaged. Therefore, always backup your data before using this program. 2.2 Why should I use CleanOPL Have you ever written an OPL program where the case of keywords, procedure-names and variables was not correct and where the wrong indentation was used. Or ever modified your code with IF..ENDIF structures and added spaces or tabs till your fingers went blue. Yes, than CleanOPL can be the answer. 2.3 When to use CleanOPL CleanOPL was developed to work with OPL source files which translate ok in the PROGRAM application. It will work on OPL source files which did not translate ok, but probably the incorrect case and/or indentation will be applied for the line(s) where the error(s) occurred. The maximum line length is limited to 255 characters, however when indentation is applied it will be limited to 254 characters This means that if an original line is 254 or 255 characters without leading spaces or tabs, no indentation will be added by CleanOPL, but the source line will kept intact. 2.4 Using CleanOPL When you start the application a dialog will be presented to you with the following options: ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ ³ CleanOPL v1.3 ³ ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ ³úFile: Name ???????? ³ ³ú Disk Internal ³ ³úIndentation Tabs ³ ³úKeywords Psion rules ³ ³úProcedures Initial caps ³ ³úVariables Lowercase ³ ³úLabels Lowercase ³ ³úOdometer 10 ³ ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ úFile: Name / Disk This is a standard file selector where you can select the OPL source file to process. úIndentation Here you can choose how the file will be indented Choices are: Leave The current indentation will be left intact. None No indentation will be used. All lines will be left-aligned. 1 Space 1 Space will be used for indentation. 2 Spaces 2 Spaces will be used for indentation. 3 Spaces 3 Spaces will be used for indentation. 4 Spaces 4 Spaces will be used for indentation. Tabs Tabs will be used for indentation úKeywords Here you can choose the case of the Psion keywords. Choices are: Leave Does not change the case of keywords. Uppercase Keywords will be converted to upper case. (example: 'dinit' will be converted to 'DINIT') Lowercase Keywords will be converted to lower case. (example: 'DINIT' will be converted to 'dinit') Initial caps Keywords will be converted to first letter in upper case and the rest in lower case. (example: 'dINIT' will be converted to 'Dinit') Psion rules Keywords will be converted to the case as mentioned in the Psion programming manual. (example: 'dinit' will be converted to 'dINIT' 'print' will be converted to 'PRINT') úProcedures Here you can choose the case of the procedure names. Choices are: Leave Does not change the case of procedure names. Uppercase Procedure names will be converted to upper case. Lowercase Procedure names will be converted to lower case. Initial caps Procedure names will be converted to first letter in upper case and the rest in lower case. úVariables Here you can choose the case of the variable names. Choices are: Leave Does not change the case of variable names. Uppercase Variable names will be converted to upper case. Lowercase Variable names will be converted to lower case. Initial caps Variable names will be converted to first letter in upper case and the rest in lower case. úLabels Here you can choose the case of the labels. Choices are: Leave Does not change the case of labels. Uppercase Labels will be converted to upper case. Lowercase Labels will be converted to lower case. Initial caps Labels will be converted to first letter in upper case and the rest in lower case. úOdometer Here you can specify the interval with which the progress indicator is displayed 'xxx lines processed'. The higher this number, the faster this program will run. Pressing 'ENTER' will start the cleanup process. During processing a progress indicator is shown in the bottom right corner. During processing 'ESC' will interrupt and return you to the dialog. Pressing 'ESC' while in the dialog will stop the program. 2.5 Notes on processing þ APPlications names are not processed and left intact. þ Database logical names are always converted to upper case. 2.6 When something goes wrong. CleanOPL will first convert your OPL source file to a temporary file 'M:\OPL\CLEANOPL.$$$'. When processing is complete this temporary file will be copied over the original source file. Only when no error occurred during copying, this temporary file will be deleted. So if there goes something wrong, probably a copy of your source file is still on disk as 'M:\OPL\CLEANOPL.$$$' 3. Remarks and suggestions If you have any remarks or suggestions please let me know about it. Send them to me. My address can be found at the end of this file. 4. Limitations and outstanding items None 5. Revision History Version 1.3 26-10-96 þ Added an adjustable odometer. When this is set to 10 instead of the pre-defined value of 1 in version 1.2 a speed increase of 30% will be achieved. Version 1.2 03-10-96 þ Searching for keywords is now hardcoded instead of finding them in a table. This gives a speed increase of about 55 % Version 1.1 13-08-96 þ Every second keyword in a line, before a colon occurred, was not recognized. (Fixed) þ Database logical names with letters above 'D' before the field name were recognized as correct. (Fixed) Version 1.0 10-08-96 þ First public release 6. The Author Marcel Uithoof Kinkelenburg 194 3328 AK Dordrecht The Netherlands or email uithoof@globalxs.nl