Running Code Examples

See Also

Many language topics in Help contain code examples that you can run in a program window. You must install the sample application files provided by choosing the MSDN Library option during Setup. For more information, see Chapter 1, Installing Visual FoxPro in the Installation Guide.

To run a code example

  1. At the top of the Help topic, click the “Example” link.

  2. Select the code entirely and copy it to the Clipboard (Ctrl+C).

Important   You must select the entire code example in order to preserve the paragraph formatting for each line of code. Otherwise the paragraphs will be ignored when you paste the code into the program window and the code won't run.

  1. Click the Command window in Visual FoxPro and type MODIFY COMMAND to open a program window.

    –or-

    Choose New from the File menu in Visual FoxPro, click the Program option button in the New dialog box, then click the New File button.

  2. Paste the code into the program window (Ctrl+V).

  3. Click the ! button to run the progam.

  4. Name and save the program when prompted. When saved, the program runs.