Partager via


How to: Operate the Command Window

In general, you can do anything in the Command window that you can do in a program. For example, you can execute a line of code, such as a Visual FoxPro command, by typing it in the Command window. However, when you execute code in the Command window, that code is executed immediately. You can also run multiple lines of code in the Command window as if though they were in a self-contained program.

In addition, choices you make from menus and dialog boxes are echoed in the Command window. You can copy and paste these commands into a Visual FoxPro program, then run the program repeatedly, making it easy to execute multiple commands repeatedly.

The Command window is an editing window; therefore, you can edit code using the editing tools available in Visual FoxPro. For example, you can edit, insert, delete, cut, copy, or paste text in the Command window.

To execute a line of code in the Command window

  • In the Command window, type a line of code and press the ENTER key.

To execute the same line of code in the Command window

  1. In the Command window, move the cursor to any position in the line of code you want to execute.

  2. Press the ENTER key.

To run multiple lines of code in the Command window

  1. In the Command window, select the lines of code you want to execute.

  2. Press the ENTER key.

Although you can run code in the Command window that you might usually execute in a program file, certain advantages exist when running code from a program. For more information, see Working with Programs.

See Also

Reference

Command Window (Visual FoxPro)

Other Resources

Development Productivity Tools