Freigeben über


IntelliSense Table Structure

The IntelliSense table contains records that specify IntelliSense functionality for native Visual FoxPro and user-defined language elements. By default, the IntelliSense table is named FoxCode and is stored in the FoxCode.dbf file, which is located in the main Microsoft Visual FoxPro directory and is specified by the _FOXCODE system variable. For more information, see _FOXCODE System Variable.

Note

The IntelliSense table contains limited support for the Watch window in the Visual FoxPro Debugger and depends on whether an expression is valid for the Watch window.

Support for the Watch window exists in the IntelliSense table for the following areas:

  • List Members for instantiated objects.

  • Quick Info for instantiated objects.

  • Function items.

  • Memory variable expansion by typing m.

IntelliSense functionality is not supported in the Watch window for the following:

  • List Values for instantiated objects.

  • Command items.

  • Default script handlers.

  • Property value editors.

  • User-defined commands.

  • Most recently used (MRU) files.

The following table describes the structure of the IntelliSense table.

Field name Type (size) Description

Type

C (1)

Specifies the type of item in the record. For more information, see Valid Item Types for the Type Field.

Abbrev

C (24)

Represents the minimum set of characters typed to activate IntelliSense functionality for this item. The text you type from the Abbrev field is replaced by the text in the Expanded field.

Expanded

C (26)

Specifies the text that IntelliSense uses to replace text typed at the current cursor position. The text in the Expanded field replaces the text you type from Abbrev field.

Cmd

C (15)

Specifies the script reference for this item.

Tip

M

Specifies the text to display in the Quick Info Tip window.

Data

M

Specifies contents for IntelliSense List Values functionality, Visual FoxPro code specific to this item, or other script text.

Case

C (1)

Specifies letter casing for replacement text.

U = Uppercase

L = Lowercase

M or <empty> = Mixed case

P = Proper case

X = Unchanged

Any value you specify in the field of the version record sets a global default for individual records that do not have a Case setting.

Save

L

Specifies whether the record is saved when the field is updated.

TimeStamp

T

Represents a unique timestamp for this item.

Source

M

Specifies the source of record contents. The word RESERVED specifies core contents shipped with this version of Visual FoxPro. This field can contain path and file name information for user-supplied records.

UniqueID

C (10)

Specifies a unique identifier for this record.

User

M

Specifies user information.

Valid Item Types for the Type Field

The following table describes valid values and item types for the Type field in the IntelliSense table.

Type field Item type Description

O

COM Component

Specifies the COM type library reference to display in AS clause IntelliSense lists. For more information, see COM Component Item Type.

C

Command

Specifies syntax completion items for Visual FoxPro commands. For more information, see Command Item Type.

E

XML

Specifies that the item is a property or method that has member metadata. For more information, see MemberData Extensibility.

F

Function

Specifies syntax completion items for Visual FoxPro functions, procedures, and user-defined functions. For more information, see Function Item Type.

P

Property

Specifies script references for displaying value editors for certain Visual FoxPro properties. For more information, see Property Item Type.

S

Script

Specifies the Visual FoxPro scripts to run. For more information, see Script Item Type.

T

Typing

Specifies items that appear in AS clause IntelliSense lists or when referencing objects. For more information, see Typing Item Type.

U

User

Specifies user-defined auto-expansion items. Unlike Command items, User items do not require exact pattern matches. For more information, see User Item Type.

V

Version

Specifies a special record for version and tracking information (reserved). For more information, see Version Item Type.

COM Component Item Type

The COM Component item type specifies an IntelliSense table record whose contents appear in AS clause IntelliSense lists, similar to Typing items. A COM Component item specifies the name of a COM type library that contains a collection of classes (ProgIDs) that Visual FoxPro can create instances of using the CREATEOBJECT( ) function. The Data field for a COM Component item contains the GUID and version for the type library.

The following table illustrates an example IntelliSense record for a COM Component item.

Field Name Example

Type

O

Abbrev

Excel

Cmd

{}

Tip

Microsoft Excel 9.0 Object Library

Data

{00020813-0000-0000-C000-000000000046}#1.3

Command Item Type

The Command item specifies a IntelliSense table record whose contents complete or replace syntax or display a Tip window for Visual FoxPro commands.

Note

The characters in the Abbrev field of Command item records must match the initials of the text in the Expanded field. For example, if the Expanded field contains the command MODIFY COMMAND, the Abbrev field must contain the initials MC.

The following table illustrates an example IntelliSense record for a Command item.

Field Name Example

Type

C

Abbrev

MC

Expanded

MODIFY COMMAND

_MemberData Property Type

The _MemberData record supports the GetMemberData design-time builder hooks.

Field Name Example

Type

E - Indicates that the item is property or method with metadata

Abbrev

_GETMEMBERDATA - Name of a member property or method

Data

Contents of the script to run for the property or method

Function Item Type

The Function item specifies an IntelliSense table record whose contents complete or replace syntax or display a Tip window for Visual FoxPro and user-defined functions and procedures.

The following table illustrates an example IntelliSense record for a Function item.

Field Name Example

Type

F

Abbrev

FCOU

Expanded

FCOUNT

Tip

[nWorkArea | cTableAlias]

Property Item Type

The Property item specifies an IntelliSense table record whose contents can specify code in its Data field or a script reference in its Data field to a Script item. The code or script reference can run to display a custom value editor when you assign values for the property that the Property item corresponds to.

The following table illustrates an example IntelliSense record for a Property item.

Field Name Example

Type

P

Abbrev

.Picture

Cmd

{picture}

In this example, the Cmd field contains the script reference "{picture}" for a script stored by a separate Script item. The Abbrev field in the Script record contains the character string, "Picture", and the code in the Data field of the Script record runs when you type the following line of code or use IntelliSense to complete the following syntax:

Object.Picture=

For more information, see Script Item Type.

Script Item Type

The Script item specifies an IntelliSense table record that contains code or data in its Data field. When you store code in a separate Script item, other IntelliSense table records can reference and run that code by storing a script reference in the Cmd field.

Note

A script reference is an optional keyword that appears in the Abbrev field of the Script record and is enclosed by a pair of opening and closing braces ({}).

Code that IntelliSense runs must contain a parameter to pass to the FoxCode parameter object. The FoxCode parameter object contains metadata describing how the script was called, including the source record in the IntelliSense table. Therefore, the code in a Data field must contain a PARAMETERS or LPARAMETERS statement to accommodate the object reference. For more information about the FoxCode parameter object, see FoxCode Object Reference.

The value returned by the code replaces any text that is typed at the current cursor position. However, if the return value evaluates to an empty string (""), Visual FoxPro leaves the typed text unchanged.

The following table illustrates an example IntelliSense record for a Script item.

Field Name Example

Type

S

Abbrev

Picture

Data

(Stored in a memo field)

LPARAMETERS oFoxcode
   LOCAL lcPicture
   oFoxcode.ValueType="V"
   lcPicture = GETPICT()
   IF LEN(lcPicture) > 0 
      lcPicture = ['] + lcPicture + [']
   ENDIF
   RETURN lcPicture

For this example, suppose the Cmd field in a Property item for the Picture property contains the script reference "{picture}" for the example Script item. When you select the Picture property for an object by typing .Picture followed by an equal sign (=) and select the image picker, the code in the Data field of the Script item runs and displays the Open Picture dialog box.

For more information about using scripting, see How to: Create IntelliSense Scripts.

Typing Item Type

The Typing item specifies an IntelliSense table record whose contents describe an item that appears in the IntelliSense list for AS clauses. The Data field for a Typing item can optionally contain code that returns a value that IntelliSense inserts at the current cursor position.

Tip

If you include code in the Data field, end it with a RETURN statement.

The following table illustrates an example IntelliSense record for a Typing item.

Field Name Example

Type

T

Abbrev

CommandButton

Data

CommandButton

User Item Type

The User item specifies an IntelliSense table record whose contents complete or replace user-defined abbreviations. Unlike the Abbrev field in Command items, the User item abbreviation does not need to match the initials of text in the Expanded field.

Field Name Example

Type

U

Abbrev

MYADDRESS

Expanded

101 Main Street

Version Item Type

The Version item type specifies an IntelliSense table record that contains default settings and tracks version information. The Version item type is reserved for internal use.

Field Name Example

Type

V

Expanded

Identifies latest version of IntelliSense. For internal use.

See Also

Tasks

How to: Edit IntelliSense Records
How to: Create IntelliSense Scripts

Reference

_MemberData Property

Concepts

MemberData Extensibility

Other Resources

Customizing IntelliSense in Visual FoxPro