Partilhar via


Interactive Development Environment (IDE) Enhancements

To provide a more integrated development environment for your projects and applications, Visual FoxPro contains the following improved functionality for the IDE.

Additional Project Manager Shortcut Menu Commands

When docked, the Project Manager window contains the following additional shortcut menu commands that are available on the Project menu:

  • Close

    Closes the Project Manager.

  • Add Project to Source Control

    Creates a new source control project based on the current project. Available only when a source code control provider is installed and specified on the Projects tab in the Options dialog box.

  • Errors

    Displays the error (.err) file after running a build.

  • Refresh

    Refreshes the contents of the Project Manager.

  • Clean Up Project

    Removes deleted records from the Project Manager (.PJX) file.

Modifying a Class Library from the Project Manager

When you select a class library (.vcx) file in the Project Manager, you can now open and browse class libraries by clicking the Modify button. The class library opens in the Class Browser. For more information, see How to: Open Class Libraries.

Set Font of Project Manager

You can change the text font settings for the Project Manager window. Right-click the Project Manager window (outside of the tree hierarchy window) and choose Font.

Generating Message Logs During Project Build and Compile

When you build a project, application, or dynamic-link library, Visual FoxPro automatically generates an error (.err) file that includes any error messages, if they exist, when the build process completes. When you select the Display Errors check box in the Build Options dialog box, Visual FoxPro displays the .err file when the build completes. Selecting the Recompile All Files check box includes compile errors in the .err file. Build status messages usually appear in the status bar. However, in previous versions, if the build process is interrupted, Visual FoxPro did not write the .err file to disk.

In the current release, Visual FoxPro writes build status and error messages to the .err file as they occur during the build process. If the build process is interrupted, you can open the .err file opens to review the errors.

Note

If no errors occur during the build, the .err file is deleted.

If the Debug Output window is open, build status and error messages appear in the window. You can save messages from the Debug Output window to a file.

For more information, see How to: View and Save Build Messages.

Properties Window Enhancements

  • Design time support for entering property values greater than 255 characters and extended characters, such as CHR(13) (carriage return) and CHR(10) (linefeed), has been added to visual class library (.vcx) and form (.scx) files. You can now enter up to 8k characters in length.

    Note

    Extended property value support is only available through the Properties Window (Zoom dialog box) for custom user-specified properties as well as certain native ones such as CursorSchema and Value. For properties not supported, you can still specify values which are longer than 255 characters, or contain carriage returns and linefeeds by assigning them in code such as during the object's Init Event.

    The Zoom dialog box and Expression Builder dialog box have been updated to support this. The Properties window includes a Zoom (Z) button that appears next to the property settings box for appropriate properties.

    Warning

    Property values that exceed 255 characters or include carriage return and/or linefeed characters are stored in a new format inside the .vcx or .scx file. If you attempt to modify these classes in a prior version, an error occurs.

    This feature is particularly useful for setting the CursorAdapter CursorSchema property to any schema expression when schemas might exceed 255 characters.

  • The Properties window font can now be specified by the new Font shortcut menu option. This new menu replaces the Small, Medium and Large font menu items used in prior versions. This font is also used in the description pane, and object and property value dropdowns.

    Note

    Bold and italic font styles are reserved for non-default property values and read-only properties, respectively. If a bold or italic font style is chosen, then the Properties window inverts the displayed behavior. For example, if one chooses an italic font style, read-only properties appear in normal font style and all others in italic.

  • Colors can be specified for certain types of properties by right clicking on the Properties Window and selecting following menu items:

    • Non-Default Properties Color

      Sets color for properties whose values have changed from default setting (same properties that are displayed when the Non-Default Properties Only menu item is selected).

    • Custom Properties Color

      Sets color for custom properties.

    • Instance Properties Color

      Sets color for custom properties that have been added to the current class instance (same properties that appear in bold in the Edit Property/Method Dialog Box).

    Note

    If a conflict exists between color settings, the Instance setting takes priority followed by the Non-Default one.

For more information, see Zoom <property> Dialog Box, Expression Builder Dialog Box, CursorSchema Property, and Properties Window (Visual FoxPro).

MemberData Extensibility

The MemberData extensibility architecture lets you provide metadata for class members (properties, methods and events). With MemberData, you can specify a custom property editor, display a property on the Favorites tab, or change the capitalization in the Properties Window (Visual FoxPro).

For more information, see MemberData Extensibility.

Setting Default Values for New Properties

When adding a new property to a class, you can specify an initial value other than the default in the New Property dialog box. Subclasses inherit these default values unless you reset the default values to the parent class. In previous versions, you had to set the default value for the new property by selecting the property in the Properties window and setting the default value.

For more information, see How to: Add Properties to Classes.

Document View Sort Options

You can now sort items in the Document View window by name for forms and visual class libraries.

See Document View Window for more information on sorting items in the Document View Window.

Compiling Code in the Background

Visual FoxPro performs background compilation when syntax coloring is turned on in the Command window and Visual FoxPro editors for program (.prg) files, methods, stored procedures, and memos. The Expression box in the Expression Builder dialog box also includes support for background compilation and syntax coloring when turned on.

When the single and current line of code that you are typing contains invalid syntax, Visual FoxPro displays the line of code with the formatting style selected in the Editor tab of the Options dialog box.

Note

Syntax coloring must be turned on for background compilation to function. Background compilation does not detect invalid syntax in multiple lines of code, including those containing continuation characters.

For more information, see How to: Display and Print Source Code in Color.

Rich Text Format (RTF) Clipboard Support

Visual FoxPro now supports copying in RTF (Rich Text Format) to the clipboard. Visual FoxPro preserves the style (bold, italic, and underline) and color attributes.

RTF is supported only in the FoxPro editors that allow for syntax coloring, such as the Command window and editing windows opened with MODIFY COMMAND Command. The RTF clipboard format is only supported when syntax coloring is enabled such as from Edit Properties Dialog Box. You can disable RTF clipboard format with the _VFP EditorOptions Property.

The _CLIPTEXT System Variable does not support RTF.

Find Dialog Box Improvements

The following improvements were made to Find support:

  • If a word is selected in a Visual FoxPro editor, the Find Dialog Box (Visual FoxPro) when opened now displays the word in the Look For drop-down box. If Find has not yet been used for a running instance of Visual FoxPro, a word positioned under the insertion pointer will appear in the Look For drop-down. If multiple words are selected, only the first word appears in the drop-down (use copy and paste to enter multiple words).

  • When a Browse window is open and you search for a word with the Find dialog box, you can search for the word again (Find Again) after the Find dialog box is closed by pressing the F3 key.

  • You can now use Find to search for content in Name column of the Watch and Locals debug windows (see Debugger Window). When searching object members, Find searches in these debug windows are limited to nodes that have been expanded and one level below.

View Constants in Trace Window

Constants (#DEFINE values) can be viewed in the Trace Window when you hover over it with the mouse.

Note

Visual FoxPro evaluates constants as expressions in the Trace Window and may have difficulty interpreting a specific #DEFINE when you hover over it with the mouse. Consequently, if there are multiple expressions on a line, they are all displayed in the value tip.

Printing Selected Text in Editor Windows

You can print selected text from Visual FoxPro editor windows. When you have text selected in the editor window, the Selection option in the Print dialog box is available and selected.

Note

If a partial line is selected, the entire line is printed.

For more information, see Print Dialog Box (Visual FoxPro).

System Font Improvements

To improve legibility on high-resolution monitors, Error dialog boxes and the Zoom <property> Dialog Box in the Properties window now use the Windows Message Box text font.

In Windows XP, the Windows Message Box text font is set by opening Display in the Control Panel, and then clicking Advanced on the Appearance tab.

IntelliSense Saves Settings Between User Sessions

Visual FoxPro now saves IntelliSense settings, such as turning IntelliSense on, between user sessions. These settings are controlled by the _VFP EditorOptions property. In addition, the settings in the _VFP EditorOptions property are saved in the FoxUser.dbf resource file. For more information, see EditorOptions Property.

IntelliSense in Memo Field Editor Window

Visual FoxPro includes IntelliSense support in Memo field editor windows when syntax coloring is turned on.

IntelliSense Available for Runtime Applications

Selected IntelliSense features are available at run time in distributed Visual FoxPro 9.0 applications. In order to use IntelliSense at run time, you need to set the _FOXCODE and _CODESENSE variables, and EditorOptions Property.

Note

With runtime applications, syntax coloring does not need to be turned on for an editor to support IntelliSense.

For more information, see IntelliSense Support in Visual FoxPro, _FOXCODE System Variable, _CODESENSE System Variable and EditorOptions Property.

IntelliSense Support in WITH ... ENDWITH and FOR EACH ... ENDFOR Commands

Visual FoxPro now supports IntelliSense within the WITH ... ENDWITH Command and FOR EACH ... ENDFOR Command.

WITH ObjectName [AS Type [OF ClassLibrary]]

  Commands

ENDWITH

FOR EACH ObjectName [AS Type [OF ClassLibrary]] IN Group

  Commands

  [EXIT]

  [LOOP]

ENDFOR

The Type parameter can be any valid type, including data types, class types, or ProgID. If the class name cannot be found, Visual FoxPro disregards Type and does not display IntelliSense for it.

Note

The type reference does not affect the functionality of the application at run time. The type reference is only used for IntelliSense.

The ObjectName expression can refer to a memory variable or an array.

The ClassLibrary parameter must be in a path list that is visible to Visual FoxPro. You must specify a valid class library; references to existing objects are not valid. If Visual FoxPro cannot find the specified class library, IntelliSense does not display.

Types expressed as ProgIDs and class libraries do not require quotation marks ("") to enclose them unless their names contain spaces.

When a user types the AS keyword, IntelliSense displays a list of types registered in the FoxCode.dbf table with Type "T". If you have specified a valid type, typing a period within a WITH ... ENDWITH or a FOR EACH ... ENDFOR command displays IntelliSense for that object reference.

Visual FoxPro supports IntelliSense for nested WITH ... ENDWITH and FOR EACH ... ENDFOR commands. The following is an example of nested WITH ... ENDWITH commands in a class defined in a program (.prg) file named Program1.prg. To use, paste this code into a new program named Program1.prg, save it and then type a period (.) inside the WITH ... ENDWITH block.

DEFINE CLASS f1 AS form
MyVar1 = 123
ADD OBJECT t1 AS mytext
PROCEDURE Init
  WITH THIS AS f1 OF program1.prg
    WITH .t1 AS mytext OF program1.prg
    ENDWITH
  ENDWITH
ENDPROC
ENDDEFINE

DEFINE CLASS mytext as textbox
MyVar2 = 123
ENDDEFINE

IntelliSense provides limited List Values functionality for selected properties that begin with a "T" or "F" within a WITH ... ENDWITH or FOR EACH ... ENDFOR command. This is done to avoid possible conflicts with the common property values True (.T.) and False (.F.). If you just type ".T" or ".F" and press Enter, the word selected in the List Value drop-down does not expand. You need to type at least two letters for IntelliSense to insert the selected word.

See Also

Reference

Guide to Reporting Improvements
Data and XML Feature Enhancements
SQL Language Improvements
Class Enhancements
Language Enhancements
Enhancements to Visual FoxPro Designers
Miscellaneous Enhancements
Changes in Functionality for the Current Release

Other Resources

What's New in Visual FoxPro