Session D-NEU

Visual FoxPro 6.0 - Was ist neu?

Sebastian Flucke
ASCI CONSULTING GmbH


Vorbemerkung

Diese Ziele werden untersetzt in dem von Microsoft herausgegebenen Dokument "Visual FoxPro 6.0 Reviewer's Guide", welches Grundlage des vorliegenden Dokuments ist und den Konferenzunterlagen beiliegt.

Die folgenden Abschnitte geben einen Überblick über Visual FoxPro 6.0, setzen sich dabei mit den von Microsoft bereitgestellten Informationen kritisch auseinander und bewerten die neuen Features bezüglich ihrer Einsetzbarkeit.

Es werden folgende Bewertungs-Grade verwendet:

Building high-performance reusable components

Dieser Punkt der Entwicklung von Visual FoxPro 6.0 zielt im wesentlichen darauf ab, mit Visual FoxPro 6.0 COM-Komponenten zu programmieren (OLE-Server), die innerhalb der COM- und DCOM-Welt der Microsoft-Betriebssysteme eingesetzt und mit anderen Komponenten verbunden werden können.

Dieses architektonisch zukunftsweisende Design- und Programmier-Prinzip scheitert bezüglich der praktischen Einsetzbarkeit häufig noch an der Perfomance und Stabilität der Kommunikation der beteiligten Komponenten.

Und auch die Programmierung von OLE-Servern mit Visual FoxPro 6.0 unterscheidet sich in bestimmten Punkten erheblich von der Entwicklung "normaler" VFP-Programme, sowohl bei der Programmierung als auch beim Testen und Betreiben der Programme.

Unter diesem Aspekt sind die Aussagen

mit einem gewissen kritischen Blick zu betrachten. Weiterführende Informationen dazu sind den entsprechenden Sessions der Sektionen C/S, TIER und WEB zu entnehmen.

Völlig anders dagegen verhält es sich bezüglich dieser Features innerhalb von Visual FoxPro 6.0. Dort bieten die schon vorhandenen und nun durch Access- und Assign-Methoden noch wesentlich erweiterten Möglichkeiten der objektorientierten Programmierung in Zusammenarbeit mit den hochflexiblen Verbindungsmöglichkeiten zu diversen Datenquellen ein großes Potential, um flexible und skalierbare Applikationen zu entwickeln.

Easier to learn and use

In diesem Bereich hat Visual FoxPro von Version zu Version heftig dazugelernt. Wesentliche Neuerungen in der Version Visual FoxPro 6.0 sind:

Diese Tools erlauben einen sehr schnellen produktiven Einstieg in die Applikations-Erstellung mit Visual FoxPro. Allerdings reichen sie in ihrem Umfang und in ihrer Kombinierbarkeit nicht in allen Bereichen an die Leistungsfähigkeit der etablierten Dritt-Anbieter-Frameworks für Visual FoxPro heran (siehe auch die Sessions der Sektion FWK).

More productive development environment

Unter dieser Rubrik verbergen sich sowohl Verbesserungen innerhalb der Programmiersprache von Visual FoxPro als auch Verbesserungen bezüglich der Benutzeroberfläche in der Entwicklungsumgebung.

Verbesserungen der Benutzeroberfäche von VFP selbst

Einige große sowie viele kleine, aber spürbare Verbesserungen hat die Entwicklungsoberfläche von Visual FoxPro erfahren.

Zu den größeren Verbesserungen gehören:

Diverse kleine Verbesserungen sind nirgendwo dokumentiert, fallen aber sofort ins Auge [praktisch]:

Eine weitere Verbesserung soll die HTML-Hilfe sein, mit der Visual FoxPro 6.0 im Rahmen des Visual Studios ausgeliefert wird [ganz nett]. Diese neue Hilfe-Engine hat einige Vorteile, aber im Moment auch noch Nachteile. Sie muß sicherlich noch diverse Kinderkrankheiten überwinden, bevor man mit dieser Neuerung vollständig zufrieden sein kann.

Zur Erstellung von HTML-basierten Hilfedateien siehe Session E-HELP.

Erweiterungen der Programmiersprache von VFP

Auch in der Programmiersprache von Visual FoxPro 6.0 hat es einige Erweiterungen gegeben:

Enterprise application development

Dieser Teil der Erweiterungen in der aktuellen Version 6.0 von Visual FoxPro betrifft im wesentlichen die Einsatzmöglichkeiten von VFP als Programmiertool für die sogenannte Middle Tier im 3-Schichten-System der Applikations-Architektur.

Weitere Informationen zu dieser Thematik können dem Visual FoxPro Reviewer's Guide sowie den Sessions D-VID, E-SAFE, E-STUD, E-SCRP sowie den Sessions der Sektion TIER entnommen werden.

Neue Sprachelemente in Visual FoxPro 6.0

 
New Miscellaneous Language Elements Description

AddProperty Method

Adds a new property to an object.

AGETFILEVERSION( )

Creates an array containing information about files with Microsoft Windows version resources such as .exe, .dll, and .fll files, or automation servers created in Visual FoxPro. Corresponds to the GetFileVersion( ) function in Foxtools.

AGETCLASS( ) Function

Displays class libraries in the Open dialog box and creates an array containing the name of the class library and class chosen.

ALINES( ) Function

Copies each line in a character expression or memo field to a corresponding row in an array.

AMOUSEOBJ( ) Function

Returns mouse pointer position information and object references for the object and the object's container over which the mouse pointer is positioned.

ANETRESOURCES( ) Function

Places the names of network shares or printers into an array and then returns the number of resources.

AVCXCLASSES( ) Function

Places the information about classes in a class library into an array.

DisplayCount Property

Specifies the number of items displayed in the list portion of a ComboBox control.

FILETOSTR( ) Function

Returns the contents of a file as a character string.

_GALLERY System Variable

Specifies the program that is executed when you choose Component Gallery from the Tools menu.

_GENHTML System Variable

Specifies an HTML (Hypertext Markup Language) generation program that creates a text file that contains a hypertext markup language version of a form, menu, report, or table.

_GETEXPR System Variable

Specifies the program that is executed when you issue the GETEXPR command or the Expression Builder dialog box is displayed.

GridHitTest Method

Returns, as output parameters, the components of a grid control corresponding to specified horizontal (X) and vertical (Y) coordinates.

 

Specifies a default header file included with user-defined classes, forms, or form sets.

INDEXSEEK( ) Function

Without moving the record pointer, searches an indexed table for the first occurrence of a record whose index key matches a specified expression.

NEWOBJECT( ) Function

Creates a new class or object directly from a .vcx visual class library or program.

NewObject Method

Adds a new class or object to an object directly from a .vcx visual class library or program.

_SAMPLES System Variable

Contains the path of the directory in which the Visual FoxPro samples are installed.

SET BROWSEIME Command

Specifies if the Input Method Editor is opened when you navigate to a text box in a Browse window.

SET STRICTDATE Command

Specifies if ambiguous Date and DateTime constants generate errors.

STRTOFILE( ) Function

Writes the contents of a character string to a file.

SYS(3055) – FOR and WHERE Clause Complexity

Sets the complexity level of the FOR and WHERE clauses in commands and functions that support them.

SYS(3056) – Read Registry Settings

Forces Visual FoxPro to read its registry settings again and update itself with the current registry settings.

TitleBar Property

Specifies if a title bar appears at the top of a form.

VARTYPE( ) Function

Returns the data type of an expression.

Erweiterte Sprachelemente in Visual FoxPro 6.0

Enhanced Miscellaneous Language Elements Description

= Operator

Can be used in Visual FoxPro 6.0 to determine if two object references refer to the same object.

ALTER TABLE - SQL Command

Supports a new FOR clause for the ADD PRIMARY KEY and ADD FOREIGN KEY clauses. FOR allows you to create filtered primary and foreign indexes.

APPEND FROM Command

Supports a new XL8 option for importing data from a Microsoft Excel 97 worksheet, and a new CSV option for importing data from a comma separated value file.

Century Property

The default for is now 1 – On. The century portion of the date is displayed in a text box to provide Year 2000 compliance.

CheckBox Control

Now supports the ReadOnly property.

Column Object

Now supports the Comment and Tag properties and the SaveAsClass method.

COMPILE DATABASE Command

COMPILE DATABASE now packs memo fields in the .dct memo file for the database to remove unused space from the memo file.

Container Object

Now supports the Tag property.

Control Object

Now supports the Tag property.

COPY TO Command

Supports a new CSV option for exporting data as a comma separated value file.

CREATE FORM Command

Supports a new AS clause that allows you to create a new form or formset from a form or formset in a .vcx visual class library.

Cursor Object

Now supports the Comment and Tag properties, and the ReadExpression, ReadMethod, SaveAsClass, and WriteExpression methods.

Custom Object

Now supports the Tag property.

DataEnvironment Object

Now supports the Comment and Tag properties, and the ReadExpression, ReadMethod, SaveAsClass, and WriteExpression methods.

DATE( ) Function

Now supports optional numeric arguments that let you create year 2000 compliant Date values.

DATETIME( ) Function

Now supports optional numeric arguments that let you create year 2000 compliant DateTime values.

DEFINE CLASS Command

Supports new Access and Assign methods, allowing you to execute code whenever a property is queried or you attempt to change the value of a property.

FDATE( ) Function

Now supports an optional argument that lets you determine the time when a file was last modified without using character manipulation functions.

Form Object

Now supports the Scrollbars property and the Scrolled event.

FormSet Object

Now supports the Parent and Tag properties.

GETDIR( ) Function

The Select Directory dialog box has been enlarged to display more directory information.

GETFILE( ) Function

Supports a new cTitleBarCaption option that lets you specify the title bar caption in the Open dialog box.

GETFONT( ) Function

Allows you to specify a font, font size, and font style that are initially selected when the Font dialog box is displayed.

Header Object

Now supports the Comment and Tag properties, and the SaveAsClass method.

HOME( ) Function

Now lets you determine the Visual FoxPro and Visual Studio samples, tools, graphics, and common directories.

Image Control

Now supports the ToolTipText property.

IMPORT Command

Supports a new XL8 option for importing data from a Microsoft Excel 97 worksheet.

Label Control

Now supports the ToolTipText property.

MODIFY MEMO Command

Syntax coloring is now disabled in memo field editing windows in distributed run time applications.

OS( ) Function

Now supports an option that lets you determine if the operating system supports DBCS (double-byte character sets).

Page Object

Now supports the Tag property and the SaveAsClass method.

PageFrame Control

Now supports the Tag property.

PEMSTATUS( ) Function

PEMSTATUS( ) supports a new 6 option for nAttribute that lets you determine if a property, event, or method was inherited from an object or class.

PROGRAM( ) Function

Now supports –1 as an argument, allowing you to determine the current program level.

Refresh Method

Now allows you to refresh the visual display of the Project Manager, and supports a new parameter to update the source control status for files in a project.

Relation Object

Now supports the Comment and Tag properties, the Destroy, Error, and Init events, and the ReadExpression, ReadMethod, and WriteExpression methods.

REPORT Command

Now supports a PREVIEW IN SCREEN clause, allowing you to place the preview window in the main Visual FoxPro window.

Separator Object

Now supports the Comment and Tag properties, and the ReadExpression, ReadMethod, SaveAsClass, and WriteExpression methods.

SET BELL

A waveform sound duration is no longer required.

SET('PRINTER')

Supports a new 3 option that allows you to determine the current Visual FoxPro default printer set in the Visual FoxPro Print or Print Setup dialog boxes.

SET('BELL')

Can now be used to determine the waveform sound played when the bell sounds.

STRCONV( ) Function

Supports a new nLocaleID argument that allows you to specify the Locale ID to use for the conversion.

SYS(2333) - ActiveX Dual Interface Support

Now allows you to determine its current setting, and the default startup setting for ActiveX dual interface support has been changed from enabled in Visual FoxPro 5.0 to disabled in Visual FoxPro 6.0.

TABLEUPDATE( ) Function

If an error other than a simple commit error occurs while updating records, the first element of the error array will now contain –1 and you can then use AERROR( ) to determine why the changes could not be committed.

ToolBar Object

Now supports the Tag property and the Release method.

TRANSFORM( ) Function

The cFormatCodes format code is now optional. A default transformation is used if the cFormatCodes format code is omitted.

VERSION( ) Function

supports two new nExpression options, 4 and 5, to return just the Visual FoxPro version number in formats that can be easily parsed.

 

Die in Visual FoxPro 6.0 integrierten FoxTools-Funktionen

Foxtools functions Description

The following functions have been added to Visual FoxPro 6.0 from Foxtools; they can now be used without executing SET LIBRARY TO FOXTOOLS

Note that you must recompile any programs, class libraries, labels, or reports created in earlier versions of Visual FoxPro if they contain any of the following functions.

ADDBS( ) Function

Adds a backslash (if needed) to a path expression.

AGETFILEVERSION( ) Function

Creates an array containing information about files with Windows version resources such as .exe, .dll, and .fll files, or automation servers created in Visual FoxPro.
Corresponds to the GetFileVersion( ) function in Foxtools.

DEFAULTEXT( ) Function

Returns a file name with a new extension if one doesn't already exist.

DRIVETYPE( ) Function

Returns the type of the specified drive.

FORCEEXT( ) Function

Returns a string with the old file name extension replaced by a new extension.

FORCEPATH( ) Function

Returns a file name with a new path name substituted for the old one.

JUSTDRIVE( ) Function

Returns the drive letter from a complete path.

JUSTEXT( ) Function

Returns the three-letter extension from a complete path.

JUSTFNAME( ) Function

Returns the file name portion of a complete path and file name.

JUSTPATH( ) Function

Returns the path portion of a complete path and file name.

JUSTSTEM( ) Function

Returns the stem name (the file name before the extension) from a complete path and file name.