Partager via


How to: View IntelliSense When Writing Code

You can display IntelliSense functionality when typing code in Visual FoxPro editors, code windows, and the Command window or when debugging code in the Watch window of the Visual FoxPro Debugger.

When List Members or Quick Info in IntelliSense is set to Automatic, IntelliSense functionality displays when you press an activator key. The activator key you press differs depending on the code context. When List Members or Quick Info is set to Manual, you can display IntelliSense functionality by pressing the appropriate keyboard shortcut in the appropriate cursor position. For more information, see IntelliSense Activator, Navigation, and Terminator Keys and Keyboard Shortcuts (Visual FoxPro).

The following sections describe how you can view IntelliSense functionality when you type code:

  • Viewing Quick Info and Available Members and Values

  • Viewing Most Recently Used (MRU) Files

  • Viewing Available Tables, Fields, and Variables

Viewing Quick Info and Available Members and Values

You can view Quick Info (syntax information) or available members or values when you type code. For more information, see IntelliSense Syntax Completion.

To view Quick Info for commands

  1. Type the first word in the command and press SPACEBAR.

    IntelliSense performs one of the following actions so you can continue typing the command:

    • Inserts partial syntax.

    • Displays a list of valid members so you can select one.

      Tip

      To browse the list and view Quick Info for each member in the list, press the DOWN ARROW or UP ARROW key. IntelliSense displays a Tip window with information, if available, about each member.

    • Displays a Tip window with the remaining syntax.

  2. Continue typing.

    -OR-

    Select a member by double-clicking the member. You can also click the member and press SPACEBAR.

    The member appears at the current cursor position.

For example, suppose you type the following line of code followed by a space (" ") in the Command window:

ALTER 

IntelliSense completes the SQL ALTER TABLE command partially and displays the remaining syntax information in a Tip window.

To view Quick Info for functions and object methods

  1. Type the name of the function or object method followed immediately by an opening parenthesis (().

    IntelliSense performs one of the following actions so you can continue typing the function or method:

    • Displays a Tip window with the remaining syntax. When entering argument values, the syntax for the next argument appears in bold.

    • Displays a list of valid values so you can select one.

      Tip

      To browse the list and view Quick Info for each value in the list, press the DOWN ARROW or UP ARROW key. IntelliSense displays a Tip window with information, if available, about each value.

  2. Continue typing.

    -OR-

    Select a valid value by double-clicking the value or click the value and press SPACEBAR.

For example, suppose you type the following line of code followed immediately by an opening parenthesis in the Command window:

SYS(

IntelliSense displays a list of valid values so you can select one.

For more information, see IntelliSense Syntax Completion.

To view available members for system variables or objects

  1. Type the name of a valid system variable or instantiated object followed immediately by a period (.).

    IntelliSense displays a list of available members so you can choose one.

    Tip

    To browse the list and view Quick Info for each member in the list, press the DOWN ARROW or UP ARROW key. IntelliSense displays a Tip window with information, if available, about each member.

  2. To select a valid member, double-click the member. You can also click the member in the list and press SPACEBAR.

For example, suppose you want to set the Visible property for a form programmatically by typing the following in the Command window:

oMyForm = CREATEOBJECT("Form")
oMyForm.

When you type the period (.) following oMyForm, IntelliSense displays a list with the members of the object oMyForm. You can then choose the Visible property from the list.

The member list remains visible until you perform one of the following actions:

  • Enter all required parameters followed by a space (" ").

  • Type a terminator key, such as ESC, END, or HOME, or an invalid character key.

  • Change the active window.

For more information, see IntelliSense Syntax Completion.

To view available values for properties

  1. Type the name of the property followed immediately by an equal sign (=).

    -OR-

    Select the property from a member list, press SPACEBAR, and then type an equal sign.

    IntelliSense displays a list of values, if available, so you can choose one.

  2. Select a value by double-clicking the value. You can also click the value and press SPACEBAR.

    The value appears at the current cursor position.

For example, suppose you set the Visible property for a form programmatically by typing the following in the Command window:

oMyForm = CREATEOBJECT("Form")
oMyForm.Visible=

When you type the equal sign (=) to assign a True (.T.) or False (.F.) value to the Visible property, IntelliSense displays a list box with the appropriate values for you to choose from.

For more information, see IntelliSense Syntax Completion.

Viewing Most Recently Used (MRU) Files

You can view and select available most recently used files in the appropriate locations when you type code. For more information, see IntelliSense Auto MRU (Most Recently Used) Files.

To view available and most recently used (MRU) files

  1. Type the appropriate command followed immediately by a space (" ").

    IntelliSense displays a list of available files so you can browse the list and select a file.

  2. Select a file by double-clicking the file. You can also click the file and press SPACEBAR.

    The path, if appropriate, and file name appear at the current cursor position.

Viewing Available Tables, Fields, and Variables

You can view and select available tables, fields, and variables in the appropriate locations when you type code. For more information, see IntelliSense Auto Table, Field, and Variable Names.

To view available tables and fields

  1. Open a table in Visual FoxPro.

  2. Type the appropriate command followed immediately by a space (" ").

    Depending on the command, IntelliSense displays a list of available tables or fields so you can browse the list and select a table or field.

  3. Select a table or field by double-clicking the table or field. You can also click the table or field and press SPACEBAR.

    The table or field name appears at the current cursor position.

To view available variables

  • In the Command window, type the letter "m" followed immediately by a period (.).

    IntelliSense displays a list of all declared and available variables.

For example, suppose you declare two variables by typing the following code in the Command window:

oMyForm=CREATEOBJECT("Form")
oMyForm2=CREATEOBJECT("Form")
m.

When you type the period following the letter "m", IntelliSense displays a list of all declared and available variables.

See Also

Tasks

How to: Set IntelliSense Options

Other Resources

Customizing IntelliSense in Visual FoxPro

IntelliSense Overview