Condividi tramite


Command and Function Usage

You use Visual FoxPro commands and functions to perform an action or to return values for use in other commands and functions. Commands and functions can occur in expressions, or they can accept expressions as parameters. 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

BROWSE Command | DATE( ) Function | Language Reference A-Z | Expression Building