New Visual FoxPro 5.0 Features

Microsoft Corporation

October 1996

Abstract

Microsoft® Visual FoxPro™ version 5.0 brings you expanded capabilities to help you in every area of application and database development. In this version, you have greater control over your projects and databases. You can see improvements in performance, system resource use, and design environment.

This article covers features new to Visual FoxPro 5.0 in some detail and assumes familiarity with Visual FoxPro version 3.0. If you are new to Visual FoxPro, see the product information for versions 3.0 and 5.0 available at http://www.microsoft.com/VFOXPRO/vfinfo/vfinfo.htm.

Better Performance

Developers using Microsoft ® FoxPro® have come to expect the highest levels of performance. In the previous release, Microsoft Visual FoxPro™ version 3.0, the focus was on a dramatic new object-oriented paradigm for development. In developing Visual FoxPro version 5.0, honing performance under this paradigm was a key goal.

Data Retrieval Performance

Visual FoxPro 5.0 delivers even faster local data retrieval and continues its leadership in retrieving server-based data. Visual FoxPro 5.0 allows you to do the following:

Use ANSI-compliant joins. In addition to being consistent with Microsoft Access, Microsoft SQL Server, and other American National Standards Institute–compliant (ANSI-compliant) approaches, this method yields faster results than its predecessor. For developers moving from previous versions, queries are automatically converted to the new syntax by the Query Designer. The Query Designer also creates ANSI-style joins by default, so developers can learn the new syntax as they build new queries.

Include or exclude memo fields in update detection. You can use the CompareMemo property to control when memo fields are used to detect update conflicts. This view and cursor property determines whether memo fields (types M and G) are included in the update WHERE clause.

Fine-tune record fetching. Use the FetchAsNeeded property to specify whether all rows are fetched progressively or only those within the row set determined by the FetchSize property.

Speed up requery operations on parameterized views. Using the new Prepared property, you can specify whether the query for the view is prepared before it is executed. If you set this property to true (.T.), Visual FoxPro sends a request to the Open Database Connectivity (ODBC) driver to prepare, or compile, the SQL query that defines the view. If the ODBC driver for your back-end data source supports the use of prepared statements, subsequent requeries on the open view are executed faster.

Analyze queries for optimization. Use SYS(3054) to improve query performance by determining the extent to which the query is optimized by Microsoft Rushmore™ technology. If SYS(3054,1) indicates that a query could not be optimized or could be optimized only partially, you can modify the query to take advantage of Rushmore optimization.

Object Performance

Visual FoxPro 5.0 enhances the speed with which objects are painted on the screen and the speed with which form controls are bound to the underlying data, while reducing the memory footprint for several commonly used controls. The result is a 40 to 200 percent improvement in form performance, depending on machine configuration. New features include:

Delay binding. The new delayed binding technology provides faster and smarter object initialization, only binding to the data source when necessary.

Clear cached resources. When Visual FoxPro displays a bitmap, picture, cursor, icon, or font resource, the resource is cached to optimized performance. If a resource of the same name is used (for example, a different bitmap with the same name as one already cached), Visual FoxPro does not reload the resource. The new Clear Resources command, however, lets you clear the cached memory.

Enhanced Project Management and Application Creation

Multiple developers can simultaneously work on your fast and powerful Visual FoxPro applications.

Let several people work on database objects. You can now modify tables and view definitions without exclusive access to the database. Use the new Refresh option on the Database menu; this reloads the database object definition to reflect any changes made by other users.

Use source code control. You can use a source code control program, such as Microsoft Visual SourceSafe™, to coordinate and manage changes to applications you develop in Visual FoxPro. The Project Manager provides access to source code control on the Project menu.

Compare and merge changes to binary files. The new _SCCTEXT system variable references a Visual FoxPro conversion program (by default, scctext.prg) that handles translating Visual FoxPro binary files into text equivalents and back.

Create dynamic-link library (.DLL) files. The Project Manager and the BUILD DLL command allow you to create .DLL files.

Recompile before building. The new RECOMPILE keyword of the BUILD EXE, BUILD APP, and BUILD DLL commands allows you to recompile all application files before building.

Preserve build settings. When you open your new projects, Visual FoxPro 5.0 restores the last build settings so that you don't have to manually reset them.

Compile version information in your applications . You can specify information and incremented version numbers to be compiled in your .exe or .dll files (Figure 1).

Figure 1. Visual FoxPro allows you to compile version information.

More Robust Database Management

Data management is at the heart of most Visual FoxPro applications and Visual FoxPro 5.0 refines the Visual FoxPro database paradigm.

Table Design and Expanded Data Dictionary

The Table Designer has been enhanced for easier use and better integration with the Form Designer to allow you to do the following:

Manage large databases. The Database Designer helps you manage large databases by allowing you to find components, and arrange and filter the views of the data. Choose Properties from the Database Designer shortcut menu to set filters.

Add indexes as you design fields. Indexes on fields can be specified at the same time you create the field. More complex indexes can be created in the adjacent tab.

Set input masks and captions as you design the table. When you drag fields from the Table to the Form Designer, the values you set in the Table Designer are respected.

Set data validation rules directly and easily. A Table tab gives you direct access to the table-level validation rules, triggers, and statistics.

Query and View Design

You can now create outer joins, specify aliases for columns, or select the top number or percentage of records, right in the Query and View Designers. Also, using the View Designer, you can specify the same extended properties on view fields that you can on table fields. For example, you can specify a default control class, input mask, or format.

View offline data. You can use the CREATEOFFLINE() and DROPOFFLINE() functions to create offline views. An offline view allows you to edit and append data to a data source even when you aren't connected to the data source. After making changes to the offline view, you can update the data on the server with your changes by opening the offline view with USE and including the ONLINE clause.

Use an enhanced SELECT command. Table 1 lists the new keywords that have been added to the SELECT - SQL command.

Table 1. New Keywords in the SELECT - SQL Command

Keyword Description
  FORCE Specifies that tables are joined in the order in which they appear in the FROM clause. If FORCE is omitted, Visual FoxPro attempts to optimize the query.
FULL [OUTER] JOIN Specifies that the query result contains all matching and non-matching rows from both tables. The OUTER keyword is optional; it can be included to emphasize that an outer join is created.
INNER JOIN Specifies that the query result contains only rows from a table that match one or more rows in another table.
LEFT [OUTER] JOIN Specifies that the query result contains all rows from the table to the left of the JOIN keyword and only matching rows from the table to the right of the JOIN keyword. The OUTER keyword is optional; it can be included to emphasize that an outer join is created.
NOFILTER Creates a cursor that can be used in subsequent queries. Including NOFILTER can reduce query performance because a temporary table is created on disk. The temporary table is deleted from disk when the cursor is closed.
RIGHT [OUTER] JOIN Specifies that the query result contains all rows from the table to the right of the JOIN keyword and only matching rows from the table to the left of the JOIN keyword. The OUTER keyword is optional; it can be included to emphasize that an outer join is created.
TOP nExpr [PERCENT] Specifies that the query result contains a specific number of rows or a percentage of rows in the query result.

Integrating Data into Applications

One of the great strengths of Visual FoxPro is the tight integration of data, objects, and applications. Visual FoxPro 5.0 adds to this story.

Change table values in rules. The engine now supports changes to values that violate rules. You can now include code in your field and record validation rules to update values in the same table.

Update all rows that don't generate conflicts. The TABLEUPDATE() function gives you three scope options: you can update the current row; update all records up to the first row that generates a data conflict; or now, update all rows that don't generate a data conflict, leaving rows with data conflicts still in the table buffer for you to resolve separately.

Have greater control over views in the data environment. The OpenViews property of the data environment allows you to specify whether all views, only local views, or only remote views are opened. By changing a single property value, you can have a single form provide access to local or remote data.

Reference hexadecimal values. Visual FoxPro now supports hexadecimal notation. To indicate that a value is hexadecimal, prefix it with 0x. For example, the following command prints 255 on the active window:

? 0xFF

Other database engine enhancements include more efficient pessimistic buffering and the use of NULL as a recognized keyword that can be used in place of ".NULL." In addition to the features already noted, the data manipulation commands and functions in Table 2 have been added or enhanced.

Table 2. Data Manipulation Commands Added or Enhanced in Visual FoxPro 5.0

Command Description
  APPEND FROM and COPY TO New DELIMITED WITH CHARACTER clause allows you to provide the character that separates fields.
BINTOC() Converts an integer value to a binary character representation. Indexing on BINTOC(<numeric field>) reduces the size of an index.
CTOBIN() Use CTOBIN() to convert a binary character representation created with BINTOC() back to its integer value.
DROP TABLE Removes a table from the current database and deletes it from the disk.
DROP VIEW Deletes an SQL view from the current database.
IMPORT, CREATE FROM, SORT, and TOTAL New DATABASE and NAME clauses.
ISFLOCKED() Returns the file lock status.
ISRLOCKED() Returns the record lock status.

Improved Development and Debugging Tools

The Visual FoxPro editing environment is more flexible than ever, with editing features only a right-click away.

Automatically format your code for easy readability. The Beautify option from the Editing window shortcut menu allows you to capitalize and indent code.

Mark multiple lines of code as comments. Just select the lines of code you want to comment out and choose Comment from the shortcut menu. To remove the comments, select the lines of code again and choose Uncomment from the shortcut menu.

Immediately execute selected lines of code. To run a subset of a function for incremental testing, select the code and choose Execute Selection from the shortcut menu. You can take advantage of this feature in the Command window to execute FOR or WHILE loops.

Color-code language elements. New syntax coloring allows you to display different language elements in colors and fonts of your choice.

See a list of all procedures in a file. The Procedure/Function option on the shortcut menu displays a dialog box listing all the procedures, functions, and #DEFINE keywords in a program file. Choose a procedure and go there directly in the file.

Easily insert object references. In a Form or Class Designer editing window, choose Object List from the shortcut menu to open a dialog box with a list of all contained objects. Choose an object to return a fully qualified reference to the object.

Create expressions easily. The Expression Builder is accessible at all times from the shortcut menu.

Find text again. The Find dialog box, available from the shortcut menu, saves previous searches in a drop-down combo box so that you can easily rerun them. The Find Again option has been returned to the Edit menu.

Testing and Debugging Immediately

Using the debug environment, you can test and debug your code at the same time you design each component of your application and write the code. Also, the debugging tools work independently from the main application and do not interfere with the interface you are trying to test.

Test as you design. The enhanced Visual FoxPro development environment gives you more power to test your component design and code. For example, if you are designing a form, you can click the Run button to run the code. If you want to change something, just click the Design button and make your changes.

Debug with power. You can debug and monitor your application components more easily in this version of Visual FoxPro using the new Debugger window.

View properties of an object. In the new debugger, you can view the elements within a collection or array using the Watch window to show a hierarchical display of an object's properties.

Trace the execution process of your code. In the Trace window, you can see each line of code as it executes and check the values of all variables, properties, and environment settings. You can even use the Set Next Statement menu item to skip the execution of lines of code or to go back and re-execute lines of code.

Control execution with breakpoints. You can control when execution stops by using one of four types of breakpoints. You can stop at a particular line, when a certain value changes, if a condition evaluates to true, or if a condition for a certain line is true.

Set asserts and display assert messages. You can use the ASSERT command to specify conditions that verify that the code is running properly. When an error occurs, the Debug Output window records the message.

Check the current value of a variable. To quickly check values, you can place the cursor over a variable in the Trace Window to display a Value Tip.

Watch and change values. In the Watch window and Locals window, you can change values for properties or variables while you run the code.

Display output from message requests. In the new Debug Output window, you can conveniently display interactive or coded information requests separate from the active window or screen.

Use a coverage log file. In the Debugger window, you can use the coverage option to log the execution information about your code, such as how long the line took to execute, the line number, and more. You can create your own program to process this information, set the _COVERAGE system variable to the program, and call the program directly from the Coverage dialog box.

Open code from the debugger. When you have isolated a problem in the Trace window, you can choose Fix from the Debug menu and go directly to the problem area in the Form Designer, Class Designer, or an editing window.

Track event firing sequences. You can see the execution order of all or any subset of the Visual FoxPro events in your applications, whether or not you have code written for the event. This allows you to find the most efficient place to add your code.

Save and restore debugger settings. You can save breakpoints, watches, lists of events to track, and other debugging information in configuration files to be restored whenever you want.

Table 3 lists the new commands that have been added to give you greater programmatic control of your debugging environment.

Table 3. New Commands for Programmatic Control of Debugging

Command Description
  DEBUG Opens the Visual FoxPro debugger.
DEBUGOUT Directs the result of an expression to the Debug Output window.
SET ASSERTS Specifies if ASSERT commands are evaluated or ignored.
SET COVERAGE Turns code coverage on or off or specifies a text file to which code coverage information is directed.
SET DEBUGOUT Directs debugging output to a file.
SET EVENTLIST Specifies events to track in the Debug Output Window or in a file specified with SET EVENTTRACKING.
SET EVENTTRACKING Turns event tracking on or off or specifies a text file to where event tracking information is directed.

Rapid Application Development

In addition to a richer development environment, Visual FoxPro 5.0 provides more tools and features to help you quickly create robust database applications.

More and Better Wizards

Wizards automate common tasks so that you can focus on custom application features. Visual FoxPro Wizards help you to do the following:

Develop instant applications. Using the Application Wizard, you can quickly create an application by using your tables and forms or by using a sample set of application components.

Create an Internet Web page. You can create a Web page that provides Web surfers with search and retrieve access to your tables.

Add page frames to forms. If you choose more fields than can fit on the form, you can add a page frame to display the additional fields on additional pages.

Populate pivot tables through ODBC. The PivotTable Wizard uses the new Visual FoxPro ODBC driver.

Show nulls in a cross-tab report. The Cross-Tab Wizard now supports displaying null values.

Move your data to a back-end server. You can move Visual FoxPro databases, tables, and views from your system to a back-end server with the SQL Server Upsizing Wizard or the Oracle Upsizing Wizard.

Updates to other wizards and samples give you added capabilities, such as accessing index tags for sorting. The Form Wizard allows you to add a page frame to display more fields on additional pages. The PivotTable Wizard can use ODBC to populate a pivot table. The SQL Server Upsizing Wizard supports declarative referential integrity. The Cross-Tab Wizard now supports displaying null values. In addition, a wizard provided as a utility lets you create Web pages for querying and displaying your database records.

Object-Oriented Programming

Visual FoxPro 3.0 provided a rich object and class schema with true inheritance, encapsulation, and all the other features you would expect of a mature object-oriented development environment. Visual FoxPro 5.0 makes object-oriented programming even easier with an improved Class Browser, the introduction of the DODEFAULT() function, and new clauses for the DEFINE CLASS and SET CLASSLIB commands. Visual FoxPro 5.0 also makes it easier to do the following:

Display TypeLib or ObjectLib information in the Class Browser. The Class Browser now supports .tlb and .olb files. The Class Browser also sports a sleeker interface and is more customizable.

Add value to inherited classes. You can add code to classes and easily call the parent class code with the DODEFAULT() function. DODEFAULT() is easier to use than the scope resolution operator (::) because you don't have to reference the name of the class and method.

Hide class members. You can now create members of a class that are only visible within that class by using the HIDDEN clause in the DEFINE CLASS command.

Create objects based on classes in compiled applications. The new IN clause of the SET CLASSLIB command allows you to access class libraries compiled in .EXE or .APP files.

Easier to Create Office 95 Compatible Interfaces

Visual FoxPro makes it easy for you to create state-of-the-art user interfaces.

Provide What's This Help. What's This Help allows a user to click a ? button (Figure 2) on a form title, and then to click on any control on the form to get context-sensitive help in a Tool-Tip format.

Figure 2. The What's This Help button

Display nonjustified tabbed dialog boxes. The new TabStyle property on page frames allows you to create Windows 95–style tabbed dialog boxes (Figure 3).

Figure 3. Windows 95 style tabbed dialog box

Create single-document interface (SDI) or multiple-document interface (MDI) forms. The ShowWindow property of a form allows you to specify whether the form is displayed as a child of the main Visual FoxPro window (MDI), as a top-level (SDI) form, or as a child of a top-level form.

Hide the main Visual FoxPro window on start up. If the initial form of your application is a top-level, or SDI, form, you probably don't want the Visual FoxPro window to be displayed. Include "SCREEN=OFF" in your config.fpw and the Visual FoxPro window won't be displayed. You can make it visible later by issuing, in your application code:

_SCREEN.Visible = .T. 

Use windows color settings and 3D color settings. The ColorSource property of a form now allows you to choose Windows Control Panel Color Settings or Windows Control Panel 3D Color Settings.

Display item tips for list boxes. If the text of a menu item is too long to be displayed in the list, an item tip will display the text when the mouse pointer is over the item. To enable item tips for a list box, set its ItemTips property to true (.T.).

Shortcut Menus and Menus for Top-Level Forms

When you create a new menu, you have the option to add a menu to the menu bar or create a shortcut menu. After you have generated your shortcut menu, you can attach it to any control by running the menu in the control's RightClick event. You can also do the following:

Adjust shortcut menu display. The #PREPOP generator directive, added to a shortcut menu's Setup code, causes the code in the menu's Cleanup to be generated before the ACTIVATE POPUP command. This order allows you to dynamically display check marks beside items on a shortcut menu or otherwise manipulate the characteristics of the menu before displaying it.

Display menus in top-level forms. You can create menus to be displayed in top-level forms rather than in the main Visual FoxPro window—just choose Top-Level Form in the Menu Designer's General Options dialog box.

Easily insert functionality-rich menu items. Visual FoxPro system menu items have always provided build-in functionality: for example, Cut, Copy, and Paste options for your application menus. Now you can insert individual Visual FoxPro system menu items in your application menus and shortcut menus with the click of a button.

Programmatically call system menu functionality. The new SYS(1500) function allows you to tap into the functionality of system menu items without having to create the menus.

Increased Form Functionality and Easier Design

Along with enhancements to the data dictionary that help with form design, the Form Designer itself is easier to use and offers more functionality.

Save changes automatically. You can set options so that Visual FoxPro saves your forms automatically when you quit the Form Designer. In the Forms tab of the Options dialog box, you can choose the option Save Changes Before Running Form. If you select this option, you skip the confirmation dialog box and the changes you made to the current form are saved automatically.

Locate code more easily. Methods and Events with code are listed at the top of the Object menu in the editing windows so that you can find and open them more easily.

Add multiple new properties or methods. The New Property and New Method dialog boxes allow you to create as many new properties or methods as you want without having to open the dialog box multiple times.

Properties window

The Properties window is more customizable in Visual FoxPro 5.0.

Change the font in the Properties window. You can choose one of three font settings from the Properties window shortcut menu.

Change multiple properties. You can select a group of controls and see common properties, or change them, in the Properties window.

Use the keyboard in the Properties window. The Properties window supports keyboard navigation for scrolling through the hierarchy of objects, controls, and tab orders. Use the CTRL key in conjunction with the page up, page down, home, or end keys to move up and down through the list.

Edit property settings in a larger area. Choose Zoom from the Properties window shortcut menu to open a larger editing area for property settings.

Smarter drag and drop

Now more than ever, drag and drop in Visual FoxPro speeds development.

Specify classes for controls created in drag and drop. The Field Mapping tab of the Options dialog box allows you to specify default classes to be created when fields of a particular type are dropped on a form. When you right-click and drag fields or tables to a form, you can choose, right there, a class for the objects to be based on.

Automatically add labels beside controls. You can specify in the Field Mapping tab of the Options dialog box whether or not to automatically create a label for controls that were created by dragging fields to a form.

Name controls more easily. When you drag one or more fields to a form, the names of the controls created automatically follow the Visual FoxPro object naming conventions—a prefix that indicates the base class and a meaningful name, for example, txtCompany rather than Text1.

Create more data-aware controls. When you drop a field on a form, the size and MaxLength of the control is automatically adjusted to reflect the size of the field in the table.

Enhanced Controls

Visual FoxPro controls have always been feature-rich. Visual FoxPro 5.0 extends the capabilities of some of these controls.

Grid control

Allow users to easily add new records. If you set the AllowAddNew property to true (.T.), your users can add a new record to a table in a grid (as long as the grid is read-write) by pressing the down arrow while positioned on the last record in the grid.

Allow users to adjust grid display. You can control whether users can interactively change header and row height with the AllowHeaderSizing and AllowRowSizing properties.

Control the grid splitter. The SplitBar property specifies whether the split bar is displayed in a Grid control.

Add more dynamic display features. The new DynamicAlignment and DynamicInputMask properties give you added control over dynamic data display.

Control the highlighting of currently selected rows. The HighlightRow property specifies whether the current row and cell in a Grid control is highlighted.

Text box control

Customize date and time display. The new properties in Table 4 have been added to give you greater control over date and time data in text boxes.

Table 4. Date and Time Display Properties

Property Description
Century Specifies whether the century portion of a date is displayed in a text box.
DateFormat Specifies the format for Date and DateTime values displayed in a text box.
DateMark Specifies the delimiter for Date and DateTime values displayed in a text box.
Hours Specifies whether the hours portion of a DateTime value is displayed in 12- or 24-hour time format.
Seconds Specifies whether the seconds portion of a DateTime value is displayed in a text box.
StrictDateEntry Specifies whether date and DateTime values must be entered in a specific, strict format in a text box.

Distinguish what a user enters in a text box. The new Text property allows you to see what a user entered in a text box, regardless of formatting or data type.

LIST box and combo box

Control item selection in list box and combo box controls. To collect the actual value of the selected item in the control, you can set the BoundTo property to True. To collect the item's list index number, set the BoundTo property to False.

Select more than 60 items in a list box. You can now select an unlimited number of multiple items in a ListBox control.

Make sure items aren't partially displayed. When the new IntegralHeight property is set to true (.T.), the height of a list box is automatically adjusted for optimum display of the items.

Enhance the display of your list box and combo box controls. List boxes and combo boxes now support the BorderStyle, Format, and InputMask properties, which were formerly available only for other controls.

Other control enhancements

Process Microsoft IntelliMouse™ events. Visual FoxPro objects now support MiddleClick and MouseWheel events.

Predetermine how null values are displayed. The NullDisplay property allows you to choose a user-friendly value to be displayed when a control has a null value.

Display multiline captions on command buttons. Command buttons now support wrapping, or multiple line, captions.

Access page frame tabs with the keyboard. Visual FoxPro 5.0 provides better keyboard access with page frames. When a page has the focus, the left and right arrows move between pages.

Report Enhancements

Visual FoxPro 5.0 reports address a few common developer requests.

Specify a range of pages to print. The RANGE clause of the REPORT command allows you to specify a range of report pages to print.

Print directly from print preview. A new toolbar button allows you to print a report directly from the Print Preview window.

Preview reports in windows you design. The WINDOW clause of the REPORT command allows you to preview reports in a user-defined window.

Practical Samples of Application Components

The new Solutions sample provides a collection of application components that show how you can use the features of Visual FoxPro to solve real-world challenges. You can use the sample components and their code directly in your applications. Additional samples illustrate creating OLE Servers for client/server and Internet application.

New Automation Capabilities

With Visual FoxPro, you have the power to fully integrate your application with other applications.

Optimize Automation requests. With the OLERequestPendingTimeout, OLEServerBusyTimeout, and OLEServerBusyRaiseError properties, you can determine how much time your system allocates for requests and when messages appear for your user. For example, you can control how much time your system spends retrying Automation requests before displaying a "server busy" message. You can also control the number of milliseconds that pass between user input while an Automation request is pending, such as using the mouse or keyboard, and the appearance of a "busy" message.

Control Visual FoxPro from other applications. Using Visual FoxPro as an Automation server, you can create references to Visual FoxPro objects, execute Visual FoxPro commands, and run Visual FoxPro programs from other applications. The new Application object and its collections, illustrated in Figure 4, provide Automation access for your enterprise solutions.

Figure 4. The new Application object and its collections

Table 5. The Properties and Methods Supported by the New Application Object

Property or Method Description
Application Property Provides access to the Application object's properties and methods from an object contained by the application.
AutoYield Property Window events are placed in a queue when the AutoYield property is set to false (.F.) and program code is executing. DOEVENTS executes all pending Windows events and processes any user code associated with the Windows events.
DataToClip Method Copies a set of records as text to the Clipboard.
DefaultFilePath Property Specifies the default drive and directory used by an Application object.
DoCmd Method Executes a Visual FoxPro command for an instance of the Visual FoxPro application automation server.
Eval Method Evaluates an expression and returns the result for an instance of the Visual FoxPro application automation server.
FullName Property Specifies the directory from which an instance of Visual FoxPro was started.
Help Method Opens the Help window.
Quit Method Ends an instance of Visual FoxPro.
RequestData Method Creates an array containing data from a table open in an instance of Visual FoxPro.
SetVar Method Creates a variable and stores a value to the variable for an instance of the Visual FoxPro application automation server.
StartMode Property Contains a numeric value that indicates how the instance of Visual FoxPro was started: a normal interactive session, an out-of-process OLE server, a run-time out-of-process OLE server, or a run-time in-process OLE server.
StatusBar Property Specifies the text displayed in the status bar of an instance of Visual FoxPro.
Version Property Returns the version number of an instance of Visual FoxPro as a character string.

Create Automation servers. Automation servers (formerly known as OLE Automation servers or OLE servers) are applications that expose functionality that can be used and reused by other applications through Automation. Using Visual FoxPro 5.0 a developer can create an Automation server that displays reusable forms, implements business rules, or packages a complex routine into a simple component that other programmers can use.

Provide Remote Automation. Remote Automation enables developers to run an Automation server on one machine and the client application on a separate machine on the network. This feature is extremely useful for implementing three-tier client/server applications and asynchronous processing, off-loading work to underused machines, and reducing client maintenance.

Automate Visual FoxPro from applications that support API calls. FPOLE.DLL allows any application capable of making API calls to run Visual FoxPro commands or evaluate Visual FoxPro expressions. Applications such as Microsoft Word, or even a Help file, can now execute Visual FoxPro commands or evaluate Visual FoxPro expressions.

Better Support for ActiveX Controls

Use Data Binding with ActiveX controls. To bind data to ActiveX™ controls, you can use the ControlSource property (if the control supports it) in the Properties window to specify a field or variable to which the control is bound.

Send character values to ActiveX controls that require binary. Use CREATEBINARY() to convert character type data created in Visual FoxPro to a binary type character string that you can pass to an ActiveX control or automation object.

Pass bitmaps as objects to ActiveX controls. The LOADPICTURE() function creates an object reference for a bitmap, icon, or Windows metafile. Many presentation properties of ActiveX controls require an object reference for their settings. For example, the ActiveX Outline control supports the PictureOpen property that requires an object reference for its setting. The SAVEPICTURE() function creates a bitmap file from an object reference.

Expose in-place activation. The new AutoVerbMenu property specifies whether a shortcut menu containing an OLE object's verbs is displayed when the OLE object is clicked with the right mouse button.

Other New or Enhanced Commands and Functions

Table 6 lists other commands and functions that have been added to or enhanced in Visual FoxPro 5.0:

Table 6. Additional new or Enhanced Commands and Functions in Visual FoxPro 5.0

Command or Function Description
DIRECTORY() Returns true (.T.) if the specified directory is found on disk.
DISKSPACE() Now supports an optional volume name.
FOR EACH ... ENDFOR Executes a set of commands for each element in a Visual FoxPro array or collection.
GetFileVersion() A new function in FOXTOOLS.FLL, GetFileVersion() populates an array with information about an .EXE or .DLL file such as version number, company name, and copyright information.
MCOL() and MROW() New scale mode option.
MD | MKDIR Can now create an entire path.
SET DATE New SHORT, LONG, and TAIWAN clauses.
SET HOURS Now scoped to data session.
SET NULLDISPLAY Specifies the text displayed for null values. The default text is ".NULL."
SET SECONDS Now scoped to data session.
SET SYSFORMATS Uses SET DATE SHORT format.
SET("DATE", 1) Returns an integer that indicates whether the date format is MDY, DMY, or YMD.
SET("PRINTER", 2) Returns the name of the default printer.
SYS(2333) Enables or disables ActiveX dual interface (VTABLE binding) support.
TTOC(dDateTime, 2) Returns a character string containing only the time portion of a DateTime expression.