Language Elements and Reference:xpplrm

Commands Foundation

A command is a combination of keywords and expressions. The origin of the Xbase++ commands is the interpreted language dBase which was first enhanced by Clipper. The Xbase++ commands imitate dBase and Clipper commands. The preprocessor translates these commands to complex expressions which are compiled by the compiler. All Xbase++ commands are programmed as directives in the #include file STD.CH.

An example of a command is shown in the following:

USE Address ALIAS Adr INDEX Address1, Address2 

This command opens a DBF file along with two index files. To write this program code as expressions, the following syntax would be used:

DbUseArea( ,, "Address", "Adr") 
DbSetIndex( "Address1" ) 
DbSetIndex( "Address2" ) 

Commands simplify the programer's work and pass the responsibility of calling the appropriate functions with the correct arguments to the preprocessor.

Using the directives #command and #translate new user-defined commands (UDC, User-defined Command) can be integrated into the Xbase++ language. Very complex expressions can be programmed with a simple syntax which is translated by the preprocessor into valid program code. Commands simplify the work of the programmer, since the preprocessor handles making sure the appropriate function call gets written correctly.

Feedback

If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.