FoxPro commands Introduced

The ability to use FoxPro commands and functions directly in BRAHMS opens up a further dimension of editing flexibility. It is never essential to use these commands. However, if you do, it makes certain types of task much easier, for example, when editing all of the records in an RDE file.


FoxPro commands can speed up editing tasks enormously. For example, imagine in an RDE file with several 100 records, you want to replace all occurrences of the text SN, sn. and No number in the NUMBER field to a uniform s.n.. Using one of a few FoxPro commands, the task can be done is seconds.


The FoxPro command form allows you to process your data using programming commands, either as individual lines of code or in a sequence of one-line commands. A remarkable range of data processing can be undertaken with one-line program instructions using only a small number of programming keywords. The commands can be made to apply to one record, a selection of records or all records in a file.


You can execute FoxPro commands whenever the toolbar is activated on the toolbar. As FoxPro commands could be damaging, this button is only enabled in RDE, extract files and other temporary work files, but not in main database files.


Using Admin > Project configuration > FoxCommands, admin level users can enable this toolbar system wide.



If you enable, use with caution in main database files.



When you enter FoxPro commands, they are saved in your database FoxPro Command library and thus can be used again when needed.


An example FoxPro command is: Replace COUNTRY with Malaysia all. This command uses the replace instruction, which is one of the most commonly used. Here, the command replaces the data file field COUNTRY with the text string Malaysia. The all keyword tells BRAHMS to do this for all records in the open file. Assuming the file does have the field COUNTRY, all the records would have the text string Malaysia added to this field.


Single line commands

To run a single line command, highlight the command line you want to use (or add a new command) and then press the Execute button and confirm as prompted. If your command is not correct, BRAHMS issues a syntax error message.


Single line commands are usually entered in the FOXPRO COMMAND field. This stores commands up to 200 characters long. If need be, very lengthy one line commands can be stored in the command sequence memo field.



A confirmation window always displays a command before it is executed. In this case, the format of a particular collector name is being edited throughout the open file.

Command sequences

It is also possible to run a sequence of commands in a single execution. To run a sequence as stored in the COMMAND SEQUENCE memo, use the Sequence button. Sequences consist of a series of one line commands separated by a '#'.



Command errors

If a command has an error, BRAHMS issues a warning. Common causes of command error are command line syntax errors or attempting to access a field that does not exist or you have named wrongly. Remember that actual field names may be different to those shown in the file header. To list the proper field names in a file, you can use the List fields button.

BRAHMS Project © University of Oxford 1985-2011 - http://dps.plants.ox.ac.uk/bol

Created with the Freeware Edition of HelpNDoc: Single source CHM, PDF, DOC and HTML Help creation