Share via


Using Commands and Functions

Visual FoxPro commands and functions perform an action or return values for use in other commands and functions. Commands and functions can accept expressions as parameters, or they can appear in expressions. You can also use user-defined functions (UDFs) whenever you can use a Visual FoxPro command or function.

Commands and functions behave differently:

  • Commands perform an action. For example, you can use the BROWSE command to look at the contents of a table.

  • Functions return a value of a given data type. For example, the DATE( ) function returns the system date from your computer. Functions end with a pair of parentheses that distinguish them from commands.

Functions are not used by themselves, but are always combined with a Visual FoxPro command. For example, the question mark (?) is a command that sends output to the screen. DATE( ) is a function that returns the current system date. You can combine them to output the system date to the screen:

? DATE( )

Commands and functions have a prescribed syntax for parameters and clauses you can supply. For a full description of the syntax of any command or function, see the Language Reference A-Z.

See Also

Other Resources

Building Expressions