Help Table of Contents

Product Support	Help Systems	Sample Files

Interface

Interface A-Z

Menus

Windows

Dialogs

Wizards

Language Reference

Commands and Functions A-Z

Commands and Functions by Category

System Memory Variables

Commonly Used Commands and Functions

Additional Reference

What's New Since FoxPro 2.5

Catalog Manager

Changes to Documentation Since Printing

Compatibility

Configuring FoxPro

Cross-Platform Issues

Error Messages

Miscellaneous

Switching from dBASE

Tips and Tricks

Troubleshooting


Sample Files

Sample Files for Windows

Sample Files for Macintosh


Miscellaneous

Colors

Command Continuation

File Extensions

Fonts

FoxApp - Build Applications

FoxPro Reserved Words

How FoxPro Finds Components

Generator Directives

How to Perform a Clean Boot

International Settings

International and Cross Platform Features

Macintosh Considerations

Name Expressions

Report Tips

Rushmore Technology

SQL Cursors

System Capacities

Transporting Files

Version Control & Projects


Tips and Tricks

Creating Macros

Cross Platform Development

FoxApp - Build Applications

Macintosh Tips

Interface Tips

Language Tips

Navigating in the Interface

Performance Tips

Power Tool Tips

Report Tips

Using Graphs

Version Control & Projects

Wizards


Language Tips

Command Continuation

Cross-Tab Output to Spreadsheets

Custom Messages

Development Tools

Drives and Folders

Generator Directives

Moving a Screen Object

Name Expressions

Preprocessor Directives

Prevent Preprocessor Substitution in Text Strings

Run Command

Set Volume to Shorten Paths

SQL Cursors

USE Command


Cross-Platform Issues

Cross-Platform Development

Cross-Platform Differences

Cross-Platform Tips

Differences in Keyboard Functionality

Fonts

How FoxPro Finds Components

Importing and Exporting Files

Macintosh Considerations


Macintosh Considerations

2D and 3D Objects

AppleScript and Apple Events

Customizing the Apple Menu

Creator File Types

Customizing the Help Menu

Macintosh Aliases

Migrating from FoxBASE+ for Macintosh

QuickTime

Using BMP Files

Using PICT Files

XCMDs and XFCNs


Catalog Manager

See Also

The Catalog Manager is a graphical interface that enables you to manage catalogs (.FPC or .CAT files) easily. Catalogs can contain tables, queries, screens, reports, labels and programs. From this central location, you can create, modify, and run these FoxPro files. You can also use AutoMigrate to migrate existing dBASE III and dBASE IV files. The Catalog Manager, written entirely in FoxPro, is an example of the type of application you can develop in FoxPro.

Catalog Manager Menus

The Catalog Manager menus are: File, Edit, View, Data, Tools, Window, Help.

Catalog Manager Window

The Catalog Manager window displays the contents of a catalog and allows you to add, create and modify tables, queries, screens, reports, labels and programs. You can also use, run or print files as applicable. You use the Table, Query, Screen, Report, Label and Program tabs to choose the type of files to display in the scrollable list.

When you click on a tab to choose it, that tab becomes the active tab. FoxPro displays the files in the current catalog that match the active tab, and changes the push buttons to the right of the file list so they match the tasks you can accomplish using the tab. For example, when you choose the Table tab, FoxPro shows the tables (.DBF files) in the current catalog, and displays the Add, New, Modify, and Use push buttons. If you select the Screen tab, the Use button changes to Run.

You can run a file in any tab by double-clicking the file in the file list. You can choose a different tab by clicking on it or using the View Menu. To view a different catalog, select Open Catalog from the File menu.

Picture buttons located above the tabs provide access to the active table, the AutoScreen and AutoReport features, and FoxPro Help.

Button	Picture	Notes
Browse		Displays the active table/query in a Browse window. Disabled when the current catalog contains no tables, or no table is in use.
AutoScreen		Creates and runs a new screen based on the active table/query using the Screen Wizard default settings. Disabled when no table is in use.
AutoReport		Creates and runs a new report based on the active table/query using the Report Wizard default settings. Disabled when no table is in use.
Help		Opens the FoxPro Help window to the Catalog Manager topic. Always available.
Active Table/Query

The Active Table/Query line just above the Catalog Manager tabs displays the name of the table or query currently in use. FoxPro bases all the new files you create on the active table or query. To make a table or query active, choose the appropriate (table or query) tab, select the file you want to use, and choose the Use button in the Catalog Manager. The table or query name then appears in the Active Table/Query line.

Description

The Description line just below the file name list box in the Catalog Manager displays the file description for the selected table, query, screen, report, label or program file. To change the description, see the File Description Dialog Help topic.

Data Source

When the Screen, Report or Label tab is active, a Data Source line displays the source file for the selected screen, report or label file. If you want to view the description for the source file, select the appropriate (table or query) tab, then select the source file in the file list.

You can find more information about using the Catalog Manager, depending on the tasks you want to accomplish.

To get more information about	See this topic
Creating and opening catalogs	Creating a Catalog Opening an Existing Catalog
Adding and deleting items in the catalog	Editing a Catalog
Creating, modifying and running files in the catalog	Working with Tables, Working with Queries, Working with Screens, Working with Reports, Working with Labels, Working with Programs
Leaving the Catalog Manager	Exiting the Catalog Manager

FoxPro catalogs are single-user files. If you run more than one concurrent session of FoxPro, each session must have a local copy of the FOXUSER resource file. You can add table, query, screen, report, label and program files to more than one catalog.


See Also

Browse Window

Configuring the Catalog Manager

Creating a Catalog

Data Menu

Edit Menu

Editing a Catalog

Exiting the Catalog Manager

File Description Dialog

File Menu

Help Menu

Opening an Existing Catalog

Removing a Catalog

Switching from dBASE

Tools Menu

Using Wizards

View Menu

Window Menu

Working with Labels in the Catalog Manager

Working with Programs in the Catalog Manager

Working with Queries in the Catalog Manager

Working with Reports in the Catalog Manager

Working with Screens in the Catalog Manager

Working with Tables in the Catalog Manager


Creating a Catalog

See Also

You can create a new catalog from the File menu.

To create a catalog from the File menu

1.	From the File menu, choose New Catalog. FoxPro displays the Save As dialog.

2.	Type the name of the new catalog file in the Save Catalog As text box. Choose Save. The Catalog Manager window appears, displaying an empty catalog file.

You can then add existing table, query, screen, report, label and program files to your catalog, or create new files. For more information on adding files to a catalog, see the Editing a Catalog Help topic.


See Also

Configuring the Catalog Manager

Editing a Catalog

File menu

Save As Dialog


Editing a Catalog

See Also

Editing a catalog is different from adding or removing files on your system. To add a file to a catalog you specify the name of a file that already exists on your system; FoxPro then adds the file name and file location to your catalog (.FPC) file. When you remove a file from a catalog, FoxPro removes the file name and file location from your catalog file. The actual table, query, screen, report or program file remains on your system, unless you also choose to delete the file.

You can add a file to your catalog using a tab or the File menu.

To add a file to the active catalog using a tab

1.	Select the tab representing the type of file (table, query, screen, report, label, or program) you want to add to your catalog.

2.	Choose the Add push button. FoxPro displays the Open dialog.

3.	Select the file you want to add to the catalog from the list of filenames. Use the Drives and Directories list to locate the file if it's not in the current directory.

4.	Choose Add. FoxPro adds the name and location of the selected file to the active catalog (.FPC file) and displays the filename in the file list for the selected tab.

To add a file to your catalog using the File menu

1.	From the File menu, choose Add File to display a cascading menu of the types of files you can add to a catalog.

2.	Select the file type for the file you want to add and click or press Enter to display the Open Dialog.

3.	In the Open dialog, double-click on the file you want to add to the catalog.

You can remove a file from your catalog using the Delete key or the File menu.

To remove a file from the active catalog

 Select the file in the file list, then press the Delete key, or choose Remove File from the File menu. FoxPro displays the Remove File dialog.


See Also

Catalog Manager

File menu

Open Dialog

Remove File Dialog


Switching Between the Catalog Manager and FoxPro

See Also

You can switch between the Catalog Manager and FoxPro at any time.

To switch from the Catalog Manager to the FoxPro menu system and Command window

From the File menu, choose Command Window. The Catalog Manager closes and FoxPro displays the main FoxPro window and Command window.

To switch from the FoxPro menu system and Command window to the Catalog Manager

From the File menu, choose Catalog Manager. The Catalog Manager opens, displaying the last catalog used. If there is no catalog to open, a dialog prompts you to open an existing catalog or create a new one.


See Also

Catalog Manager

Configuring the Catalog Manager

Run Menu


Opening an Existing Catalog

See Also

FoxPro opens the last opened catalog when you choose the option Proceed to the Catalog Manager from the Introductory Screen. If it is not possible to determine the last opened catalog, FoxPro displays the Open dialog.

Once in the Catalog Manager, you can also open a different existing catalog (dBASE .CAT file, or FoxPro .FPC file) from the File menu.

To open a catalog from the Catalog Manager

1.	From the File menu, choose Open Catalog. FoxPro displays the Open dialog.

2.	Select the catalog you want to open from the list of files.

3.	Choose Open.


See Also

Catalog Manager

Creating a New Catalog

Open Dialog


Removing a Catalog

See Also

You remove a catalog by deleting the catalog files from your system. FoxPro catalogs consist of two associated files. The catalog file has the extension .FPC; the associated memo file has the same name as the catalog, with an .FCT extension. dBASE catalogs have the file extension .CAT.

Deleting catalog (.FPC and .FCT, or .CAT) files from your system does not affect the table, query, screen, report, label and program files referenced within the catalog. The referenced files remain on your system until you choose to remove them.

If you want to remove from your system both the files referenced in a catalog and the catalog itself, first edit the catalog to remove the file references. Check the Delete File from Disk check box in the Remove File dialog to delete the actual files. You can then remove the catalog file from your system. For more information about editing a catalog, see the Editing a Catalog Help topic.


See Also

Editing a Catalog

Remove File dialog


Exiting the Catalog Manager

See Also

When you exit the Catalog Manager you can choose to work in the main FoxPro window or to quit FoxPro.

To work in the main FoxPro window

From the File menu, choose Command Window. The Catalog Manager closes and FoxPro displays the main FoxPro window and Command window.

To quit FoxPro

From the File menu, choose Quit. The Catalog Manager closes and exits FoxPro.


See Also

File menu


Configuring Catalog Manager
Configuring the Catalog Manager

See Also

The Introductory Screen is displayed by default when you enter FoxPro. If you do not want to display the Introductory Screen each time you start FoxPro, you can check the Don't display this Introductory Screen again check box.

If you've checked this check box in the past and want to see the Introductory Screen again, or if you want to start the Catalog Manager automatically when you enter FoxPro, edit your CONFIG.FPW file. To display the introductory screen again, remove the CATMAN=ON/OFF entry.

The table below lists the Catalog Manager configuration options.

If each time you enter FoxPro you want to	Edit CONFIG.FPW to include
Display the Introductory Screen	[no CATMAN entry]
Suppress display of the Introductory Screen and enter Catalog Manager	CATMAN=ON
Suppress display of the Introductory Screen, bypass the Catalog Manager and display the FoxPro Command window	CATMAN=OFF


See Also

Configuring FoxPro


Working with Tables in the Catalog Manager

See Also	Catalog Manager

When you enter the Catalog Manager for the first time, the Table tab is active. When this tab is selected, you can add new or existing tables to your catalog, modify the structure of a table, make the selected table active, as well as view and edit the data in a table.

To view the contents of a table while the Table tab is selected, double-click on the table name in the scrollable table list. You can also select the table name in the file list, choose Use to make the table active and then the Browse button to display the table. You can then edit the contents of the table in the Browse window. If you want to switch from Browse to Change mode, choose Change from the Browse menu.

To	Button	See this topic
Add a table to a catalog	Add	Adding a Table to a Catalog
Create a new table	New	Creating New Tables
Modify a dBASE or FoxPro table	Modify	Modifying a dBASE Table Modifying a FoxPro Table
Make the selected table active	Use
Browse the active table		Catalog Manager
To remove a table from a catalog, see the Editing a Catalog Help topic.


See Also

Adding a Table to a Catalog

Browse Window

Catalog Manager

Creating New Tables from the Catalog Manager

Editing a Catalog

Modifying a dBASE Table

Modifying a FoxPro Table


Creating New Tables from the Catalog Manager

See Also

You can create tables from the Catalog Manager using the Table Wizard or the New Table button.

To create a new table using the Table Wizard

1.	Make sure that the Table tab is selected.

2.	In the Catalog Manager, choose New to open the Create Table dialog.

3.	In the Create Table dialog, choose the Table Wizard button.

4.	Follow the steps in the Table Wizard. For additional help when you are in the Table Wizard, press F1.

To create a new table without using the Table Wizard

1.	Make sure that the Table tab is selected.

2.	In the Catalog Manager, choose New to open the Create Table dialog.

3.	In the Create Table dialog, choose the New Table button. The Save As dialog opens so you can name the new table.

4.	In the Save Table As text box, enter the name of the new table.

5.	Choose Save. The Table Structure dialog opens.

You can press F1 when you are in the Table Structure Dialog for information on creating and modifying tables. For additional information on using the Table Structure dialog, see the chapter "File Menu" in the FoxPro for Windows User's Guide.


See Also

Create Table Dialog

Table Structure Dialog

Table Wizard


Adding a Table to a Catalog

See Also

You can add an existing table to your catalog using the Table tab in the Catalog Manager or through the File menu.

To add a table to your catalog using the Table tab

1.	Make sure the Table tab is selected.

2.	In the Catalog Manager, choose Add to open the Open dialog.

3.	In the Open dialog, double-click on the table you want to add to the catalog.

To add a table to your catalog using the File menu

1.	From the File menu, choose Add File to display a cascading menu of the types of files you can add to a catalog.

2.	Select Table to display the Open Dialog.

3.	In the Open dialog, double-click on the table you want to add to the catalog.


See Also

Creating New Tables from the Catalog Manager

Editing a Catalog

File menu

Open Dialog


Modifying a dBASE Table in the Catalog Manager

See Also

A dBASE table is a file with the .DBF extension [image] the same file extension used for FoxPro tables. Tables that contain memo fields have associated memo files; dBASE memo files use the .DBT extension, FoxPro memo files use .FPT. Tables created in dBASE can be used in FoxPro with few if any modifications; for information about converting dBASE tables, see the Converting Tables Help topic.

Before modifying a .DBF file, make and save a copy with a different filename if you want to continue to use the table in dBASE IV.

To modify a dBASE table in the Catalog Manager

1.	Make sure the Table tab is selected.

2.	Select the table in the list by clicking it or by using the arrow keys. If the table you want to modify isn't listed, see the Adding a Table to a Catalog Help topic for information on adding a dBASE table to your catalog.

3.	In the Catalog Manager, choose Modify to open the Table Structure dialog.

You can press F1 when you are in the Table Structure Dialog for information on creating and modifying tables. For information on modifying indexes or setting the order of the table, see the Data Menu Help topic.

For additional information on using the Table Structure dialog, see "File Menu" in the FoxPro for Windows User's Guide.


See Also

Adding a Table to a Catalog

Converting Tables

Data Menu

Modifying a FoxPro Table in the Catalog Manager

Save As dialog

Switching from dBASE

Table Structure Dialog


Modifying a FoxPro Table in the Catalog Manager

See Also

To modify an existing FoxPro table

1.	Select the table in the list by clicking it or by using the arrow keys. If the table you want to modify isn't listed, see the Adding a Table to a Catalog Help topic for information on adding a dBASE table to your catalog.

2.	In the Catalog Manager, choose Modify to open the Table Structure dialog.

You can press F1 when you are in the Table Structure Dialog for information on creating and modifying tables. For information on modifying indexes or setting the order of the table, see the Data Menu Help topic.

For additional information on using the Table Structure dialog, see the chapter "File Menu" in the FoxPro for Windows User's Guide.


See Also

Adding a Table to a Catalog

Data Menu

Modifying a dBASE Table in the Catalog Manager

Table Structure Dialog


Working with Queries in the Catalog Manager

See Also	Catalog Manager

Queries provide views of your data. When the Query tab is selected, you can add new or existing queries to your catalog, modify the criteria of the query, make the selected query active, and view the results of a query. You can also edit query data directly in the table or through a custom input screen. For more information, see Working with Tables in the Catalog Manager or Working with Screens in the Catalog Manager.

While in the Query tab, you can accomplish the following tasks:

Task	Button	See this topic
Add a query to a catalog	Add	Adding a Query to a Catalog
Create a new query	New	Creating New Queries from the Catalog Manager
Modify a dBASE or FoxPro query	Modify	Modifying a dBASE Query Modifying a FoxPro Query
Make the selected query active	Use
Browse the active query		Catalog Manager
You can run a query by double-clicking a query file in the file list. If you double-click on an RQBE query that has output directed to a graph FoxPro displays the graph. If the query output is directed to a report or label, FoxPro prints the report or label.

To remove a query from a catalog, see the Editing a Catalog Help topic.

Modifying Your Queries

You can edit and run .QBE, .CSQ, .FPQ and .QPR query files in the Catalog Manager. The following table lists the query file types, whether you can modify them using query wizards or the RQBE Window, and the types of views created by each query type.

File type	Modify with wizard?	Modify with RQBE?	Results
.QBE (dBASE query file)	Yes, using the Updatable Query Wizard. FoxPro copies .QBE to .FPQ; saves changes in .FPQ.	No	.FPQ file is created; creates updatable views; screens based on .QBE can edit live data Note: If you don't need to modify your .QBE query, you can run a .QBE file unchanged in FoxPro, without migrating it to an .FPQ file.
.CSQ (SQL query)	Yes, using the *Client-Server Query Wizard (*available in FoxPro 2.6 Professional Edition.)	No	creates read-only view (snapshot of data); can view data in a report or browse, or create a screen based on a .CSQ query.
.FPQ (Xbase query)	Yes, using the Updatable Query Wizard.	No	creates updatable view; screens based on .FPQ can edit live data
.QPR  (SQL query)	Yes, using the SQL Query Wizard, as long as you haven't edited the wizard-created query with RQBE.	Yes; once you use RQBE to modify a query, you can use only RQBE for further modifications.	creates read-only view (snapshot of data); can view data in a report or browse, or create a screen based on a .QPR query.


See Also

Adding a Query to a Catalog

Catalog Manager

Client-Server Query Wizard

Creating New Queries from the Catalog Manager

Editing a Catalog

Modifying a dBASE Query

Modifying a FoxPro Query

SQL Query Wizard

Updatable Query Wizard

Working with Screens in the Catalog Manager

Working with Tables in the Catalog Manager


Creating New Queries from the Catalog Manager

See Also

You can create a query in the Catalog Manager by using the Query Wizard or the Relational Query By Example (RQBE) power tool.

To create a new query using the Query Wizard

1.	Make sure that the Query tab is selected.

2.	In the Catalog Manager, choose New to open the Create Query dialog.

3.	In the Create Query dialog, choose the Query Wizard button.

4.	Select the type of query you want to create, and follow the steps in the Query Wizard. For additional help when you are in the Query Wizard, press F1.

To create a new query using the RQBE power tool

1.	Make sure that the Query tab is selected.

2.	In the Catalog Manager, choose New to open the Create Query dialog.

3.	In the Create Query dialog, choose the New Query button. The Save As dialog opens so you can name the new query.

4.	In the Save Query As text box, enter the name of the new query.

5.	Choose Save.

The RQBE window opens.

For information on the RQBE window, press F1 when the RQBE window is open. For more information on how to use the RQBE window, see the chapter "Querying Data with RQBE" in the FoxPro for Windows User's Guide.


See Also

Client-Server Query Wizard

Create Query Dialog

RQBE Window

Save As Dialog

SQL Query Wizard

Updatable Query Wizard


Adding a Query to a Catalog

See Also

You can add an existing query (.FPQ, .QBE, .CSQ or .QPR file) to your catalog using the Query tab in the Catalog Manager or through the File menu.

To add an existing query to your catalog using the Query tab

1.	Make sure that the Query tab is selected.

2.	In the Catalog Manager, choose Add to open the Open dialog.

3.	In the Open dialog, double-click on the query you want to add to the catalog.

To add an existing query to your catalog using the File menu

1.	From the File menu, choose Add File to display a cascading menu of the types of files you can add to a catalog.

2.	Select Query to display the Open dialog.

3.	In the Open dialog, double-click on the query you want to add to the catalog.


See Also

Editing a Catalog

File menu

Open Dialog


Modifying a dBASE Query in the Catalog Manager

See Also

A dBASE query is a file with the .QBE extension that consists primarily of the dBASE IV commands required to execute the query. This file can be run in FoxPro as a program that returns the same results as the dBASE query. For information about converting queries, see the Converting Queries Help topic.

You can also modify the .QBE from the Catalog Manager. When you choose to modify the .QBE, FoxPro copies the .QBE file to a FoxPro .FPQ query file, then saves your modifications to the .FPQ file. Your original dBASE .QBE file is unchanged.

To modify a .QBE using the Query Wizard:

1.	Make sure that the Query tab is selected.

2.	Select the query in the list by clicking it or by using the arrow keys. If the query you want to modify isn't listed, see the Adding a Query to a Catalog Help topic for information on adding a query to your catalog.

3.	In the Catalog Manager, choose Modify to open the Change Query dialog.

4.	In the Change Query dialog, choose the Query Wizard button. FoxPro opens the Query Wizard to enable you to modify the query.

5.	Follow the steps in the Query Wizard. For additional help when you are in the Query Wizard, press F1.


See Also

Adding a Query to a Catalog

Client-Server Query Wizard

Converting Queries

SQL Query Wizard

Switching from dBASE

Updatable Query Wizard


Modifying a FoxPro Query in the Catalog Manager

See Also

You can modify a FoxPro query using the Modify button in the Catalog Manager.

To modify an existing FoxPro query

1.	Make sure that the Query tab is selected.

2.	Select the query in the list by clicking it or by using the arrow keys. If the query you want to modify isn't listed, see the Adding a Query to a Catalog Help topic for information on adding a query to your catalog.

3.	In the Catalog Manager, choose Modify to open the RQBE window.

For information on the RQBE window, press F1 when the RQBE window is open. For more information on how to use the RQBE window, see the chapter "Querying Data with RQBE" in the FoxPro for Windows User's Guide.


See Also

Adding a Query to a Catalog

RQBE Window


Working with Screens in the Catalog Manager

See Also 	Catalog Manager

When the Screen tab is selected, you can add new or existing screens to your catalog, create a new screen, modify or run an existing screen, and automatically generate a screen based on the active table or query.

Task	Button	See this topic
Add a screen to a catalog	Add	Adding a Screen to a Catalog
Create a new screen	New	Creating New Screens from the Catalog Manager
Modify a dBASE or FoxPro screen	Modify	Modifying a dBASE Screen Modifying a FoxPro Screen
Run the selected screen	Run	Running a Screen from the Catalog Manager
Automatically generate a screen from the active table or query		Catalog Manager
You can run a screen by double-clicking the screen file in the file list. To remove a screen from a catalog, see the Editing a Catalog Help topic.


See Also

Adding a Screen to a Catalog

Catalog Manager

Creating New Screens from the Catalog Manager

Editing a Catalog

Modifying a dBASE Screen

Modifying a FoxPro Screen

Running a Screen from the Catalog Manager


Creating New Screens from the Catalog Manager

See Also

You can create a screen in the Catalog Manager using the AutoScreen button, the Screen Wizard or the Screen Builder power tool.

To create a new screen using the AutoScreen button

1.	In the Catalog Manager, make sure the table or query upon which you want to base your new screen is active. To make a table or query active, choose the appropriate (table or query) tab, select the file you want to use, and choose the Use button. The table or query name then appears in the Active Table/Query line.

2.	Choose the AutoScreen button.

FoxPro automatically creates and runs a new screen using default settings.

To create a new screen using the Screen Wizard

1.	Make sure that the Screen tab is selected.

2.	In the Catalog Manager, choose New to open the Create Screen dialog.

3.	If you want to base the screen on a table other than the one currently in use, select the table from the Select a Table or Query popup.

4.	In the Create Screen dialog, choose the Screen Wizard button.

5.	Follow the steps in the Screen Wizard. For additional help when you are in the Screen Wizard, press F1.

To create a new screen using the Screen Builder power tool

1.	Make sure that the Screen tab is selected.

2.	In the Catalog Manager, choose New to open the Create Screen dialog.

3.	If you want to base the screen on a table other than the one currently in use, select the table from the Select a Table or Query popup.

4.	In the Create Screen dialog, choose the New Screen button. The Save As dialog opens so you can name the new screen.

5.	In the Save Screen As text box, enter the name of the new screen.

6.	Choose Save. The Screen Design window opens, with the name of the new screen as the window title.

For information on the Screen Builder, press F1 when the Screen Design window is open. For more information on how to use the Screen Design window, see the chapter "Designing Screens with the Screen Builder" in the FoxPro for Windows User's Guide.


See Also

Create Screen Dialog

Save As dialog

Screen Design Window

Screen Wizard


Adding a Screen to a Catalog

See Also

You can add an existing dBASE or FoxPro screen to your catalog using the Screen tab in the Catalog Manager or the File menu.

To add an existing screen to your catalog using the Screen tab

1.	Make sure that the Screen tab is selected.

2.	In the Catalog Manager, choose Add to open the Open dialog.

3.	In the Open dialog, double-click on the screen you want to add to the catalog.

To add an existing screen to your catalog using the File menu

1.	From the File menu, choose Add File to display a cascading menu of the types of files you can add to a catalog.

2.	Select Screen to display the Open dialog.

3.	In the Open dialog, double-click on the screen you want to add to the catalog.


See Also

Editing a Catalog

File menu

Open Dialog


Modifying a dBASE Screen in the Catalog Manager

See Also

A dBASE screen is a file with the .SCR extension that consists primarily of the dBASE IV commands required to execute the screen.

To convert a .SCR into a screen that can be run in FoxPro

1.	Make sure that the Screen tab is selected.

2.	Select the screen in the list by clicking it or by using the arrow keys. If the screen you want to modify isn't listed, see the Adding a Screen to a Catalog Help topic for information on adding a dBASE screen to your catalog.

3.	In the Catalog Manager, choose Modify.

4.	Using AutoMigrate technology, FoxPro automatically converts the screen to a FoxPro for DOS screen, then transports the DOS screen to Windows, retaining the dBASE file name and changing the file extension to .SCX. The Screen Design window appears, displaying the converted screen.

For information on the Screen Design window, press F1 when the Screen Design window is open. For more information on how to use the Screen Design window, see "Designing Screens with the Screen Builder" in the FoxPro for Windows User's Guide.


See Also

Adding a Screen to a Catalog

Converting dBASE Files

Screen Design Window

Switching from dBASE


Modifying a FoxPro Screen in the Catalog Manager
Modifying a FoxPro Screen from the Catalog Manager

See Also

You can modify a FoxPro screen with the Modify button in the Catalog Manager.

To modify an existing FoxPro screen

1.	Make sure that the Screen tab is selected.

2.	Select the screen in the list by clicking it or by using the arrow keys. If the screen you want to modify isn't listed, see the Adding a Screen to a Catalog Help topic for information on adding a screen to your catalog.

3.	In the Catalog Manager, choose Modify.

The Change Screen dialog appears, giving you a choice of tools to modify the screen with, unless you have altered the screen with the Screen Builder power tool. The table below lists the possible options.

Screen created with	Screen modified with	Modify opens
Screen Wizard	Screen Wizard, or never modified	Change Screen dialog
Screen Wizard	Screen Builder power tool	Screen Design window
Screen Builder power tool		Screen Design window
You can press F1 when the Screen Wizard or Screen Design window is open for more information on using these methods to modify screens. For more information on how to use the Screen Design window, see "Designing Screens with the Screen Builder" in the FoxPro for Windows User's Guide.


See Also

Adding a Screen to a Catalog

Change Screen dialog

Screen Design window

Screen Wizard


Running a Screen in the Catalog Manager

See Also

You can run a screen from the Catalog Manager using the Run push button, or by double-clicking on the file name in the file list.

To run a screen from the Catalog Manager using the Run button

1.	Make sure that the Screen tab is selected.

2.	Select the screen in the list by clicking it or by using the arrow keys.

3.	In the Catalog Manager, choose Run.

When you run a dBASE screen from the Catalog Manager, FoxPro's AutoMigrate technology automatically converts the screen to a FoxPro screen before running it.


See Also

Converting dBASE Files

Modifying a dBASE Screen

Modifying a FoxPro Screen


Working with Reports in the Catalog Manager

See Also	Catalog Manager

When the Report tab is selected, you can add new or existing reports to your catalog, create or modify a report, print a report, and automatically generate a report using the active table or query.

Task	Button	See this topic
Add a report to a catalog	Add	Adding a Report to a Catalog
Create a new report	New	Creating New Reports from the Catalog Manager
Modify a dBASE or FoxPro report	Modify	Modifying a dBASE Report Modifying a FoxPro Report
Print a report	Print	Printing a Report from the Catalog Manager
Automatically generate a report from the active table or query		Catalog Manager
You can run a report by double-clicking the report file in the file list. To remove a report from a catalog, see the Editing a Catalog Help topic.


See Also

Adding a Report to a Catalog

Catalog Manager

Creating New Reports from the Catalog Manager

Editing a Catalog

Modifying a dBASE Report

Modifying a FoxPro Report

Printing a Report from the Catalog Manager


Creating New Reports from the Catalog Manager

See Also

You can create a report in the Catalog Manager using the AutoReport button, a report wizard or the Report Writer power tool.

To create a new report using the AutoReport button

1.	In the Catalog Manager, make sure the table or query upon which you want to base your new report is active. To make a table or query active, choose the appropriate (table or query) tab, select the file you want to use, and choose the Use button. The table or query name then appears in the Active Table/Query line.

2.	Choose the AutoReport button.

FoxPro automatically creates and runs a new report using default settings.

To create a new report using a report wizard

1.	Make sure that the Report tab is selected.

2.	In the Catalog Manager, choose New to open the Create Report dialog.

3.	If you want to base the report on a table or query other than the one currently in use, select the file from the Select a Table or Query popup.

4.	In the Create Report dialog, choose the Report Wizard button.

5.	Select the report wizard you want to use, then follow the steps in the Group/Total Report Wizard, Multi-Column Report Wizard or Report Wizard. For additional help when you are in a report wizard, press F1.

To create a new report using the Report Writer power tool

1.	Make sure that the Report tab is selected.

2.	In the Catalog Manager, choose New to open the Create Report dialog.

3.	If you want to base the report on a table or query other than the one currently in use, select the file from the Select a Table or Query popup.

4.	In the Create Report dialog, choose the New Report button. The Save As dialog opens so you can name the new report.

5.	In the Save Report As text box, enter the name of the new report.

6.	Choose Save.

The Report Layout window opens, with the name of the new report as the window title.

You can press F1 when the Report Layout window is open, for information on using the Report Layout window. For more information on how to create reports, see the chapter "Designing Reports and Labels" in the FoxPro for Windows User's Guide.


See Also

Create Report dialog

Group/Total Report Wizard

Multi-Column Report Wizard

Report Layout window

Report Wizard

Save As Dialog


Adding a Report to a Catalog

See Also

You can add an existing dBASE or FoxPro report to your catalog with the Report tab in the Catalog Manager or through the File menu.

To add an existing report to your catalog using the Report tab

1.	Make sure that the Report tab is selected.

2.	In the Catalog Manager, choose Add to open the Open dialog.

3.	In the Open dialog, double-click on the report you want to add to the catalog.

To add an existing report to your catalog using the File menu

1.	From the File menu, choose Add File to display a cascading menu of the types of files you can add to a catalog.

2.	Select Report to display the Open dialog.

3.	In the Open dialog, double-click on the report you want to add to the catalog.


See Also

Editing a Catalog

File menu

Open Dialog


Modifying a dBASE Report in the Catalog Manager

See Also

A dBASE report is a file with the .FRM extension that consists primarily of the dBASE IV commands required to execute the report. For information about converting dBASE reports, see the Converting Reports and Labels Help topic.

To convert an .FRM into a report that can be run in FoxPro

1.	Make sure that the Report tab is selected.

2.	Select the report in the list by clicking it or by using the arrow keys.

3.	In the Catalog Manager, choose Modify.

4.	Using AutoMigrate technology, FoxPro automatically converts the report to a FoxPro for DOS report, then transports the DOS report to Windows, retaining the dBASE file name and changing the file extension to .FRX. The Report Layout window appears, displaying the converted report layout.

You can press F1 when you are in the Report Layout window for information on creating and modifying reports. For additional information on using the Report Layout window, see Report Layout Window or "Designing Reports and Labels" in the FoxPro for Windows User's Guide.


See Also

Converting Reports and Labels

Report Layout Window

Switching from dBASE


Modifying a FoxPro Report in the Catalog Manager

See Also

You can change a FoxPro report by using the Modify button in the Catalog Manager.

To modify an existing FoxPro report

1.	Make sure that the Report tab is selected.

2.	Select the report in the list by clicking it or by using the arrow keys.

3.	In the Catalog Manager, choose Modify.

The Change Report dialog appears, giving you a choice of tools to modify the report with, unless you have altered the report with the Report Writer power tool. The table below lists the possible options.

Report created with	Report modified with	Modify opens
A Report wizard	A Report wizard, or never modified	A Report wizard
A Report wizard	Report Writer power tool	Report Layout window
Report Writer power tool		Report Layout window
You can press F1 when the Report Wizard or Report Layout window is open for more information on using these methods to modify reports. For additional information on using the Report Layout window, see "Designing Reports and Labels" in the FoxPro for Windows User's Guide.


See Also

Change Report dialog

Report Wizard

Report Layout window


Printing a Report
Printing a Report from the Catalog Manager

See Also

You can print FoxPro reports to the screen, a file, or a printer, using the Print push button or the File menu.

To print an existing report from the Catalog Manager using the Print button

1.	Make sure that the Report tab is selected.

2.	In the Catalog Manager, choose Print to open the Catalog Manager Print dialog.

To print an existing report from the Catalog Manager using the File menu

1.	Make sure that the Report tab is selected.

2.	From the File menu, choose Print to open the Catalog Manager Print dialog.

You can press F1 when the Catalog Manager Print dialog is open for more information on using the dialog.


See Also

Catalog Manager Print Dialog


Working with Labels in the Catalog Manager

See Also	Catalog Manager

When the Label tab is selected, you can add new or existing labels to your catalog, as well as modify and print a dBASE or FoxPro label.

Task	Button	See this topic
Add a label to a catalog	Add	Adding a Label to a Catalog
Create a new label	New	Creating New Labels from the Catalog Manager
Modify a dBASE or FoxPro label	Modify	Modifying a dBASE Label Modifying a FoxPro Label
Print a label	Print	Printing a Label from the Catalog Manager
You can run a label by double-clicking the label file in the file list. To remove a label from a catalog, see the Editing a Catalog Help topic.


See Also

Adding a Label to a Catalog

Catalog Manager

Creating New Labels from the Catalog Manager

Editing a Catalog

Modifying a dBASE Label

Modifying a FoxPro Label

Printing a Label from the Catalog Manager


Creating New Labels from the Catalog Manager

See Also

You can create a new label using the Label Wizard or the Report Writer power tool.

To create a new label using the Label Wizard

1.	Make sure that the Label tab is selected.

2.	In the Catalog Manager, choose New to open the Create Label dialog.

3.	If you want to base the label on a table or query other than the one currently in use, select the file from the Select a Table or Query popup.

4.	In the Create Label dialog, choose the Label Wizard button.

5.	Follow the steps in the Label Wizard. For additional help when you are in the Label Wizard, press F1.

To create a new label using the Report Writer Power Tool

1.	Make sure that the Label tab is selected.

2.	In the Catalog Manager, choose New to open the Create Label dialog.

3.	If you want to base the label on a table or query other than the one currently in use, select the file from the Select a Table or Query popup.

4.	In the Create Label dialog, choose the New Label button. The Save As dialog opens so you can name the new label.

5.	In the Save As dialog, in the Save Label As text box, enter the name of the new label.

6.	Choose Save. The New Label dialog is displayed.

7.	Select the format for the new label from the scrolling list of standard Avery label formats by double-clicking on your selection, or by highlighting the selection and choosing OK. The Label Layout window opens, with the name of the new label as the window title.

While in the Label Layout window, you can get help by pressing F1. For more information on how to use the Label Layout window, see the Report Layout Window Help topic or the chapter "Designing Reports and Labels" in the FoxPro for Windows User's Guide.


See Also

Create Label dialog

New Label dialog

Report Layout Window

Save As Dialog


Adding a Label to a Catalog

See Also

You can add an existing dBASE or FoxPro label to your catalog using the Label tab in the Catalog Manager or through the File menu.

To add an existing label to your catalog using the Label tab

1.	Make sure that the Label tab is selected.

2.	In the Catalog Manager, choose Add to open the Open dialog.

3.	In the Open dialog, double-click on the label you want to add to the catalog.

To add an existing label to your catalog using the File menu

1.	From the File menu, choose Add File to display a cascading menu of the types of files you can add to a catalog.

2.	Select Label to display the Open dialog.

3.	In the Open dialog, double-click on the label you want to add to the catalog.


See Also

Editing a Catalog

File menu

Open Dialog


Modifying a dBASE Label in the Catalog Manager

See Also

A dBASE label is a file with the .LBL extension that consists primarily of the dBASE IV commands required to print labels. For information about converting dBASE labels, see the Converting Reports and Labels Help topic.

To convert an .LBL into a label file that can be run in FoxPro

1.	Make sure the Label tab is selected.

2.	Select the label file in the list by clicking it or by using the arrow keys.

3.	In the Catalog Manager, choose Modify.

4.	FoxPro automatically converts the label file to a FoxPro for DOS label file, then transports the DOS label file to Windows, using the dBASE file name and changing the file extension to .LBX. The Label Layout window appears, displaying the converted label layout.

While in the Label Layout window, you can get help by pressing F1. For more information on how to use the Label Layout window, see the Report Layout Window Help topic or the chapter "Designing Reports and Labels" in the FoxPro for Windows User's Guide.


See Also

Converting Reports and Labels

Label Layout

Report Layout Window

Switching from dBASE


Modifying a FoxPro Label in the Catalog Manager

See Also

You can modify an existing FoxPro label using the Modify button in the Catalog Manager.

To modify an existing FoxPro label

1.	Make sure the Label tab is selected.

2.	Select the label in the list by clicking it or by using the arrow keys.

3.	In the Catalog Manager, choose Modify.

The Change Label dialog appears, giving you a choice of tools to modify the label with, unless you have altered the label with the Label Layout window. The table below lists the possible options.

Label created with	Label modified with	Modify opens
Label Wizard	Label Wizard, or never modified	Label Wizard
Label Wizard	Report Writer power tool	Label Layout window
Report Writer power tool		Label Layout window
You can press F1 when the Label Wizard or Label Layout window is open for more information on using these methods to modify reports. For additional information on using the Label Layout window, see the Report Layout window Help topic or the chapter "Designing Reports and Labels" in the FoxPro for Windows User's Guide.


See Also

Change Label dialog

Label Wizard

Report Layout Window


Printing a Label

See Also

You can print FoxPro labels to the screen, a file, or a printer using the Print push button or the File menu.

To print an existing label from the Catalog Manager using the Print button

1.	Make sure that the Label tab is selected.

2.	In the Catalog Manager, choose Print to open the  Catalog Manager Print dialog.

To print an existing label from the Catalog Manager using the File menu

1.	Make sure that the Label tab is selected.

2.	From the File menu, choose Print to open the Catalog Manager Print dialog.

You can press F1 when the Catalog Manager Print dialog is open for more information on using the dialog.


See Also

Catalog Manager Print Dialog


Working with Programs in the Catalog Manager

See Also	Catalog Manager

When the Program tab is selected, you can add new or existing programs to your catalog, as well as create, modify or run a program.

Task	Button	See this topic
Add a program to a catalog	Add	Adding a Program to a Catalog
Create a new program	New	Creating New Programs from the Catalog Manager
Modify a dBASE or FoxPro program	Modify	Modifying a dBASE Program Modifying a FoxPro Program
Run a program	Run	Running a Program from the Catalog Manager
You can run a program by double-clicking the program file in the file list. You can also control the way FoxPro runs programs by selecting or clearing the dBASE Program check box on the Program tab, which shows the SET COMPATIBLE setting for the selected file in the file list. By default dBASE Program is unchecked (SET COMPATIBLE is off) for programs and applications created in FoxPro and checked (SET COMPATIBLE is on) for dBASE programs. To override the default setting, select or clear the check box. FoxPro will use the new setting each time you run the program or application in the Catalog Manager. When the dBASE Program check box is checked, FoxPro also removes the FoxPro system menu (SYSMENU is set OFF) to more closely emulate the dBASE environment.

For a list of commands and functions affected by the SET COMPATIBLE setting, see the Commands  and Functions Affected by SET COMPATIBLE section of the Compatibility Help topic.

To remove a program from a catalog, see the Editing a Catalog Help topic.


See Also

Adding a Program to a Catalog

Catalog Manager

Commands  and Functions Affected by SET COMPATIBLE

Creating New Programs from the Catalog Manager

Editing a Catalog

Modifying a dBASE Program

Modifying a FoxPro Program

Running a Program from the Catalog Manager

SET COMPATIBLE


Creating New Programs from the Catalog Manager

See Also

You can create a new program from the Catalog Manager using the Application Generator or the text editor.

To create a new program using the Application Generator

1.	Make sure that the Program tab is selected.

2.	In the Catalog Manager, choose New to open the Create Program dialog.

3.	In the Create Program dialog, choose the Application Generator button.

4.	Follow the steps in the FoxPro Application Generator. For additional help when you are in the Application Generator, press F1.

To create a new program using FoxPro's text editor

1.	Make sure that the Program tab is selected.

2.	In the Catalog Manager, choose New to open the Create Program dialog.

3.	In the Create Program dialog, choose the New Program button. The Save As dialog opens so you can name the new program.

4.	In the Save As dialog, in the Save Program As text box, enter the name of the new program.

5.	Choose Save. A text editing window opens, with the new program name as the title.

For more information on how to use the text editor, see Text Editing or the chapter "Interface Basics" in the FoxPro for Windows User's Guide.


See Also

Create Program dialog

Save As Dialog

Text Editing


Adding a Program to a Catalog

See Also

You can add an existing program to your catalog using the Program tab in the Catalog Manager or through the File menu.

To add an existing program to your catalog using the Program tab

1.	Make sure that the Program tab is selected.

2.	In the Catalog Manager, choose Add to open the Open dialog.

3.	In the Open dialog, double-click on the program you want to add to the catalog.

To add an existing program to your catalog using the File menu

1.	From the File menu, choose Add File to display a cascading menu of the types of files you can add to a catalog.

2.	Select Program to display the Open dialog.

3.	In the Open dialog, double-click on the program you want to add to the catalog.


See Also

Editing a Catalog

File menu

Open Dialog


Modifying a dBASE Program in the Catalog Manager

See Also

A dBASE program is a file with the .PRG extension. For information about converting dBASE programs, see the Converting Programs and Applications Help topic.

To modify a dBASE program from the Catalog Manager

1.	Make sure that the Program tab is selected.

2.	Select the program in the list by clicking it or by using the arrow keys.

3.	In the Catalog Manager, choose Modify to open the text editing window so you can modify the program file.

For more information on using the text editor to write and edit programs, see the Text Editing Help topic or the chapter "Interface Basics" in the FoxPro for Windows User's Guide.

Note:  The Modify button is disabled when you select an application created using the Application Generator, since these applications are not modifiable.


See Also

Converting Programs and Applications

Switching from dBASE

Text Editing


Modifying a FoxPro Program in the Catalog Manager

See Also

You can modify a FoxPro program from the Catalog Manager using the Modify push button.

To modify an existing FoxPro program

1.	Make sure that the Program tab is selected.

2.	Select the program in the list by clicking it or by using the arrow keys.

3.	In the Catalog Manager, choose Modify to open the text editing window so you can modify the program file.

For more information on how to write and edit programs using the text editor, see Text Editing or "Interface Basics" in the FoxPro for Windows User's Guide.

Note:  The Modify button is disabled when you select an application created using the Application Generator, since these applications are not modifiable.


See Also

Text Editing


Running a Program from the Catalog Manager

See Also

You can run an existing program from the Catalog Manager by double-clicking on the file name in the file list, or using the Run push button on the Program tab.

To run a program from the Catalog Manager

1.	Make sure that the Program tab is selected.

2.	Select the program in the list by clicking it or by using the arrow keys.

3.	In the Catalog Manager, double-click on the file name or choose Run to execute the program.

You can control the way FoxPro runs programs by selecting or clearing the dBASE Program check box on the Program tab, which shows the SET COMPATIBLE setting for the selected file in the file list. By default dBASE Program is unchecked (SET COMPATIBLE is off) for programs and applications created in FoxPro and checked (SET COMPATIBLE is on) for dBASE programs. To override the default setting, select or clear the check box. FoxPro will use the new setting each time you run the program or application in the Catalog Manager. When the dBASE Program check box is checked, FoxPro also removes the FoxPro system menu (SYSMENU is set OFF) to more closely emulate the dBASE environment.

For a list of commands and functions affected by the SET COMPATIBLE setting, see the Commands  and Functions Affected by SET COMPATIBLE section of the Compatibility Help topic.


See Also

Commands  and Functions Affected by SET COMPATIBLE

SET COMPATIBLE


Catalog Manager Tabs

The Table, Query, Screen, Report, Label and Program tabs in the
Catalog Manager look like the tabs on a paper file folder.

When you click on a tab to choose it, that tab becomes the active tab.


AutoScreen Button

The AutoScreen button looks like a small screen overlaid with a lightning bolt.

When you choose this button, FoxPro automatically creates and runs a screen based on the active table or query.


AutoReport Button

The AutoReport button looks like a small report overlaid with a lightning bolt.

When you choose this button, FoxPro automatically creates and runs a report based on the active table or query.


Browse Button

The Browse button looks like a small table overlaid with a magnifying glass.

When you choose this button, FoxPro automatically opens the active table or query in a Browse window.


% Operator

See Also	Example

Returns the remainder obtained by dividing a numeric expression by another numeric expression.

Syntax

<expN1> % <expN2>

Remarks

The modulus operator % and MOD( ) return identical results.

The modulus operator % is an arithmetic operator like + (addition), [image] (subtraction), * (multiplication), / (division) and ^ (exponentiation).  When these operators are combined in a numeric expression, % has the same precedence as * and /.  See the Overview of the FoxPro Language chapter in the FoxPro Language Reference for a further discussion of operators and their order of precedence.

Parameters

<expN1>

<expN1> is the dividend (the numeric expression being divided).  The number of decimal places in <expN1> determines the number of decimals places in the result.

<expN2>

<expN2> is the divisor (the numeric expression dividing the dividend <expN1>).  A positive number is returned if <expN2> is positive and a negative number is returned if <expN2> is negative.  <expN2> cannot be zero.


% Operator Example
Example

? 36 % 10

? (4*9) % (90/9)

? 25.250 % 5.0

? IIF(YEAR(DATE( )) % 4 = 0, 'Summer Olympics this year';
, 'No Summer Olympics this year')


% Operator See Also
See Also

MOD( ) Function


$& Function
& Function

Performs macro substitution.

Syntax

& <memvar> [.<expC>]

Remarks

Macro substitution treats the contents of a memory variable or array element as a character string literal.  When an ampersand (&) precedes a character type memory variable or array element, the contents of the variable or element replace the macro reference.  You can use macro substitution in any command or function that accepts a character string literal.

Tip   Whenever possible, use a name expression instead of macro substitution.  A name expression operates like macro substitution.  However, a name expression is limited to passing character strings as names.   Use a name expression for significantly faster processing if a command or function accepts a name (a file name, window name, popup name and so on).  See the Overview of the FoxPro Language chapter in the FoxPro Language Reference for additional information on name expressions.

While the following commands are acceptable:

STORE 'Customer' TO dbf_file
STORE 'company' TO tagname
USE &dbf_file ORDER &tagname

use a name expression instead:

USE (dbf_file) ORDER (tagname)

Macro substitution is useful for substituting a key word in a command.  In the following example, the TALK setting is saved to a memory variable so the setting can be restored later in the program.  The original TALK setting is restored with macro substitution.

STORE SET('TALK') TO savetalk
SET TALK OFF
*
*  Additional program code
*
SET TALK TO &savetalk	&& Restore original TALK setting

Parameters

<memvar>

This is the name of the memory variable or array element to reference in the macro substitution.  Do not include the M. prefix that distinguishes memory variables from fields.  This causes a syntax error.  The macro should not exceed the maximum statement length permitted in FoxPro.

A variable cannot reference itself recursively in macro substitution.  For example, the following generates an error message:

STORE '&X' TO X
? &X

Macro substitution statements that appear in DO WHILE, FOR and SCAN are only evaluated at the start of the loop and are not reevaluated on subsequent iterations.  Any changes to the memory variable or array element that occur within the loop are not recognized.

<expC>

The optional . (period) delimiter and character expression <expC> is used to append additional characters to a macro.  The character expression <expC> appended to the macro with .<expC> can also be a macro.


$ Function

See Also	Example

Returns true if a character expression is contained in another character expression.

Syntax

<expC1> $ <expC2>

Returns

Logical

Remarks

If the character expression isn't found, false (.F.) is returned.  This function isn't Rushmore optimizable.

Parameters

<expC1>, <expC2>

The character expression <expC2> is searched for an occurrence of <expC1>.  If <expC1> is found in <expC2>, .T. is returned.  If <expC1> isn't found in <expC2>, .F. is returned.  This function is case sensitive (upper- and lower-case are respected).

<expC1> and <expC2> can be character type memory variables or array elements, character type fields, character string literals or memo fields of any length.

Memo fields can be manipulated like character expressions, fields in tables, memory variables or array elements.  For example, if MEMO_FLD is a memo field, the following is perfectly acceptable:

LIST FOR 'FOX' $ UPPER(memo_fld)


$ Function Example

The following example creates a table called MEMOTEST containing one memo field.  Three records are appended to the table and a Browse window is opened to display the 3 records.  $ is used to list the records which contain the string "FOX".  The files created for the example are then deleted.

CLOSE DATABASES
CLEAR
CREATE CURSOR memotest (text C(3), memo M)
INSERT INTO memotest (text, memo) VALUES ('Fox', 'Fox')
INSERT INTO memotest (text, memo) VALUES ('Cat', 'Cat')
INSERT INTO memotest (text, memo) VALUES ('FOX', 'FOX')

LIST FIELDS memo, text FOR 'FOX' $ UPPER(memo)
USE


$ Function See Also
See Also

AT( ) Function


= Command

See Also

Evaluates one or more expressions.

Syntax

= <expr1>[, <expr2> ...]

Remarks

The = command evaluates one or more expressions <expr1>, <expr2> ... and discards the return values.  This is particularly useful when a FoxPro function or a user-defined function has a desired effect but there is no need to assign the function's return value to a memory variable, array element or field.

For example, to turn insert mode on you can issue the command:

= INSMODE(.T.)

INSMODE normally returns a true (.T.) or false (.F.) value.  In this example the function is executed but the return value is discarded.

Note   There are two other unrelated uses for the equal sign =.  It can be used as an operator in logical expressions to make a comparison or to assign values to memory variables and array elements.  In these two cases the equal sign = is an operator and not a command.


= Command See Also
See Also

? | ?? Commands

User-Defined Functions (UDFs)


\ | \\ Commands

See Also	Example

Outputs lines of text.

Syntax

\<text line>
or
\\<text line>

Remarks

The \ and \\ commands facilitate text merge in FoxPro.  Text merge lets you output text to a file to create form letters or programs.

Use \ and \\ to output a text line to the current text merge output file and the screen.  SET TEXTMERGE is used to specify the text merge output file.  If text merge isn't directed to a file, the text line is output only to the desktop (FoxPro for MS-DOS) or the main FoxPro window. SET TEXTMERGE NOSHOW suppresses output to the desktop or main FoxPro window.

When you use \, the output line is preceded by a carriage return and a linefeed.  When you use \\, the output line isn't preceded by a carriage return and linefeed.

Any spaces preceding \ and \\ are not included in the output line, but spaces following \ and \\ are.

You can embed an expression in the text line.  If the expression is enclosed in the text merge delimiters (<<  >> by default) and TEXTMERGE is SET ON, the expression is evaluated and its value is output as text.


\ | \\ Commands Example
\ | \\ Example

USE customer

SET TEXTMERGE ON
SET TEXTMERGE TO letter.txt

\<<CDOW(DATE( ))>>, <<CMONTH (DATE( ))>>
\\<<DAY(DATE( ))>>, <<YEAR(DATE( ))>>
\
\
\Dear <<contact>>
\Additional text
\
\Thank you,
\
\XYZ Corporation
CLOSE ALL
MODIFY FILE letter.txt NOEDIT


= \ | \\ Commands See Also
See Also

_PRETEXT System Memory Variable

SET TEXTMERGE Command

SET TEXTMERGE DELIMITERS Command

_TEXT System Memory Variable

TEXT ... ENDTEXT Command


ASC( ) Function

See Also	Example

Returns the ASCII code for the leftmost character in a character expression.

Syntax

ASC(<expC>)

Returns

Numeric

Remarks

Every character has a unique ASCII value in the range from 0 to 255.

In FoxPro for MS-DOS you can open the ASCII Chart desk accessory for a list of characters and their ASCII values.

Parameter

<expC>

The ASCII value is returned for the first character in the character expression <expC>.  Any characters after the first character in <expC> are ignored by ASC( ).


ASC( ) Example

USE salesman
? name
? ASC(name)
? ASC('A')
? ASC('a')


ASC() SeeAlso
See Also

CHR( ) Function


ASCAN( ) Function

See Also	Example

Searches an array for an expression.

Syntax

ASCAN(<array>, <expr>[, <expN1>[, <expN2>]])

Returns

Numeric

Remarks

ASCAN( ) searches an array for an element containing the same data and data type as <expr>.  If a match is found, the number of the element containing the expression is returned. If a match cannot be found, 0 is returned.

The criteria for a successful match of character data is determined by the setting of SET EXACT (ON or OFF).  If SET EXACT is ON, an element must match the search expression character for character and have the same length.  If SET EXACT is OFF and an element and search expression match up to the point where the expression is exhausted, the match is successful.  For more information on match criteria for character strings, see the string comparison table in SET EXACT.

Parameters

<array>, <expr>

Include the name of the array to search and the general expression <expr> to search for.

<expN1>

By default, the entire array is searched.  The search can be started at an element other than the first element by including <expN1>.  The search begins at element number <expN1>, with element number <expN1> included in the search.

<expN2>

A specific number of elements can be searched by including <expN2>.  The array is searched beginning with element <expN1>, and <expN2> elements are searched for a match.

If the optional numeric expressions <expN1> and <expN2> are omitted the search begins with the first array element and continues to the last array element.

Tips

You can refer to an element in a two-dimensional memory variable array in one of two ways.  The first method uses two subscripts to specify the row and column position of the element in the array; the other method uses an element number.  This function and others that manipulate two dimensional arrays require element numbers (<expN1> and <expN2>).

Use AELEMENT( ) to return the element number from row and column subscripts in a two-dimensional array.


ASCAN( ) Example

The following example dimensions and fills an array from the COMPANY field of the CUSTOMER table, then searches the array for the element containing "1st Computers" and deletes that element.

CLOSE DATABASES
USE customer
COUNT TO m.count

*** DIMENSION array large enough to hold data ***

DIMENSION companies[m.count,1]

COPY TO ARRAY companies FIELD company	&& Fill array

m.name = '1st Computers'
m.pos  = ASCAN(companies, m.name)	&& Search for company

IF m.pos != 0
msg1 = 'Company in cell 1: '+companies(m.pos)
WAIT WINDOW (msg1) TIMEOUT 3
= ADEL(companies, m.pos)
m.count = m.count - 1
msg1 = 'Company removed, now cell 1: '+companies(m.pos)
WAIT WINDOW (msg1) NOWAIT
ELSE
WAIT WINDOW '1st Computers not found.' NOWAIT
ENDIF


ASCAN() SeeAlso
See Also

ACOPY( ) Function

ADEL( ) Function

ADIR( ) Function

AELEMENT( ) Function

AFIELDS( ) Function

AINS( ) Function

ASORT( ) Function

ASUBSCRIPT( ) Function

DIMENSION Command

SET EXACT Command


ASIN( ) Function

See Also	Example

This trigonometric function returns in radians the arc sine of the numeric expression <expN>.

Syntax

ASIN(<expN>)

Returns

Numeric

Parameters

<expN>

The value of <expN> can range from +1 through -1, and the value returned by ASIN( ) can range from -pi/2  through +pi/2  ( -1.57079 to 1.57079).  The number of decimal places in the display of the result can be specified with SET DECIMALS.

Use RTOD( ) to convert radians to degrees.


ASIN( ) Example

? RTOD(ASIN(0))

STORE 1 to arcangle
? RTOD(ASIN(arcangle))

? RTOD(ASIN(SQRT(2)/2))


ASIN() SeeAlso
See Also

RTOD( ) Function

SET DECIMALS Command

SIN( ) Function


ASORT( ) Function

See Also	Example

Sorts elements in an array in ascending or descending order.

Syntax

ASORT(<array>[, <expN1>[, <expN2>[, <expN3>]]])

Returns

Numeric

Remarks

All elements included in the sort must be of the same data type (character, numeric, date or logical).  One-dimensional arrays are sorted by their elements; two-dimensional arrays are sorted by their rows.  When a two-dimensional array is sorted, the order of the rows in the array is changed so the elements in a column of the array are in ascending or descending order.

If the sort is successful, 1 is returned; otherwise -1 is returned.

Parameters

<array>

Include the name of the array to sort.

<expN1>

By default, arrays are sorted starting with the first array element.  You may designate a different starting element for the sort by including <expN1>.  If the array is one-dimensional, the array is sorted starting with the <expN1>th element; the starting element <expN1> is included in the sort.  If the array is two-dimensional, the starting element <expN1> determines both the row where the sort begins and the column that determines the sort order of the rows.

Tips

You can refer to an element in a two-dimensional array in one of two ways.  The first method uses two subscripts to specify the row and column position of the element in the array; the other method uses an element number.  This function and others that manipulate two-dimensional arrays require element numbers (in ASORT( ) the numeric expressions <expN1> and <expN2>).

You can use AELEMENT( ) to return the element number from row and column subscripts in a two-dimensional array.

The following example illustrates that the starting element <expN1> determines how the rows in a two-dimensional array are sorted.  A small array named MARRAY is created and sorted twice.  The first sort begins with the first element of MARRAY, the rows are sorted based on the values contained in the first column of the array.  The second sort begins with the fourth element of MARRAY, and the rows are sorted based on the values contained in the second column.

The first sort begins with the first row.  The second sort begins with the second row.  You can use DISPLAY MEMORY to display the contents of the array; in these examples tables are used to graphically display the results of the sorts.

These commands create the array named MARRAY:

DIMENSION marray(3,2)
marray(1) = 'G'
marray(2) = 'A'
marray(3) = 'C'
marray(4) = 'Z'
marray(5) = 'B'
marray(6) = 'N'

MARRAY looks like this:

	Column 1	Column 2
Row 1	G	A
Row 2	C	Z
Row 3	B	N
The array is then sorted by ASORT( ) starting with the first element (1,1) in the array.  The elements in the first column are placed in ascending order by rearranging the rows of the array.

=ASORT(marray,1)

Note the new order of the rows:

	Column 1	Column 2
Row 1	B	N
Row 2	C	Z
Row 3	G	A
The array is then sorted starting with the fourth element (2,2) in the array.  The elements in the second column are placed in order by rearranging the array rows.

=ASORT(marray,4)

Note the difference in the order of the rows:

	Column 1	Column 2
Row 1	B	N
Row 2	G	A
Row 3	C	Z
<expN2>

If you include a starting element <expN1> you can also specify the number of elements in a one-dimensional array or rows in a two-dimensional array to sort.  The number of elements or rows that are sorted is specified with <expN2>.  For example, if the array is one-dimensional and <expN1> is 2 (start with the second array element) and <expN2> is 3 (use three elements), the second, third and fourth array elements are sorted.  If <expN2> is -1 or is omitted, all array elements from the starting element <expN1> through the last element in the array are sorted.

If the array is two-dimensional, <expN2> designates the number of rows to sort, beginning with the row containing the starting element <expN1>.  For example, if <expN1> is 2 and <expN2> is 3, the row containing the second array element and the following two rows are sorted.  If <expN2> is -1 or is omitted, all array rows beginning with the row containing the starting element <expN1> through the last array row are sorted.

<expN3>

By default, array elements are sorted in ascending order.  You can include <expN3> to specify that the array's sort order (ascending or descending).  If <expN3> is 0, the array elements are sorted in ascending order.  If <expN3> is 1 or any non-zero value, the array elements are sorted in descending order.


ASORT( ) Example

The following example copies the CNO and COMPANY fields from the CUSTOMER table to an array named COMPANIES.  The array is then sorted based on the elements in the first column starting with the fourth row. In other words, the array is sorted starting with element 7.  A list containing the elements in the first column (CNO) of the COMPANIES array is displayed.

*** SELECT or USE customer ***

IF USED('customer')
SELECT customer
ELSE
USE LOCFILE('customer.','DBF','Where is CUSTOMER.DBF?')
ENDIF

COUNT TO m.count

*** DIMENSION array large enough to hold data ***

DIMENSION companies[m.count,2]

COPY TO ARRAY companies FIELD cno,company	&& Fill the array

= ASORT(companies, AELEMENT(companies,4,1))	&& Sort array
WAIT WINDOW 'First three rows are not sorted' NOWAIT
@ 5,30 SAY 'List of Companies CNO:'
@ 7,30 GET m.choice FROM companies RANGE 1 SIZE 10,30 DEFAULT 1

READ	&& Display and GET sorted company data

CLEAR
USE


ASORT() SeeAlso
See Also

ACOPY( ) Function

ADEL( ) Function

ADIR( ) Function

AELEMENT( ) Function

AFIELDS( ) Function

AINS( ) Function

ALEN( ) Function

ASCAN( ) Function


ASSIST Command

See Also

Displays the Catalog Manager.

Syntax

ASSIST

Remarks

Included for dBASE compatibility.

The Catalog Manager is a graphical interface that enables you to manage catalogs (.FPC or .CAT files) easily. Catalogs can contain tables, queries, screens, reports, labels and programs. From this central location, you can create, modify, and run these FoxPro files. You can also use AutoMigrate to migrate existing dBASE III and dBASE IV files. The Catalog Manager, written entirely in FoxPro, is an example of the type of application you can develop in FoxPro.


ASSIST SeeAlso
See Also

_ASSIST

Catalog Manager


ASUBSCRIPT( ) Function

See Also

Returns the row or column subscript of an element from the element's number.

Syntax

ASUBSCRIPT(<array>, <expN1>, <expN2>)

Returns

Numeric

Remarks

You can refer to elements in two-dimensional memory variable arrays in one of two ways.  The first method uses two subscripts to specify the row and column position of the element in the array. The second method uses an element number.  Use ASUBSCRIPT( ) to obtain an element's row or column subscript from the element's number.

In the following example, an array with two rows and three columns is created. DISPLAY MEMORY shows the contents of the elements of the array listed in element number order.

DIMENSION x(2,3)
DISPLAY MEMORY LIKE x

X           Pub    A
  (   1,   1)     L  .F.  (element number 1)
  (   1,   2)     L  .F.  (element number 2)
  (   1,   3)     L  .F.  (element number 3)
  (   2,   1)     L  .F.  (element number 4)
  (   2,   2)     L  .F.  (element number 5)
  (   2,   3)     L  .F.  (element number 6)

These commands both store the character string INVOICE to the same array element:

STORE 'INVOICE' TO X(2, 1)

STORE 'INVOICE' TO X(4)

In one-dimensional arrays, an element's number is identical to its single row subscript.  It isn't necessary to use ASUBSCRIPT( ) with one-dimensional arrays.

<array>, <expN1>, <expN2>

If the array is one-dimensional, include the element number in <expN1> and 1 in <expN2>.  ASUBSCRIPT( ) identically returns <expN1>.

If the array is two-dimensional you must include both the element number <expN1> and a value of 1 or 2 in <expN2>.  Specifying 1 in <expN2> returns the row subscript of the element, and specifying 2 returns the column subscript.

For more information on how to reference elements in an array, see DIMENSION.


ASUBSCRIPT() SeeAlso
See Also

ADEL( ) Function

ADIR( ) Function

AELEMENT( ) Function

AFIELDS( ) Function

AINS( ) Function

ALEN( ) Function

ASCAN( ) Function

ASORT( ) Function

DIMENSION Command

DISPLAY MEMORY Command


AT( ) Function

See Also	Example

Returns the beginning numeric position of the first occurrence of a character expression or memo field within another character expression or memo field, counting from the leftmost character.

Syntax

AT(<expC1>, <expC2>[, <expN>])

Returns

Numeric

Remarks

AT( ) searches the second character expression for the first occurrence of the first character expression.  It then returns an integer indicating the position of the first character in the found character expression.  If the character expression isn't found, 0 is returned.

The search performed by AT( ) is case sensitive (upper and lower-case is respected).  To perform a search that isn't case sensitive, use ATC( ).

Parameters

<expC1>, <expC2>

FoxPro looks for the search character expression <expC1> in the second character expression <expC2>.  The character expressions <expC1> and <expC2> can be memo fields of any size.

<expN>

If <expN> is included, AT( ) searches for the <expN>th occurrence of <expC1> in <expC2>.  By default, AT( ) searches for the first occurrence of <expC1> (<expN> = 1).  Including <expN> lets you search for additional occurrences of <expC1> in <expC2>.


AT( ) Example

STORE 'Now is the time for all good men' TO string
STORE 'is the' TO find_str
? AT(find_str,string)

STORE 'IS' TO find_str
? AT(find_str,string)

USE parts
STORE 'Kimono' to string
LIST ALL pno,descript FOR AT(string,descript) > 0

STORE 'AB' TO find_str
STORE 'ABABAB' TO string
? AT(find_str,string,2)


AT() SeeAlso
See Also

ATC( ) Function

LEFT( ) Function

RAT( ) Function

RIGHT( ) Function

SUBSTR( ) Function


ATAN( ) Function

See Also	Example

This trigonometric function returns in radians the arc tangent of a numeric expression.

Syntax

ATAN(<expN>)

Returns

Numeric

Parameter

<expN>

ATAN( ) returns the arc tangent of the numeric expression <expN>.  <expN> can be any value; the value returned by ATAN( ) can range from -pi/2  through +pi/2 ( -1.57079 to 1.57079).  The number of decimal places displayed in the value returned by ATAN( ) is determined by SET DECIMALS.

The numeric value returned by ATAN( ) is in radians.  Use RTOD( ) to convert this value to degrees.


ATAN( ) Example

? ATAN(0)

STORE PI( )/2 to angle
? ATAN(angle)

? ATAN(PI( )/2)

? ATAN(DTOR(90))


ATAN() SeeAlso
See Also

ATN2( ) Function

RTOD( ) Function

SET DECIMALS Command

TAN( ) Function


ATC( ) Function

See Also	Example

Returns the beginning numeric position of the first occurrence of a character expression or memo field within another character expression or memo field, without regard for the case of these two expressions.

Syntax

ATC(<expC1>, <expC2>[, <expN>])

Returns

Numeric

Remarks

ATC( ) searches the second character expression for the occurrence of the first character expression, without concern for the case (upper or lower) of the characters in either expression.  Use AT( ) to perform a case-sensitive search.

ATC( ) returns an integer corresponding to the position where the first character of the character expression is found.  If the character expression isn't found, 0 is returned.

Parameters

<expC1>, <expC2>

ATC( ) searches <expC2> for <expC1>.  The character expressions <expC1> and <expC2> can be memo fields of any size.

<expN>

If <expN> is included, ATC( ) searches for the <expN>th occurrence of <expC1> in <expC2>.  By default, ATC( ) searches for the first occurrence of <expC1> (<expN> = 1).  Including <expN> lets you search for additional occurrences of <expC1> in <expC2>.


ATC( ) Example

STORE 'Now is the time for all good men ... ' TO string
STORE 'IS THE' TO find_str
? ATC(find_str,string)

STORE 'IS' TO find_str
? ATC(find_str,string)
? ATC('now',string)


ATC() SeeAlso
See Also

AT( ) Function

ATCLINE( ) Function

LEFT( ) Function

RAT( ) Function

RIGHT( ) Function

SUBSTR( ) Function


ATCLINE( ) Function

See Also	Examples

Returns the line number of the first occurrence of a character expression or memo field within another character expression or memo field; without regard for the case of the two expressions.

Syntax

ATCLINE(<expC1>, <expC2>)

Returns

Numeric

Remarks

ATCLINE( ) searches the second character expression for the occurrence of the first character expression without concern for the case (upper or lower) of the characters in either expression.  Use ATLINE( ) to perform a case-sensitive search.

If the search is successful, the number of the line containing the first character expression is returned.  If the search is unsuccessful, 0 is returned.

The line number returned by ATCLINE( ) is determined by the value of SET MEMOWIDTH, even if <expC2> isn't a memo field.  For more information, see SET MEMOWIDTH.

Parameters

<expC1>, <expC2>

ATCLINE( ) searches <expC2> for <expC1>.  The character expressions <expC1> and <expC2> can be memo fields of any size.

The line containing the matching character expression can be returned with MLINE( ).

Tip   ATCLINE( ) offers a convenient way to search memo fields.


ATCLINE( ) Example
ATCLINE( ) Examples

The following example locates the first time a character string occurs in a memo field and displays the city, state and line of the memo for the record.

CLOSE DATABASES
USE salesman
GO TOP
CLEAR
STORE 'JANET' TO findstring
LOCATE FOR ATCLINE(findstring, notes) != 0
? city
? state
? MLINE(notes, ATCLINE(findstring, notes))

The following example demonstrates how the memo width affects ATCLINE( ).

STORE '1234567890ABCDEFGHIJ' TO string
SET MEMOWIDTH TO 20
? ATCLINE ('AB', string)

SET MEMOWIDTH TO 10
? ATCLINE('AB', string)


ATCLINE() SeeAlso
See Also

AT( ) Function

ATC( ) Function

ATLINE( ) Function

MLINE( ) Function

SET MEMOWIDTH Command


ATLINE( ) Function

See Also	Examples

Returns the line number of the first occurrence of a character expression or memo field within another character expression or memo field, counting from the first line.

Syntax

ATLINE(<expC1>, <expC2>)

Returns

Numeric

Remarks

ATLINE( ) searches the second character expression for the occurrence of the first character expression.  The case (upper or lower) of the characters in either expression is respected.  Use ATCLINE( ) to perform a search that isn't case sensitive.

If the search is successful, the number of the line where the match occurs is returned.  If the search is unsuccessful, 0 is returned.

The line number returned by ATLINE( ) is determined by the value of SET MEMOWIDTH, even if <expC2> isn't a memo field.  For more information, see SET MEMOWIDTH.

Parameters

<expC1>, <expC2>

ATLINE( ) searches <expC2> for <expC1>.  The character expressions <expC1> and <expC2> can be memo fields of any size.

The line containing the matching character expression can be returned as a character string with MLINE( ).

Tip   ATLINE( ) offers a convenient way to search memo fields.


ATLINE( ) Example
ATLINE( ) Examples

CLOSE DATABASES
USE salesman
GO TOP
CLEAR
STORE 'Janet' TO findstring
LOCATE FOR ATLINE(findstring, notes) != 0
? city
? state
? MLINE(notes, ATLINE(findstring, notes))

The following example demonstrates how the memo width affects ATLINE( ).

STORE '1234567890ABCDEFGHIJ' TO string
SET MEMOWIDTH TO 20
? ATLINE('AB', string)

SET MEMOWIDTH TO 10
? ATLINE('AB', string)


ATLINE() SeeAlso
See Also

AT( ) Function

ATC( ) Function

ATCLINE( ) Function

MLINE( ) Function

SET MEMOWIDTH Command


ATN2( ) Function

See Also	Example

Returns the arc tangent angle in all four quadrants from specified values.

Syntax

ATN2(<expN1>, <expN2>)

Returns

Numeric

Remarks

ATN2( ) returns the angle (in radians) between the line y = 0 and the line connecting the specified coordinates and the origin (0, 0) of the coordinate system.

ATN2( ) returns a value between - pi and + pi.

The value returned by ATN2( ) can be converted to degrees with RTOD( ).  The number of decimal places in the display of the result can be specified with SET DECIMALS.

Parameters

<expN1>, <expN2>

Specify the y coordinate with <expN1> and the x coordinate with <expN2>.


ATN2( ) Example

? PI( )

? ATN2(0,-1)

STORE COS(PI( )) TO X
STORE SIN(PI( )) TO Y
? ATN2(Y,X)

? ATN2(Y,X)/PI( )


ATN2() SeeAlso
See Also

ATAN( ) Function

DTOR( ) Function

RTOD( ) Function

SET DECIMALS Command

TAN( ) Function


AVERAGE Command

See Also	Example

Computes the arithmetic mean of numeric expressions or fields.

Syntax

AVERAGE
[<expr list>]
[<scope>]
[FOR <expL1>]
[WHILE <expL2>]
[TO <memvar list> | TO ARRAY <array>]
[NOOPTIMIZE]

Remarks

All numeric fields in the selected table are averaged unless you include an optional expression list.  The result is displayed on the screen if SET TALK is ON.  If SET HEADINGS is ON, the field names or expression involving the field names are displayed above the results.

Clauses

<expr list>

These are expressions to be averaged.  <expr list> can be a list of fields from the table separated by commas, or numeric expressions involving fields from the table.

<scope>

The scope clauses are:  ALL, NEXT <expN>, RECORD <expN>, and REST.  These are explained in the Overview of the FoxPro Language chapter of the FoxPro Language Reference.  Commands which include <scope> operate only on the table in the active work area.

You can specify a scope of records to copy to average.  Only the records that fall within the range of records specified by the scope are averaged.

The default scope for AVERAGE is ALL records.

FOR <expL1>

If FOR <expL1> is included, only the records that satisfy the logical condition <expL1> are included in the average.  Including FOR lets you conditionally include records in the average, filtering out undesired records.

Rushmore optimizes a AVERAGE FOR query if <expL1> is an optimizable expression.  For best performance, use an optimizable expression in the FOR clause.  A discussion of Rushmore optimizable expressions appears in the Optimizing Your Application chapter in the FoxPro Developer's Guide.

WHILE <expL2>

If WHILE <expL2> is included, records are included in the average for as long as the logical expression <expL2> evaluates to true (.T.).

TO <memvar list> | TO ARRAY <array>

The results of AVERAGE can optionally be stored to a list of memory variables or array elements or to a one-dimensional ARRAY.

If TO ARRAY <array> is included, the results are stored in the one-dimensional array.  The one-dimensional array can be created before the execution of AVERAGE.

If the array you include in AVERAGE doesn't exist, FoxPro will automatically create it.  If the array exists and isn't large enough to contain all the results, the size of the array is automatically increased to accommodate the information.

NOOPTIMIZE

To disable Rushmore optimization of AVERAGE, include NOOPTIMIZE.  For more information, see SET OPTIMIZE or consult the discussion of Rushmore optimization in the Optimizing Your Application chapter in the FoxPro Developer's Guide.


AVERAGE Example

USE invoices
AVERAGE itotal FOR BETWEEN(idate,{05/01/90},{05/31/90})

AVERAGE itotal TO mavg

? mavg


AVERAGE SeeAlso
See Also

CALCULATE Command

DIMENSION Command

SET HEADINGS Command

SUM Command


BAR( ) Function

See Also	Example

Returns the number of the most recently chosen option from a popup defined with DEFINE POPUP or a FoxPro menu system popup.

Syntax

BAR( )

Returns

Numeric

Remarks

Each option on a popup is assigned a number with DEFINE BAR.  When an option is chosen from the popup, BAR( ) returns the number assigned to that option.  A program can branch to other routines based on the value returned by BAR( ).

BAR( ) returns 0 if there is no active popup or if Esc has been pressed to exit the menu.


BAR( ) Example

This example uses BAR( ) to pass the number of a popup option to a procedure.  The current system menu bar is saved to memory with SET SYSMENU SAVE, and then all system menu pads are removed with SET SYSMENU TO.

Two menu pads are created with DEFINE PAD, and DEFINE POPUP is used to create a popup for each menu pad.  DEFINE BAR is used to create options on each popup.  When a menu pad is chosen, ON PAD uses ACTIVATE POPUP to activate the corresponding popup.

When an option is chosen from a popup, ON SELECTION POPUP uses BAR( ) and POPUP( ) to pass the option number and popup name to the CHOICE procedure.  CHOICE displays the number of the chosen option and the name of the popup containing the option.  If the Exit option is chosen from the Card Info popup, the original FoxPro system menu is restored with SET SYSMENU TO DEFAULT.

*** Name this program BAR_EXAM.PRG ***

CLEAR

SET SYSMENU SAVE
SET SYSMENU TO

DEFINE PAD convpad OF _MSYSMENU ;
PROMPT '\<Conversions' COLOR SCHEME 3 ;
KEY ALT+C, ''
DEFINE PAD cardpad OF _MSYSMENU ;
PROMPT 'Card \<Info' COLOR SCHEME 3 ;
KEY ALT+I, ''

ON PAD convpad OF _MSYSMENU ACTIVATE POPUP conversion
ON PAD cardpad OF _MSYSMENU ACTIVATE POPUP cardinfo

DEFINE POPUP conversion MARGIN RELATIVE SHADOW COLOR SCHEME 4
DEFINE BAR 1 OF conversion PROMPT 'Ar\<ea' KEY CTRL+E, '^E'
DEFINE BAR 2 OF conversion PROMPT '\<Length' ;
KEY CTRL+L, '^L'
DEFINE BAR 3 OF conversion PROMPT 'Ma\<ss' ;
KEY CTRL+S, '^S'
DEFINE BAR 4 OF conversion PROMPT 'Spee\<d' ;
KEY CTRL+D, '^D'
DEFINE BAR 5 OF conversion PROMPT '\<Temperature' ;
KEY CTRL+T, '^T'
DEFINE BAR 6 OF conversion PROMPT 'T\<ime' ;
KEY CTRL+I, '^I'
DEFINE BAR 7 OF conversion PROMPT 'Volu\<me' ;
KEY CTRL+M, '^M'

*** Here is where the conversion menu pad uses the BAR( ) function
*** to pass a bar number to the procedure called choice below.

ON SELECTION POPUP conversion;
DO choice IN bar_exam WITH BAR( ), POPUP( )

DEFINE POPUP cardinfo MARGIN RELATIVE SHADOW COLOR SCHEME 4
DEFINE BAR 1 OF cardinfo PROMPT '\<View Charges' ;
KEY ALT+V, ''
DEFINE BAR 2 OF cardinfo PROMPT 'View \<Payments' ;
KEY ALT+P, ''
DEFINE BAR 3 OF cardinfo PROMPT 'Vie\<w Users' ;
KEY ALT+W, ''
DEFINE BAR 4 OF cardinfo PROMPT '\-'
DEFINE BAR 5 OF cardinfo PROMPT '\<Charges '
DEFINE BAR 6 OF cardinfo PROMPT '\-'
DEFINE BAR 7 OF cardinfo PROMPT 'E\<xit '

*** Here is where the cardinfo menu pad uses the BAR( ) function
*** to pass a bar number to the procedure called choice below.

ON SELECTION POPUP cardinfo;
DO choice IN bar_exam WITH BAR( ), POPUP( )

*** The procedure choice uses the mbar parameter
*** to contain the value passed by the BAR( ) function.

PROCEDURE choice
PARAMETERS mbar, mpopup

WAIT WINDOW 'You chose bar #' + LTRIM(STR(mbar)) + ;
' from popup ' + mpopup NOWAIT

IF mbar = 7 AND mpopup = 'CARDINFO'
SET SYSMENU TO DEFAULT
ENDIF


BAR() SeeAlso
See Also

ACTIVATE POPUP Command

CNTBAR( ) Function

DEFINE BAR Command

DEFINE POPUP Command

GETBAR( ) Function

MRKBAR( ) Function

ON BAR Command

ON SELECTION BAR Command

PRMBAR( ) Function


BARCOUNT( ) Function

See Also

Returns the number of bars on a popup defined with DEFINE POPUP or on a FoxPro system popup.

Syntax

BARCOUNT([<expC>])

Returns

Numeric

Remarks

If the popup bars are defined with DEFINE POPUP ... PROMPT, FoxPro evaluates the prompts when you issue ACTIVATE POPUP.  For such a popup, BARCOUNT( ) returns a meaningful value only after you activate the popup.  If the popup bars are defined with DEFINE BAR, BARCOUNT( ) can determine the number of bars before you issue ACTIVATE POPUP.

BARCOUNT( ) is provided for dBASE compatibility. In dBASE, BARCOUNT( ) returns the number of bars in a defined popup, regardless of whether or not the popup has been activated. BARCOUNT( ) in FoxPro calculates the number of bars of active popups. BARCOUNT( ) returns 0 in FoxPro if a popup has been defined but not activated.

Parameter

<expC>

Specify the name of the popup with <expC>.  For a list of FoxPro system menus, see MENU - System Menu Names.

If you omit <expC>, BARCOUNT( ) returns the number of bars on an active popup created with DEFINE POPUP.


BARCOUNT( ) SeeAlso
See Also

ACTIVATE POPUP Command

CNTBAR( ) Function

CNTPAD( ) Function

CREATE MENU Command

DEFINE BAR Command

DEFINE POPUP Command

GETBAR( ) Function

MRKBAR( ) Function

ON BAR Command

ON SELECTION BAR Command

PRMBAR( ) Function


BARPROMPT( ) Function

See Also

Returns the prompt text from a bar on a popup.

Syntax

BARPROMPT(<expN>, <expC>)

Returns

Character

Remarks

Popups are created with DEFINE POPUP and DEFINE BARs.  DEFINE POPUP creates the popup, while DEFINE BARs create the popup bars. BARPROMPT( ) also works with a FoxPro system popup.  BARPROMPT( ) returns the text that appears on the bar.

A popup doesn't have to be active for BARPROMPT( ) to return a bar's prompt text.

If a popup bar was created with the hot key (\<) or disabled option (\) special characters aren't included, only the prompt is returned.  The special characters aren't included.  BARPROMPT( ) returns the null string when a popup bar is a separator created with the \- special characters.  The null string is also returned if a bar is created without a prompt.

BARPROMPT( ) is provided for dBASE compatibility. It is identical to PRMBAR( ) with the parameter positions are switched.

Parameters

<expN>

Include the bar number <expN>.  The prompt text of the bar with that number is returned.  For example, if <expN> is 1 the first bar's prompt text is returned, if <expN> is 2 the second bar's prompt text is returned and so on.  <expN> must be at least 1 and no greater than the number of bars in the popup.

<expC>

Specify the popup name with <expC>.


BARPROMPT() SeeAlso
See Also

CNTBAR( ) Function

GETBAR( ) Function

DEFINE BAR Command

DEFINE POPUP Command

MRKBAR( ) Function

PRMBAR( ) Function

PRMPAD( ) Function


BETWEEN( ) Function

See Also	Example

Determines if the value of an expression lies between the values of two other expressions of the same date type.

Syntax

BETWEEN(<expr1>, <expr2>, <expr3>)

Returns

Logical

Remarks

BETWEEN( ) returns a value of true (.T.) if the value of a character, numeric or date expression lies between the values of two other expressions of the same data type.  If the value of the expression doesn't lie between the values of two other expressions, BETWEEN( ) returns false (.F.).

Parameters

<expr1>, <expr2>, <expr3>

True (.T.) is returned if the value of <expr1> is greater than or equal to the value of <expr2> and less than or equal to the value of <expr3>; otherwise, false (.F.) is returned.


BETWEEN( ) Example

This example scans the INVOICES table for all records with invoice numbers between 1250 and 1260 inclusive and then displays the invoices and their respective totals.

CLOSE DATABASES
USE invoices
SCAN FOR BETWEEN(ino,1250,1260 )
? 'Itotal for ' + ALLTRIM(STR(ino)) + ' is ' + ;
ALLTRIM(STR(itotal))
ENDSCAN


BETWEEN() SeeAlso
See Also

MAX( ) Function

MIN( ) Function


BLANK Command

See Also

Clears a record.

Syntax

BLANK
[FIELDS <field list> | FIELDS LIKE <skel> | FIELDS EXCEPT <skel>]
[<scope>]
[FOR <expL1>]
[WHILE <expL2>]
[NOOPTIMIZE]

Remarks

BLANK, when issued without any additional arguments, clears data from all fields in the current record. Issue APPEND BLANK to add a new blank record to the end of a table. Use ISBLANK( ) to determine if a field in a record is blank.

Clauses

[FIELDS <field list>]

By default, all fields in a record are cleared.  Include the FIELD clause to clear specific fields.  Data is cleared only in the fields you specify in <field list>. Any fields you specify in unselected work areas must be prefaced with their alias.

Important   No clearing occurs if the record pointer is at the end of the file in the current work area and you specify a field in another work area.

FIELDS LIKE <skel> | FIELDS EXCEPT <skel>

You can selectively clear fields by including the LIKE or EXCEPT clause or both. If you include LIKE <skel>, FoxPro clears data in the fields that match <skel>. If you include EXCEPT <skel>, FoxPro clears all fields except those that match <skel>.

The skeleton <skel> supports wildcard characters.  For example, to clear fields that begin with the letters A and P, use:

BLANK FIELDS LIKE A*,P*

The LIKE clause can be combined with the EXCEPT clause:

BLANK FIELDS LIKE A*,P* EXCEPT PARTNO*

<scope>

The scope clauses are:  ALL, NEXT <expN>, RECORD <expN>, and REST.  These are explained in Chapter 1, "Overview of the FoxPro Language" in the FoxPro Language Reference.  Commands which include <scope> operate only on the table in the active work area.

You can specify a scope of records to clear.  Only the records that fall within the range of records specified by the scope are cleared.

The default scope for BLANK is the current record (NEXT 1).

FOR <expL1>

If the FOR clause is included, specified fields are cleared only in records for which <expL1> evaluates to true.  Including FOR lets you conditionally clear records.

Rushmore optimizes BLANK FOR if <expL1> is an optimizable expression.  For best performance, use an optimizable expression in the FOR clause.  A discussion of Rushmore optimization appears in the Optimizing Your Application chapter in the FoxPro Developer's Guide.

WHILE <expL2>

If the WHILE clause is included, records are cleared as long as the logical expression <expL2> evaluates to true (.T.).

NOOPTIMIZE

To prevent Rushmore optimization of BLANK, include NOOPTIMIZE.  For more information, see SET OPTIMIZE or the discussion of Rushmore optimization in the Optimizing Your Application chapter in the FoxPro Developer's Guide.


BLANK SeeAlso
See Also

EMPTY( ) Function

ISBLANK( ) Function

REPLACE Command

SET OPTIMIZE Command


BOF( ) Function

See Also	Example

Determines if the record pointer is positioned at the beginning of a table.

Syntax

BOF([<expN> | <expC>])

Returns

Logical

Remarks

Use BOF( ) to test for a beginning-of-file condition for a table.  BOF( ) returns true (.T.) if you have tried to move the record pointer to a position before the first logical record in the table.

Parameters

<expN> | <expC>

BOF( ) supports optional parameters that specify the work area in which BOF( ) is tested.  If you omit <expN> and <expC>, the record pointer position for the selected work area is returned.

You can test the beginning-of-file condition in a table open in another work area by specifying the work area number <expN> or the table alias <expC>.

If a table isn't open in the indicated work area, BOF( ) returns false (.F.).


BOF( ) Example

This example opens CUSTOMER.DBF and displays a small window with push buttons you can use to move the record pointer forward or backward through the table.  As you move the cursor forward or backward, FoxPro moves the record pointer.  Depending on the direction the pointer moves, FoxPro checks to see if the record pointer is at the end of the file (EOF) or at the beginning of the file (BOF).  If either condition is true, FoxPro displays the appropriate message and repositions the record pointer.

CLOSE DATABASES
SET TALK OFF
CLEAR
USE customer
ACTIVATE SCREEN

@ 2,1 SAY 'Company: '+ company
DEFINE WINDOW mskip FROM 9,10 TO 13,65 DOUBLE COLOR SCHEME 5
ACTIVATE WINDOW mskip

@ 1,5 GET mchoice FUNCTION '*HN \<Forward;\<Backward;\<Quit' ;
DEFAULT 0 SIZE 1,14 VALID CHOICE( )

READ CYCLE
RELEASE WINDOW mskip

PROCEDURE choice
DO CASE
CASE mchoice = 1
SKIP
IF EOF('CUSTOMER')
WAIT WINDOW 'End of file encountered' NOWAIT
SKIP -1
ENDIF
CASE mchoice = 2
SKIP -1
IF BOF('CUSTOMER')
WAIT WINDOW 'Beginning of file encountered' NOWAIT
GO TOP
ENDIF
CASE mchoice = 3
CLEAR READ
ENDCASE
ACTIVATE SCREEN
@ 2,1 SAY 'Company: '+ company
RETURN .T.


BOF() SeeAlso
See Also

EOF( ) Function


BROWSE Command

See Also

Opens the Browse window.

Syntax

BROWSE
[FIELDS <field list>]
[FONT <expC1>[, <expN1>]]
[STYLE <expC2>]
[FOR <expL1>]
[FORMAT]
[FREEZE <field>]
[KEY <expr1>[, <expr2>]]
[LAST | NOINIT]
[LEDIT]
[REDIT]
[LOCK <expN2>]
[LPARTITION]
[NOAPPEND]
[NOCLEAR]
[NODELETE]
[NOEDIT | NOMODIFY]
[NOLGRID]
[NORGRID]
[NOLINK]
[NOMENU]
[NOOPTIMIZE]
[NOREFRESH]
[NORMAL]
[NOWAIT]
[PARTITION <expN3>]
[PREFERENCE <preference name>]
[REST]
[SAVE]
[TIMEOUT <expN4>]
[TITLE <expC3>]
[VALID [:F] <expL2> [ERROR <expC4>]]
[WHEN <expL3>]
[WIDTH <expN5>]
[[WINDOW <window name1>]
[IN [WINDOW] <window name2> | IN SCREEN | IN MACDESKTOP]]
[COLOR SCHEME <expN6> | COLOR <color pair list>]

Remarks

BROWSE is one of the most useful commands available in FoxPro.  Use BROWSE to open a Browse window and display records from a table.  You can then easily edit and append records.  You can have a Browse window open for each work area if you have sufficient memory.  For more information on the use of the Browse window, see the FoxPro User's Guide.

Navigating in a Browse Window

You can move from record to record with the Up and Down Arrow keys or the vertical scroll bar.  You can move forward or backward through a group of records with Page Up or Page Down. You can move to the next or previous field by pressing Tab or Shift+Tab or by using the horizontal thumb.

For more information on navigating in a Browse window, see the Database Menu chapter in the FoxPro User's Guide.

Saving Your Changes

In FoxPro for MS-DOS, you can save any changes you make to your data and exit the Browse window by pressing Ctrl+W or Ctrl+End, or by clicking on the close box.  If you press Ctrl+Q or Escape, you can exit the Browse window without saving changes you make to the current field.

In FoxPro for Windows, you can save any changes you make to your data and exit BROWSE by pressing Ctrl+W or Ctrl+End, or by choosing Close from the Browse window Control

In FoxPro for Macintosh, you can save any changes you make to your data and exit the Browse window by pressing Ctrl+W or Ctrl+End, by choosing Close from the File menu or by clicking the close box. Press Esc to exit the Browse window without saving changes you make to the current field.

In a program, use DEACTIVATE WINDOW to save your changes and close a Browse window.  Include the name of the Browse window in DEACTIVATE WINDOW.  For more information on Browse window names, see WTITLE( ).

You can edit memo fields in the Browse window by placing the cursor in the memo field and pressing Ctrl+Page Down or double-clicking on the memo field.  To exit the memo field and save your changes, press Ctrl+W or click on the close box.  To exit the memo field without saving your changes, press Esc.

BROWSE and Related Files

With FoxPro you can establish relationships between tables.  If a relationship is established, when the record pointer is moved in the parent table, the record pointer is automatically positioned on the corresponding record in the child table.  You can open a Browse window for the parent window and each of the child tables.  When you move to a record in the parent Browse window, the corresponding record or records are displayed in the child Browse window.

In a single Browse window you can include fields from both the parent table and any child tables.  The FIELDS clause described in further detail below enables you to include a list of fields from the parent and child tables.

Select the work area of the parent table.  Then issue BROWSE with the FIELDS clause.  When you include fields from child tables in the field list, preface the child field names with their table alias and a period.

For additional information on creating relationships between tables, see SET RELATION.

SET SKIP Support

SET SKIP lets you establish a one-to-many relationship between two tables.  For each record in the parent table, there can be multiple related records in the child table.  If you create a one-to-many relationship, you may use BROWSE to view records from both the parent and child tables.

For each record from the parent table that FoxPro displays in the Browse window, all related records (if any) from the child table are displayed.  The parent record is displayed once along with the first matching record from the child table.  Any subsequent matching records are displayed in the rows following the parent record and first matching child record.  In FoxPro for MS-DOS, shaded blocks are displayed in any column containing information from the parent table beyond the first matching record.  In FoxPro for Windows and FoxPro for Macintosh, the fill character for repeated parent information depends on the current Browse window font.

If the record pointer is positioned on a parent record, you can move the pointer between each of the parent records in the Browse window by pressing Ctrl+down arrow to move to the next parent record or Ctrl+Up Arrow to move to the previous parent record.  For more information on creating one-to-many relationships, see SET SKIP.

This example uses SET SKIP to create a one-to-many relationship between two tables.  There is a single record in the parent table (OFFICES) for each invoice created.  The child table (CUSTOMER) contains multiple records for each record in the parent table.  After the relationship is created, a Browse window displaying records from both the parent and child tables is opened.

The FIELDS clause fields list contains records from both the parent and child tables.  The names of fields are prefaced with their table alias (CUSTOMER or OFFICES) and a period.

CLEAR
CLOSE DATABASES
USE offices INDEX offices ORDER ono IN 0	&& Parent table
USE customer INDEX customer ORDER ono IN 0	&& Child table
SELECT offices	&& Back to parent work area
SET RELATION TO ono INTO customer	&& Establish relationship
SET SKIP TO customer	&& One-to-many relationship
WAIT WINDOW 'Scroll to see companies for each office' NOWAIT

BROWSE FIELDS offices.ono :H='Office Number', ;
offices.city :H='Office City', customer.company

Useful Functions

Several FoxPro functions return useful information about a Browse window.  VARREAD( ) can be used to determine the current field in a Browse window.  When a Browse window is active, VARREAD( ) returns the name of the field the cursor is positioned in.

RECNO( ) returns the record number of the selected record.  ROW( ) and COL( ) return the row and column position of the cursor in the Browse window.

BROWSE supports numerous options.  A list of the available options and a brief description of each follow.

Clauses

FIELDS <field list>

If FIELDS is included, the listed fields are displayed in the order specified in <field list>.  If FIELDS isn't included, all fields in the table are displayed in the order they appear in the table structure.

You can include fields from other related tables in the field list.  When you include a field from a related table, preface the field name with its table alias and a period.

The field list can specify any combination of fields or calculated fields.

The syntax of the field list is:

<field1>
[:R]
[:column width]
[:V = <expr1> [:F] [:E = <expC1>]]
[:P = <expC2>]
[:B = <expr2>, <expr3> [:F]]
[:H = <expC3>]
[:W = <expL1>]

[, <field2> [:R]...]

Calculated Fields

The field list can contain statements for creating calculated fields.  A calculated field contains read-only data created with an expression.  This expression can take any form, but it must be a valid FoxPro expression.

The format of the statement you use to create a calculated field is:

<calculated field name> = <expr>

This example creates a calculated field called LOCATION:

CLOSE DATABASES
USE customer

BROWSE FIELD LOCATION = ALLTRIM(city) + ', ' + state

CITY and STATE are the names of fields from the selected table.

The FIELDS clause fields list includes eight options, which enable special handling of fields displayed in a Browse window:

:R

The read-only option (:R) specifies that the field is read-only.  The data it contains can be viewed but not edited.

In the following example, a Browse window is opened with the CNO and COMPANY fields.  The CNO (customer number) field is read-only and cannot be changed.

CLOSE DATABASES
USE customer
BROWSE FIELD cno:R, company

:<column width>

The width clause specifies the display size for a field in columns.  The value of this option doesn't affect the size of the field in the table; it alters only the way the field is displayed in the Browse window.

:V = <expr1> [:F] [:E = <expC1>]

The verify option (:V) lets you perform field-level data validation within the Browse window.  If <expr1> evaluates to true (.T.) when you move the cursor from a field, the data input into the field is considered correct and the cursor moves to the next field.

If <expr1> evaluates to false (.F.), the data input is considered incorrect, the cursor remains in the field and a message is displayed.  If <expr1> evaluates to 0, the data input is considered incorrect and the cursor remains in the field but no error message is displayed.

By default, <expr1> is evaluated only when the field is modified.  To force verification, include the :F option.

You can display your own error message by including the :E option described below.  The verify option isn't executed for memo fields.

:F

The forced validation option (:F) determines if the expression in the verify option is evaluated when you move the cursor out of a field.  If :F is not included, <expr1> is evaluated only if changes are made to the field.  If :F is included, <expr1> is evaluated even if the field isn't modified.

:E = <expC1>

If the validation expression :V = <expr1> evaluates to true, the cursor leaves the field normally.  If the expression evaluates to false, the cursor remains in the field, and the system error message "Invalid input" is displayed.

If the error option (:E) is included, <expC1> is displayed instead of the system error message.  <expC1> is displayed only if SET NOTIFY is ON.  The bell is sounded if BELL is SET ON.

If :V = <expr1> evaluates to 0, no message is displayed and the cursor remains in the field being validated.  This lets you display your own error messages in validation routines.

The following example opens the CUSTOMER table and displays the CNO and COMPANY fields.  The CNO (customer number) field is a character field which will accept up to 5 characters.  For purposes of this example, we consider a customer number less than 14000 to be invalid.

:V specifies the validation criteria.  :F forces the validation check be performed whether the data is changed or not.  :E replaces the FoxPro system error message with a user-defined error message.  In FoxPro for Windows and FoxPro for Macintosh, the error message is displayed in the status bar at the bottom of the main FoxPro window.

Press Esc to close the Browse window.

CLOSE DATABASES
IF _WINDOWS
SET STATUS BAR ON
ENDIF
USE customer
BROWSE FIELDS cno :V = cno > '14000' ;
:F ;
:E = 'The customer number must be greater than 14000', ;
company

:P = <expC2>

If you include a FIELDS clause, you can also specify a picture option (:P) for each field in the list.  The picture option lets you create a list of codes that controls the display and input of data for each field in a Browse window.  <expC2> is the list of codes.

For more information on the use of picture editing codes, see @ ... GET and @ ... SAY.  With the exception of the M code, all of the function and picture codes available in @ ... GET and @ ... SAY can be used in PICTURE and FUNCTION clauses.

The following example uses the picture option to allow only numeric data in a specific format to be entered in the YTDPURCH field:

CLOSE DATABASES
USE customer

BROWSE FIELDS ytdpurch :P = '999999.99'

:B = <expr2>, <expr3> [:F]

With this option, you can specify a set of boundaries between which data in a field must fall.  The boundary expressions <expr2> and <expr3> must match the data type of the field and cannot be the names of user-defined functions.  If the data entered doesn't fall between <expr2> and <expr3>, a system error message is displayed indicating the range between which the data must fall.

By default, the data you enter is checked against the boundary values only if you make a change to the contents of the field.  To force checking against the boundary values, include the forced validation option (:F).

The following example ensures that the YTDSALES data is between 100 and 99,999.  Press Esc to close the Change window.

CLOSE DATABASES
USE salesman
BROWSE FIELDS ytdsales :B = 100, 99999 ;
:F, name

:H = <expC3>

By default, field names are used as the column headings in the Browse window.  Including the heading option (:H) replaces the default field names with your own headings,  which you specify with <expC3>.

The following example provides user-defined headings for the displayed fields.

CLOSE DATABASES
USE customer
BROWSE FIELDS ytdpurch :H = 'Purchases:', ;
company :H = 'Company:'

:W = <expL1>

You can conditionally prohibit moving the cursor to a field based on the value of the logical expression <expL1>.  If <expL1> evaluates to false (.F.), moving the cursor to the field is prohibited.  If <expL1> evaluates to true (.T.), the cursor can be moved to the field.  User-defined functions are supported in <expL1>.

If moving the cursor to all fields is prohibited, the current field is marked read-only.  This occurs only when every field contains a WHEN clause that evaluates to false.

FONT <expC1>[, <expN1>]

The character expression <expC1> is the name of the font, and the numeric expression <expN1> is the font size.  For example, the following clause specifies 16-point Courier font for the fields displayed in a Browse window:

FONT 'Courier',16

If you include the FONT clause but omit the font size <expN1>, a 10 point font is used in the Browse window.  In FoxPro for Windows, if you omit the FONT clause, 8-point MS Sans Serif is used. In FoxPro for Macintosh, 10-point Geneva is used.

In FoxPro for Windows, if the font you specify is not available, a font with similar font characteristics is substituted.

In FoxPro for Macintosh, if the font you specify is not available, the Chicago font is used.

In FoxPro for MS-DOS, the FONT clause is ignored.

STYLE <expC2>

In FoxPro for Windows and FoxPro for Macintosh, include the STYLE clause to specify a font style for fields displayed in the Browse window.

The font style is specified with <expC2>.  If the STYLE clause is omitted, the standard font style is used.

In FoxPro for Windows, if the font style you specify is not available, a font style with similar characteristics is substituted.

In FoxPro for Macintosh, if the font you specify is not available, the normal font style is used.The STYLE clause is ignored in FoxPro for MS-DOS.

Character	Font Style

B	Bold

I	Italic

N	Normal

O	Outline

S	Shadow

-	Strikeout*

U	Underline

C	Condense*

E	Extend*

*The Condense and Extend styles are available only in FoxPro for Macintosh. The Strikeout style is available only in FoxPro for Windows.

You can include more than one character to specify a combination of font styles. The following example open a Browse window and uses an underline font:

CLOSE DATABASES
USE customer
IF _WINDOWS
BROWSE FIELDS contact FONT 'System', 15  STYLE 'NU'
ENDIF
IF _MAC
BROWSE FIELDS contact FONT 'Geneva', 14  STYLE 'NU'
ENDIF

FOR <expL1>

Including the FOR clause lets you conditionally display records in a Browse window, filtering out undesired records.  If you include the FOR clause, only records for which the logical expression <expL1> is true are displayed in the Browse window.

Rushmore optimizes a query specified with a BROWSE FOR if <expL1> is an optimizable expression.  For best performance, use an optimizable expression in the FOR clause.  A discussion of Rushmore optimizable expressions appears in the Optimizing Your Application chapter in the FoxPro Developer's Guide.

FORMAT

Include the FORMAT clause to use a format file to control the display and data entry format in a Browse window.  A format file must first be opened with SET FORMAT.  The following information is extracted from the format file and applied to the Browse window:

The list of fields to browse

All VALID clauses

All WHEN clauses

All RANGE clauses

Field sizes (as specified in PICTURE clauses)

All SAY expressions (included as calculated BROWSE fields)

The following example uses a format file to validate data entered into a Browse window.  Locations specified with @ ... GET can be the same and, in the format file, are ignored.

The first line creates a BROWSE field (CNO) that is 5 characters wide and allows the entry of letters and digits only.  The second line creates a BROWSE field (COMPANY) that cannot contain a blank value and can contain a maximum of 20 alphabetic characters.

The third line creates a BROWSE field (CONTACT) into which you enter data only when the field is blank.  The fourth line creates a BROWSE field (YTDPURCH) that displays the year-to-date purchases.  The last line creates a calculated field (indicated by @ ... SAY) that displays the contents of the CITY and STATE fields with all blanks removed in a field 20 characters wide.

USE customer
SET FORMAT TO custentr.fmt
BROWSE FORMAT

Here are the contents of the CUSTENTR.FMT format file, which is used to validate data entered into CUSTOMER table:

@ 3,0 GET cno PICTURE 'NNNNN'
@ 3,0 GET company VALID company != SPACE(40) ;
PICTURE 'AAAAAAAAAAAAAAAAAAAA'
@ 3,0 GET contact WHEN contact = SPACE(40)
@ 3,0 SAY ytdpurch
@ 3,0 SAY ALLTRIM(city) + ', ' + ALLTRIM(state) ;
PICTURE 'XXXXXXXXXXXXXXXXXXXX'

FREEZE <field>

Include the FREEZE clause to permit changes to be made to only one field in the Browse window.  You specify this field with <field name>.  The remaining fields are displayed and cannot be edited.

CLOSE DATABASES
USE customer
BROWSE FIELDS ytdpurch :H = 'Purchases:' , ;
company :H = 'Company:' ;
FREEZE ytdpurch

KEY <expr1>[, <expr2>]

Use the KEY clause to limit the scope of records that are displayed in the Browse window.  With KEY you can specify an index key value (<expr1>) or a range of key values (<expr1>, <expr2>) for the records that are displayed in the Browse window.  The table you browse must be indexed, and the index key value or values included in the KEY clause must be the same data type as the index expression of the master index file or master tag.

For example, the CUSTOMER table includes a character field containing zip codes.  If the table is indexed on the zip code field, you can specify a range of zip codes in the KEY clause.

In this example, only records with zip codes falling within the range of 43000 to 43999 are displayed in the Browse window:

CLOSE DATABASES
USE customer
SET ORDER TO zip
BROWSE KEY '43000', '43999'

LAST | NOINIT

Any configuration changes made to the appearance of a Browse window are saved in the FOXUSER resource file when the Browse window is closed.  The field list, the size of each field, and the location and size of the Browse window are stored in the FOXUSER file.  For more information on this file, see SET RESOURCE.

If you issue BROWSE with the LAST or NOINIT clauses, the Browse window opens in the same configuration that was last saved in the FOXUSER file if RESOURCE is SET ON.  This restores the previous Browse window configuration created with the last BROWSE command.  If the last BROWSE issued in the Command window included a long list of clauses, issue BROWSE with the LAST or NOINIT option to avoid having to retype the command.

If the last Browse window was opened with a BROWSE that included a PREFERENCE clause, BROWSE LAST or NOINIT won't restore the preference.

Any Browse window configuration changes you make in the current session aren't saved if you exit BROWSE by pressing Ctrl+Q.

The LAST and NOINIT clauses are identical; NOINIT provides dBASE compatibility.

LEDIT
REDIT

Information in a Browse window can be viewed in two modes:  Change or Browse.  In the default Browse mode, fields are displayed horizontally.  In Change mode, fields are displayed vertically.

You can split a Browse window into left and right partitions by moving the window splitter with the mouse, by choosing Resize Partitions from the Browse menu or by including PARTITION in the BROWSE.  Each partition can be viewed in Change or Browse mode independently of the other partition.

If LEDIT or REDIT is included in BROWSE, the left or right partition is in Change mode when the Browse window is displayed.  Include both key words to open both partitions in Change mode.  Each partition can be toggled between Change and Browse modes by choosing Browse and Change from the Browse menu popup.

CLOSE DATABASE
USE customer
BROWSE PARTITION 30 LEDIT

LOCK <expN2>

Include LOCK to specify the number of fields displayed in the left partition of the Browse window.  The number of fields displayed is specified with <expN2>.  The first <expN2> fields (form left to right) in the Browse window are placed in their own partition.

For more information about Browse window partitions and the features that are available for a split Browse window, see the FoxPro User's Guide.

LPARTITION

A Browse window can be split into left and right partitions by including the PARTITION clause described later.  By default, the cursor is placed in the first field in the right partition when the Browse window is opened.  If you include LPARTITION, the cursor is placed in the first field in the left Browse window partition.

The cursor is placed in the right Browse window partition if you include LPARTITION without the PARTITION clause.

NOAPPEND

If you include NOAPPEND in BROWSE, you can't add records to the table by pressing Ctrl+N or choosing Append Record from the Browse menu.

Caution   Including NOAPPEND doesn't prevent you from appending a record from within a routine (created with VALID, WHEN or ON KEY LABEL) while in the Browse window.

NOCLEAR

If NOCLEAR is included in BROWSE and you close the Browse window, an image of the Browse window remains displayed.  This image isn't an active Browse window.  Use CLEAR to remove the Browse window image.

NOCLEAR is ignored in FoxPro for Windows and FoxPro for Macintosh.

NODELETE

Including NODELETE prevents records from being marked for deletion from within a Browse window.  By default, a record can be marked for deletion by pressing Ctrl+T, choosing Toggle Delete from the Browse menu, or clicking in the leftmost column of the record.

Caution   Including NODELETE doesn't prevent you from marking a record for deletion from within a routine (created with VALID, WHEN or ON KEY LABEL) while in the Browse window.

NOEDIT | NOMODIFY

Including NOEDIT or NOMODIFY prevents you from modifying the table.  NOEDIT and NOMODIFY are identical.  If you include either clause, you can browse or search the table, but you cannot edit it.  However, you can append and delete records.  Include NOAPPEND and NODELETE to prohibit the addition and deletion of records.

NOLGRID
NORGRID

The fields in a Browse window are separated by vertical lines.  You can remove the vertical field grid lines from the left or right partitions of the Browse window by including NOLGRID or NORGRID in BROWSE.  To remove the field grid lines in the left partition of the Browse window, include NOLGRID.  To remove the grid lines in the right partition, include NORGRID.

You can also toggle grid lines on or off by choosing Grid from the Browse menu.

NOLINK

By default, the left and right partitions of the Browse window are linked together:  when you scroll through one partition, the other partition scrolls.  You can unlink the partitions by including NOLINK.  You can also unlink partitions by choosing Unlink Partitions from the Browse menu.

NOMENU

Including NOMENU in BROWSE prevents access to the Browse menu and its options by removing the Browse menu pad from the system menu bar.

NOOPTIMIZE

To disable Rushmore optimization of BROWSE, include NOOPTIMIZE.  For more information, see SET OPTIMIZE or consult the discussion of Rushmore optimization in the Optimizing Your Application chapter in the FoxPro Developer's Guide.

NOREFRESH

Including NOREFRESH prevents the Browse window from being refreshed.  Browse windows are refreshed at the rate determined by SET REFRESH.  NOREFRESH is useful with read-only files and improves performance.

NORMAL

When the current output window is a user-defined window, the Browse window derives its colors, size, position, title and control options (GROW, FLOAT, ZOOM, and so on) from the user-defined window.  If  NORMAL is specified, the Browse window is opened normally with its default settings as if there were no active user-defined window.

NOWAIT

When BROWSE is issued from within a program, a Browse window is opened and program execution pauses until the Browse window is closed.  Including NOWAIT continues program execution immediately after the Browse window is opened.  The program doesn't wait for the Browse window to be closed but continues executing on the program line immediately following the program line containing BROWSE NOWAIT.

This option is available only from within a program.  Including NOWAIT in BROWSE has no effect when the command is issued in the Command window.

PARTITION <expN3>

A Browse window can be split into left and right partitions by including PARTITION in BROWSE.  The numeric expression <expN3> specifies the column in which the window splitter is located.  For example, if <expN3> is 20, the window splitter is placed in column 20 of the Browse window.

A Browse window can also be split into left and right partitions by moving the window splitter with the mouse or by choosing Resize Partitions from the Browse menu.

PREFERENCE <preference name>

Include PREFERENCE in BROWSE to save a Browse window's attributes and options for later use.  Unlike LAST, which restores the Browse window as it appeared in the previous session, PREFERENCE saves a Browse window's attributes indefinitely in the FOXUSER resource file.  Preferences can be retrieved at any time.  For more information about the FOXUSER resource file, see SET RESOURCE.

Issuing BROWSE with the specified preference name for the first time creates an entry in the FOXUSER file that saves the Browse window configuration.  Issuing BROWSE later with the same preference name restores the Browse window to that preference state.  When the Browse window is closed, the preference is updated.

Preference names can be up to 10 characters long, must begin with a letter or an underscore, and can contain any combination of letters, numbers and underscores.

Once you have a preference the way you like it, you can prevent it from being changed.  Close the Browse window, issue SET RESOURCE OFF, open the FOXUSER file as a table, and change the field containing the preference to read-only by changing the value of the logical field READONLY to true (.T.).

If you exit a Browse window by pressing Ctrl+Q, any Browse window changes aren't saved to the resource file.

REST

By default, BROWSE positions the record pointer at the top of the table.  Include REST to prevent the record pointer from being moved from its current position to the top of the table.

SAVE

Include SAVE with BROWSE to keep the Browse window and any of its memo field text editing windows active and visible (open).  You can then return to the Browse window after cycling through other open windows with the keyboard or the mouse.

This option is available only from within a program.  SAVE has no effect when included with BROWSE in the Command window because BROWSE SAVE is always the default in the interactive mode.

TIMEOUT <expN4>

Include TIMEOUT to specify how long a Browse window waits for input.  The numeric expression <expN4> specifies how many seconds can elapse without any input before the Browse window automatically closes.

TIMEOUT is available only from within a program; it has no effect when issued in the Command window.

TITLE <expC3>

By default, the name of the table being browsed appears in the top border of the Browse window.  If you issue BROWSE WINDOW <window name1> and the window has a title, the Browse window assumes <window name1> as its title.

You can overwrite the table name or window title with your own title by including a TITLE clause.  The character expression <expC3> is the new title you want to display in the top border of your Browse window.

DEFINE WINDOW mybrowse FROM 1,1 TO 24,40 ;
CLOSE ;
GROW ;
COLOR SCHEME 10

CLOSE DATABASES
USE customer
BROWSE WINDOW mybrowse ;
FIELDS ytdpurch :H = 'Purchases' , ;
company :H = 'Company:' ;
TIMEOUT 3

BROWSE WINDOW mybrowse ;
TITLE 'Mybrowse Window' ;
FIELDS ytdpurch :H = 'Purchases' , ;
company :H = 'Company:' ;
TIMEOUT 3

RELEASE WINDOW mybrowse

VALID [:F] <expL2> [ERROR <expC4>]

Including VALID lets you perform record-level validation in a Browse window.  VALID is executed only if a change is made to the record and you move the cursor to another record.  The VALID clause is not executed if the only change is to a memo field.

If VALID returns a true value (.T.), you can move the cursor to another record.

If VALID returns a false value (.F.), the cursor remains in the current field, and the system message "Invalid input" is displayed.  You can display your own error message when VALID returns false by including the ERROR clause.  The character expression <expC4> is displayed as the error message.

If VALID returns 0, the cursor remains in the current field, and an error message isn't displayed.

You can force the VALID clause to execute before you move the cursor to the next record by including :F after the VALID key word.  In this case, VALID is executed even if the record isn't changed.

The VALID clause shouldn't be confused with the verify option (:V), which enables field-level validation.

WHEN <expL3>

The WHEN clause is executed when you move the cursor to another record.  If <expL3> evaluates to a true value (.T.), you can make changes to the record you move the cursor to.  If <expL3> evaluates to false or 0, the record you move the cursor to becomes read-only and cannot be modified.

WIDTH <expN5>

The WIDTH clause limits the number of characters displayed for all fields in a Browse window to <expN5>.  The contents of a field can be scrolled horizontally using the Left and Right Arrow keys or the horizontal scroll bar.  Including the WIDTH clause doesn't change the size of fields in the table; it alters only the way the fields are displayed in the Browse window.  If a width has been specified for an individual field with the FIELDS clause, it overrides the width specified with the WIDTH clause for that field.

WINDOW <window name1>

If you include the WINDOW clause in BROWSE, the Browse window takes on the characteristics of the window specified with <window name1>.  For example, if the window is defined with the FLOAT clause, the Browse window can be moved.  The specified window doesn't have to be active or visible, but it must be defined.  In FoxPro for MS-DOS, if the window is defined with a footer, the footer doesn't appear; the Browse window scroll bar takes its place.

IN [WINDOW] <window name2>

If the IN WINDOW clause is included, the Browse window is opened within the parent window specified with <window name2>.  The Browse window doesn't assume the characteristics of the parent window.  A Browse window activated inside a parent window cannot be moved outside the parent window.  If the parent window is moved, the Browse window moves with it.

To access the Browse window, the parent window must first be defined with DEFINE WINDOW and must be active and visible.

IN SCREEN

By including IN SCREEN, you can explicitly place a Browse window on the desktop in FoxPro for MS-DOS or in the main window in FoxPro for Windows when a user-defined window is active.

IN MACDESKTOP

MACDESKTOP is available in FoxPro for Macintosh only.

Include the MACDESKTOP clause to place a Browse window on the Macintosh desktop. The Browse window resides at the same level as the main FoxPro window. The Browse window can be moved outside of the main FoxPro window and the main FoxPro window can be brought forward over the top of it. When you include the MACDESKTOP clause, the Browse window behaves in the same manner as Browse windows in FoxBASE+ for Macintosh.

Including the MACDESKTOP clause overrides the current SET MACDESKTOP setting. SET MACDESKTOP determines if Browse windows are placed on the main FoxPro window or the Macintosh desktop when the SCREEN or MACDESKTOP clause is not included. For more information about placing Browse windows on the main FoxPro window or the Macintosh desktop, see SET MACDESKTOP.

COLOR SCHEME <expN6> | COLOR <color pair list>

The color of a Browse window can be specified by including the number of an existing color scheme in the COLOR SCHEME clause or a set of color pairs in the COLOR clause.

A color scheme is a set of 10 predefined color pairs.  The color pairs in a color scheme can be changed with SET COLOR OF SCHEME.  In FoxPro for MS-DOS the color pairs in a color scheme can also be changed in the Color Picker.

A color pair is a set of two letters separated by a forward slash.  The first color letter specifies the foreground color and the second letter specifies the background color.

For example, this color pair specifies a red foreground on a white background:

R/W

For a list of colors and their corresponding color letters, see the SET COLOR commands section or the Color Table by Color Pair topic.

A color pair can also be specified with a set of 6 RGB (Red Green Blue) color values separated by commas.  The first 3 color values specify the foreground color and the second 3 color values specify the background color.  The color values can range from 0 through 255.

The R/W color pair in the example above can also be specified with this RGB color pair:

RGB(255,0,0,255,255,255)

In FoxPro for MS-DOS, the Browse window assumes the colors specified with COLOR SCHEME 10 (Browse) by default.

In FoxPro for Windows, the Browse window assumes the color scheme established using the Color option in the Microsoft Windows Control Panel.

In FoxPro for Macintosh, the Browse window assumes the color scheme established using the Color option in the Control Panels (Apple menu).

The following table shows what element each color pair controls in FoxPro for MS-DOS.

Color Pair Number	Browse Window Element
1	Other records (In FoxPro for Windows, color pair 1 controls the color of the current record and field.)
2	Current field
3	Border
4	Title color when Browse window is active
5	Title color when another window is active
6	Selected text
7	Current record
8	Shadow
In FoxPro for MS-DOS, the second color specified in color pair number 1 designates the color of the grid background.  The second color specified in color pair number 3 is used for the grid foreground.


BROWSE SeeAlso
See Also

CHANGE Command

EDIT Command

SET SKIP Command

WTITLE( ) Function


BUILD APP Command

See Also

Creates an application file with an .APP file name extension using information from a project file.

Syntax

BUILD APP <app file> FROM <project file>

Remarks

You create a project file with CREATE PROJECT or MODIFY PROJECT.  A project file is a table which uses the file extensions .PJX (table file) and .PJT (memo file).

Before using BUILD APP, be sure that the project file contains all of the files needed in the application.  Unresolved references or other compile-time errors encountered during the build process are reported and/or stored in an error file.  The first 8 characters of the error file name are the same as your project name and it has the file extension .ERR.

Clauses

<app file>

Specify the application file name with <app file>.  The default file name extension is .APP.

FROM <project>

FROM <project> specifies the name of the project from which the custom application is built.

For more information on building applications, refer to the FoxPro User's Guide.


BUILD APP SeeAlso
See Also

BUILD EXE Command

BUILD PROJECT Command

CREATE PROJECT Command

MODIFY PROJECT Command


BUILD EXE Command

See Also

Creates a compact or stand-alone executable .EXE file from a project.

Syntax

BUILD EXE <exe file> FROM <project>
[STANDALONE]
[EXTENDED]

Remarks

BUILD EXE is available only to owners of the FoxPro Distribution Kit.  The Distribution Kit must be installed in the same directory as FoxPro.

For additional information about creating executable files and BUILD EXE, see the FoxPro Distribution Kit manual.

Clauses

<exe file>

<exe file> specifies the name of the .EXE file to create.  If an APP application file with the same root name as the stand-alone .EXE file exists, it's deleted.  Note that if an .EXE file exists and you create an APP file with the same name, the .EXE file is deleted.

FROM <project>

FROM <project> specifies the name of the project from which the executable file is built.

STANDALONE

STANDALONE creates a Standard version .EXE file that is completely self-contained and has the same requirements as the Standard version of FoxPro.

EXTENDED

EXTENDED creates an 32-bit Extended version .EXE file that's completely self-contained and has the same system requirements as the 32-bit Extended version of FoxPro.  Creating an Extended version .EXE file requires considerably more time than does creating a Standard version .EXE file.

If you don't include either STANDALONE or EXTENDED, a compact .EXE file is created.  To execute a compact .EXE file, the FoxPro .EXE Support Library must be located on the MS-DOS path.


BUILD EXE SeeAlso
See Also

BUILD APP Command

BUILD PROJECT Command


BUILD PROJECT Command

See Also

Creates and builds a project file.

Syntax

BUILD PROJECT <project file> FROM
<program> | <menu> | <report> | <label> | <screen> | <library>
[, <program> | <menu> | <report> | <label> | <screen>| <library>...]

Remarks

BUILD PROJECT automatically creates a project table with a .PJX file name extension by opening and processing one or more program, menu, report, label, screen and library files that you specify.  You can use the project file to create one of two program types: an application .APP file or an executable .EXE file.  The project table keeps track of all the files required to create an application, as well as the dependencies, references and connections among the files.  Once you specify the pieces in the project, FoxPro makes sure that the application is based on the latest source files.  For more information on building projects, refer to the Project Manager chapter in the FoxPro User's Guide.

When FoxPro encounters a program, menu or screen file while creating a project file from BUILD PROJECT, it finds its compiled file and compares the time and date stamp of the two files.  If the time and date stamp of the source file is later than that of the compiled file, FoxPro recompiles the source file.

Each project file contains a time and date stamp so you can refresh the project file when you make changes to files in the project or when dependencies change.  This helps to guarantee that any applications created from a project file will always use the most recent source files.  To refresh a project file, issue BUILD PROJECT without the optional FROM clause and FoxPro updates the specified project.

When you issue BUILD PROJECT, unresolved references and other errors are reported but do not prevent the project file from being created.  This enables you to build a project when all the necessary pieces aren't actually created or available at the time the project is built.  Unresolved references or other problems can then be corrected by refreshing the project file at a later date or by manually modifying the information stored in the project file with MODIFY PROJECT.

Clauses

<project file>

The name of the project table to be created is specified with <project file>.

FROM <program> | <menu> | <report> | <label> | <screen>| <library>

[, <program> | <menu> | <report> | <label> | <screen>| <library>]...

The FROM clause is optional and specifies the files to include in the project.  You can specify one or more program, menu, report, label, screen and library files and the project will keep track of these files, as well as the dependencies, references and connections among them.

The first executable program or menu file in the FROM clause is the master program file in the project by default.


BUILD PROJECT SeeAlso
See Also

BUILD APP Command

BUILD EXE Command

CREATE PROJECT Command

EXTERNAL Command

MODIFY PROJECT Command


CALCULATE Command

See Also	Example

Performs financial and statistical operations on fields in a table or on expressions involving fields.

Syntax

CALCULATE <expr list>
[<scope>]
[FOR <expL1>]
[WHILE <expL2>]
[TO <memvar list> | TO ARRAY <array>]
[NOOPTIMIZE]

Clauses

<expr list>

The expression list can contain any combination of the following functions:

AVG(<expN>)

CNT( )

MAX(<expr>)

MIN(<expr>)

NPV(<expN1>, <expN2>[, <expN3>])

STD(<expN>)

SUM(<expN>)

VAR(<expN>)

Functions in the expression list <expr list> are separated by commas.  These functions are specific to CALCULATE.  These functions are described in detail later in this section.  They should not be confused with similarly named independent functions.  For example, CALCULATE MIN( ) is not the same as MIN( ).

<scope>

The scope clauses are:  ALL, NEXT <expN>, RECORD <expN>, and REST.  These are explained in the Overview of the FoxPro Language chapter in the FoxPro Language Reference.  Commands which include <scope> operate only on the table in the active work area.

You can specify a scope of records used in the calculation.  Only the records that fall within the range of records specified by the scope are included in the calculation.

The default scope for CALCULATE is ALL records.

FOR <expL1>

If the FOR <expL1> clause is included, only the records that satisfy the logical condition <expL1> are included in the calculation.  Including a FOR clause conditionally includes records in the calculation, filtering out undesired records.

Rushmore optimizes a CALCULATE ... FOR query if <expL1> is an optimizable expression.  For best performance, use an optimizable expression in the FOR clause.  A discussion of Rushmore optimizable expressions appears in the Optimizing Your Application chapter in the FoxPro Developer's Guide.

WHILE <expL2>

If the WHILE clause is included, records are included in the calculation as long as the logical expression <expL2> evaluates to true (.T.).

TO <memvar list> | TO ARRAY <array>

Results of the calculation can be stored to one or more memory variables or to an array.  If you include the TO clause to store a result to a memory variable, a new memory variable is created if one of the specified memory variables doesn't exist.

If you include the TO clause to store a result to an array, FoxPro automatically creates it if an array with the specified name doesn't exist.  If the array exists and isn't large enough to contain all the results, the size of the array is automatically increased to accommodate the information.  If an existing array is larger than necessary, additional elements are left unchanged.  Results are stored to the array elements in the order they are specified in the CALCULATE command.

NOOPTIMIZE

To cause Rushmore not to optimize CALCULATE, include NOOPTIMIZE.  For more information, see SET OPTIMIZE or the discussion of Rushmore optimization in the Optimizing Your Application chapter in the FoxPro Developer's Guide.

AVG <expN>

AVG( ) computes the arithmetic mean of <expN>.

Only records meeting the <scope> and/or optional FOR or WHILE conditions are included in the result.

CNT( )

CNT( ) returns the number of records in the table.

Only records meeting the <scope> and/or optional FOR or WHILE conditions are included in the result.

MAX(<expr>)

MAX( ) returns the highest or latest value of <expr>.  Within the MAX( ) clause, you can specify any numeric, character or date field, or any expression using fields of these types.

Only records meeting the <scope> and/or optional FOR or WHILE conditions are included in the result.

MIN(<expr>)

MIN( ) returns the lowest or earliest value of <expr>.  Any numeric, character or date field, or any valid expression using fields of these types can be included in <expr>.

Only records meeting the <scope> and/or optional FOR or WHILE conditions are included in the result.

NPV(<expN1>, <expN2>[,<expN3>])

NPV( ) computes the net present value of a series of future cash flows discounted at a constant periodic interest rate.

<expN1> is the interest rate expressed as a decimal value.

<expN2> is a field, field expression or a numeric expression representing a series of cash flows.  Each cash flow can be either positive or negative.  In cases where <expN2> is a field, the value in that field for each record in the table is considered a cash flow.

<expN3> is an optional initial investment.  If the initial investment isn't included, then the initial investment is assumed to occur at the end of the first period.  This initial investment is the first record in the field and is negative to represent a cash outflow.

Only records meeting the <scope> and/or optional FOR or WHILE conditions are included in the result.

STD(<expN>)

STD( ) computes the standard deviation of <expN>.  The standard deviation measures the degree to which the values of fields or expressions involving fields differ from the average of all the values.  The smaller the standard deviation, the less the values vary from the average.

Only records meeting the <scope> and/or optional FOR or WHILE conditions are included in the result.

SUM(<expN>)

SUM( ) totals the values of <expN>.

Only records meeting the <scope> and/or optional FOR or WHILE conditions are included in the result.

VAR(<expN>)

VAR( ) computes the variance from the average of <expN>.  The variance is the standard deviation squared.  The smaller the variance, the less the values vary from the average.

Only records meeting the <scope> and/or optional FOR or WHILE conditions are included in the result.


CALCULATE Example

CLOSE DATABASES
SET TALK ON
USE invoices
CALCULATE AVG(itotal), MIN(itotal), MAX(itotal)

CALCULATE STD(itotal), VAR(itotal) TO mstd, mvar
? mstd, mvar


CALCULATE SeeAlso
See Also

AVERAGE Command

COUNT Command

DIMENSION Command

FV( ) Function

MAX( ) Function

MIN( ) Function

PAYMENT( ) Function

PV( ) Function

SUM Command


CALL Command

See Also

Executes a binary file that has been placed in memory with LOAD.

Syntax

CALL <file>
[WITH <expC> | WITH <memvar>]
[SAVE | NOSAVE]

Remarks

CALL works in conjunction with LOAD.  With CALL you can run customized binary routines directly from memory.  LOAD places the binary file into memory.  CALL executes the loaded binary file.

In FoxPro for Macintosh, CALL is used to execute an external command (XCMD) or external function (XFNC) that has been placed into memory with SET XCMDFILE and LOAD.

Clauses

<file>

In FoxPro for MS-DOS and FoxPro for Windows, the binary file to be called is specified with <file>.  It isn't necessary to specify an extension in the file name, since the extension is stripped from the file when it's loaded.

In FoxPro for Macintosh, use <file> to specify the memory resident external command or function to execute.

WITH <expC> | WITH <memvar>

WITH can be used to pass a character string or memory variable parameter to the binary subroutine.  The memory variable can be of any data type.

In FoxPro for MS-DOS and FoxPro for Windows, you can pass a single parameter to the binary routine.

In FoxPro for Macintosh, you can pass multiple parameters in a comma delimited character expression.

In FoxPro for MS-DOS and FoxPro for Windows, when the called binary file executes, the code segment initially points to the beginning of the module.  The DS and BX register pair points to the first byte of the parameter passed using WITH.  If no parameter is passed, BX contains 0.

TO <memvar2>

A binary routine, external command or external function can return a value to a memory variable by including the TO <memvar2> clause.

SAVE | NOSAVE

In FoxPro for MS-DOS and FoxPro for Windows,CALL and LOAD both support the SAVE key word for use with binary routines that write to the screen.

SAVE and NOSAVE are ignored in FoxPro for Macintosh.

NOSAVE is the default.  You may include SAVE when loading a binary routine with CALL, or SAVE and NOSAVE when loading a binary routine in memory with LOAD.  If specified with CALL, SAVE or NOSAVE overrides the SAVE or NOSAVE setting specified with LOAD.

If CALL ... SAVE is specified, FoxPro copies the current contents of video RAM into the FoxPro desktop upon return from the binary routine (assuming that the binary routine is writing directly into video RAM). This means that anything written by the binary routine is known to FoxPro and is treated as if FoxPro had written it.  In particular, if SAVE is in effect, such externally written data will not be erased the first time a FoxPro object is dragged over it.

Unless it is needed, the SAVE clause isn't desirable since it takes FoxPro some time to scan and save the screen contents upon each return from the binary routine.

Caution   Carefully read the following assembly language interface warnings:

When using string variables in the binary file, do not change the length of the string.  It is possible that the free memory list could be corrupted if the length of a string variable is changed by even one byte.

When saving a string address from one call to the next, you should also reset the string address you will be storing to just prior to using the string variable.


CALL SeeAlso
See Also

LOAD Command

RELEASE MODULE Command

SET LIBRARY Command


CANCEL Command

See Also	Example

Aborts execution of the current FoxPro program file.

Syntax

CANCEL

Remarks

FoxPro returns control to the Command window or to MS-DOS in FoxPro for MS-DOS, or to the Command window or to Windows in FoxPro for Windows. In FoxPro for Macintosh, you are returned to the Command window or the Finder.

If a program is executing in a runtime version of FoxPro for MS-DOS, the program terminates and control returns to MS-DOS.  If a program is executing in the development version of FoxPro for MS-DOS, control returns to the Command window.

If a program is executing in a runtime version of FoxPro for Windows, the program terminates and control returns to Windows.  If a program is executing in the development version of FoxPro for Windows, control returns to the Command window.

If a program is executing in a runtime version of FoxPro for Macintosh, the program terminates and returns control to the Finder. If a program is executing in the development version of FoxPro for Macintosh, control returns to the Command window.

Executing CANCEL releases all private memory variables.


CANCEL Example

In this example, the memory variable MPASS is tested to see if it contains the character string FOXPRO.  If an invalid password is entered, the program is terminated with CANCEL.

SET TALK OFF
DO WHILE .T.
CLEAR
STORE SPACE(6) TO mpass
@ 8,29 SAY 'Password  '
@  8,39 GET mpass
READ

IF UPPER(mpass) = 'FOXPRO'
@ 18,25 SAY 'Password correct'
CANCEL
ELSE
WAIT WINDOW 'Sorry! Password not accepted, Try "FoxPro"'
ENDIF
ENDDO


CANCEL SeeAlso
See Also

QUIT Command

RESUME Command

RETURN Command

SUSPEND Command


CAPSLOCK( ) Function

See Also	Example

Returns the current mode of the CapsLock key or sets the CapsLock key mode on or off.

Syntax

CAPSLOCK([<expL>])

Returns

Logical

Remarks

Issuing CAPSLOCK( ) with no argument returns true (.T.) if CapsLock is on, or false (.F.) if CapsLock is off.

Parameter

<expL>

In FoxPro for MS-DOS and FoxPro for Windows,<expL> can be included to turn the CapsLock key on or off.  CAPSLOCK(.T.) turns CapsLock on and CAPSLOCK(.F.) turns CapsLock off.  A logical value is returned corresponding to the CapsLock setting before CAPSLOCK(.T.) or CAPSLOCK(.F.) is issued.

In FoxPro for Macintosh, CAPSLOCK( ) cannot be used to turn Caps Lock on or off  it must be set manually. If you include <expL>, CAPSLOCK( ) returns true if Caps Lock is on, or false if Caps Lock is off.


CAPSLOCK( ) Example

The following code stores the state of CAPSLOCK( ) to a memory variable.  The = command executes the CAPSLOCK( ) function to set CapsLock on.  Then the = command executes the CAPSLOCK( ) function to set CapsLock to its previous state.

oldlock = CAPSLOCK( )	&& Save original setting
=CAPSLOCK(.T.)	&& Turn it on

*** Perform any number of statements ***

= CAPSLOCK(oldlock)	&& Return to original setting

*** or, toggle CapsLock to the opposite value and back ***

= CAPSLOCK(!CAPSLOCK( ))
= CAPSLOCK(!CAPSLOCK( ))


CAPSLOCK() SeeAlso
See Also

INSMODE( ) Function

NUMLOCK( ) Function


CDOW( ) Function

See Also	Example

Returns the day of the week from a given date expression.

Syntax

CDOW(<expD>)

Returns

Character

Remarks

CDOW( ), the character day of the week function, returns from a date expression the name of the day of the week. For example: Sunday or Monday.

Parameter

<expD>

Include the date expression <expD> for which CDOW( ) returns the day.


CDOW( ) Example

STORE {02/16/56} TO bdate
? CDOW(bdate)


CDOW() SeeAlso
See Also

DAY( ) Function

DOW( ) Function

SYS( ) Functions Overview


CDX( ) Function

See Also

Returns the names of the open compound index (.CDX) file that has the specified index position number.

Syntax

CDX(<expN1>[, <expN2> | <expC>])

Returns

Character

Remarks

The CDX( ) function is identical to the MDX( ) function.

A .CDX (compound) index consists of one physical file containing many tags.  Each tag is an index order reference for the associated table.

There are two types of .CDX files.  A standard compound index (.CDX) may have a different name from its associated table and can reside in a different directory than its associated table.  A table can have multiple compound index files.  You open a compound index with the INDEX clause of USE or with SET INDEX.

A structural .CDX must have the same name as its associated table and reside in the same directory.  A table can have only one structural index file.  Structural .CDXs are automatically opened and updated when the associated table is opened with USE.

Any .IDX (FoxBASE+ and FoxPro 1.0 compatible index) files specified in USE or SET INDEX are ignored by the CDX( ) function.

Use TAG( ) to return individual tag names contained in a .CDX, and NDX( ) to return the name of open .IDX files.

In FoxPro for MS-DOS and FoxPro for Windows, when SET FULLPATH is ON, the path to the .CDX is returned with the .CDX name. When SET FULLPATH is OFF, the drive the .CDX resides on is returned with the .CDX name. In FoxPro for Macintosh, the FULLPATH setting is ignored and the path to the .CDX is always returned with the .CDX name.

Parameters

<expN1>

For a table with a structural compound index and one or more compound indexes:

If <expN1> is 1, the name of the structural index file (which is always the same as the name of the table) is returned.

If <expN1> is 2, the name of the first compound index file name specified in the INDEX clause of USE or in SET INDEX is returned.

If <expN1> is 3, the second compound index file name, if any, is returned and so on.

If <expN1> is greater than the number of open .CDX files, the null string is returned.

For a table with no structural compound index and one or more compound indexes:

If <expN1> is 1, the name of the first compound index file name specified in the INDEX clause of USE or in SET INDEX is returned.

If <expN1> is 2, the second compound index file name, if any, is returned and so on.

If <expN1> is greater than the number of open .CDX files, the null string is returned.

<expN2> | <expC>

You can return the names of compound index files open in work areas other than the current work area by specifying either the work area number <expN2> or the table or work area alias <expC>.

If you omit the optional <expN2> and <expC> arguments, names of compound index files are returned for the current work area.


CDX() SeeAlso
See Also

INDEX Command

MDX( ) Function

NDX( ) Function

SET FULLPATH Command

SET INDEX Command

SYS(14) Function - Index Expression

SYS(21) Function - Controlling Index Number

SYS(22) Function - Controlling Tag or Index Name

SYS(2021) Function - Filtered Index Expression

TAG( ) Function

USE Command


CEILING( ) Function

See Also	Example

Returns the nearest integer that is greater than or equal to the specified numeric expression.

Syntax

CEILING(<expN>)

Returns

Numeric

Remarks

CEILING rounds a positive number with a fractional portion up to the next highest integer, and rounds a negative number with a fractional portion up to the integer portion of the number.

Parameter

<expN>

Include a numeric expression <expN> in CEILING( ).


CEILING( ) Example

STORE 10.1 TO num1
STORE -10.9 TO num2
STORE  10.0 TO num3
STORE -10.0 TO num4

? CEILING(num1)

? CEILING(num2)

? CEILING(num3)

? CEILING(num4)


CEILING() SeeAlso
See Also

FLOOR( ) Function

ROUND( ) Function


CHANGE Command

See Also

Displays fields for editing.

Syntax

CHANGE
[FIELDS <field list>]
[<scope>]
[FOR <expL1>]
[WHILE <expL2>]
[FONT <expC1>[, <expN1>]]
[STYLE <expC2>]
[FREEZE <field name>]
[KEY <expr1>[, <expr2>]]
[LAST]
[LEDIT]
[REDIT]
[LPARTITION]
[NOAPPEND]
[NOCLEAR]
[NODELETE]
[NOEDIT | NOMODIFY]
[NOLINK]
[NOMENU]
[NOOPTIMIZE]
[NORMAL]
[NOWAIT]
[PARTITION <expN2>]
[PREFERENCE <expC3>]
[REST]
[SAVE]
[TIMEOUT <expN3>]
[TITLE <expC4>]
[VALID [:F] <expL3> [ERROR <expC5>]]
[WHEN <expL4>]
[WIDTH <expN4>]
[[WINDOW <window name1>]
[IN [WINDOW] <window name2> | IN SCREEN | IN MACDESKTOP]]
[COLOR SCHEME <expN5> | COLOR <color pair list>]

Remarks

CHANGE allows editing of the selected table within a window.  CHANGE functions identically to EDIT.

The Change window is also available from within the Browse window.  For a complete description of using the Browse window in Change mode, see the FoxPro User's Guide.

Navigating in a Change Window

You can move from record to record with the Up and Down Arrow keys or move forward or backward through a group of records with the Page Up or Page Down key.  To move to the next or previous field, press Tab or Shift+Tab.

Saving Your Changes

In FoxPro for MS-DOS, you can save any changes you make to your data and exit the Change window by pressing Ctrl+W or Ctrl+End, or by clicking on the close box.  If you press Ctrl+Q or Esc, you can exit the Change window without saving changes you make to the current field.

In FoxPro for Windows, you can save any changes you make to your data and exit the Change window by pressing Ctrl+W or Ctrl+End, or by choosing Close from the Change window Control menu.

In FoxPro for Macintosh, you can save any changes you make to your data and exit the Change window by pressing Ctrl+W or Ctrl+End, by choosing Close from the File menu or by clicking the close box. Press Esc to exit the Change window without saving changes you make to the current field.

In a program, use DEACTIVATE WINDOW to save your changes and close a Change window.  Include the name of the Change window in DEACTIVATE WINDOW.  For more information on Change window names, see WTITLE( ).

You can edit memo fields in the Change window by placing the cursor in the memo field and pressing Ctrl+Page Down or double-clicking on the memo field.  To exit the memo field and save your changes, press Ctrl+W or click the close box.  To exit the memo field without saving your changes, press Esc.

SET SKIP Support

SET SKIP lets you establish a one-to-many relationship between two tables.  For each record in the parent table, there can be multiple related records in the child table.  If you create a one-to-many relationship, you can use CHANGE to view records from both the parent and child tables.

For each record from the parent table that FoxPro displays in the Change window, all related records (if any) from the child table are displayed.  The parent record is displayed once along with the first matching record from the child table.  Any subsequent matching records are displayed in the rows following the parent record and first matching child record.  In FoxPro for MS-DOS, shaded blocks are displayed in any column containing information from the parent table beyond the first matching record.  In FoxPro for Windows and FoxPro for Macintosh, the fill character for repeated parent information depends on the current Browse window font.

For more information on creating one-to-many relationships, see SET SKIP.

This example uses SET SKIP to create a one-to-many relationship between two tables.  There is a single record in the parent table (OFFICES) for each invoice created.  The child table (CUSTOMER) contains multiple records for each record in the parent table.

After the relationship is created, a Change window displaying records from both the parent and child tables is opened.

CLEAR
CLOSE DATABASES
USE offices  INDEX offices  ORDER ono IN 0	&& Parent table
USE customer INDEX customer ORDER ono IN 0	&& Child table
SELECT offices	&& Back to parent work area
SET RELATION TO ono INTO customer	&& Establish relationship
SET SKIP TO customer	&& One-to-many relationship

WAIT WINDOW 'Scroll to see companies for each office' NOWAIT
CHANGE FIELDS offices.ono :H='Office Number', ;
offices.city :H='Office City', customer.company

COL( ) and ROW( ) Support

Use COL( ) and ROW( ) to return the current screen row and column position of the cursor in a Change window.  If a Change window is opened on the desktop in FoxPro for MS-DOS or the main FoxPro window in FoxPro for Windows or FoxPro for Macintosh, the returned cursor position is relative to the desktop or the main FoxPro window, not to the Change window itself.  If a Change window is opened in a user-defined window, COL( ) and ROW( ) return the cursor position relative to the user-defined window.

CHANGE supports numerous options.  A list of the available options and a brief description of each follow.

Clauses

FIELDS <field list>

If FIELDS is included in CHANGE, the listed fields are displayed in the order they appear in <field list>.  If FIELDS isn't included, all fields in the table are displayed in the order they appear in the table structure.

The field list can specify any combination of fields or calculated fields, including fields from tables open in other work areas.  The syntax of the field list is:

<field1>
[:R]
[:V = <expr1> [:F] [:E = <expC1>]]
[:P = <expC2>]
[:B = <expr2>, <expr3> [:F]]
[:H = <expC3>]
[:W = <expL1>]

[, <field2> [:R] ...]

Calculated Fields

The field list can contain statements for creating calculated fields.  A calculated field contains read-only data created with an expression.  This expression may take any form but it must be a valid FoxPro expression.

The syntax of the statement you use to create a calculated field is:

<calculated field name> = <expr>

This example creates a calculated field called ADDRESS:

CLEAR
CLOSE DATABASES
USE customer

*** ADDRESS, CITY, and STATE ***
*** are the names of fields from the table ***

CHANGE FIELD ADDRESS = ALLTRIM(address) + ' ' + ALLTRIM(city) ;
+ ',' + state :H='Street,City,State'

The FIELDS clause fields list includes eight options, which enable special handling of fields displayed in the Change window.

:R

The read-only option (:R) specifies that the field included in the Change window is read-only.  The data it contains can be viewed but not edited.

CLOSE DATABASES
USE customer
CHANGE FIELD cno:R, company

:V = <expr1>

Use the verify option (:V) to perform field-level data validation within the Change window.  If <expr1> evaluates to true (.T.) when you move the cursor from the field, the data input into the field is considered correct and the cursor moves to the next field.

If <expr1> evaluates to false (.F.), the data input is considered incorrect, the cursor remains in the field and a message is displayed.  If <expr1> evaluates to 0, the data input is considered incorrect, the cursor remains in the field, but no error message is displayed.

By default, <expr1> is evaluated only when the field is modified.  To force verification, include the :F option.

You can display your own error message by including the :E option.

The verify option isn't executed for memo fields.

:F

The forced validation option (:F) determines if the expression in the verify option (<expr1>) is evaluated when you move the cursor from a field.  If :F is not included, <expr1> is evaluated only if changes are made to the field.  If :F is included, <expr1> is evaluated, even if the field isn't modified.

:E = <expC1>

If the validation expression :V = <expr1> evaluates to true, the cursor leaves the field normally.  If the expression evaluates to false, the cursor remains in the field and the system error message "Invalid input" is displayed.

If the Error option (:E) is included, <expC1> is displayed instead of the system error message.  <expC1> is displayed only if SET NOTIFY is ON.  The bell is sounded if BELL is SET ON.

If the validation expression :V = <expr1> evaluates to 0, no message is displayed and the cursor remains in the field being validated.  This lets you display your own error messages in validation routines.

The following example opens SALESMAN.DBF and displays the CITY and YTDSALES fields.  Enter a value of 0 in the YTDSALES field to perform the field validation.

:V is the validation criteria.  :F forces the validation check to be performed whether the data is changed or not.  :E replaces the FoxPro system error message with a user-defined error message.

In FoxPro for Windows and FoxPro for Macintosh, the error message is displayed in the status bar at the bottom of the main FoxPro window.

Press Esc to close the Change window.

CLOSE DATABASES
USE salesman
CHANGE FIELD ono :R, city, ytdsales :V = ytdsales > 0  ;
:F :E = 'Ytdsales must be greater than 0'

:P = <expC2>

If you include a FIELDS clause, you can also specify a picture option (:P) for each field in the list.  The picture option lets you create an editing template specified with <expC2> that controls the display and input of data for each field in a Change window.

For more information on using picture editing codes, see @ ... GET and @ ... SAY.  With the exception of the M code, all of the function and picture codes available in @ ... GET and @ ... SAY can be used in the PICTURE and FUNCTION clauses.

The following example uses the picture option to allow only numeric data in a specific format to be entered in the YTDSALES field:

CLOSE DATABASES
USE salesman
CHANGE FIELDS name, ytdsales :P = '999,999.99'

:B = <expr2>, <expr3> [:F]

With this option, you can specify a set of boundaries between which data must fall.  The boundary expressions <expr2> and <expr3> must match the data type of the field and cannot be the names of user-defined functions.  If the data entered doesn't fall between <expr2> and <expr3>, a system message is displayed indicating the range between which the data must fall.

By default, the data you enter is checked against the boundary values only if you make a change to the contents of the field.  To force checking against the boundary values, include the forced validation option (:F).

The following example ensures that the YTDSALES data is between 100 and 99,999.  Enter a value less than 100 in the YTDSALES field to check the value against the boundary values.  Press Esc to close the Change window.

CLOSE DATABASES
USE salesman
CHANGE FIELDS ytdsales :B = 100, 99999 ;
:F, name

:H = <expC3>

By default, field names are placed to the left side of the fields in the Change window.  Including the heading option (:H) replaces the default field names with your own headings,  which you specify with <expC3>.

The following example provides user-defined headings for the displayed fields.

CLOSE DATABASES
USE customer
CHANGE FIELDS ytdpurch :H = 'Purchases:',  ;
company :H = 'Company:'

:W = <expL1>

You can conditionally prohibit moving the cursor to a field based on the value of the logical expression <expL1>.  The when option (:W) evaluates <expL1>.  If <expL1> evaluates to false (.F.), you can't move the cursor to the field.  If <expL1> evaluates to true (.T.), you can move the cursor to the field.  User-defined functions are supported in <expL1>.

Moving the cursor to all fields is prohibited, the current field is marked read-only.  This occurs only when every field contains a WHEN clause that evaluates to false.

<scope>

The scope clauses are:  ALL, NEXT <expN>, RECORD <expN>, and REST.  These are explained in the Overview of the FoxPro Language chapter of the FoxPro Language Reference.  Commands which include <scope> operate only on the table in the active work area.

You can specify a scope of records that are displayed in the Change window.  Only the records that fall within the range of records specified by the scope appear in the Change window.

The default scope for CHANGE is ALL records.

FOR <expL1>

Including the FOR clause lets you conditionally display records in the Change window, filtering out undesired records.  If you include the FOR clause, only the records that satisfy the logical condition <expL1> are displayed in the Change window.

Rushmore optimizes a CHANGE FOR query if <expL1> is an optimizable expression.  For best performance, use an optimizable expression in the FOR clause.  A discussion of Rushmore optimizable expressions appears in the Optimizing Your Application chapter in the FoxPro Developer's Guide.

WHILE <expL2>

If the WHILE clause is included in CHANGE, records are displayed in the Change window for as long as the logical expression <expL2> evaluates to true (.T.).

FONT <expC1> [, <expN1>]

The character expression <expC1> is the name of the font, and the numeric expression <expN1> is the font size.  For example, the following clause specifies 16-point Courier font for the fields displayed in a Change window:

FONT 'Courier',16

If you include the FONT clause but omit the font size <expN1>, a 10 point font is used in the Change window.  In FoxPro for Windows, if you omit the FONT clause, 8-point MS Sans Serif is used. In FoxPro for Macintosh, 10-point Geneva is used.

In FoxPro for Windows, if the font you specify is not available, a font with similar font characteristics is substituted.

In FoxPro for Macintosh, if the font you specify is not available, the Chicago font is used.

In FoxPro for MS-DOS, the FONT clause is ignored.

STYLE <expC2>

In FoxPro for Windows and FoxPro for Macintosh, include the STYLE clause to specify a font style for fields displayed in the Change window.

The font style is specified with <expC2>.  If the STYLE clause is omitted, the normal font style is used.

In FoxPro for Windows, if the font style you specify is not available, a font style with similar characteristics is substituted.

In FoxPro for Macintosh, if the font you specify is not available, the normal font style is used.

The STYLE clause is ignored in FoxPro for MS-DOS.

Character	Font Style
B	Bold
I	Italic
N	Normal
O	Outline
S	Shadow
-	Strikeout *
U	Underline
C	Condense*
E	Extend*

*The Condense and Extend styles are available only in FoxPro for Macintosh. The Strikeout style is available only in FoxPro for Windows.

You can include more than one character to specify a combination of font styles.  The following example open a Change window and uses a 15 point underlined System font:

CLOSE DATABASES
USE customer
IF _WINDOWS
CHANGE FIELDS contact FONT 'System', 15 STYLE 'NU'
ENDIF
IF _MAC
CHANGE FIELDS contact FONT 'Geneva', 14  STYLE 'NU'
ENDIF

The STYLE clause is ignored in FoxPro for MS-DOS.

FREEZE <field name>

Include the FREEZE clause to allow changes to be made to a single field in the Change window.  You specify this field with <field name>.  The remaining fields are displayed and cannot be edited.

KEY <expr1>[,<expr2>]

Use the KEY clause to limit the scope of records that are displayed in the Change window.  With KEY, you can specify an index key value (<expr1>) or a range of key values (<expr1>, <expr2>) for the records displayed in the Change window.  The table must be indexed, and the index key value or values included in the KEY clause must be the same data type as the index expression of the master index file or master tag.

For example, the CUSTOMER table includes a character field containing zip codes.  If the table is indexed on the zip code field, you can specify a range of zip codes in the KEY clause.  In this example, only records with zip codes falling within the range 43000 to 43999 are displayed in the Change window:

USE customer
SET ORDER TO zip
CHANGE FIELD company, zip KEY '43000','43999'

LAST

Any configuration changes made to the appearance of a Change window are saved in the FOXUSER resource file when the Change window is closed.  The field list, the size of each field, and the location and size of the Change window are stored in the FOXUSER file.  For more information on this file, see SET RESOURCE.

If you issue CHANGE with the LAST clause, the Change window opens in the same configuration that was last saved in the FOXUSER file.  This restores the previous Change window configuration created with the last CHANGE.  If the last CHANGE command issued in the Command window included a long list of clauses, issue CHANGE LAST to avoid having to retype the command.

Any Change window configuration changes you make in the current session aren't saved if you exit CHANGE by pressing Ctrl+Q.

LEDIT
REDIT

Information in a Change window can be viewed in two modes: Change or Browse.  In the default Change mode, fields are displayed vertically.  In Browse mode, fields are displayed horizontally.

You can split a Change window into left and right partitions by moving the window splitter with the mouse, by choosing Resize Partitions from the Browse menu or by including PARTITION in CHANGE.  Each partition can be viewed in Change or Browse mode independently of the other partition.

If LEDIT or REDIT is included in CHANGE, the left or right partition is in Browse mode when the Change window is displayed.  Include both key words to open both partitions in Browse mode.  Each partition can be toggled between Change and Browse modes by choosing Browse and Change from the Browse menu popup.

USE customer
CHANGE PARTITION 30 LEDIT

LPARTITION

A Change window can be split into left and right partitions by including the PARTITION clause described later.  By default, the cursor is placed in the first field in the right partition when the Change window is opened.  If you include LPARTITION, the cursor is placed in the first field in the left Change window partition.

The cursor is placed in the right Change window partition if you include LPARTITION without the PARTITION clause.

NOAPPEND

If you include NOAPPEND in CHANGE, you can't add records to the table by pressing Ctrl+N or choosing Append Record from the Browse menu.

Caution   Including NOAPPEND doesn't prevent you from appending a record from within a routine (created with VALID, WHEN or ON KEY LABEL) while in the Change window.

NOCLEAR

If NOCLEAR is included and you close the Change window, an image of the Change window remains displayed.  This image isn't an active Change window.  Use CLEAR to remove the Change window image.

NOCLEAR is ignored in FoxPro for Windows and FoxPro for Macintosh.

NODELETE

Including NODELETE prevents records from being marked for deletion from within a Change window.  By default, a record can be marked for deletion by pressing Ctrl+T, choosing Toggle Delete from the Browse menu or clicking in the leftmost column of the record to be deleted.

Caution   Including NODELETE doesn't prevent you from marking a record for deletion from within a routine (created with VALID, WHEN or ON KEY LABEL) while in the Change window.

NOEDIT | NOMODIFY

Including NOEDIT or NOMODIFY prevents you from modifying the table.  NOEDIT and NOMODIFY are identical.  If you include either clause, you can browse or search the table, but you cannot be edit it.  However, you can append and delete records.  Include NOAPPEND and NODELETE to prohibit the addition and deletion of records.

NOLINK

By default, the left and right partitions of the Change window are linked; when you scroll through one partition, the other partition scrolls.  You can unlink the partitions by including NOLINK.  You can also unlink partitions by choosing Partitions from the Browse menu.

NOMENU

Including NOMENU in CHANGE prevents access to the Browse menu and its options by removing the Browse menu pad from the system menu bar.

NOOPTIMIZE

To disable Rushmore optimization of CHANGE, include NOOPTIMIZE.  For more information on the NOOPTIMIZE clause, see SET OPTIMIZE, or consult the Optimizing Your Application chapter in the FoxPro Developer's Guide.

NORMAL

When the current output window is a user-defined window, the Change window derives its colors, size, position, title and control options (GROW, FLOAT, ZOOM, and so on) from this window.  If  NORMAL is specified, the Change window is opened normally with its default settings as if there were no active user-defined window.

NOWAIT

When CHANGE is issued from within a program, a Change window is opened and program execution pauses until the Change window is closed.  Including NOWAIT continues program execution immediately after the Change window is opened.  The program doesn't wait for the Change window to be closed but continues executing on the program line immediately following the program line containing CHANGE NOWAIT.

This option is available only from within a program.  Including NOWAIT in CHANGE has no effect when the command is issued in the Command window.

PARTITION <expN2>

A Change window can be split into left and right partitions by including PARTITION in CHANGE.  The numeric expression <expN2> specifies the column in which the window splitter is located.  For example, if <expN2> is 20, the window splitter is placed in column 20 of the Change window.

A Change window can also be split into left and right partitions by moving the window splitter with the mouse or by choosing Resize Partitions from the Browse menu.

PREFERENCE <expC3>

Include PREFERENCE in CHANGE to save a Change window's attributes and options for later use.  Unlike LAST, which restores the Change window as it appeared in the previous session, PREFERENCE saves a Change window's attributes indefinitely in the FOXUSER resource file.  Preferences can be retrieved at any time.  For more information about the FOXUSER resource file, see SET RESOURCE.

Issuing CHANGE with the specified preference name <expC3> for the first time creates an entry in the FOXUSER file that saves the Change window configuration.  Issuing CHANGE later with the same preference name restores the Change window to that preference state.  When the Change window is closed, the preference state is updated.

If you exit a Change window by pressing Ctrl+Q, any Change window changes aren't saved to the resource file.

REST

By default, CHANGE positions the record pointer at the top of the table.  Include REST to prevent the record pointer from being moved from its current position to the top of the table.

SAVE

Include SAVE with CHANGE to keep the Change window and any of its memo field text editing windows active and visible (open).  You can then return to the Change window after cycling through other open windows with the keyboard or the mouse.

This option is available only from within a program.  SAVE has no effect when included with CHANGE in the Command window because CHANGE SAVE is always the default in the interactive mode.

TIMEOUT <expN3>

Include TIMEOUT to specify how long a Change window waits for input.  The numeric expression <expN3> specifies how many seconds can elapse without any input before the Change window automatically closes.

TIMEOUT is available only from within a program; it has no effect when issued in the Command window.  In the following example the Change window is closed if no input occurs in 10 seconds.

DEFINE WINDOW mybrowse FROM 1,1 TO 24,40 ;
CLOSE ;
GROW ;
COLOR SCHEME 10

CLOSE DATABASES
USE customer
CHANGE WINDOW mybrowse ;
FIELDS ytdpurch :H = 'Purchases:' , ;
company :H = 'Company:' ;
TIMEOUT 10
RELEASE WINDOW mybrowse

TITLE <expC4>

By default, the name of the table being browsed appears in the top border of the Change window.  If you issue CHANGE WINDOW <window name1> and the window has a title, the Change window assumes <window name1> as its title.

You can overwrite the table name or window title with your own title by including a TITLE clause.  The character expression <expC4> is the new title you want to display in the top border of your Change window.

VALID [:F] <expL2> [ERROR <expC5>]

Including VALID lets you perform record-level validation in a Change window.  VALID is executed only if a change is made to the record and you move the cursor to another record.  The VALID clause is not executed if the only change is to a memo field.

If VALID returns a true value (.T.), you can move the cursor to another record.

If VALID returns a false value (.F.), the cursor remains in the current field, and the system message "Invalid input" is displayed.  You can display your own error message when VALID returns false by including the ERROR clause.  The character expression <expC5> is displayed as the error message.

If VALID returns 0, the cursor remains in the current field, and an error message isn't displayed.

You can force the VALID clause to execute before you move the cursor to the next record by including :F after the VALID key word.  In this case, VALID is executed even if the record isn't changed.

The VALID clause shouldn't be confused with the verify option (:V), which enables field-level validation.

WHEN <expL4>

The WHEN clause is executed when you move the cursor to another record.  If <expL4> evaluates to a true value (.T.), you can make changes to the record you move the cursor to.  If <expL4> evaluates to false or 0, the record you select becomes read-only and cannot be modified.  The cursor moves to the next field.

WIDTH <expN4>

The WIDTH clause limits the number of characters displayed for all fields in a partition of the Change window to <expN4>.  Including the WIDTH clause doesn't change the size of fields in the table itself; it alters only the way the fields are displayed in the Change window.

WINDOW <window name1>

If you include the WINDOW clause in CHANGE, the Change window takes on the characteristics of the window specified with <window name1>.  For example, if the window is defined with the FLOAT clause, the Change window can be moved.  The specified window doesn't have to be active or visible, but it must be defined.

IN [WINDOW] <window name2>

If the IN WINDOW clause is included, the Change window is opened within the parent window specified with <window name2>.  The Change window doesn't assume the characteristics of the parent window.  A Change window activated inside a parent window cannot be moved outside the parent window.  If the parent window is moved, the Change window moves with it.

To access the Change window, the parent window must first be defined with DEFINE WINDOW and must be active and visible.

IN SCREEN

By including IN SCREEN, you can explicitly place a Change window on the desktop in FoxPro for MS-DOS or in the main window in FoxPro for Windows when a user-defined window is active.

IN MACDESKTOP

MACDESKTOP is available in FoxPro for Macintosh only.

Include the MACDESKTOP clause to place a Change window on the Macintosh desktop. The Change window resides at the same level as the main FoxPro window. The Change window can be moved outside of the main FoxPro window and the main FoxPro window can be brought forward over the top of it. When you include the MACDESKTOP clause, the Change window behaves in the same manner as Change windows in FoxBASE for Macintosh.

Including the MACDESKTOP clause overrides the current SET MACDESKTOP setting. SET MACDESKTOP determines if Change windows are placed on the main FoxPro window or the Macintosh desktop when the SCREEN or MACDESKTOP clause is not included. For more information about placing Change windows on the main FoxPro window or the Macintosh desktop, see SET MACDESKTOP.

COLOR SCHEME <expN5> | COLOR <color pair list>

The color of a Change window can be specified by including the number of an existing color scheme in the COLOR SCHEME clause or a set of color pairs in the COLOR clause.

A color scheme is a set of 10 predefined color pairs.  The color pairs in a color scheme can be changed with SET COLOR OF SCHEME.  In FoxPro for MS-DOS the color pairs in a color scheme can also be changed in the Color Picker.

A color pair is a set of two letters separated by a forward slash.  The first color letter specifies the foreground color and the second letter specifies the background color.

For example, this color pair specifies a red foreground on a white background:

R/W

For a list of colors and their corresponding color letters, see the SET COLOR commands section or the Color Table by Color Pair topic.

In FoxPro for Windows, a color pair can also be specified with a set of 6 RGB (Red Green Blue) color values separated by commas.  The first 3 color values specify the foreground color and the second 3 color values specify the background color.  The color values can range from 0 through 255.

In FoxPro for Windows, the R/W color pair in the example above can also be specified with this RGB color pair:

RGB(255,0,0,255,255,255)

In FoxPro for MS-DOS, the Change window assumes the colors specified with COLOR SCHEME 10 (Browse) by default.

In FoxPro for Windows and FoxPro for Macintosh, the Change window assumes the color scheme established using the Color option in the Microsoft Windows Control Panel (FoxPro for Windows) or the Color option in the Control Panels on the Apple menu (FoxPro for Macintosh).

The following table shows what element each color pair controls in FoxPro for MS-DOS.

Color Pair  Number	Change Window Element
1	Other records (In FoxPro for Windows  and FoxPro for Macintosh, color pair 1 controls the color of the current record and field.)
2	Current field
3	Border
4	Active title
5	Idle title
6	Selected text
7	Current record
8	Shadow
In FoxPro for MS-DOS, the second color specified in color pair number 1 designates the color of the grid background.  The second color specified in color pair number 3 is used for the grid foreground.


CHANGE SeeAlso
See Also

BROWSE Command

EDIT Command

WTITLE( ) Function


CHR( ) Function

See Also	Example

Returns the character associated with the specified numeric ASCII code.

Syntax

CHR(<expN>)

Returns

Character

Remarks

CHR( ) returns a single  character corresponding to a numeric expression.  CHR( ) can be used to send printer control codes to a printer.

Clause

<expN>

Include in CHR( ) a numeric expression <expN> that evaluates to a number in the range of 0 to 255.  The numeric expression is evaluated and the equivalent ASCII character is returned.

Use ASC( ) to return the ASCII code for a specified character.


CHR( ) Example

? CHR(65)
? CHR(97)

? CHR(7)	&& Rings the bell

The following example puts an HP LaserJet Series II printer into landscape mode:

??? CHR(27) + '&l10'


CHR() SeeAlso
See Also

ASC( ) Function

INKEY( ) Function


CHRSAW( ) Function

See Also	Example

Determines whether or not a character is present in the keyboard buffer.

Syntax

CHRSAW([<expN>])

Returns

Logical

Remarks

CHRSAW( ) returns true (.T.) if a character is present in the keyboard buffer, and false (.F.) if not. CHRSAW( ) doesn't affect the keyboard buffer contents.

Parameter

<expN>

If the <expN> is included, CHRSAW( ) waits <expN> seconds before checking the keyboard buffer.  If <expN> is omitted, the keyboard buffer is checked immediately.

Including <expN> lets you use CHRSAW( ) for a variety of timed activities.  For example, your program can close an application if a key hasn't been pressed for a specific number of seconds.


CHRSAW( ) Example

In this example, the system displays a window containing input fields created with @ ... GETs, and waits 5 seconds for keyboard input.  If a key isn't pressed, CHRSAW( ) returns false (.F.) and the program terminates.

SET TALK OFF
DEFINE WINDOW menter FROM 7,10 to 17,70 PANEL
ACTIVATE WINDOW menter

@ 1,3 SAY 'Customer: ' GET mcustomer DEFAULT SPACE(40)
@ 3,3 SAY 'Address: '  GET maddress  DEFAULT SPACE(40)
@ 5,3 SAY 'City: '     GET mcity     DEFAULT SPACE(24)
@ 7,3 SAY 'State: '    GET mstate    DEFAULT SPACE(2)
@ 7,18 SAY 'Zip: '     GET mzip      DEFAULT SPACE(10)
@ 1,14 SAY ''

WAIT WINDOW 'Waiting for input' NOWAIT

IF NOT CHRSAW(5)
DEACTIVATE WINDOW menter
CLEAR GETS
ELSE
READ
DEACTIVATE WINDOW menter
ENDIF

RELEASE WINDOW menter
WAIT
CLEAR


CHRSAW() SeeAlso
See Also

INKEY( ) Function

READKEY( ) Function


CHRTRAN( ) Function

See Also	Example

Replaces each character in a character expression that matches a character in a second character expression with the corresponding character in a third character expression.

Syntax

CHRTRAN(<expC1>, <expC2>, <expC3>)

Returns

Character

Remarks

CHRTRAN( ) translates the character expression <expC1> using the translation expressions <expC2> and <expC3>.

Parameters

<expC1>, <expC2>, <expC3>

If a character from <expC1> is found in <expC2>, the character in <expC1> is replaced by the character from <expC3> that's in the same position in <expC3> as is the character in <expC2>.

If <expC3> has fewer characters than <expC2>, the additional characters in <expC2> are translated to null characters.  If <expC3> has more characters than <expC2>, the additional characters are ignored.


CHRTRAN( ) Example

? CHRTRAN('abcdef', 'ace', 'xyz')

? CHRTRAN('abcd', 'abc', 'yz')

? CHRTRAN('abcdef', 'ace', 'xyzqrst')


CHRTRAN() SeeAlso
See Also

SYS(15) Function - Character Translation


CLEAR Commands

See Also	Example

Clear the specified item.

Syntax

CLEAR
or
CLEAR ALL
or
CLEAR FIELDS
or
CLEAR GETS
or
CLEAR MACROS
or
CLEAR MEMORY
or
CLEAR MENUS
or
CLEAR POPUPS
or
CLEAR PROGRAM
or
CLEAR PROMPT
or
CLEAR READ
[ALL]
or
CLEAR TYPEAHEAD
or
CLEAR WINDOWS

Commands

CLEAR

CLEAR erases the desktop in FoxPro for MS-DOS, the main FoxPro window, or the current user-defined window, and releases all pending @ ... GET statements.  You can include CLEAR in format files.

CLEAR ALL

CLEAR ALL releases from memory all memory variables and arrays and the definitions of all user-defined menu bars, popups and windows; it also closes any open tables, including all associated index, format and memo files, and selects work area 1.  CLEAR ALL doesn't release system memory variables.

CLEAR FIELDS

CLEAR FIELDS releases a list created with SET FIELDS and executes SET FIELDS OFF.  CLEAR FIELDS differs from SET FIELDS TO in that it releases all field lists in all work areas, not just the fields list in the current work area.  Also, SET FIELDS TO doesn't implicitly issue a SET FIELDS OFF.

CLEAR GETS

CLEAR GETS releases all pending @ ... GET statements.  Issuing CLEAR also releases all pending @ ... GET statements.

CLEAR MACROS

CLEAR MACROS releases from memory all keyboard macros, including any SET FUNCTION key assignments.  Macros can be saved to a macro file or to a memo field with SAVE MACROS and restored later with RESTORE MACROS.  You can also restore the default macros with RESTORE MACROS.

CLEAR MEMORY

CLEAR MEMORY releases from memory all public and private memory variables and arrays.  System memory variables aren't released.

CLEAR MENUS

CLEAR MENUS releases all menu bar definitions from memory.

CLEAR POPUPS

CLEAR POPUPS releases all popup definitions established with DEFINE POPUP from memory.

CLEAR PROGRAM

CLEAR PROGRAM clears the compiled program buffer.  FoxPro keeps a buffer of the most recently executed programs.  In rare cases, FoxPro may not recognize changes made to program files on disk.  CLEAR PROGRAM forces FoxPro to read the programs from disk, rather than from the program buffer.  The most common reason FoxPro may not recognize changes made to program files is your using an external or TSR (Terminate and Stay Resident) editor to modify a program file.  With this exception, you should not have to use CLEAR PROGRAM.

CLEAR PROMPT

CLEAR PROMPT releases menu prompts created with @ ... PROMPT.

CLEAR READ
[ALL]

CLEAR READ exits the active READ, and returns control to the previous READ level if the active READ is nested.  READs can be nested up to five levels.  When CLEAR READ is issued, the READ isn't immediately terminated.  Any commands that remain to be executed before returning to the READ are executed.

FoxPro supports nested READs.  A nested READ is created by using a VALID or WHEN clause with @ ... GET to call a UDF (user-defined function) containing additional @ ... GETs and a READ.  READs can be nested in this manner to five levels.  CLEAR READ terminates the READ on the current level and returns control to the previous READ level.

Including ALL terminates all READs on all READ levels.

CLEAR READ will not terminate a READ issued with no previous @ ... GET statements.  In this case, READ VALID is executed when CLEAR READ is issued.  If the READ follows @ ... GET statements and has a VALID clause, the VALID clause is not executed when CLEAR READ is issued.  For more information on commands issued with no previous @ ... GET statements, see the Foundation READ section in READ.

CLEAR TYPEAHEAD

CLEAR TYPEAHEAD clears the keyboard typeahead buffer.  CLEAR TYPEAHEAD is useful when you want to prevent input into a field or prevent a response to a prompt before the field or prompt is displayed.

CLEAR WINDOWS

CLEAR WINDOWS releases all user-defined window definitions from memory and clears the windows from the desktop in FoxPro for MS-DOS, the main FoxPro window, or the active user-defined window.  Windows definitions can be saved  with SAVE WINDOW to a file or memo field for later use.


CLEAR Example

SET TALK OFF
DEFINE WINDOW entry FROM 6,14 TO 14,65 ;
TITLE 'Input Window' FLOAT SHADOW SYSTEM COLOR SCHEME 8
ACTIVATE WINDOW entry
@ 2,2 SAY 'First Name:'
@ 4,2 SAY 'Last Name:'
@ 2,16 GET firstname SIZE 1,24 DEFAULT ''
@ 4,16 GET lastname SIZE 1,24 DEFAULT ''
@ 6,14 GET button FUNCTION '*HN \?\<Clear;\!\<Exit' ;
SIZE 1,9,2 DEFAULT '' VALID clearexit( )

READ CYCLE
RELEASE WINDOW entry

FUNCTION clearexit
DO CASE
CASE button = 'Clear'
firstname = SPACE(10)
lastname = SPACE(10)
_CUROBJ = 1
SHOW GETS
WAIT WINDOW 'Enter Name Again' NOWAIT
CASE button = 'Exit'
CLEAR READ
WAIT WINDOW  'Entry Complete' NOWAIT
ENDCASE


CLEAR SeeAlso
CLEAR Commands See Also

CLEAR

@ ... SAY Command

@ ... GET Command

@ ... CLEAR Command

CLEAR ALL

CLOSE Commands

RELEASE ALL Command

CLEAR FIELDS

SET FIELDS Command

CLEAR GETS

@ ... SAY Command

@ ... GET Command

CLEAR MACROS

PLAY MACRO Command

RESTORE MACROS Command

SAVE MACROS Command

CLEAR MEMORY

RELEASE ALL Command

CLEAR MENUS

ACTIVATE MENU Command

CREATE MENU Command

DEFINE MENU Command

HIDE MENU Command

SHOW MENU Command

CLEAR POPUPS

ACTIVATE POPUP Command

CREATE MENU Command

DEFINE POPUP Command

HIDE POPUP Command

SHOW POPUP Command

CLEAR READ

RDLEVEL( ) Function

READ Command

CLEAR TYPEAHEAD

SET TYPEAHEAD Command

CLEAR PROMPT

@ ... PROMPT Command

CLEAR WINDOWS

ACTIVATE WINDOW Command

DEFINE WINDOW Command

HIDE WINDOW Command

RELEASE WINDOWS Command

SAVE WINDOWS Command

SHOW WINDOW Command


CLOSE Commands

See Also

Close various file types.

Syntax

CLOSE ALL
or
CLOSE ALTERNATE
or
CLOSE DATABASES
or
CLOSE FORMAT
or
CLOSE INDEXES
or
CLOSE PROCEDURE

Commands

CLOSE ALL

CLOSE ALL closes all files in all work areas and selects work area 1.  CLOSE ALL also closes any files opened with the FCREATE( ) and FOPEN( ) low-level file functions.

CLOSE ALL also closes the following windows:

Label
Project
Report
RQBE
Screen

CLOSE ALL doesn't close these windows:

Command
Debug
Desk Accessories (for example, Calculator, and Puzzle)
Help
Trace

CLOSE ALTERNATE

CLOSE ALTERNATE closes the alternate file you opened with SET ALTERNATE.

CLOSE DATABASES

CLOSE DATABASES closes all open tables, index, memo and format files and selects work area 1.

CLOSE FORMAT

CLOSE FORMAT closes the format file open in the current work area.

CLOSE INDEXES

CLOSE INDEXES closes all open index files (both .IDX and .CDX files) in the current work area.  A structural index (a .CDX file with the same root name as the open table) isn't closed.

CLOSE PROCEDURE

CLOSE PROCEDURE closes the file you opened with SET PROCEDURE.


CLOSE SeeAlso
See Also

CLOSE ALTERNATE

SET ALTERNATE Commands

CLOSE DATABASES

USE Command

CLOSE FORMAT

SET FORMAT Command

CLOSE INDEXES

INDEX Command

SET INDEX Command

CLOSE PROCEDURE

SET PROCEDURE Command


CLOSE MEMO Command

See Also

Closes one or more memo editing windows.

Syntax

CLOSE MEMO <memo field1>[, <memo field2> ...] | ALL

Remarks

CLOSE MEMO closes memo editing windows opened with MODIFY MEMO, or during a BROWSE, CHANGE or EDIT.  CLOSE MEMO saves changes you made to the memo fields.

In FoxPro for MS-DOS, you can also exit a memo editing window and save changes you made to the memo field by pressing Ctrl+W or clicking the close box.  To exit the memo window without saving any changes, press Esc or Ctrl+Q.

In FoxPro for Windows, you can also exit a memo editing window and save any changes made to the memo field by pressing Ctrl+W or choosing Close from the window's Control menu or Close from File menu. To exit the memo window without saving any changes, press Esc or Ctrl+Q.

In FoxPro for Macintosh, you can also exit a memo editing window and save any changes made to the memo field by pressing Ctrl+W or choosing Close from File menu. To exit the memo window without saving any changes, press Esc.

Clauses

<memo field1>[, <memo field2> ...] | ALL

Include the name of the memo field whose memo editing window you want to close.  To close a set of memo editing windows, include a list of memo field names with the names separated from each other with a comma.  You can close the memo editing window of a memo field in a table open in another work area by including the table alias.

Use ALL instead of listing memo field names to close all memo editing windows for all memo fields in tables open in every work area.


CLOSE MEMO SeeAlso
See Also

BROWSE Command

MODIFY MEMO Command


CMONTH( ) Function

See Also	Examples

Returns the name of the month from a given date expression.

Syntax

CMONTH(<expD>)

Returns

Character

Remarks

CMONTH( ), the character month function, returns the name of the month as a string in proper noun format.

Parameter

<expD>

The date expression <expD> can be a function that returns a date, a date type memory variable, array element or field.


CMONTH( ) Example
CMONTH( ) Examples

? CMONTH({9/25/92})

STORE {6/25/92} TO due_date
? 'Your payment was due in', CMONTH(due_date)

STORE due_date+60 TO finaldate
? 'You must pay by', CMONTH(finaldate)


CMONTH( ) SeeAlso
See Also

DMY( ) Function

MDY( ) Function

MONTH( ) Function


CNTBAR( ) Function

See Also	Example

Returns the number of bars on a popup defined with DEFINE POPUP or on a FoxPro system popup.

Syntax

CNTBAR([<expC>])

Returns

Numeric

Remarks

If the popup bars are defined with DEFINE POPUP ... PROMPT, FoxPro evaluates the prompts when you issue ACTIVATE POPUP.  For such a popup, CNTBAR( ) returns a meaningful value only after you activate the popup.  If the popup bars are defined with DEFINE BAR, CNTBAR( ) can determine the number of bars before you issue ACTIVATE POPUP.

Parameter

<expC>

Specify the name of the popup with <expC>.  For a list of FoxPro system menus, see MENU - System Menu Names.

If you omit <expC>, CNTBAR( ) returns the number of bars on an active popup created with DEFINE POPUP.


CNTBAR( ) Example
CNTBAR( ) , PRMBAR ( ) and SET MARK OF Example

In the following example, CNTBAR.PRG adds a menu pad to the system menu.  The popup ENVIRO is defined with four bars.  Each bar sets the item indicated on or off.  The program places a mark character by each bar when the associated item is turned on, and removes the mark when the associated item is turned off.

*** You must name this program CNTBAR.PRG ***

CLEAR
SET TALK OFF
DEFINE PAD enviro OF _MSYSMENU PROMPT 'E\<nvironment';
KEY ALT+V, 'ALT+V'
ON PAD enviro OF _MSYSMENU ACTIVATE POPUP enviro

DEFINE POPUP enviro MARGIN RELATIVE SHADOW COLOR SCHEME 4
DEFINE BAR 1 OF enviro  PROMPT '\<Status Bar'
DEFINE BAR 2 OF enviro  PROMPT '\<Clock'
DEFINE BAR 3 OF enviro  PROMPT '\<Extended Video'
DEFINE BAR 4 OF enviro  PROMPT 'St\<icky'
ON SELECTION POPUP enviro DO enviropop IN cntbar.prg

FOR i = 1 TO cntbar('enviro')
DO CASE
CASE PRMBAR('enviro', i) = 'Status Bar'
SET MARK OF BAR i OF enviro TO  SET('STATUS') = 'ON'
CASE PRMBAR('enviro', i) = 'Clock'
SET MARK OF BAR i OF enviro TO  SET('CLOCK') = 'ON'
CASE PRMBAR('enviro', i) = 'Extended Video'
SET MARK OF BAR i OF enviro TO  SROW( ) > 25
CASE PRMBAR('enviro', i) = 'Sticky'
SET MARK OF BAR i OF enviro TO  SET('STICKY') = 'ON'
ENDCASE
ENDFOR

PROCEDURE enviropop
DO CASE
CASE PROMPT() = 'Status'
IF mrkbar('enviro', bar( ))
DO CASE
CASE _WINDOWS OR _MAC
SET STATUS BAR OFF
CASE _DOS
SET STATUS OFF
OTHERWISE
ENDCASE
SET MARK OF BAR bar( ) OF enviro TO .F.
ELSE
DO CASE
CASE _WINDOWS OR _MAC
SET STATUS BAR ON
CASE _DOS
SET STATUS ON
OTHERWISE
ENDCASE
SET MARK OF BAR bar( ) OF enviro TO .T.
ENDIF
CASE PROMPT( ) = 'Clock'
IF mrkbar('enviro', bar( ))
SET CLOCK OFF
SET MARK OF BAR bar( ) OF enviro TO .F.
ELSE
DO CASE
CASE _WINDOWS OR _MAC
SET STATUS BAR ON
SET CLOCK STATUS
CASE _DOS
SET CLOCK ON
OTHERWISE
ENDCASE
SET MARK OF BAR bar( ) OF enviro TO .T.
ENDIF
CASE PROMPT( ) = 'Extended Video'
IF MRKBAR('enviro', bar( ))
SET DISPLAY TO VGA25
SET MARK OF BAR bar( ) OF enviro TO .F.
ELSE
SET DISPLAY TO VGA50
SET MARK OF BAR bar( ) OF enviro TO .T.
ENDIF
CASE PROMPT( ) = 'Sticky'
IF MRKBAR('enviro', bar( ))
DO CASE
CASE _WINDOWS OR _MAC
WAIT WINDOW 'STICKY is always ON in FoxProw'
CASE _DOS
SET STICKY OFF
OTHERWISE
ENDCASE
SET MARK OF BAR bar( ) OF enviro TO .F.
ELSE
DO CASE
CASE _WINDOWS OR _MAC
WAIT WINDOW 'STICKY is always ON in FoxProw'
CASE _DOS
SET STICKY ON
OTHERWISE
ENDCASE
   	SET MARK OF BAR bar( ) OF enviro TO .T.
ENDIF
ENDCASE


CNTBAR( ) SeeAlso
See Also

ACTIVATE POPUP Command

CNTPAD( ) Function

CREATE MENU Command

DEFINE BAR Command

DEFINE POPUP Command

GETBAR( ) Function

MRKBAR( ) Function

ON BAR Command

ON SELECTION BAR Command

PRMBAR( ) Function


CNTPAD( ) Function

See Also	Example

Returns the number of pads on a user-defined menu bar or the FoxPro system menu bar.

Syntax

CNTPAD(<expC>)

Returns

Numeric

Parameter

<expC>

Specify the name of the menu with <expC>.


CNTPAD( ) Example

The following line of code uses CNTPAD( ) to count the number of pads in the FoxPro system menu bar.

?CNTPAD('_MSYSMENU')


CNTPAD() SeeAlso
See Also

ACTIVATE MENU Command

CNTBAR( ) Function

CREATE MENU Command

DEFINE PAD Command

DEFINE MENU Command

GETPAD( ) Function

MRKPAD( ) Function

ON PAD Command

ON SELECTION PAD Command

PRMPAD( ) Function


COL( ) Function

See Also	Example

Returns the current column position of the cursor.

Syntax

COL( )

Returns

Numeric

Remarks

COL( ) is especially useful for directing screen output to a column position relative to the current column position of the cursor.

The special operator $ can be used in place of COL( ).


COL( ) Example

@ 5,5 SAY ''
@ ROW(), COL()+12 SAY 'Contact person'
@ ROW(), $+12 SAY 'Contact person'


COL() SeeAlso
See Also

PCOL( ) Function

PROW( ) Function

ROW( ) Function

WCOLS( ) Function

WROWS( ) Function


COMPILE Command

See Also

Compiles one or more files and creates an object file for each source file.

Syntax

COMPILE <file> | <skel>
[AS <expN>]
[ENCRYPT]
[NODEBUG]

Remarks

FoxPro executes only object files, so if the source file hasn't been compiled the file is automatically compiled when you run the program.

The source file remains unchanged.  A separate compiled file is created with the same root name as the source file, but with a different extension.  This table lists the source and compiled file extensions for each file type:

File Type	Source Extension	Compiled Extension
Program file	PRG	FXP
Screen code	SPR	SPX
Menu code	MPR	MPX
Query	QPR	QPX
Format	FMT	PRX
The compiler detects any syntax errors in the source file.  Compilation error messages are saved to a text file if SET LOGERRORS is ON when a file is compiled.  The error log file has the same root name as the compiled file and an .ERR extension.  If SET LOGERRORS is OFF, the error log file isn't created.

Clauses

<file> | <skel>

You can compile a single file <file>, or a set of files that match a file skeleton <skel> that contains wildcard characters.  For example, to compile all program files with the extension .PRG in the current directory, issue COMPILE *.PRG.

You can also compile program files by choosing Compile ... from  the Program menu.  For more information on compiling program files, refer to the Program Menu chapter in the FoxPro User's Guide.

AS <expN>

Include AS <expN> to compile a program for a specific code page. Specify the code page with <expN>. See the International and Cross-Platform Features topic for a listing of code pages and international considerations.

The compilation code page you specify with this clause overrides the global compilation code page specified with SET CPCOMPILE.

ENCRYPT

Including ENCRYPT encrypts your compiled FoxPro programs.  This prevents any access to your original source programs.  For additional source code protection, users of the FoxPro Distribution Kit should always include this option when compiling programs intended for distribution.

NODEBUG

Include NODEBUG to reduce the size of your compiled file by two bytes per source file line.  These two bytes in the compiled file are a reference to the corresponding line in the source file.  Removing these two bytes doesn't affect the program's performance, but it does reduce your compiled file size, and conserves disk space.

When you include the NODEBUG clause, you can neither view a program's execution in the Trace window nor use MESSAGE(1) to return the source code for a line that causes an error.


COMPILE SeeAlso
See Also

BUILD APP Command

BUILD PROJECT Command

MODIFY COMMAND Command

MODIFY PROJECT Command

SET CPCOMPILE Command

SET LOGERRORS Command


CONTINUE Command

See Also	Example

Continues the previous LOCATE.

Syntax

CONTINUE

Remarks

CONTINUE is used after LOCATE succeeds in finding a record, to continue the LOCATE operation.  CONTINUE moves the record pointer to the next record for which the logical expression specified in the previous LOCATE evaluates to true (.T).

You can continue LOCATE interactively by choosing Continue from the Record menu or by pressing Ctrl+K.

CONTINUE can be repeated until the end of the file is encountered, or until the end of the scope you specified with LOCATE is reached.

If CONTINUE succeeds in finding a record, RECNO( ) returns the record number of the record, FOUND( ) returns a value of true (.T.) and EOF( ) returns a value of false (.F.).

If CONTINUE doesn't succeed in finding a record, RECNO( ) returns the number of records in the table plus one, FOUND( ) returns the value false (.F.) and EOF( ) returns the value true (.T.).


CONTINUE Example

In this example, all customers from New York are counted and the total is displayed.  All records are found using one LOCATE command followed by CONTINUE commands.

CLOSE DATABASES
SET TALK OFF
USE customer
STORE 0 TO mcount
LOCATE FOR ALLTRIM(UPPER(state)) = 'NY'

DO WHILE FOUND()
mcount = mcount + 1
CONTINUE
ENDDO

? 'Total customers from New York state: '+ LTRIM(STR(mcount))


CONTINUE SeeAlso
See Also

EOF( ) Function

FOUND( ) Function

LOCATE Command

SEEK Command


COPY FILE Command

See Also

Duplicates any type of file.

Syntax

COPY FILE <file1> TO <file2>

Remarks

COPY FILE creates an exact duplicate of the file whose name is specified in <file1>.  You can use COPY FILE to copy any type of file.  The file to be copied cannot be open.  You must include the extensions for both the source file name <file1> and destination file name <file2>.

If you use COPY FILE to create a backup of a table that has a memo field and/or structural index, be sure to copy the .FPT and .CDX files also.


COPY FILE SeeAlso
See Also

DELETE FILE Command

FILER Command

RENAME Command


COPY INDEXES Command

See Also

Copies single-entry index files to a compound index file.

Syntax

COPY INDEXES <index file list> | ALL
[TO <cdx file>]

Remarks

A compound index file is an index file containing any number of separate index entries called tags.  Each tag is identified by its unique tag name.  The default extension for a compound index file is .CDX, and the default extension for a single-entry index file is .IDX.

You must first open the table and single-entry index files before using COPY INDEXES.  By default, the new tags are added to the structural compound index file, which is automatically opened when the table is opened.  If a structural compound index file doesn't exist for the table, COPY INDEXES creates one.

Clauses

<index file list>

The single-entry index file names in the <index file list> must be separated from each other by a comma.  For each index file in the index file list, COPY INDEXES creates a tag with the same index expression as the associated index file.  The name assigned to each tag is the root name of the corresponding single-entry index file name.  If you try to copy an index file that has the same name as an existing tag, a dialog is displayed (if SAFETY is ON) asking if you would like to overwrite the tag.

You can create a single-entry index file from a tag with COPY TAG.

ALL

If you include ALL instead of a specific index file list, all open single-entry index files are added to the compound index file.

TO <cdx file>

Include TO <cdx file> to add tags to a compound index file other than the structural compound index file.  Specify the name of the compound index file in <cdx file>.  If a compound index file with the specified name doesn't exist, it is automatically created.  The default file name extension for the compound file is .CDX.


COPY INDEXES SeeAlso
See Also

CDX( ) Function

COPY TAG Command

DELETE TAG Command

INDEX Command

TAG( ) Function

USE Command


COPY MEMO Command

See Also	Example

Copies the contents of the specified memo field in the current record to a text file.

Syntax

COPY MEMO <memo field> TO <file>
[ADDITIVE]

Clauses

<memo field> TO <file>

<memo field> specifies  the name of the memo field to be copied, and <file> specifies the name of a new or existing text file.  If you do not provide an extension in <file>, a .TXT extension is assigned.  You can also include a path with the file name.

ADDITIVE

If you include the ADDITIVE clause, the contents of the memo field is appended to the end of the text file. If you do not include ADDITIVE, the memo field contents replaces the contents of the text file.


COPY MEMO Example

In this example, the contents of the memo field named NOTES are copied to a file called TEST.TXT.  The memo field is then copied again and appended to the end of the text file.

CLOSE DATABASES
USE salesman
COPY MEMO notes TO test.txt

WAIT WINDOW 'Memo contents now in test.txt' NOWAIT
MODIFY FILE test.txt
COPY MEMO notes TO test.txt ADDITIVE

WAIT WINDOW 'Memo contents added again to test.txt' NOWAIT
MODIFY FILE test.txt
DELETE FILE test.txt


COPY MEMO SeeAlso
See Also

APPEND MEMO Command

COPY FILE Command

COPY TO Command

MODIFY MEMO Command


COPY STRUCTURE Command

See Also	Example

Copies the structure of the current table to a new table.

Syntax

COPY STRUCTURE TO <file>
[FIELDS <field list> | FIELDS LIKE <skel> | FIELDS EXCEPT <skel>]
[[WITH] CDX | [WITH] PRODUCTION]

Remarks

COPY STRUCTURE creates an empty table named <file> with the same structure as the current table.

Clauses

FIELDS <field list>

If the FIELDS <field list> clause is included, only the fields whose names are specified in the <field list> are copied to the new table.  If the FIELDS <field list> clause is omitted, all fields are copied  to the new table.

FIELDS LIKE <skel> | FIELDS EXCEPT <skel>

You can selectively copy fields to the new table by including the LIKE or EXCEPT clause or both. If you include LIKE <skel>, FoxPro copy fields that match <skel> to the new table. If you include EXCEPT <skel>, FoxPro copies all fields except those that match <skel> to the new table.

The skeleton <skel> supports wildcard characters.  For example, to copy all fields that begin with the letters A and P to the new table, use:

COPY STRUCTURE TO mytable FIELDS LIKE A*,P*

The LIKE clause can be combined with the EXCEPT clause:

COPY STRUCTURE TO mytable FIELDS LIKE A*,P* EXCEPT PARTNO*

[WITH] CDX | [WITH] PRODUCTION

If the original table has a structural index file, you can create a structural index file for the new table.  Include CDX or PRODUCTION to create an identical structural index file for the new table.  The tags and index expressions from the original structural index file are copied to the new structural index file.  The CDX and PRODUCTION clauses have the same effect.


COPY STRUCTURE Example

In this example, the CUSTOMER table is opened, its structure is copied to a table called BACKUP and BACKUP is opened.  APPEND FROM then appends records to the BACKUP table from the CUSTOMER table and browses the BACKUP table.

CLOSE DATABASES
USE customer
COPY STRUCTURE TO backup
USE backup
APPEND FROM customer FOR state = 'OH'
BROWSE FIELDS state, company
USE
DELETE FILE backup.dbf


COPY STRUCTURE SeeAlso
See Also

COPY STRUCTURE EXTENDED Command

CREATE Command

DISPLAY STRUCTURE Command


COPY STRUCTURE EXTENDED Command

See Also	Example

Copies the structure of the current table to records in a new table.

Syntax

COPY STRUCTURE EXTENDED TO <file>
[FIELDS <field list> | FIELDS LIKE <skel> | FIELDS EXCEPT <skel>]

Remarks

Information about each field in the current table is copied to one record in the new table with this command.  The structure of the new table is fixed in format and consists of four fields.  The names of the four fields and their contents are:

Field	Contents
FIELD_NAME	Field names from selected table
FIELD_TYPE	C = Character N = Numeric F = Float D = Date L = Logical M = Memo G = General P = Picture
FIELD_LEN	Width of Field
FIELD_DEC	Number of decimal places in numeric fields
You can modify the newly created table and then use CREATE FROM to create a new table that has the new structure.

Clause

FIELDS <field list>

If FIELDS <field list> is included, only the fields specified in the list have a record in the new table.  If a field list is omitted, all fields have a record in the new table.

FIELDS LIKE <skel> | FIELDS EXCEPT <skel>

You can selectively create records for fields by including the LIKE or EXCEPT clause or both. If you include LIKE <skel>, FoxPro creates records in the new table for all fields that match <skel>. If you include EXCEPT <skel>, FoxPro creates records in the new table for all fields except those that match <skel>.

The skeleton <skel> supports wildcard characters. For example, to create records in the new table for all fields that begin with the letters A and P, use:

COPY STRUCTURE EXTENDED TO mytable FIELDS LIKE A*,P*

The LIKE clause can be combined with the EXCEPT clause:

COPY STRUCTURE EXTENDED TO mytable FIELDS LIKE A*,P* EXCEPT PARTNO*


COPY STRUCTURE EXTENDED Example

The following example displays the structure of the INVOICES table, copies the structure extended to a TEMP table, browses TEMP, creates a BACKUP table from TEMP, and displays the structure of BACKUP.

CLOSE DATABASES
CLEAR

USE invoices
DISPLAY STRUCTURE
WAIT WINDOW 'Structure of the invoices table' NOWAIT
COPY STRUCTURE EXTENDED TO temp

USE temp
WAIT WINDOW 'The temp table - 1 row per field in invoices' NOWAIT
BROWSE

CREATE backup FROM temp
USE backup
DISPLAY STRUCTURE
WAIT WINDOW 'Backup.dbf has the same structure as invoices' NOWAIT
USE
DELETE FILE temp.dbf
DELETE FILE backup.dbf


COPY STRUCTURE EXTENDED SeeAlso
See Also

CREATE FROM Command


COPY TAG Command

See Also

Creates a single-entry index file from a tag in a compound index file.

Syntax

COPY TAG <tag name>
[OF <cdx file>]
TO <index file>

Remarks

A compound index (.CDX ) file is a single-entry index file that consists of any number of separate tags.  Each tag represents one index, and is identified by a unique tag name.  A compound index f

ile lets you have a large number of "indexes" available with only one index file open.

With COPY TAGS you can copy a tag from a compound index file to create a new single-entry (.IDX) index file.  The compound index file from which you copy a tag must be open.  If you are copying a tag from a structural compound index file (a file with the same root name as the associated table), the structural compound index file is opened automatically when you open its table.

Additional compound index files can be opened with USE ... INDEX or SET INDEX.  For more information on compound index files, see INDEX.

Single-entry (.IDX) index files can be added as tags to compound index files with COPY INDEX.

Clauses

<tag name>

The <tag name> is a unique name that identifies a tag (index entry) in a compound index file.  Use TAG( ) to obtain a tag name.

OF <cdx file>

If the OF <cdx file> clause isn't included, FoxPro looks first for the tag in the structural index file.  If it isn't found there, all other compound index files open for the current table are searched.  If duplicate tag names occur in open compound index files, include the OF <cdx file> clause to specify which compound index file contains the specified tag.

TO <index file>

The TO <index file> clause specifies the name of the single-entry file to create.


COPY TAG SeeAlso
See Also

CDX( ) Function

COPY INDEXES Command

DELETE TAG Command

INDEX Command

TAG( ) Function

USE Command


COPY TO Command

See Also	Example

Copies the contents of the current table to a new file.

Syntax

COPY TO <file>
[FIELDS <field list> | FIELDS LIKE <skel> | FIELDS EXCEPT <skel>]
[<scope>]
[FOR <expL1>]
[WHILE <expL2>]
[[WITH] CDX] | [[WITH] PRODUCTION]
[NOOPTIMIZE]
[[TYPE] [FOXPLUS | DIF | MOD | SDF | SYLK| WK1 | WKS | WR1 | WRK | XLS |
DELIMITED [WITH <delimiter> WITH BLANK | WITH TAB]]]

Remarks

If an index order is set, records are copied in master index order.

Clauses

<file>

The name of the new file to which COPY TO copies data is specified with <file>.  If you do not include an extension with the file name, the default extension for the specified file type is assigned.  If you do not specify a file type, COPY TO creates a new table and assigns the table file name the default extension .DBF.

FIELDS <field list>

If you include FIELDS and a field list, you can specify which fields are copied to the new file.  If the FIELDS clause is omitted, all fields are copied to the file.  If the file you are creating is not a database, memo fields aren't copied to the new file even if memo field names are included in the field list.

FIELDS LIKE <skel> | FIELDS EXCEPT <skel>

You can selectively copy fields to the new file by including the LIKE or EXCEPT clause or both. If you include LIKE <skel>, FoxPro copies fields that match <skel> to the new file. If you include EXCEPT <skel>, FoxPro copies all fields except those that match <skel> to the new file.

The skeleton <skel> supports wildcard characters.  For example, to copy all fields that begin with the letters A and P to the new file, use:

COPY TO myfile FIELDS LIKE A*,P*

The LIKE clause can be combined with the EXCEPT clause:

COPY TO myfile FIELDS LIKE A*,P* EXCEPT PARTNO*

<scope>

The scope clauses are:  ALL, NEXT <expN>, RECORD <expN>, and REST.  These are explained in the Overview of the FoxPro Language chapter in the FoxPro Language Reference.  Commands which include <scope> operate only on the table in the active work area.

You can specify a scope of records copied to a file.  Only the records that fall within the range of records specified by the scope are copied.

The default scope for COPY TO is ALL records.

FOR <expL1>

If the FOR <expL1> clause is included, only the records for which the logical condition <expL1> evaluates to true (.T.) are copied to the file.  Include FOR <expL1> to conditionally copy records, filtering out undesired records.

Rushmore optimizes COPY TO with a FOR <expL1> clause if <expL1> is an optimizable expression.  For best performance, use an optimizable expression in the FOR <expL1> clause.  A discussion of Rushmore optimizable expressions appears in the Optimizing Your Application chapter in the FoxPro Developer's Guide.

WHILE <expL2>

If WHILE <expL2> is included, records are copied as long as the logical expression <expL2> evaluates to true (.T.).

[WITH] CDX | [WITH] PRODUCTION

If the table you copy from has a structural index file, you can create a structural index file for the new table.  Including CDX or PRODUCTION creates an identical structural index file for the new table.  The tags and index expressions from the original structural index file are copied to the new structural index file.  The CDX and PRODUCTION clauses have the same effect.

Do not include CDX or PRODUCTION if you are copying to a file other than a new FoxPro table.

NOOPTIMIZE

Include NOOPTIMIZE to cause Rushmore to not optimize COPY TO.  For more information, see SET OPTIMIZE or consult the discussion of Rushmore optimization in the Optimizing Your Application chapter in the FoxPro Developer's Guide.

TYPE

If the file you are creating isn't a FoxPro table, you must specify its file type.  Although you must specify a file type, you need not include the key word TYPE.  You can create a wide variety of different file types including DELIMITED ASCII text files in which you can specify a field delimiter.

FOXPLUS

FoxPro memo files have a different structure than FoxBASE+ memo files.  If your source FoxPro table contains a memo field, include the FOXPLUS clause to create a table that can be used in FoxBASE+.  The FoxPro memo field cannot contain binary data because FoxBASE+ does not support binary data in memo fields.

DIF

Use DIF to create a .DIF (Data Interchange Format) file, used by VisiCalc.  Fields from the FoxPro table become vectors (columns) and records become tuples (rows).  The new file name is assigned a .DIF extension if you do not include an extension in <file>.

MOD

A FoxPro table can be copied to a new file in Microsoft Multiplan version 4.01 MOD format.  The new Microsoft Multiplan file name is assigned a .MOD extension if an extension isn't included.

SDF

An SDF (System Data Format) file is an ASCII text file in which records have a fixed length and end with a carriage return and line feed.  Fields aren't delimited.  The SDF file name is assigned a .TXT file extension if you do not include an extension.

SYLK

A SYLK file is a Symbolic Link interchange format (used in Microsoft MultiPlan) in which fields from the FoxPro table become columns in the spreadsheet and records become rows.  SYLK file names have no extension.

WK1

Data from a FoxPro table can be copied to a new Lotus 1-2-3 spreadsheet by including the WK1 clause.  Each field from the selected table becomes a column in the spreadsheet; each table record becomes a row in the spreadsheet.  A .WK1 file name extension is assigned to the new spreadsheet for use in Lotus 1-2-3 revision 2.x.

WKS

A FoxPro table can be copied to a new Lotus 1-2-3 spreadsheet with the WKS clause.  Each field from the current table becomes a column in the spreadsheet and the each record becomes a row in the spreadsheet.  A .WKS file name extension is assigned to the new spreadsheet for use in Lotus 1-2-3 revision 1-A.

WR1

A FoxPro table can be copied to a new Lotus Symphony spreadsheet with this the WR1 clause.  Each field from the current table becomes a column in the spreadsheet and the each record becomes a row in the spreadsheet.  A .WR1 file name extension is assigned to the new spreadsheet for use in Symphony version 1.1 or 1.2.

WRK

A table can be copied to a new Lotus Symphony spreadsheet with the WRK clause.  Each field from the current table becomes a column in the spreadsheet, and each record becomes a row in the spreadsheet.  A .WR1 file name extension is assigned to the new spreadsheet for use in Lotus Symphony version 1.0.

XLS

The data in a FoxPro table can be copied to a Microsoft Excel version 2 spreadsheet by including the XLS clause.  Each field from the current table becomes a column in the spreadsheet and each record becomes a row in the spreadsheet.  An .XLS extension is assigned to the newly created spreadsheet if you do not include a file extension.

DELIMITED [WITH <delimiter> | WITH BLANK | WITH TAB]

A DELIMITED file is an ASCII text file in which each record ends with a carriage return and line feed.  The default field separator is a comma.  Since character data may include commas, character fields are additionally delimited with double quotation marks.

In the following example there are 2 character fields ("Smith" and "TELEPHONE") delimited with double quotation marks.  There is one numeric field which is not delimited since numeric data does not contain commas.  The 3 fields are separated with commas.

"Smith", 9999999, "TELEPHONE"

The DELIMITED WITH <delimiter> option can be used to replace the double quotation marks with one of your choice.

The comma is not truly a delimiter.  However, the DELIMITED WITH BLANK or DELIMITED WITH TAB clauses allow you to replace the comma field separator with either a space or a tab.  The data should not contain embedded spaces or tabs.

You cannot combine the WITH <delimiter> clause with either the WITH BLANK or WITH TAB clauses.

Unless you specify otherwise, a .TXT extension is assigned to all newly created DELIMITED files.


COPY TO Example

In this example, CUSTOMER.DBF is opened and the next three records are copied to a new DELIMITED data file called TEMP.TXT.

CLOSE DATABASES
USE customer
COPY NEXT 3 TO temp TYPE DELIMITED
WAIT WINDOW 'This is the delimited text file' NOWAIT
MODIFY FILE temp.txt
DELETE FILE temp.txt


COPY TO SeeAlso
See Also

APPEND FROM Command

COPY FILE Command

IMPORT Command

EXPORT Command


COPY TO ARRAY Command

See Also	Example

Copies data from the current table to an array.

Syntax

COPY TO ARRAY <array>
[FIELDS <field list> | FIELDS LIKE <skel> | FIELDS EXCEPT <skel>]
[<scope>]
[FOR <expL1>]
[WHILE <expL2>]
[NOOPTIMIZE]

Remarks

COPY TO ARRAY and SCATTER are similar.  COPY TO ARRAY copies multiple records to an array while SCATTER copies just one record into an array or a set of memory variables.  Both COPY TO ARRAY and  SCATTER create a new array if an array with the name you specify doesn't exist.

To copy a single record to an array you can use a one-dimensional array.  The one-dimensional array should have the same number of elements as fields in the table not counting memo fields.  Memo fields are ignored in COPY TO ARRAY.

In a one-dimensional array, the first field of a record is stored to the first element of the array, the second field is stored to the second element of the array and so on.  If the one-dimensional array has more elements than the table has fields, any remaining elements remain unchanged.  If the array has fewer elements than the table has fields, any remaining fields are ignored.

To copy multiple records or an entire table to an array, use a two-dimensional array.  The first subscript in the array (array rows) is the number of records the array can hold, the second subscript (array columns) is the number of fields the array can hold.

Each record is stored in one row of the array, and each field of the record is stored in one column of the array.  For each record, the first field is stored to the first column of the array, the second field is stored to the second column of the array and so on.  If the array has more columns than the table has fields, any remaining columns aren't changed.  If the array has fewer columns than the table has fields, any remaining fields aren't stored to the array.

Each successive row in the array is filled with the contents of the next record in the table.  If the array has more rows than the table has records, any remaining rows aren't changed.  If the array has fewer rows than the table has records, any remaining records aren't stored to the array.

Data can be copied from arrays to table records with APPEND FROM ARRAY.  Data can also be copied from either an array or memory variables to a table with GATHER.

Clauses

<array>

The array to which data is copied.

FIELDS <field list>

If FIELDS <field list> is included, only the fields specified in the list are stored to the array.  If the FIELDS <field list> clause is omitted, all fields are stored to the array if the array has enough columns.

FIELDS LIKE <skel> | FIELDS EXCEPT <skel>

You can selectively store fields to an array by including the LIKE or EXCEPT clause or both. If you include LIKE <skel>, FoxPro stores fields that match <skel> to the array. If you include EXCEPT <skel>, FoxPro copies all fields except those that match <skel> to the array.

The skeleton <skel> supports wildcard characters.  For example, to store all fields that begin with the letters A and P to the array, use:

COPY TO ARRAY myarray FIELDS LIKE A*,P*

The LIKE clause can be combined with the EXCEPT clause:

COPY TO ARRAY myarray FIELDS LIKE A*,P* EXCEPT PARTNO*

<scope>

The scope clauses are:  ALL, NEXT <expN>, RECORD <expN>, and REST.  These are explained in the Overview of the FoxPro Language chapter in the FoxPro Language Reference.  Commands which include <scope> operate only on the table in the active work area.

You can specify a scope of records copied to the array.  Only the records that fall within the range of records specified by the scope are copied.

The default scope for COPY TO ARRAY is ALL records.

FOR <expL1>

If the FOR <expL1> clause is included, only the records that satisfy the logical condition <expL1> are copied to the array.  Including FOR lets you conditionally copy records to the array, filtering out undesired records.

Rushmore optimizes a COPY TO ARRAY query that includes FOR <expL1> if <expL1> is an optimizable expression.  For best performance, use an optimizable expression in the FOR clause.  A discussion of Rushmore optimizable expressions appears in the Optimizing Your Application chapter in the FoxPro Developer's Guide.

WHILE <expL2>

If the WHILE <expL2> clause is included, records are copied to the array as long as the logical expression <expL2> evaluates to true (.T.).

NOOPTIMIZE

To cause Rushmore to not optimize COPY TO ARRAY, include NOOPTIMIZE.  For more information, see SET OPTIMIZE or consult the discussion of Rushmore optimization in the Optimizing Your Application chapter in the FoxPro Developer's Guide.


COPY TO ARRAY Example

In this example, the CUSTOMER table is opened.  A two-dimensional array is then created and the first three records from CUSTOMER are copied to the array.  DISPLAY MEMORY shows the data stored in the array.

CLOSE DATABASES
USE customer
DIMENSION temp(3,10)
COPY NEXT 3 TO ARRAY temp
DISPLAY MEMORY LIKE temp


COPY TO ARRAY SeeAlso
See Also

APPEND FROM ARRAY Command

DECLARE Command

DIMENSION Command

GATHER Command

PUBLIC Command

REPLACE FROM ARRAY Command

SCATTER Command

STORE Command


COS( ) Function

See Also	Example

Returns the cosine of a numeric expression.

Syntax

COS(<expN>)

Returns

Cosine

Remarks

COS( ) returns the cosine of <expN>.

Clauses

<expN>

<expN> can be any value, and the value returned by COS( ) ranges between -1 and 1.

<expN> is given in radians. To convert an angle from degrees to radians, use DTOR( ).  The number of decimal places returned by COS( ) can be specified with SET DECIMALS.


COS( ) Example

? COS(0)

? COS(PI( ))

? COS(DTOR(180))

STORE PI( ) * 3 TO angle
? COS(angle)


COS() SeeAlso
See Also

ACOS( ) Function

DTOR( ) Function

RTOD( ) Function

SET DECIMALS Command

SIN( ) Function


COUNT Command

See Also	Example

Counts table records.

Syntax

COUNT
[<scope>]
[FOR <expL1>]
[WHILE <expL2>]
[TO <memvar>]
[NOOPTIMIZE]

Remarks

This command counts the records within a scope of records for which the FOR or WHILE conditions are true.  If SET TALK is ON, the record count is displayed in this form:

nnnnnn records

Records marked for deletion are included in the count if SET DELETE is OFF.

Clauses

<scope>

The scope clauses are:  ALL, NEXT <expN>, RECORD <expN>, and REST.  These are explained in the Overview of the FoxPro Language chapter in the FoxPro Language Reference.  Commands which include <scope> operate only on the table in the active work area.

You can specify a scope of records that are counted.  Only the records that fall within the range of records specified by the scope are counted.

The default scope for COUNT is ALL records.

FOR <expL1>

If you include the FOR clause, only the records that satisfy the logical condition <expL1> are counted.  Including FOR lets you conditionally count records, filtering out undesired records.

Rushmore will optimize a COUNT FOR query if <expL1> is an optimizable expression.  For best performance, use an optimizable expression in the FOR clause.  A discussion of Rushmore optimizable expressions appears in the Optimizing Your Application chapter in the FoxPro Developer's Guide.

WHILE <expL2>

If you include the WHILE clause, records are counted for as long as the logical expression <expL2> evaluates to true (.T.).

TO <memvar>

The number of records counted is stored to the memory variable or array element specified in <memvar>.  A memory variable is created, if it isn't defined.

NOOPTIMIZE

To disable Rushmore optimization of COUNT, include NOOPTIMIZE.  For more information, see SET OPTIMIZE or consult the discussion of Rushmore optimization in the Optimizing Your Application chapter in the FoxPro Developer's Guide.


COUNT Example

The following example counts and displays the number of customers in Seattle.

CLOSE DATABASES
USE customer
COUNT TO mcount FOR city = 'Seattle'
WAIT WINDOW 'Total customers from Seattle is '+ LTRIM(STR(mcount))


COUNT SeeAlso
See Also

CALCULATE Command

SET DELETED Command

SET TALK Command


CREATE Command

See Also

Builds a new FoxPro table.

Syntax

CREATE
[<file> | ?]

Remarks

Specify the name of the table to create in <file>.  If you don't specify a table name or if you include the question mark (?), a dialog is displayed so you can enter the name of the table to create.  You cannot create a table with the name of an MS-DOS device (CON, NUL, PRN, COM1 ...).  You should avoid using hyphens in a table name because hyphenated table names don't appear in the View window, and can cause confusion with the alias pointer (->).

A table is created by defining the name, type and size of each field.  Once the structure of the table is created, you can then add records to the table.

For more information on creating and modifying tables, see the Database Menu chapter in the FoxPro User's Guide.


CREATE SeeAlso
See Also

MODIFY STRUCTURE Command


? | ?? Commands

See Also	Example

Evaluates expressions and outputs the results.

Syntax

? | ?? <expr1>
[PICTURE <expC1>] | [FUNCTION <expC2>]
[AT <expN1>]
[FONT <expC3> [, <expN2>] [STYLE <expC4> | <expr2>]]
[, <expr3>] ...

Remarks

? and ?? evaluate expressions and send the results to the desktop in FoxPro for MS-DOS, the main FoxPro window in FoxPro for Windows, an active user-defined window, or the printer.

If SET PRINTER is ON, the expression results are directed to the printer and the desktop, the main FoxPro window or an active user-defined window.  If SET PRINTER is ON and SET CONSOLE is OFF, the results are only directed to the printer.

?

A single question mark sends a carriage return and line feed before the expression results.  The results are displayed on the next line of the desktop, main FoxPro window or the active user-defined window and printed at the left margin of a page unless a function code <expC2> or the _ALIGNMENT system memory variable specifies otherwise.

If the expressions are omitted, a blank line is printed.  A space is placed between the expression results when multiple expressions are included.

??

Two question marks display the expression results on the current line at the current position of the desktop, main FoxPro window or an active user-defined window or printer.  A carriage return and line feed isn't sent before the results.

Clauses

PICTURE <expC1>

If the PICTURE clause is present, the result of <expr1> is displayed according to the format specified by <expC1>.  <expC1> can consist of function codes, picture codes or a combination of both.

You can use the same picture and function codes available in @ ... SAY.  For a list of those codes, see @ ... SAY.

Function codes affect the overall format of the result; picture codes act on individual characters in the result.  If function codes are used in <expC1>, they must appear before the picture codes and they must be preceded by @.  Multiple function codes with no embedded spaces can immediately follow @.  The last function code must be followed by one or more spaces.  The space(s) signals the end of the function codes and the start of the picture codes.

FUNCTION <expC2>

The FUNCTION character expression <expC2> offers another method of including function codes in ? and ?? output.  If the function clause is included, the function codes are not preceded by @.  Function codes must be preceded by @ when included in PICTURE.

V<n>

V<n> is a special function code that can be used with ? and ??.  This code enables the results of a character expression to stretch vertically in a limited number of columns.  <n> is the number of columns in the output.

? 'This is an example of how the V(n) function works.' ;
FUNCTION 'V10'

AT <expN1>

AT is used to specify the column number <expN1> where the output is displayed.  This option lets you align output in columns to create a table.  The numeric expression <expN1> can be a UDF that returns a numeric value.

FONT <expC3>[, <expN2>]

The character expression <expC3> is the name of the font, and the numeric expression <expN2> is the font size.  For example, the following command displays the system date in 16-point Courier font:

? DATE( ) FONT 'Courier',16

If you include the FONT clause but omit the font size <expN2>, a 10 point font is used.

If the FONT clause is omitted and ? | ?? output is placed in the main FoxPro window, the main FoxPro window font is used for the output.  If the FONT clause is omitted and ? | ?? output is placed in a user-defined window, the user-defined window font is used for the output.

In FoxPro for MS-DOS, the FONT clause is ignored.

In FoxPro for Windows, if the font you specify is not available, a font with similar font characteristics is substituted.

In FoxPro for Macintosh, if the font you specify is not available, the Chicago font is used.

STYLE <expC4> | <expr2>

In FoxPro for Windows and FoxPro for Macintosh, include the STYLE clause to specify a font style for ? | ?? output.

In FoxPro for Windows, if the font style you specify is not available, Windows substitutes a font style with similar characteristics.

In FoxPro for Macintosh, if the font you specify is not available, the normal font style is used.

Note   You must include the FONT clause when you specify a font style with the STYLE clause.

The font style is specified with <expC4>.  If the STYLE clause is omitted, the normal font style is used.

Character	Font Style

B	Bold

C	Condense*

E	Extend*

I	Italic

N	Normal

O	Outline

Q	Opaque

S	Shadow

-	Strikeout*

T	Transparent

U	Underline

*The Condense and Extend styles are only available in FoxPro for Macintosh. The Strikeout style is only available in FoxPro for Windows.

You can include more than one character to specify a combination of font styles.  For example, the following command displays the system date in Bold Italic:

? DATE( ) STYLE 'BI'

In FoxPro for MS-DOS, the STYLE clause lets you specify the font style and size of output sent to the printer with ? and ??.  The expression <expr2> included in a STYLE clause is sent to three procedures, PDOBJST, PDOBJECT and PDOBJEND, in the current FoxPro printer driver program.  These procedures determine how output from ? and ?? are printed.  The STYLE clause is ignored when output from ? and ?? is sent to the desktop or a user-defined window.


? | ?? Example

? 15* (10+10)

? 'Welcome to ' PICTURE '@!'
?? 'FoxPro'


? | ?? See Also
See Also

??? Command

@ ... SAY Command

SET MEMOWIDTH Command

SET PRINTER Command


??? Command

See Also

Sends output directly to the printer.

Syntax

??? <expC>

Remarks

Three question marks direct the contents of <expC> directly to the printer without incrementing the printer column or row.  ??? allows you to send printer control codes directly to a printer without advancing the print head.

Printer control codes allow you to reset the printer, change type styles and sizes, and enable or disable boldface printing.  These codes can consist of any combination of printable or non-printable characters that are specific to the printer you're using.  You can direct control codes to the printer in several different ways:

Use CHR( ) to send ASCII characters directly to the printer.

Use braces { } to send printer codes or ASCII characters.

Use a combination of CHR( ) and braces.

Codes can be sent to the printer before printing begins and after printing ends with the _PSCODE and _PECODE system memory variables.  For more information, see _PSCODE and _PECODE.

Printer control codes vary from printer to printer.  The best source for information on printer control codes is the manual which accompanied your printer.


??? Command See Also
See Also

? | ?? Commands

@ ... SAY Command

@ ... GET Command

CHR( ) Function


@ ... SAY Command

See Also

Displays output at a specified row and column position.

Syntax

@ <row, column> SAY <expr>
[FUNCTION <expC1>]
[PICTURE <expC2>]
[SIZE <expN1>, <expN2>]
[FONT <expC3>[, <expN3]]
[STYLE <expC4>]
[COLOR SCHEME <expN4> | COLOR <color pair list>]

Remarks

Use this command to display formatted output on the desktop in FoxPro for MS-DOS, the main FoxPro window in FoxPro for Windows or a user-defined window.  It can also be used to format output for a printer.

If you use the Screen Builder to create your data entry screens, you may not have to use @ ... SAY at all.  The Screen Builder automatically generates the @ ... SAY commands.

You can combine @ ... SAY and @ ... GET into a single command.  If both the SAY and GET clauses are included, specify a single set of coordinates <row, column> where @ ... SAY output begins.  A space is automatically inserted between the @ ... SAY output and the @ ... GET text editing region.

If you issue SET DEVICE TO SCREEN, output from @ ... SAY appears on the desktop, the main FoxPro window or an active user-defined window.  SET DEVICE TO SCREEN is the startup default.  If you issue SET DEVICE TO PRINTER, output is directed to the printer.

Clauses

<row, column>

Row and column are numeric expressions with values 0 or greater that determine where @ ... SAY output appears.

The first row is number 0 on the desktop, main FoxPro window or a user-defined window.  In FoxPro for MS-DOS, row 0 is the row the FoxPro system menu bar occupies.  See SET SYSMENU for information about manipulating the system menu bar so you can place output on row 0. In FoxPro for Macintosh, row 0 is the row immediately under the FoxPro title bar. In FoxPro for Windows, row 0 is the row immediately under the FoxPro system menu bar.

Rows are numbered from top to bottom.  For printers, the first row is 1 and the physical page size and the number of lines per page determines the maximum row number.

The first column is number 0 on the desktop, main FoxPro window or a user-defined window.  Columns are numbered from left to right.  For printers, the first column is 1 and the physical page size determines the maximum column number.

When @ ... SAY output is directed to a user-defined window, the row and column coordinates are relative to the user-defined window, not the desktop in FoxPro for MS-DOS or the main FoxPro window in FoxPro for Windows.

In FoxPro for Windows and FoxPro for Macintosh, a position in the main FoxPro window or in a user-defined window is determined by the font of the main FoxPro window or the user-defined window.  Most fonts can be displayed in a wide variety of sizes, and some are proportionally spaced.  A row corresponds to the height of the current font; a column corresponds to the average width of a letter in the current font.  For more information, see Fonts.

In FoxPro for Windows and FoxPro for Macintosh, you can position @ ... SAY output in a window with decimal fractions for row and column coordinates.In FoxPro for MS-DOS, decimal fractions used for row and column coordinates are rounded to the nearest integer value.

<expr>

<expr> is evaluated and displayed or printed starting at <row, column>.  It can be a user-defined function (UDF).

FUNCTION <expC1> | PICTURE <expC2>

You can include the FUNCTION clause, the PICTURE clause or both to control how <expr> is displayed or printed.

FUNCTION codes can be included in a PICTURE clause.  In this case, the PICTURE clause must start with @.  Also, a PICTURE clause can contain FUNCTION codes, PICTURE codes or both.  Since a FUNCTION clause affects the entire expression it can contain only FUNCTION codes.

FUNCTION
Code	Purpose

B	Left-justifies numeric data within the display region.

C	CR is displayed after a positive number to indicate a credit.  Can be used with numeric data only.

D	Uses the current SET DATE format.

E	Edits date type data as a BRITISH date.

T	Trim leading and trailing blanks from <expr>.

X	DB is displayed after negative numbers to indicate a debit.  Use only with numeric data.

Z	<expr> is displayed as all blanks if its numeric value is 0.  Use only with numeric data.

(	Encloses negative numbers in parentheses.  Use only with numeric data.

!	Converts alphabetic characters to upper-case.  Use with character data only.

^ 	Displays numeric data using scientific notation.  Use with numeric data only.

$	Displays data in currency format.  The currency symbol appears before or after the field value depending on the current setting of SET CURRENCY.  Use with numeric data only.

A PICTURE expression can include any characters, but only the characters listed below actively participate in display and printing.

PICTURE
Code	Purpose

X	Allows any character.

Y	Allows logical Y, y, N and n only.  Converts y and n to Y and N, respectively.

!	Converts lower-case letters to upper-case letters.

$	Displays the current currency symbol specified by SET CURRENCY.  By default, the symbol is placed immediately before or after the field.  However, the currency symbol and its placement (SET CURRENCY), the separator character (SET SEPARATOR) and the decimal character (SET POINT) can all be changed.

*	Asterisks are displayed in front of the numeric value.  Use with a dollar sign $ for check protection.

.	A decimal point specifies the decimal point position.

,	A comma is used to separate digits to the left of the decimal point.

The following example combines two FUNCTION codes to format a numeric value.  The $$ codes create a floating dollar sign and the C code places CR after the number.

CLEAR
@ 2, 2 SAY 1.15 FUNCTION 'C$$'

SIZE <expN1>, <expN2>

The SIZE clause lets you control the length and height of a @ ... SAY display or print region.

FoxPro creates a region one row high by default.  Include the optional SIZE clause to create a region that is more than one row high.  The height of the region in rows is specified by <expN1>, and the width in columns by <expN2>.  The @ ... SAY output word wraps at the width specified by <expN1> for <expN2> rows.

In FoxPro for Windows and FoxPro for Macintosh, the @ ... SAY font determines the size of the editing-region. The @ ... SAY font is specified with the FONT clause.  If the FONT clause is omitted, the @ ... SAY output uses the font of its parent window (the main FoxPro window or a user-defined window).

FONT <expC3>[, <expN3>]

The character expression <expC3> is the name of the font, and the numeric expression <expN3> is the font size.  For example, the following command displays the @ ... SAY text in 16 point Roman font:

@ 2, 2 SAY 'Font clause example' FONT 'Courier', 16

If you include the FONT clause but omit the font size <expN3>, a 10 point font is used.

In FoxPro for Windows, if the font you specify is not available, a font with similar font characteristics is substituted.

In FoxPro for Macintosh, if the font you specify is not available, the Chicago font is used.

In FoxPro for MS-DOS, the FONT clause is ignored.

STYLE <expC4>

In FoxPro for Windows and FoxPro for Macintosh, include the STYLE clause to specify a font style for @ ... SAY output.

The font style is specified with <expC4>.  If the STYLE clause is omitted, the normal font style is used.

In FoxPro for Windows, if the font style you specify is not available, a font style with similar characteristics is substituted.

 In FoxPro for Macintosh, if the font you specify is not available, the normal font style is used.

The STYLE clause is ignored in FoxPro for MS-DOS.

Character	Font Style

B	Bold

C	Condense*

E	Extend*

I	Italic

N	Normal

O	Outline

Q	Opaque

S	Shadow

-	Strikeout*

T	Transparent

U	Underline

*The Condense and Extend styles are available only in FoxPro for Macintosh. The Strikeout style is available only in FoxPro for Windows.

You can include more than one character to specify a combination of font styles.  For example, the following command specifies Bold Italic:

@ 2, 2 SAY 'Font clause example' STYLE 'BI'

In FoxPro for Windows and FoxPro for Macintosh, a position in the main FoxPro window or in a user-defined window is determined by the font of the main FoxPro window or the user-defined window. Most font can be displayed in a wide variety of sizes, and some are proportionally spaced. A row corresponds to the height of the current font; a column corresponds to the average width of a letter in the current font.

Rows are numbered from top to bottom In FoxPro for Windows, row 0 is the row immediately under the FoxPro system menu bar. In FoxPro for Macintosh, row 0 is the row immediately under the FoxPro title bar. In FoxPro for MS-DOS, row 0 is the row the FoxPro system menu bar occupies. See SET SYSMENU for information about manipulating the system menu bar so you can place output on row The first column is number 0 in the main FoxPro window or a user-defined window. Columns are numbered from left to right.

When the @ ... GET editing-region is directed to a user-defined window, the row and column coordinates are relative to the user-defined window, not the main FoxPro window.

In FoxPro for Windows and FoxPro for Macintosh, a position in the main FoxPro window or in a user-defined window is determined by the font of the main FoxPro window or the user-defined window. Most font can be displayed in a wide variety of sizes, and some are proportionally spaced. A row corresponds to the height of the current font; a column corresponds to the average width of a letter in the current font. In FoxPro for Windows and FoxPro for Macintosh, you can position the @ ... GET editing-region in a window with decimal fractions for row and column coordinates In FoxPro for MS-DOS, decimal fractions used for row and column coordinates are rounded to the nearest integer value. The STYLE clause is ignored in FoxPro for MS-DOS.

A color scheme is a set of 10 predefined color pairs. The color pairs in a color scheme can be changed with SET COLOR OF SCHEME. In FoxPro for MS-DOS the color pairs in a color scheme can also be changed in the Color Picker.

A color pair is a set of two letters separated by a forward slash. The firsCOLOR SCHEME <expN4> | COLOR <color pair list>

If you do not include a COLOR clause, the color of @ ... SAY output is determined by the color scheme for the desktop or the main FoxPro window; if @ ... SAY output is directed to a user-defined window, the window's color scheme determines the color of @ ... SAY output.

Only the first color pair in a color scheme or color pair list affects the color of @ ... SAY output.

The color of @ ... SAY output can be specified by including the number of an existing color scheme in the COLOR SCHEME clause or a set of color pairs in the COLOR clause.

A color scheme is a set of 10 predefined color pairs.  The color pairs in a color scheme can be changed with SET COLOR OF SCHEME.  In FoxPro for MS-DOS the color pairs in a color scheme can also be changed in the Color Picker.

A color pair is a set of two letters separated by a forward slash.  The first color letter specifies the foreground color and the second letter specifies the background color.

For example, this color pair specifies a red foreground on a white background:

R/W

For a list of colors and their corresponding color letters, see SET COLOR Commands Overview or Color Table by Color Pair.

A color pair can also be specified with a set of 6 RGB (Red Green Blue) color values separated by commas.  The first 3 color values specify the foreground color and the second 3 color values specify the background color.  The color values can range from 0 through 255.

The R/W color pair in the example above can also be specified with this RGB color pair:

RGB(255,0,0,255,255,255)

For example:

@ 2, 2 SAY 'This is red on white' COLOR R/W
@ 4, 2 SAY 'This is Color Scheme 16' COLOR SCHEME 16
IF _WINDOWS	&& FoxPro for Windows.
@ 6, 2 SAY 'This is red on white' COLOR RGB(255,0,0,255,255,225)
ENDIF


@ ... SAY - BMPs & OLE ObjectsCommand See Also
See Also

@ ... GET Command

CREATE SCREEN Command

Fonts

SET COLOR Commands

SET CURRENCY Command

SET DEVICE Command

SHOW GETS Command

User-Defined Functions (UDFs)


@ ... SAY - BMPs & OLE Objects Commands

See Also

Displays .BMPs and OLE objects or calls the OLE server to execute the OLE object verb.

Syntax

@ <row, column> SAY <file> BITMAP | <general field>
[STYLE <expC1>]
[CENTER]
[ISOMETRIC | STRETCH]
[SIZE <expN1>, <expN2>]
[NOWAIT]

or

@ <row, column> SAY <general field>
VERB <expN3> | <expC2>

Remarks

@ ... SAY [image] BMPs & OLE Objects is supported in FoxPro for Windows and FoxPro for Macintosh only.

Use this command to display .BMPs (bitmap pictures) and OLE (Object Linking and Embedding) objects in the main FoxPro window or a user-defined window.  .BMPs and OLE objects can also be directed to the printer with @ ... SAY.

In FoxPro for Windows, you can use this command to display .BMPs (bitmap picture files).

In FoxPro for Macintosh, you can display PICT type picture files and .BMP bitmap files.

If you issue SET DEVICE TO SCREEN, output appears in the main FoxPro window or an active user-defined window.  SET DEVICE TO SCREEN is the startup default.  If you issue SET DEVICE TO PRINTER, output is directed to the printer.

The second syntax form for this command is used to call the OLE server to service a verb for an OLE object.  An OLE verb is a powerful tool for manipulating OLE objects.  Use the VERB clause to execute commands associated with the OLE object.  For example, you can start the application that created the OLE object, or edit or print an OLE object.

Tip   For additional information about OLE objects, see the Object Linking and Embedding chapter in the Developer's Guide.

Clauses

<row, column>

Row and column are numeric expressions with values 0 or greater that determine where a picture or OLE object appears.

The first row is number 0 in the main FoxPro window or a user-defined window. Rows are numbered from top to bottom. In FoxPro for Windows, row 0 is the row immediately under the FoxPro system menu bar. In FoxPro for Macintosh, row 0 is the row immediately under the FoxPro title bar. For printers, the first row is 1 and the physical page size and the number of lines per page determine the maximum row number.

The first column is number 0 in the main FoxPro window or a user-defined window. Columns are numbered from left to right. For printers, the first column is 1 and the physical page size determines the maximum column number.

When a picture or OLE object is directed to a user-defined window, the row and column coordinates are relative to the user-defined window, not the main FoxPro window.

In FoxPro for Windows and FoxPro for Macintosh, you can position a picture or OLE object in a window with decimal fractions for row and column coordinates.

<picture file> BITMAP | <general field>

The picture or OLE object specified with <picture file> or <general field> is displayed starting at the position specified by the row and column coordinates.  Pictures are stored in files on disk.  OLE objects are stored in fields of the general data type.

If you use the Screen Builder to create your data entry screens, you may not have to use this form of @ ... SAY at all.  The Screen Builder automatically generates the @ ... SAYs.

To display a picture in the main FoxPro window or in a user-defined window, specify the name of the file containing the picture in <file> and include BITMAP.  The BITMAP key word must follow <picture file>. The picture filename must be delimited with single or double quotation marks or square brackets.  If the picture filename is stored in a memory variable or an array element, you can include the memory variable or array element without the delimiters.

If the picture file resides in a directory or folder other than the current default directory or folder, include a path with the filename.

If you omit the extension for the picture file, FoxPro for Macintosh first looks for a picture file with the name you specified and a .BMP extension. If a picture file with a .BMP extension and the name you specified isn't found, FoxPro for Macintosh then looks for a file with the name you specified and a .PCT extension. If a picture file with a .PCT extension and the name you specified isn't found, FoxPro for Macintosh then looks for a picture file with the name you specified without an extension.

STYLE <expC1>

Include the STYLE clause to specify an opaque or transparent picture. If you include Q in <expC1>, an opaque picture is displayed [image] objects behind the opaque picture don't show through the picture. If you include T in <expC1>, a transparent picture is displayed [image] objects behind the picture show through the picture.

CENTER

Include the CENTER keyword to center a picture or OLE object within the area specified by the SIZE clause.  If the SIZE clause is omitted, the picture or OLE object is centered in the rectangular region bounded by the row and column coordinates and the lower-right corner of the main FoxPro window or user-defined window.

ISOMETRIC | STRETCH

If the area specified with the SIZE clause is too small to contain a picture or OLE object, the picture is clipped to fit in the area.  You can prevent a picture or OLE object from being clipped by including ISOMETRIC or STRETCH.

If ISOMETRIC is included, the picture or object is scaled so that its proportions are maintained.  The picture is shrunk or expanded to fit within the specified area and isn't distorted.

If STRETCH is included, the picture or object is scaled horizontally, vertically or in both directions to fit the picture or object within the area specified by the SIZE clause.  The picture or object's proportions are not maintained.

SIZE <expN1>, <expN2>

You can specify the size of a picture or OLE object with the SIZE clause.  If the SIZE clause is omitted, a picture or an OLE object is displayed at its default size.

The numeric expression <expN1> specifies the height of the picture or OLE object.  The height of the picture or OLE object is a multiple of the height of the font in the active window.  For example, if <expN1> is 2, the height of the picture or OLE object is twice the height of the font in the active window.

The numeric expression <expN2> specifies the width of the picture or OLE object.  The width of the picture or OLE object is a multiple of the width of the font in the active window.  For example, if <expN2> is 2, the width of the picture or OLE object is twice the width of the font in the active window.

If the area specified with the SIZE clause is too small to contain a picture or OLE object, the picture or object is clipped.  Include ISOMETRIC or STRETCH to prevent a picture from being clipped.

VERB <expN3> | <expC2>

Include the VERB clause to execute a command verb in the registration database for an OLE object.

Tip   In FoxPro for Windows, you can run REGEDIT /V to see what command verbs are available for each installed OLE server.  The command verbs and their corresponding numbers are displayed.

The command verb can be either a numeric expression <expN1> or a character expression <expC1>.  Command verb numbers start at 0.

For example, if the OLE object is an Word document and the first command verb (<expN1> = 0) is EDIT, issuing either

@ 2, 2 SAY worddoc VERB 2

or

@ 2, 2 SAY worddoc VERB 'EDIT'

opens the Word document contained in the general field named WORDDOC.

The verb EDIT is supported for most OLE objects.

For additional information about OLE objects, see the Object Linking and Embedding chapter in the Developer's Guide.

NOWAIT

Include NOWAIT to continue program execution immediately after FoxPro instructs an OLE object to be played.  For example, a sound may take several seconds to play.  Include NOWAIT to continue FoxPro program execution while the sound is being played.

In FoxPro for Windows, include NOWAIT if you are using Quick Recorder to play a sound.  The Quick Recorder remains open after you play a sound, and must be manually closed before FoxPro program execution resumes.  Including NOWAIT automatically closes the Quick Recorder.


@ ... SAY - BMPs & OLE Objects SeeAlso
See Also

APPEND GENERAL Command

CREATE SCREEN Command

MODIFY GENERAL Command

SET DEVICE Command

SET PALETTE Command

SHOW GETS Command


@ ... GET Command

See Also	Example

Creates an editing region.

Syntax

@ <row, column> GET <memvar> | <field>
[FUNCTION <expC1>]
[PICTURE <expC2>]
[FONT <expC3>[, <expN1>]]
[STYLE <expC4>]
[DEFAULT <expr1>]
[ENABLE | DISABLE]
[MESSAGE <expC5>]
[[OPEN] WINDOW <window name>]
[RANGE [<expr2>] [, <expr3>]]
[SIZE <expN2>, <expN3>]
[VALID <expL1> | <expN4> [ERROR <expC6>]]
[WHEN <expL2>]
[COLOR SCHEME <expN5> | COLOR <color pair list>]

Remarks

OPEN WINDOW is included for backward compatibility.  Use @ ... EDIT instead.

Use this command to create an editing region for the contents of a memory variable, array element or field.  Use READ or READ CYCLE to activate @ ... GET editing regions.

You can combine @ ... SAY and @ ... GET into a single command.  If both the SAY and GET clauses are included, specify a single set of coordinates <row, column> where the @ ... SAY output begins.  A space is automatically inserted between the @ ... SAY output and the @ ... GET editing region.  In FoxPro for Windows, @ ... GET editing regions are surrounded by a black border if the BORDER clause is included in READ.

If you use the Screen Builder to create your data entry screens, you may not have to use @ ... GET or @ ... SAY at all.  The Screen Builder automatically generates the @ ... GETs or @ ... SAYs.

Clauses

<row, column>

Row and column are numeric expressions with values 0 or greater that determine where the @ ... GET editing region is displayed.  The first row is number 0 on the desktop, main FoxPro window or a user-defined window.  Rows are numbered from top to bottom.

The first column is number 0 on the desktop, main FoxPro window or a user-defined window.  Columns are numbered from left to right.

When the editing region is placed in a user-defined window, the row and column coordinates are relative to the user-defined window, not the desktop (FoxPro for MS-DOS) or the main FoxPro window.

In FoxPro for Windows and FoxPro for Macintosh, a position in the main FoxPro window or in a user-defined window is determined by the font of the main FoxPro window or the user-defined window.  Most fonts can be displayed in a wide variety of sizes, and some are proportionally spaced.  A row corresponds to the height of the current font; a column corresponds to the average width of a letter in the current font.

To facilitate precise positioning of an @ ... GET editing region in the main FoxPro window or in a user-defined window, you can use decimal fractions for row and column coordinates in FoxPro for Windows and FoxPro for Macintosh.

In FoxPro for MS-DOS, decimal fractions used for row and column coordinates are rounded to the nearest integer value.

<memvar> | <field>

@ ... GET creates an editing region for the memory variable or array element specified in <memvar> or the field specified in <field>.

@ ... GET can be used to create an editing region for a memo field.  When you use @ ... GET with a memo field, the word Memo is displayed.  When READ is issued and the memo field is selected, place the cursor on the word Memo and press Ctrl+Home, Ctrl+PgUp or Ctrl+PgDn to open the memo editing window.  You can also double-click on Memo to open the editing window.

To exit the memo editing window and save your editing changes in FoxPro for MS-DOS, click the window's close box or press Ctrl+W.  Press Esc to discard your changes.

To exit the memo editing window and save your changes in FoxPro for Windows and FoxPro for Macintosh, choose Close from the window's Control menu or press Ctrl+W.  Press Esc to discard your changes.

Tip   A better method for editing memo fields is using @ ... EDIT instead of @ ... GET.  @ ... EDIT creates a text editing window with a scroll bar, and the contents of the memo field are displayed when @ ... EDIT is issued.

FUNCTION <expC1> | PICTURE <expC2>

When creating a text editing region with @ ... GET, you can include the FUNCTION clause, the PICTURE clause or both to create an editing mask.  These clauses contain special codes that control how the memory variable, array element or field is displayed and edited.

FUNCTION codes can be included in a PICTURE clause.  In this case, the PICTURE clause must start with @.  Also, a PICTURE clause can contain FUNCTION codes, PICTURE codes or both.  Since a FUNCTION clause affects the entire expression it can contain only FUNCTION codes.

FUNCTION
Code	Purpose

A	Allows alphabetic characters only (no spaces or symbols).

B	Left-justifies numeric data within the output field.

D	Uses the current SET DATE format.

E	Edits date type data as a BRITISH date.

I	Centers text within a field.

J	Right-justifies text within a field.

K	Selects an entire field for editing when the cursor is moved to the field.

L	Displays leading zeros (instead of spaces) in numeric output.  Use with numeric data only.

M<list>	Creates multiple preset choices.  The list is a comma-delimited collection of items.  Individual items within the list cannot contain embedded commas.  If <memvar> or <field> initially do not contain one of the items in the list when READ is issued, the first item in the list is displayed.  To scroll through the list, press the Spacebar or type the first letter of an item.  To choose one of the items and move to the next control, press Enter.  Use only with character data.

R	Displays a format mask in an @ ... GET editing region.  These mask characters are not stored to the field when you exit the @ ... GET editing region.  Use only with character or numeric data.

S<n>	Limits the display width to n characters.  You can scroll within the region with the cursor control keys.  Use only with character data.

T	Trims leading and trailing blanks from <memvar> or <field>.

Z	Displays <memvar> or <field> as blank if its numeric value is 0.  Use with numeric data only.

!	Converts alphabetic characters to upper-case.  Use with character data only.

^	Displays numeric data using scientific notation.  Use with numeric data only.

$	CURRENCY.  If CURRENCY is SET LEFT, the $ function code cannot be used. Use with numeric data only.

A PICTURE expression can include any characters, but only the characters listed below actively participate in display and editing.

PICTURE
Code	Purpose

A	Allows alphabetic characters only.

L	Allows logical data only.

N	Allows letters and digits only.

X	Allows any character.

Y	Allows logical Y, y, N and n only.  Converts y and n to Y and N, respectively.

9	Allows only digits in character data.  Allows digits and signs in numeric data.

#	Allows digits, blanks and signs.

!	Converts lower-case letters to upper-case letters.

$	Displays the current currency symbol specified by SET CURRENCY.  By default, the symbol is placed immediately before or after the field.  However, the currency symbol and its placement (SET CURRENCY), the separator character (SET SEPARATOR) and the decimal character (SET POINT) can all be changed.  Can only be used in @ ... GET when SET CURRENCY is LEFT.

*	Asterisks are displayed in front of a numeric value.  Use with a dollar sign $ for check protection.

.	A decimal point specifies the decimal point position.

,	A comma is used to separate digits to the left of the decimal point.

FONT <expC3>[, <expN1>]

The character expression <expC3> is the name of the font and the numeric expression <expN1> is the font size.

For example, this short program example displays the CONTACT field for editing.  In FoxPro for Macintosh, the text in the editing-region is displayed in 16-point Courier font:

CLOSE DATABASES
USE customer
DO CASE
CASE _WINDOWS OR _MAC
@ 2, 2 GET contact FONT 'Courier',16
CASE _DOS
@ 2, 2 GET contact
ENDCASE
READ

If you include the FONT clause but omit the font size <expN1>, a 10 point font is used.

In FoxPro for Windows, if the font you specify is not available, a font with similar font characteristics is substituted.

In FoxPro for Macintosh, if the font you specify is not available, the Chicago font is used.

In FoxPro for MS-DOS, the FONT clause is ignored.

If the FONT clause is omitted and the editing region is placed in the main FoxPro window, the main FoxPro window font is used.  If the FONT clause is omitted and the editing region is placed in a user-defined window, the user-defined window font is used.

STYLE <expC4>

In FoxPro for Windows and FoxPro for Macintosh, include the STYLE clause to specify a font style for an @ ... GET editing-region.

The font style is specified with <expC4>.  If the STYLE clause is omitted, the normal font style is used.

In FoxPro for Windows, if the font style you specify is not available, a font style with similar characteristics is substituted.

In FoxPro for Macintosh, if the font you specify is not available, the normal font style is used.

Character	Font Style

B	Bold

C	Condense*

E	Extend*

I	Italic

N	Normal

O	Outline

Q	Opaque

S	Shadow

-	Strikeout*

T	Transparent

U	Underline

*The Condense and Extend styles are available only in FoxPro for Macintosh. The Strikeout style is available only in FoxPro for Windows.

If you include T to create a transparent editing-region, the background color is ignored by the region.

You can include more than one character to specify a combination of font styles.  For example, the following short program create an @ ... GET text editing region.  The CONTACT field appears in the editing region in Bold Italic in FoxPro for Windows and FoxPro for Macintosh.

CLOSE DATABASES
CLEAR
USE customer

DO CASE
CASE _WINDOWS OR _MAC
@ 2, 2 GET contact STYLE 'BI'
CASE _DOS
@ 2, 2 GET contact
ENDCASE

READ

The STYLE clause is ignored in FoxPro for MS-DOS.

DEFAULT <expr1>

If you specify a memory variable for the @ ... GET editing region that doesn't exist, it is automatically created and initialized if you include DEFAULT.  However, an array element isn't created if you specify an array element in a DEFAULT clause.  The DEFAULT clause is ignored if the memory variable already exists or you specify a field.

Note   If the DEFAULT clause isn't included and the memory variable <memvar> doesn't exist, the error message "Variable not found" is displayed.

The DEFAULT expression <expr1> determines the type of memory variable created and its initial value.

ENABLE | DISABLE

Including DISABLE prevents access to an @ ... GET editing region.  The editing region is displayed in the disabled colors and cannot be selected.

By default, @ ... GET editing regions are enabled.  You can include ENABLE as a reminder in a program that a GET editing region can be accessed.

Tip   If all the GETs in user-defined window are disabled, the window won't remain on top.  If all the GETs in the current READ are disabled, the READ is terminated.

MESSAGE <expC5>

The MESSAGE clause character expression <expC5> is displayed when the @ ... GET editing region is selected.  In FoxPro for MS-DOS the message is centered on the last line of the desktop and temporarily cancels any SET MESSAGE expression.

In FoxPro for Windows and FoxPro for Macintosh, the message is placed in the Windows-style status bar.  If the Windows-style status bar has been turned off with SET STATUS BAR OFF, the message is placed on the last line of the main FoxPro window.

[OPEN] WINDOW <window name>

Include the WINDOW clause to edit a memo field in a user-defined window.  The user-defined window must first be created with DEFINE WINDOW.  The word Memo is displayed when you issue @ ...  GET WINDOW.

To open the memo editing window, double-click Memo or place the cursor on the word Memo and press Ctrl+Home, Ctrl+PgUp or Ctrl+PgDn.

If OPEN is included, the memo editing window is automatically opened when READ or READ CYCLE is issued.

To exit the window and save your editing changes in FoxPro for MS-DOS, click the window's close box (if available) or press Ctrl+W.  Press Esc to discard your changes.

To exit the window and save your editing changes in FoxPro for Windows, choose Close from the window's Control menu (if available) or press Ctrl+W.  Press Esc to discard your changes.

To exit the window and save your editing changes in FoxPro for Macintosh, click the close box or press Ctrl+W. Press Esc to discard your changes.

Tip   A better method for editing memo fields is using @ ... EDIT instead of @ ... GET.  @ ... EDIT creates a text editing window with a scroll bar, and the contents of the memo field are displayed when @ ... EDIT is issued.

RANGE [<expr2>] [, <expr3>]

Use the RANGE clause with character, date and numeric data to specify a range of acceptable values.  If the value you enter in the @ ...  GET editing region isn't within the specified range, a message showing the correct range is displayed.  To override the default range message, use ON READERROR.

The lower boundary of the range is specified with <expr2>, the upper boundary with <expr3>.  <expr2> and <expr3> must be character, numeric or date expressions that correspond to the data in the memory variable, array element or field.  Either <expr2> or <expr3> can be omitted, but not both.  If one boundary is omitted, the data you enter is checked against the specified boundary only.

Note   The range isn't checked if you press Enter without changing the memory variable, array element or field.

SIZE <expN2>, <expN3>

SIZE lets you control the length and height of an @ ... GET text editing region.  By default, a text editing region is one row high.  The size of the region is determined by the length of the memory variable, array element or field or a PICTURE clause.

The height of the text editing region in rows is specified with <expN2> and the width in columns is specified with <expN3>.

In FoxPro for Windows and FoxPro for Macintosh, the editing-region font determines the size of the editing region.  The editing region font is specified with the FONT clause.  If the FONT clause is omitted, the editing region uses the font of its parent window (the main FoxPro window or a user-defined window).

VALID <expL1> | <expN4>

Use VALID to validate input.  When you attempt to exit the GET editing region, the VALID expression is evaluated.

A VALID clause greatly simplifies data validation when used with a user-defined function (UDF).  If a UDF is called within a VALID clause in @ ... GET, the UDF should return a logical or numeric value.

Note   Unlike the RANGE clause, a VALID clause is always executed when you exit the GET editing-region unless you press Esc. The RANGE clause is only executed when a change is made to the memory variable, array element or a field.

<expL1>

If <expL1> evaluates to a logical true (.T.), the input is considered correct and the editing region is exited.

If <expL1> evaluates to false (.F.), the value you entered is considered incorrect and a message is displayed directing you to reenter the data after pressing the Spacebar.

If a UDF validation routine performs a replacement on a field and the validation routine then returns false, the field replacement occurs but the previous field value is restored when you return from the UDF to the GET editing region.

<expN4>

A VALID clause that includes a numeric expression is used to specify which object is activated after you exit the GET editing region.  Objects are @ ... GET input fields, check boxes, lists, popups, spinners, text editing regions and each individual button in a set of push, radio and invisible buttons.  The numeric expression <expN4> has one of the three effects:

When <expN4> is 0, the cursor remains in the GET editing region.  The MESSAGE <expC5> and ERROR <expC6> error messages are suppressed.  A special error message routine can be written as part of a UDF called by VALID.

If a UDF validation routine performs a replacement on a field and the validation routine returns 0, the field replacement occurs but the previous field value is restored when you return to the GET editing region.

When <expN4> is positive, <expN4> specifies the number of objects to advance.  For example, when the cursor is positioned on a GET editing region and VALID returns 1, the next object is activated.  If <expN4> is greater than the number of remaining objects, the READ is terminated (unless READ CYCLE is issued to activate the objects).

When <expN4> is negative, <expN4> specifies the number of objects to move back.  For example, when the cursor is positioned on a GET editing region and VALID returns -1, the previous object is activated.  If <expN4> moves back past the first object, the READ is terminated (unless READ CYCLE is issued to activate the objects).

ERROR <expC6>

ERROR <expC6> lets you specify a custom error message displayed when a VALID clause evaluates to false (.F.).  FoxPro displays <expC6> in place of the default error message.

WHEN <expL2>

WHEN allows or prohibits access to a GET editing region based on the value of <expL2>, which must be true (.T.) before the GET editing region can be accessed.  If WHEN is specified and <expL2> is false (.F.), the GET editing region cannot be accessed and the next object is activated.

COLOR SCHEME <expN5> | COLOR <color pair list>

If you do not include a COLOR clause, the colors of an @ ... GET editing region are determined by the color scheme for the desktop or the main FoxPro window; if an @ ... GET editing region is placed in a user-defined window, the window's color scheme determines the editing region's colors.

Only the second color pair in a color scheme or color pair list affects the color of an @ ... GET editing region.

The color of an @ ... GET editing region can be specified by including the number of an existing color scheme in the COLOR SCHEME clause or a set of color pairs in the COLOR clause.

A color scheme is a set of 10 predefined color pairs.  The color pairs in a color scheme can be changed with SET COLOR OF SCHEME.  In FoxPro for MS-DOS the color pairs in a color scheme can also be changed in the Color Picker.

A color pair is a set of two letters separated by a forward slash.  The first color letter specifies the foreground color and the second letter specifies the background color.

For example, this color pair specifies a red foreground on a white background:

R/W

For a list of colors and their corresponding color letters, see SET COLOR Commands Overview or Color Table by Color Pair.

A color pair can also be specified with a set of 6 RGB (Red Green Blue) color values separated by commas.  The first 3 color values specify the foreground color and the second 3 color values specify the background color.  The color values can range from 0 through 255.

The R/W color pair in the example above can also be specified with this RGB color pair:

RGB(255,0,0,255,255,255)

Only color pairs 2, 5, 6 and 10 in a color scheme or color pair list affect the @ ... GET editing region colors.

Color Pair Number	Editing Region Attribute
2	@ ... GET editing region
5	Message
6	Selected @ ... GET editing region
10	Disabled @ ... GET editing region


@ ... GET Example

The following example demonstrates how you can combine @ ... SAY and @ ... GET into a single command and the COLOR, PICTURE, RANGE and WHEN clauses.  Two tables are opened and a relation is set between the CUSTOMER and OFFICES tables to extract information from both tables.

SET TALK OFF
CLEAR
CLOSE DATABASES

USE customer IN 0	&& Parent
USE offices  IN 0 ORDER ono	&& Child
SET RELATION TO ono INTO offices	&& Set the relation

@  1, 0 TO 18, 79 DOUBLE
@  3, 13 SAY 'Company: '	GET company COLOR gr+/b, r/w
@  5, 13 SAY 'Contact: '	GET contact COLOR gr+/b, r/w
@  7, 13 SAY 'Address: '	GET address COLOR gr+/b, r/w
@  9, 13 SAY 'City: '	GET city COLOR gr+/b, r/w
@ 11, 13 SAY 'State: '	GET state PICTURE '!!' COLOR gr+/b, r/w
@ 11, 28 SAY 'Zip: '	GET zip COLOR gr+/b, r/w
@ 15, 13 SAY 'Ytdsales: '
@ 15, 23 GET offices.ytdsales PICTURE '999999.99' RANGE 100,999999  ;
MESSAGE 'Enter ytdsales from 100 to 999999.'
READ
CLEAR


@ ... GET SeeAlso
See Also

@ ... SAY Command

@ ... EDIT - Text Edit Regions Command

CREATE SCREEN Command

_CUROBJ System Memory Variable

FONTMETRIC( ) Function

Fonts

OBJNUM( ) Function

READ Command

SET COLOR Commands Overview

SET CURRENCY Command

SET DEVICE Command

SHOW GETS Command

SHOW OBJECT Command

User-Defined Functions (UDFs)

VARREAD( ) Function


@ ... GET - Check Boxes Command

See Also

Creates a check box or a picture check box.

Syntax

@ <row, column> GET <memvar> | <field>
FUNCTION <expC1> | PICTURE <expC2>
[FONT <expC3>[, <expN1>]]
[STYLE <expC4>]
[DEFAULT <expr>]
[SIZE <expN2>, <expN3>]
[ENABLE | DISABLE]
[MESSAGE <expC5>]
[VALID <expL1> | <expN4>]
[WHEN <expL2>]
[COLOR SCHEME <expN5> | COLOR <color pair list>]

Remarks

Picture check boxes are supported in FoxPro for Windows and FoxPro for Macintosh.

With this variation of @ ... GET you can create a check box or a picture check box.  A check box is used to toggle between two states, such as true (.T.) and false (.F.) or yes and no.

If you use the Screen Builder to create your data entry screens, you may not have to use this command at all.  The Screen Builder automatically generates the commands that create check boxes and picture check boxes.

A check box is box with descriptive text to its right.  The string of text, called a prompt, indicates what the check box controls.  The text of the prompt is specified by the FUNCTION or PICTURE clause.  When a condition is true, an X is displayed.  Only one check box may be created in a single @ ... GET.  Issue READ or READ CYCLE to activate a check box.

You can create a picture check box in FoxPro for Windows and FoxPro for Macintosh. A picture on a button replaces the check box and the check box prompt.

In FoxPro for MS-DOS, pressing the Spacebar or Enter or clicking the check box toggles the check box from one state to the other.

In FoxPro for Windows, pressing the Spacebar or Enter or clicking the check box toggles the check box from one state to the other if KEYCOMP is set to DOS.  If KEYCOMP is set to WINDOWS, which is the FoxPro for Windows default, you can toggle the check box state by pressing the Spacebar or clicking on the check box.  Press Enter to move to the next object.

In FoxPro for Macintosh, click the check box to toggle the check box from one state to the other. If KEYCOMP is set to DOS or WINDOWS and the check box has the focus, you can press the Spacebar to toggle the check box from one state to the other.

Clauses

<row, column>

Row and column are numeric expressions with values 0 or greater that determine where the check box appears.

The first row is number 0 in the main FoxPro window or a user-defined window. Rows are numbered from top to bottom. In FoxPro for Windows, row 0 is the row immediately under the FoxPro system menu bar. In FoxPro for Macintosh, row 0 is the row immediately under the FoxPro title bar. In FoxPro for MS-DOS, row 0 is the row the FoxPro system  menu bar occupies. See SET SYSMENU for information about manipulating the system menu bar so you can place output on row 0 in FoxPro for MS-DOS.

The first column is number 0 in the main FoxPro window or a user-defined window. Columns are numbered from left to right.

When the check box is directed to a user-defined window, the row and column coordinates are relative to the user-defined window, not the main FoxPro window.

In FoxPro for Windows and FoxPro for Macintosh, a position in the main FoxPro window or in a user-defined window is determined by the font of the main FoxPro window or the user-defined window. Most fonts can be displayed in a wide variety of sizes, and some are proportionally spaced. A row corresponds to the height of the current font; a column corresponds to the average width of a letter in the current font.

In FoxPro for Windows, row 0 is the row immediately under the FoxPro system menu bar.  In FoxPro for Windows and FoxPro for Macintosh, you can position the check box in a window with decimal fractions for row and column coordinates.In FoxPro for MS-DOS, decimal fractions used for row and column coordinates are rounded to the nearest integer value.

<memvar> | <field>

When you check or uncheck a check box, your choice is stored to a memory variable, an array element or a field, which you specify with <memvar> or <field>.  The <memvar> or <field> must be of numeric or logical type.

When a check box is initially displayed on the screen or in a window, the box is checked if <memvar> or <field> contains a non-zero numeric value or a true (.T.) value.  The box isn't checked if <memvar> or <field> is zero or false (.F.).

READ or READ CYCLE activates the check box.  The state of the check box when the READ is terminated determines the value stored to the memory variable, array element or field [image] 1 or .T. if checked and 0 or .F. if unchecked.

FUNCTION <expC1> | PICTURE <expC2>

When creating a check box, you must include the FUNCTION clause, the PICTURE clause or both.  There is no advantage for any of the three methods.  The FUNCTION clause or the PICTURE clause contains the check box specification code *C.

The FUNCTION clause character expression <expC1> must begin with *C.  To create the prompt, include a space after *C followed by the text of the prompt.  For example, this clause creates a check box with the prompt Titles:

... FUNCTION '*C Titles' ...

The PICTURE clause character expression <expC2> uses the same syntax as the FUNCTION clause character expression, except the PICTURE clause expression must begin with @ followed by *C.  For example, this clause creates a check box with the prompt Titles:

... PICTURE '@*C Titles' ...

You can also include both the FUNCTION and PICTURE clauses to create a check box.  If both are included, the FUNCTION character expression <expC1> must contain *C to create the check box. The PICTURE character expression <expC2> must include the prompt.  For example:

... FUNCTION '*C' PICTURE 'Titles' ...

The following examples illustrate the various forms of syntax you can use to create a check box.  In all the examples the check box is placed in the second row and column.  The state of the box (checked or unchecked) is stored to the memory variable MCHOICE.  Each example creates the same check box.

FUNCTION clause only:

STORE 1 TO mchoice
@ 2,2 GET mchoice FUNCTION '*C Titles'
READ

STORE 1 TO mchoice
STORE '*C Titles' TO mprompt
@ 2,2 GET mchoice FUNCTION mprompt
READ

PICTURE clause only:

STORE 1 TO mchoice
@ 2,2 GET mchoice PICTURE '@*C Titles'
READ

STORE 1 TO mchoice
@ 2,2 GET mchoice PICTURE '@*C' + ' Titles'
READ

FUNCTION and PICTURE clauses:

STORE 1 TO mchoice
@ 2,2 GET mchoice FUNCTION '*C' PICTURE ' Titles'
READ

Picture Check Boxes

In FoxPro for Windows and FoxPro for Macintosh, the prompt for a check box can also be the name of a picture file. In FoxPro for Windows, the picture file can be a BMP bitmap file. In FoxPro for Macintosh, you can use a picture file of PICT type or a BMP bitmap file.

 When a check box uses a picture file for a prompt, the check box mimics the behavior of a check box with a text prompt.  For example, the picture file is displayed but the check box isn't displayed.  Like checking a check box, choosing the picture toggles the value of <memvar> or <field> between .T. and .F. or 1 and 0.

To use a picture file in a check box, add B to the check box specification code.  The FUNCTION and PICTURE clause specification codes that create a check box are *C or @*C, respectively.  To create a check box with picture prompts, use the codes *CB and @*CB, followed by a space and the picture filename. If the picture file is not located in the default directory or folder, include the path to the picture file with the picture filename.

Note   The pictures aren't clipped, reduced or enlarged to fit the check box button.  Use the SIZE clause to adjust the size of the check box button to accommodate the picture.

If you omit the extension for the picture file, FoxPro for Macintosh first looks for a picture file with the name you specified and a .BMP extension. If a picture file with a .BMP extension and the name you specified isn't found, FoxPro for Macintosh then looks for a file with the name you specified and a .PCT extension. If a picture file with a .PCT extension and the name you specified isn't found, FoxPro for Macintosh then looks for a picture file with the name you specified without an extension.

Picture Masks and Check Boxes

In FoxPro for Windows and FoxPro for Macintosh, a picture check box has three states:  up, down and disabled.  FoxPro automatically controls the appearance a picture check box when it is in each of these three states, but you can override the default appearance by using a picture mask.

A mask is used to control the transparent areas of a picture check box.  By default, the white areas are transparent.  If a mask is present, the white areas of the mask, not the picture file, are transparent.

A mask is a monochrome picture file. In FoxPro for Windows, a mask is a .BMP with an .MSK extension. In FoxPro for Macintosh, a mask can be a .BMP with an .MSK extension or a PICT type file with a .PCM extension. The mask must have the same base name as the picture file and the appropriate extension. FoxPro automatically looks for a mask for a picture file in the same directory or folder where the picture file is located.

In most cases, a mask isn't necessary.  If you don't need anything in your picture to appear white and your picture file has a white background, the picture check box will appear as desired in the up, down and disabled states.

When a picture check box has a mask and is in the up or down state, any white areas in the picture appear transparent, allowing the color of the button face to show through.  However, you can maintain the white color of certain areas.

Suppose that you have a picture with a dog on a white background; the dog has white eyes and the button face is red.  You want the background of the button to appear red but you want the dog's eyes to be white, not red.  Make a mask that is the same size as the picture file but includes only two colors, black and white.  Leave the background of the mask white but make the dog [image] including his eyes [image] completely black.  When the button is displayed, the background is red to match the button face but the dog's eyes are white.

When a picture check box is disabled, any white areas in the picture file appear transparent so the color of the button face shows through.  Any non-white areas appear dark gray.  If the button has a mask, all white areas in the mask are transparent so the color of the button face show through, and all black areas appear dark gray.

PICTURE and FUNCTION Options N and T

Two options can be placed after the specification code *C in the FUNCTION or PICTURE clause to modify the behavior (N and T) and appearance (2 and 3) of check boxes.

The 2 (two-dimensional) and 3 (three-dimensional) specification codes are only available in FoxPro for Macintosh.

Option	Description

N	Do not terminate the READ when the box is chosen.  This is the default behavior.

T	Terminate the READ when the box is chosen.

2	Creates a flat (two-dimensional) check box identical to check boxes in Macintosh dialogs. This is the default check box type in FoxPro for Macintosh.

3	Creates a three-dimensional check box identical to check boxes in FoxPro for Macintosh dialogs.

For example, the following clause creates a check box and doesn't cause the READ to terminate when the check box is chosen:

... FUNCTION '*CN ... '

In FoxPro for Macintosh, the following clause creates a three-dimensional check box and doesn't cause the READ to terminate when the check box is chosen:

... FUNCTION '*CN3 ... '

Check Boxes with Special Features

You can assign a hot key to the check box or disable the check box by including special characters when defining the prompt.

Hot Keys

A hot key allows you to immediately choose or change the state of the check box.  To assign a hot key, place a backslash and a less than sign (\<) before the desired character of the check box prompt.  The hot key is a highlighted character (FoxPro for MS-DOS) or an underlined character (FoxPro for Windows). In FoxPro for Macintosh, if KEYCOMP is set to MAC (the default), the hot key isn't highlighted or underlined; if KEYCOMP is set to DOS or WINDOWS the hot key is underlined.

Tip   A hot key doesn't choose the check box if the current object is an @ ... GET input field, a text editing region, a popup or a list.

If the current object is an @ ... GET input field or a text editing region, pressing the hot key enters the corresponding letter in the field or the text editing region.  If the current object is a popup or a scrollable list, pressing the hot key selects the first option in the popup or list whose prompt begins with the letter corresponding to the hot key.

Tip   In FoxPro for Windows, if the current object is an @ ... GET input field, text editing region, popup or list and KEYCOMP is set to WINDOWS, you can press Alt and the hot key to move to the check box and choose it.  If you create a picture check box, you cannot create a hot key for the picture check box.

The following example creates a check box with the prompt Titles and assigns the hot key T to it:

STORE 1 TO mchoice
@ 2,2 GET mchoice FUNCTION '*C' PICTURE ' \<Titles'
READ

Disabled Check Boxes

A disabled check box cannot be selected or chosen and is displayed in disabled colors.  To disable a check box, place two backslashes (\\) before the check box prompt or use the DISABLE clause.  The following example disables the check box created earlier:

STORE 1 TO mchoice1, mchoice2, mchoice3
@ 2,2 GET mchoice1 FUNCTION '*C \\Titles'
@ 4,2 GET mchoice2 FUNCTION '*C Titles' DISABLE
@ 6,2 GET mchoice3 FUNCTION '*C Titles'
READ

FONT <expC3>[, <expN1>]

Include FONT to specify a font and font size for the check box prompt.  The character expression <expC3> is the name of the font, and the numeric expression <expN1> is the font size.  For example, the following command displays the prompt in 16-point Courier font:

@ 2,2 GET mchoice FUNCTION '*C Titles' DEFAULT 1 ;
FONT 'Courier',16

If you include the FONT clause but omit the font size <expN1>, a 10 point font is used.

In FoxPro for Windows, if the font you specify is not available, a font with similar font characteristics is substituted.

In FoxPro for Macintosh, if the font you specify is not available, the Chicago font is used.

In FoxPro for MS-DOS, the FONT clause is ignored.

If the FONT clause is omitted and the check box is placed in the main FoxPro window, the main FoxPro window font is used.  If the FONT clause is omitted and the check box is placed in a user-defined window, the user-defined window font is used.

STYLE <expC5>

In FoxPro for Windows and FoxPro for Macintosh, include the STYLE clause to specify a font style for a check box.

The font style is specified with <expC5>.

In FoxPro for Windows, if the font style you specify is not available, Windows substitutes a font style with similar characteristics.

In FoxPro for Macintosh, if the font you specify is not available, the normal font style is used.

The STYLE clause is ignored in FoxPro for MS-DOS.

Character	Font Style

B	Bold

C	Condense*

E	Extend*

I	Italic

N	Normal

O	Outline

Q	Opaque

S	Shadow

-	Strikeout*

T	Transparent

U	Underline

*The Condense and Extend styles are only available in FoxPro for Macintosh. The Strikeout style is only available in FoxPro for Windows.

You can include more than one character to specify a combination of font styles.  For example, the following clause specifies Bold Italic:

STYLE 'BI'

If T is included to create a transparent check box, the check box is filled with the background color.  If Q is included, the check box and the check box prompt is filled with the background color.

DEFAULT <expr>

When you check or uncheck a check box, the state of the box is saved in a memory variable, an array element or a field.  If you specify a memory variable that doesn't exist, it is automatically created and initialized if the DEFAULT clause is included.  However, an array element isn't created if you specify an array element in a DEFAULT clause.  The DEFAULT clause is ignored if the memory variable already exists or you specify a field.

Note   If the DEFAULT clause is omitted and the memory variable <memvar> doesn't exist, the error message "Variable not found" is displayed.

The DEFAULT expression <expr> determines the type of memory variable created and its initial value.  It must be a numeric or logical expression.  Here are examples of DEFAULT clauses for check boxes:

@ 2,2 GET mchoice FUNCTION '*C Titles' DEFAULT .T.
READ

STORE .T. TO button
@ 2,2 GET mchoice FUNCTION '*C Titles' DEFAULT button
READ

SIZE <expN2>, <expN3>

The numeric expression <expN2> specifies the height of a check box.  For check boxes in FoxPro for MS-DOS, this expression is ignored because a check box is always one line high.  However, you must include <expN2> if you include <expN3> to specify the width of the prompt.

In FoxPro for Windows and FoxPro for Macintosh, you can specify a height for the check box.  If <expN2> is 1, the focus rectangle around the check box prompt will be clipped.  In this case, include a larger value for <expN2>.

By default, the width of a check box is determined by the length of the prompt text.  You can use <expN3> to make the check box prompt wider than the default.  The numeric expression <expN3> specifies the width (in columns) of a check box.

In FoxPro for Windows and FoxPro for Macintosh, the check box font determines the size of the check box.  The check box font is specified with the FONT clause.  If the FONT clause is omitted, the check box uses the font of its parent window (the main FoxPro window or a user-defined window).

ENABLE | DISABLE

By default, a check box is enabled when READ is issued.  You can prevent a check box from being activated when READ is issued by including DISABLE.  A disabled check box cannot be selected and is displayed in disabled colors.  Use SHOW GET ENABLE to enable a disabled check box.

MESSAGE <expC5>

The MESSAGE clause character expression <expC5> is displayed when a check box is selected.  The message is centered by default on the last line of the desktop in FoxPro for MS-DOS; the message location can be specified with SET MESSAGE.

In FoxPro for Windows and FoxPro for Macintosh, the message is placed in the graphics status bar. If the graphical status bar has been turned off with SET STATUS BAR OFF, the message is centered on the last line of the main FoxPro window.

VALID <expL1> | <expN4>

You can include an optional VALID expression <expL1> or <expN4> that is evaluated when a check box is chosen (checked or unchecked).  That is, VALID isn't evaluated when you select (move to) the check box, but when you actually choose the check box.

Typically, <expL1> or <expN4> is a user-defined function.  With user-defined functions you can select, enable or disable other objects, open a Browse window, open another data entry screen or move to a new record.  CLEAR READ can be included in a user-defined function to terminate the READ.

<expL1>

When a logical value <expL1> is returned to the VALID clause, the logical value is ignored and the check box remains the active control.  However, you can specify a UDF that returns a logical value to the VALID clause and activates another object.

The following example demonstrates how a VALID clause UDF is executed when a check box is chosen.  The check box remains the current control when the VALID clause UDF is executed because a logical false (.F.) is returned by the UDF.

CLEAR
STORE 1 TO mchoice1, mchoice2, mchoice3
@ 2,2 GET mchoice2
@ 4,2 GET mchoice1 FUNCTION '*C \<Titles' ;
VALID showmes( ) ;
MESSAGE 'Execute the VALID. ' + ;
'Select this check box using Spacebar.'
@ 6,2 GET mchoice3
READ CYCLE	&& Press Esc to exit the READ

FUNCTION showmes
WAIT WINDOW NOWAIT 'The VALID clause was executed.'
RETURN .F.

<expN4>

A VALID clause that includes a numeric expression <expN4> is used to specify which object is activated after a check box is chosen.  Objects are @ ... GET input fields, check boxes, lists, popups, spinners, text editing regions and each individual button in a set of push, radio and invisible buttons.

The numeric expression has one of three effects:

When <expN4> is 0, the check box remains the active control.

When <expN4> is positive, <expN4> specifies the number of objects to advance.  For example, when the check box is selected and VALID returns 1, the next object is activated.  If <expN4> is greater than the number of objects remaining, the READ is terminated (unless READ CYCLE is issued to activate the objects).

When <expN4> is negative, <expN4> specifies the number of objects to move back.  For example, when the check box is selected and VALID returns -1, the previous object is activated.  If <expN4> moves back past the first object, the READ is terminated (unless READ CYCLE is issued to activate the objects).

The following example demonstrates how a VALID clause UDF can activate another object by returning a numeric value.  When the VALID clause UDF is executed, the UDF returns 2.  The second object after the check box is activated.  Since READ CYCLE was issued, the READ isn't terminated even though there are less than two objects remaining.

CLEAR
STORE 1 TO mchoice1, mchoice2
STORE 0 TO m.choice3
@ 2,2 GET mchoice1
@ 4,2 GET mchoice2
@ 6,2 GET m.choice3 FUNCTION '*C \<Titles' ;
VALID showmes( ) ;
MESSAGE 'Execute the VALID. ' + ;
'Select this check box using Spacebar.'
READ CYCLE	&& Press Esc to exit the READ

FUNCTION showmes
WAIT WINDOW NOWAIT 'The VALID clause was executed.'
RETURN 2

WHEN <expL2>

The optional WHEN clause allows or prohibits selection of a check box based on the logical value of <expL2>, which must evaluate to a logical true (.T.) before a check box can be selected.  If <expL2> evaluates to a logical false (.F.), the check box cannot be selected and is skipped over if placed between other objects.

In the following example, the check box WHEN clause returns a logical (.F.).  The check box is skipped even though it isn't disabled.

CLEAR
STORE 1 TO mchoice1, mchoice2
STORE 0 TO mchoice3
@ 2,2 GET mchoice1
@ 4,2 GET mchoice2 FUNCTION '*C \<Titles' ;
WHEN showmes( )
@ 6,2 GET mchoice3
READ CYCLE	&& Press {Esc} to exit the READ

FUNCTION showmes
WAIT WINDOW NOWAIT 'The WHEN clause was executed.'
RETURN .F.

COLOR SCHEME <expN5> | COLOR <color pair list>

If you do not include a COLOR clause, check box colors are determined by the color scheme for the desktop or the main FoxPro window; if a check box is placed in a user-defined window, the window's color scheme determines the check box colors.

The color of a check box can be specified by including the number of an existing color scheme in the COLOR SCHEME clause or a set of color pairs in the COLOR clause.

A color scheme is a set of 10 predefined color pairs.  The color pairs in a color scheme can be changed with SET COLOR OF SCHEME.  In FoxPro for MS-DOS the color pairs in a color scheme can also be changed in the Color Picker.

A color pair is a set of two letters separated by a forward slash.  The first color letter specifies the foreground color and the second letter specifies the background color.

For example, this color pair specifies a red foreground on a white background:

R/W

For a list of colors and their corresponding color letters, see SET COLOR Commands Overview or Color Table by Color Pair.

A color pair can also be specified with a set of 6 RGB (Red Green Blue) color values separated by commas.  The first 3 color values specify the foreground color and the second 3 color values specify the background color.  The color values can range from 0 through 255.

The R/W color pair in the example above can also be specified with this RGB color pair:

RGB(255,0,0,255,255,255)

Only color pairs 5, 6, 7, 9 and 10 in a color scheme or color pair list affect the check box colors.  The color of picture check boxes is controlled by Windows

Color Pair  Number	Check Box Attribute
5	Message
6	Selected check box prompt (supported in FoxPro for MS-DOS only)
7	7 Hot keys (supported in FoxPro for MS-DOS only)
9	Enabled check box prompt
10	Disabled check box prompt
The following example shows how to override the color scheme of the desktop or main FoxPro window with another predefined color scheme:

ACTIVATE SCREEN
STORE 1 TO mchoice
@ 2,2 GET mchoice FUNCTION '*C Titles' COLOR SCHEME 4
READ

The following example creates check boxes with the prompt Titles, the hot key T and the following color characteristics:

A selected box is shown with a bright white prompt on a blue background (W+/B).

Hot key characters are shown in red on a blue background (R/B) in FoxPro for MS-DOS.  In FoxPro for Windows, the hot key character is underlined.

An enabled check box is shown with a yellow prompt on a blue background (GR+/B).

A disabled check box is shown with a gray prompt on a blue background (W/B).

When you skip a color pair, you must include a comma where the color pair is omitted.

Here are the commands:

CLEAR
SET COLOR TO W/B
STORE 1 TO mchoice
@ 2,2 GET mchoice FUNCTION '*C \<Titles';
COLOR ,,,,,W+/B,R/B,,GR+/B,W/B
@ 4,2 GET mchoice FUNCTION '*C \\Titles';
COLOR ,,,,,W+/B,R/B,,GR+/B,W/B
@ 6,2 GET mchoice FUNCTION '*C \<Titles';
COLOR ,,,,,W+/B,R/B,,GR+/B,W/B
READ


@ ... GET - Check Boxes SeeAlso
See Also

@ ... SAY Command

@ ... GET Command

Controls Overview

_CUROBJ System Memory Variable

Fonts

OBJNUM( ) Function

READ Command

SET KEYCOMP Command

SHOW GET Command

User-Defined Functions (UDFs)


CREATE COLOR SET Command

See Also

Creates a color set from the current color settings.

Syntax

CREATE COLOR SET <color set name>

Remarks

Every color pair in every color scheme is saved in the color set you create.  A color set name can be up to 10 characters long, and can contain numbers and underscores, but it cannot begin with a number.

Once you have created a color set, you can load it with SET COLOR SET.  In FoxPro for MS-DOS, you can also load the color set in the Color Picker.

Color sets are saved in the FoxPro resource file.  If a color set exists with the same name you specify, it is overwritten.


CREATE COLOR SET SeeAlso
See Also

SET COLOR OF SCHEME Command

SET COLOR SET Command

SET COLOR TO Command


CREATE CURSOR Command - SQL

See Also	Example

Creates a temporary table.

Syntax

CREATE CURSOR <dbf_name> (<fname1> <type> [(<precision>[, <scale>])
[, <fname2> ...]]) |
FROM ARRAY <array>

Remarks

CREATE CURSOR creates a temporary table that exists only until it is closed.  A temporary table created with CREATE CURSOR can be manipulated like any other table - it can be browsed and indexed, and you can append and delete records.

The temporary table is opened in the lowest available work area, and can be accessed by its alias.

Each field in the temporary table is defined with a name, type, precision and scale.  These definitions can be obtained from the command itself or from an array.  The temporary table is opened exclusively regardless of the setting of SET EXCLUSIVE.

Clauses

<dbf_name>

<dbf_name> specifies the name of the temporary table to create. <dbf_name> can include a path and can be a name expression.

(<fname1> <type> [(<precision>[, <scale>] [, <fname2> ...  ])

In this clause, <fname1> and <fname2> are names of fields in the temporary table.  Each <fname> can be a name expression.  <type> is a single letter indicating the data type for the field.  Some data types require that you specify a <precision> (field width) and <scale> (number of decimal places).

<type>, <precision> and <scale> can be:

Type	Precision	Scale	Description
C	n	-	Character string of width n
D	-	-	Date
F	n	d	Float of width n with d decimal places
L	-	-	Logical
M	-	-	Memo
N	n	d	Numeric of width n with d decimal places
G	-	-	General
P	-	-	Picture
<precision> and <scale> are ignored for D, L, M, G and P types.  If a <scale> isn't included for N or F types, the <scale> defaults to zero (no decimal places).

FROM ARRAY <array>

In this clause, <array> is the name of an existing array whose contents are the name, type, precision and scale for each field in the temporary table.  The contents of the array can be defined with the AFIELDS( ) function.


CREATE CURSOR - SQL Example

The following example creates a cursor with the alias EMPLOYEE.

CLOSE DATABASES
CLEAR
CREATE CURSOR employee ;
(name C(20), addr C(30), city C(30), zip C(5), salary N(8,2), ;
comments M)
? ALIAS( )
DISPLAY STRUCTURE


CREATE CURSOR - SQL SeeAlso
See Also

AFIELDS( ) Function

CREATE Command

CREATE QUERY Command

CREATE TABLE Command - SQL

INSERT Command - SQL

MODIFY QUERY Command

SELECT Command - SQL


CREATE FROM Command

See Also	Example

Creates a table from a COPY STRUCTURE EXTENDED file.

Syntax

CREATE
[<file1>]
FROM
[<file2>]

Remarks

This variation of CREATE assumes that the table specified in <file2> has been created either with COPY STRUCTURE EXTENDED or manually.  A new table <file1> is created with the structure described in <file2>.  The newly created table becomes the active table.  The structure of the new table is fixed in format and consists of four fields.  The names of the four fields and their contents are:

Field	Contents
FIELD_NAME	Field names from selected table
FIELD_TYPE	C = Character N = Numeric F = Float D = Date L = Logical M = Memo G = General P = Picture
FIELD_LEN	Width of Field
FIELD_DEC	Number of decimal places in numeric fields
If you don't include either <file1> or <file2> or both, a dialog is displayed.  In this dialog, you can specify the file to be created or the FROM file or both.


CREATE FROM Example

The following example displays the structure of the INVOICES table, copies the structure extended to a TEMP table, browses TEMP, creates a BACKUP table from TEMP, and displays the structure of BACKUP.

CLOSE DATABASES
CLEAR

USE invoices
DISPLAY STRUCTURE
WAIT WINDOW 'Structure of the invoices table' NOWAIT
COPY STRUCTURE EXTENDED TO temp
USE temp
WAIT WINDOW 'Temp table has 1 row per field in INVOICES' NOWAIT
BROWSE

CREATE backup FROM temp
USE backup
DISPLAY STRUCTURE
WAIT WINDOW 'Backup.dbf has the same structure as INVOICES' NOWAIT
USE
DELETE FILE temp.dbf
DELETE FILE backup.dbf


CREATE FROM SeeAlso
See Also

COPY STRUCTURE EXTENDED Command


CREATE LABEL Command

See Also

Opens a Label Design window in FoxPro for MS-DOS.

Opens the New Label dialog in FoxPro for Windows and FoxPro for Macintosh.

Syntax

CREATE LABEL
[<file> | ?]
[NOWAIT]
[SAVE]
[[WINDOW <window name1>] [IN [WINDOW] <window name2> | IN SCREEN | IN MACDESKTOP]]

Remarks

Now you can create and print labels in standard label formats or design your own custom labels.  You can see how your labels will look before they are printed using Page Preview.

Clauses

<file> | ?

If a file name is included, the label file is created with that name.  If an extension isn't included with the file name, an .LBX extension is automatically assigned.  The Open dialog appears when the question mark (?) is included.  A list of existing label files is displayed.  Choose one of the existing labels or enter the name of a new labels to create.

NOWAIT

When CREATE LABEL is issued in a program, a Label Design or Report Layout window is opened and program execution pauses until the Label Design or Report Layout window is closed.

The NOWAIT option continues program execution after the Label Design Window or Report Layout window has been opened.  The program doesn't wait for the Label Design or Report Layout window to be closed, but continues execution on the program line immediately following that containing CREATE LABEL NOWAIT.  Including the NOWAIT option has no effect on the CREATE LABEL command, when it is issued from the Command window.

SAVE

During program execution, SAVE leaves the Label Design or Report Layout window open after another window is brought forward.  Including the SAVE option has no effect, when issued from the Command window.

In FoxPro for MS-DOS, you can close a Label Design window opened with the SAVE option by pressing Ctrl+W, Ctrl+End, Ctrl+Q or Esc, by clicking the close box or by choosing the Close option from the Edit menu.

In FoxPro for Windows, you can close a Report Layout window created with SAVE by pressing Ctrl+W, Ctrl+End or Esc, or by choosing Close from the Browse window Control menu or the In FoxPro for Macintosh, you can close a Report Layout window created with SAVE by pressing Ctrl+W, Ctrl+End or Esc, or by choosing Close from the File menu.

WINDOW <window name1>

If you include WINDOW <window name1>, the Label Design or Report Layout window takes on the characteristics of the specified window.  For example, if the window is created with the FLOAT option of DEFINE WINDOW, the Label Design or Report Layout window can be moved.  The window doesn't have to be active or visible, but it must be defined.

The Label Design or Report Layout window has a default size that can be larger than the window from which it takes it characteristics.  In this case, the Label Design or Report Layout window still assumes the characteristics of the window in which it is placed.  The upper left corner of the Label Design or Report Layout window is placed at the same coordinates as the upper left corner of the window, and can extend beyond the window's borders.

IN [WINDOW] <window name2>

If IN WINDOW <window name2> is included, the Label Design or Report Layout window is opened within a parent window.  It doesn't assume the characteristics of the parent window in which it is placed.  A Label Design or Report Layout window activated inside a parent window cannot be moved outside the parent window.  If the parent window is moved, the Label Design or Report Layout window moves with it.

The parent window must first be defined with DEFINE WINDOW, and must be visible to access the Label Design or Report Layout window.

IN SCREEN

You can place a Label Design or Report Layout window on the desktop in FoxPro for MS-DOS or in the main window in FoxPro for Windows by including IN SCREEN.  This clause lets you explicitly place a Label Design or Report Layout window on the desktop or main window in FoxPro for Windows when a user-defined window is active.  Label Design or Report Layout windows are placed on the desktop or main window in FoxPro for Windows by default.

IN MACDESKTOP

MACDESKTOP is available in FoxPro for Macintosh only.

Include the MACDESKTOP clause to place a Label Design or Report Layout window on the Macintosh desktop. The Label Design or Report Layout window resides at the same level as the main FoxPro window. The Label Design or Report Layout window can be moved outside of the main FoxPro window and the main FoxPro window can be brought forward over the top of it. When you include the MACDESKTOP clause the Label Design or Report Layout window behaves in the same manner as Label Design or Report Layout windows in FoxBASE+ for Macintosh.

Including the MACDESKTOP clause overrides the current SET MACDESKTOP setting. SET MACDESKTOP determines if Label Design or Report Layout windows are placed on the main FoxPro window or the Macintosh desktop when the SCREEN or MACDESKTOP clause is not included. For more information about placing Label Design or Report Layout  windows on the main FoxPro window or the Macintosh desktop, see SET MACDESKTOP.


CREATE LABEL SeeAlso
See Also

LABEL Command

MODIFY LABEL Command


CREATE MENU Command

See Also

Opens a Menu Design window.

Syntax

CREATE MENU
[<file> | ?]
[NOWAIT]
[SAVE]
[[WINDOW <window name1>] [IN [WINDOW] <window name2> | IN SCREEN | IN MACDESKTOP]]

Remarks

In the Menu Design window, user-defined menus and popups are easily created with the Menu Builder.  After you have created your menus and popups, the menu and popup definition information is stored in a FoxPro table with an .MNX extension.

Issuing CREATE MENU without any additional arguments opens a new Menu Design window.  The name UNTITLED is temporarily assigned to the menu definition.  When you exit the Menu Design window, you can save the menu definition under a different name.

Clauses

<file>

If a file name is included, the menu table is created with that name.  If an extension isn't included with the table name, an .MNX extension is automatically assigned.

?

The Open dialog appears when the question mark (?) is included.  A list of existing report files is displayed.  Choose one of the existing reports or enter the name of a new report to create.

NOWAIT

When CREATE MENU is issued in a program, a Menu Design window is opened and program execution pauses until the Menu Design window is closed.

The NOWAIT option continues program execution after the Menu Design window has been opened.  The program doesn't wait for the Menu Design window to be closed, but continues execution on the program line immediately following that containing CREATE MENU NOWAIT.  Including the NOWAIT option has no effect on CREATE MENU, when it is issued in the Command window.

SAVE

During program execution, SAVE leaves the Menu Design window open after another window is brought forward.  Including the SAVE option has no effect, when issued in the Command window.

In FoxPro for MS-DOS, you can close a Menu Design window opened with the SAVE option by pressing Ctrl+W, Ctrl+End, Ctrl+Q or Esc, by clicking the close box or by choosing the Close option from the Edit menu.

In FoxPro for Windows, you can close a Menu Design window created with SAVE by pressing  Ctrl+W, Ctrl+End or Escape, or by choosing Close from the Browse window Control menu or the Edit menu.

In FoxPro for Macintosh, you can close a Menu Design window created with SAVE by pressing  Ctrl+W, Ctrl+End or Esc, by clicking the close box or by choosing Close from the File menu.

WINDOW <window name1>

If you include WINDOW <window name1>, the Menu Design window takes on the characteristics of the specified window.  For example, if the window is created with the FLOAT option of DEFINE WINDOW, the Menu Design window can be moved.  The window need not be active or visible, but it must be defined.

The Menu Design window has a default size that can be larger than the window from which it takes it characteristics.  In this case, the Menu Design window still assumes the characteristics of the window in which it is placed.  The upper left corner of the Menu Design window is placed at the same coordinates as the upper left corner of the window, and can extend beyond the window's borders.

IN [WINDOW] <window name2>

If IN WINDOW <window name2> is included, the Menu Design window is opened within a parent window.  It doesn't assume the characteristics of the parent window in which it is placed.  A Menu Design window activated inside a parent window cannot be moved outside the parent window.  If the parent window is moved, the Menu Design window moves with it.

The parent window must first be defined with DEFINE WINDOW, and must be visible, to access the Menu Design window.

IN SCREEN

You can place a Menu Design window on the desktop in FoxPro for MS-DOS or in the main window by including IN SCREEN.  This clause lets you explicitly place a Menu Design window on the desktop or main window when a user-defined window is active.

IN MACDESKTOP

MACDESKTOP is available in FoxPro for Macintosh only.

Include the MACDESKTOP clause to place a Menu Design window on the Macintosh desktop. The Menu Design window resides at the same level as the main FoxPro window. The Menu Design window can be moved outside of the main FoxPro window and the main FoxPro window can be brought forward over the top of it. When you include the MACDESKTOP clause, the Menu Design window behaves in the same manner as windows in FoxBASE+ for Macintosh.

Including the MACDESKTOP clause overrides the current SET MACDESKTOP setting. SET MACDESKTOP determines if Menu Design windows are placed on the main FoxPro window or the Macintosh desktop when the SCREEN or MACDESKTOP clause is not included. For more information about placing Menu Design windows on the main FoxPro window or the Macintosh desktop, see SET MACDESKTOP.


CREATE MENU SeeAlso
See Also

DEFINE MENU Command

MODIFY MENU Command


CREATE PROJECT Command

See Also

Opens a Project window so you can create a project.

Syntax

CREATE PROJECT
[<file> | ?]
[NOWAIT]
[SAVE]
[[WINDOW <window name1>] [IN [WINDOW] <window name2> | IN SCREEN | IN MACDESKTOP]]

Remarks

A project is a table that keeps track of all files that are required to create an application, as well as all dependencies, references and connections among the files.  A project table has a .PJX extension and an associated memo file with a .PJT extension.  In a project, you specify all the pieces that are required for the final application, then FoxPro ensures that compiled files are based on the latest source files.

A project table can be opened with USE and manipulated like any other FoxPro table.

Issuing the command CREATE PROJECT without any additional arguments opens a new Project window.  The name UNTITLED is assigned to the project.  When you exit the Project window, you can save the project definition with a different name.

For more information about creating a project, refer to the Project Manager chapter in the FoxPro User's Guide.

Clauses

<file>

The Open dialog appears when the question mark (?) is included.  A list of existing report files is displayed.  Choose one of the existing reports or enter the name of a new report to create.

?

The Open dialog appears when the question mark (?) is included.  A list of existing report files is displayed.  Choose one of the existing reports or enter the name of a new report to create.

NOWAIT

When CREATE PROJECT is issued in a program, a Project window is opened and program execution pauses until the Project window is closed.

The NOWAIT option continues program execution after the Project window has been opened.  The program doesn't wait for the Project window to be closed, but continues execution on the program line immediately following the line containing CREATE PROJECT NOWAIT.  Including the NOWAIT option has no effect on the CREATE PROJECT command, when it is issued in the Command window.

SAVE

During program execution, SAVE leaves the Project window open after another window is brought forward.  Including the SAVE option has no effect, when issued in the Command window.

In FoxPro for MS-DOS, you can close a Project window opened with the SAVE option by pressing Ctrl+W, Ctrl+End, Ctrl+Q or Esc, by clicking the close box or by choosing the Close option from the Edit menu.

In FoxPro for Windows, you can close a Project window created with SAVE by pressing Ctrl+W, Ctrl+End or Esc, by clicking the close box or by choosing Close from the Browse window Control menu or the Edit menu.

In FoxPro for Macintosh, you can close a Project window created with SAVE by pressing Ctrl+W, Ctrl+End or Esc, by clicking the close box or by choosing Close from the File menu.

WINDOW <window name1>

If you include WINDOW <window name1>, the Project window takes on the characteristics of the specified window.  For example, if the window is created with the FLOAT option of DEFINE WINDOW, the Project window can be moved.  The window need not be active or visible, but it must be defined.

The Project window has a default size that can be larger than the window from which it takes it characteristics.  In this case, the Project window still assumes the characteristics of the window in which it is placed.  The upper left corner of the Project window is placed at the same coordinates as the upper left corner of the window, and can extend beyond the window's borders.

IN [WINDOW] <window name2>

If IN WINDOW <window name2> is included, the Project window is opened within a parent window.  It doesn't assume the characteristics of the parent window in which it is placed.  A Project window activated inside a parent window cannot be moved outside the parent window.  If the parent window is moved, the Project window moves with it.

The parent window must first be defined with DEFINE WINDOW, and must be visible to access the Project window.

IN SCREEN

You can place a Project window on the desktop in FoxPro for MS-DOS or in the main window in FoxPro for Windows by including IN SCREEN.  This clause lets you explicitly place a Project window on the desktop or main window in FoxPro for Windows when a user-defined window is active.  Project windows are placed in the main FoxPro window by default.

IN MACDESKTOP

MACDESKTOP is available in FoxPro for Macintosh only.

Include the MACDESKTOP clause to place a Project window on the Macintosh desktop. The Project window resides at the same level as the main FoxPro window. The Project window can be moved outside of the main FoxPro window and the main FoxPro window can be brought forward over the top of it. When you include the MACDESKTOP clause the Project window behaves in the same manner as windows in FoxBASE+ for Macintosh.

Including the MACDESKTOP clause overrides the current SET MACDESKTOP setting. SET MACDESKTOP determines if Project windows are placed on the main FoxPro window or the Macintosh desktop when the SCREEN or MACDESKTOP clause is not included. For more information about placing Project windows on the main FoxPro window or the Macintosh desktop, see SET MACDESKTOP.

window, by default.


CREATE PROJECT SeeAlso
See Also

BUILD APP Command

BUILD PROJECT Command

MODIFY PROJECT Command


CREATE QUERY Command

See Also

Opens an RQBE window.

Syntax

CREATE QUERY
[<file> | ?]

Remarks

CREATE QUERY opens an RQBE window so you can interactively create a query (SQL SELECT command).  All you need to do is specify settings in the RQBE window and FoxPro takes care of the rest.

SELECT is used to retrieve data from tables.  SELECT is very powerful and can replace a series of FoxPro commands.  Because one SQL SELECT performs the function of a series of FoxPro commands, SELECT optimizes program performance.

Think of SELECT as a way to pose a query to FoxPro to obtain information from tables.  SELECT allows you to specify the information you want without telling FoxPro how to retrieve the information.  FoxPro determines the best way to retrieve the information.

After you create a query, the query is stored as a FoxPro program file with a .QPR extension.  A query program can be executed with DO.  You must include the query file extension when executing a query with DO.  For example,

DO my_query.qpr

Issuing the command CREATE QUERY without any additional arguments opens a new RQBE query window.  The name UNTITLED is assigned to the query.  When you exit the Query window, you can save the query with a different name.

For more information about creating queries, refer to the File Menu chapter in the User's Guide or the lesson on creating queries in the FoxPro Getting Started manual.

<file>

If a <file> name is included, the query is created with that name.  If an extension isn't included with the file name, a .QPR extension is automatically assigned.

?

The Open dialog appears when the question mark (?) is included.  A list of existing report files is displayed.  Choose one of the existing reports or enter the name of a new report to create.


CREATE QUERY SeeAlso
See Also

MODIFY QUERY Command


CREATE REPORT Command

See Also

Opens a report in a Report Design window.

Syntax

CREATE REPORT
[<file> | ?]
[NOWAIT]
[SAVE]
[[WINDOW <window name1>] [IN [WINDOW] <window name2> | IN SCREEN | IN MACDESKTOP]]

Remarks

CREATE REPORT can also be used to generate a quick report without opening the Report Design window.  For more information, see CREATE REPORT Command - Quick Report  and the reports chapter in the FoxPro User's Guide.

Clauses

<file>

Issuing CREATE REPORT without any additional arguments opens a new Report Design window.  The name UNTITLED is assigned to the report definition.  When you exit the Report Design window you are prompted to save the report definition with a different name.

If a <file> name is included, the report is saved under that name.  An .FRX extension is automatically assigned.  If a report file with that name already exists, you are asked if you want to overwrite the existing file (if SET SAFETY is ON).

?

The Open dialog appears when the question mark (?) is included.  A list of existing report files is displayed.  Choose one of the existing reports or enter the name of a new report to create.

NOWAIT

When CREATE REPORT is issued in a program, a Report Design window is opened and program execution pauses until the Report Design window is closed.

The NOWAIT option continues program execution after the Report Design window has been opened.  The program doesn't wait for the Report Design window to be closed, but continues execution on the program line immediately following that containing CREATE REPORT NOWAIT.  Including the NOWAIT option has no effect on the CREATE REPORT command, when it is issued from the Command window.

SAVE

During program execution, SAVE leaves the Report Design window open after another window is brought forward.  Including the SAVE option has no effect, when issued in the Command window.

In FoxPro for MS-DOS, you can close a Report Design window opened with the SAVE option by pressing Ctrl+W, Ctrl+End, Ctrl+Q or Esc, by clicking the close box or by choosing the Close option from the Edit menu.

In FoxPro for Windows, you can close a Report Design window created with SAVE by pressing Ctrl+W, Ctrl+End or Esc, by clicking the close box or by choosing Close from the Browse window Control menu or the Edit menu.

In FoxPro for Macintosh, you can close a Report Design window created with SAVE by pressing Ctrl+W, Ctrl+End or Esc, by clicking the close box or by choosing Close from the File menu.

WINDOW <window name1>

If you include WINDOW <window name1>, the Report Design window takes on the characteristics of the specified window.  For example, if the window is created with the FLOAT option of DEFINE WINDOW, the Report Design window can be moved.  The window need not be active or visible, but it must be defined.

The Report Design window has a default size that can be larger than the window from which it takes it characteristics.  In this case, the Report Design window still assumes the characteristics of the window in which it is placed.  The upper left corner of the Report Design window is placed at the same coordinates as the upper left corner of the window, and can extend beyond the window's borders.

IN [WINDOW] <window name2>

If IN WINDOW <window name2> is included, the Report Design window is opened within a parent window.  It doesn't assume the characteristics of the parent window in which it is placed.  A Report Design window activated inside a parent window cannot be moved outside the parent window.  If the parent window is moved, the Report Design window moves with it.

The parent window must first be defined with DEFINE WINDOW, and must be active and visible to access the Report Design window.

IN SCREEN

You can place a Report Design window on the desktop in FoxPro for MS-DOS or in the main window in FoxPro for Windows by including IN SCREEN.  This clause lets you explicitly place a Report Design window on the desktop or main window when a user-defined window is active.  Report Design windows are placed in the main FoxPro window by default.

IN MACDESKTOP

MACDESKTOP is available in FoxPro for Macintosh only.

Include the MACDESKTOP clause to place a Report Design window on the Macintosh desktop. The Report Design window resides at the same level as the main FoxPro window. The Report Design window can be moved outside of the main FoxPro window and the main FoxPro window can be brought forward over the top of it. When you include the MACDESKTOP clause the Report Design window behaves in the same manner as Report Design windows in FoxBASE+ for Macintosh.

Including the MACDESKTOP clause overrides the current SET MACDESKTOP setting. SET MACDESKTOP determines if Report Design windows are placed on the main FoxPro window or the Macintosh desktop when the SCREEN or MACDESKTOP clause is not included. For more information about placing Report Design windows on the main FoxPro window or the Macintosh desktop, see SET MACDESKTOP.


CREATE REPORT SeeAlso
See Also

CREATE REPORT Command - Quick Report

MODIFY REPORT Command

REPORT Command


CREATE REPORT Command - Quick Report

See Also

Programmatically creates a report.

Syntax

CREATE REPORT <file1> | ?
FROM <file2>
[FORM | COLUMN]
[FIELDS <field list>]
[ALIAS]
[NOOVERWRITE]
[WIDTH <expN>]

Remarks

This form of CREATE REPORT creates a quick report without opening a Report Design window.  The report is created as if you chose the Quick Report ...  option while the Report Design window is open.

Another form of CREATE REPORT, discussed in the previous topic, opens the Report Writer in a Report Design window to let you interactively create a report.  The Report Writer has a Page Preview feature to show you how your report looks before it is printed.

For more information on interactively creating quick reports, refer to the reports chapter in the FoxPro User's Guide.

<file1>

When a file name <file1> is included, the report file is saved under that name.  An .FRX extension is automatically assigned.  If a report file with that name already exists and the NOOVERWRITE option is omitted, you are asked if you want to overwrite the existing file (if SAFETY is SET ON).

?

The Open dialog appears when the question mark (?) is included.  A list of existing report files is displayed.  Choose one of the existing reports or enter the name of a new report to create.

FROM <file2>

Specify the name of the table from which the quick report is created with <file2>.  The table doesn't have to be open.

FORM | COLUMN

If you include FORM, the quick report is created with the fields and their names arranged from top to bottom in the Detail band.

If you include COLUMN, the quick report is created with the fields arranged from left to right across the page in the Detail band.  The field names are placed in the Page Header band.  If you do not include FORM or COLUMN, the quick report defaults to the COLUMN format.

FIELDS <field list>

Including FIELDS lets you specify the fields from the table that appear in the quick report.  Separate the fields in the <field list> with commas.

ALIAS

Include ALIAS to add the table alias to the field names in the quick report.

NOOVERWRITE

NOOVERWRITE prevents an existing report from being overwritten.  If a report already exists with the name <file1>, the report isn't created.

WIDTH <expN>

The width of the report page can be specified by including WIDTH <expN>.  The number of columns in the report is specified by <expN>.


CREATE REPORT - Quick Report SeeAlso
See Also

CREATE REPORT Command

MODIFY REPORT Command

REPORT Command


CREATE SCREEN Command

See Also

Opens a Screen Design window.

Syntax

CREATE SCREEN
[<file> | ?]
[NOWAIT]
[SAVE]
[[WINDOW <window name1>] [IN [WINDOW] <window name2> | IN SCREEN | IN MACDESKTOP]]

Remarks

CREATE SCREEN can also be used to generate a quick screen without opening the screen layout window.  For more information, see CREATE SCREEN Command - Quick Screen and the Screen Builder chapter in the FoxPro User's Guide.

Clauses

<file>

Issuing CREATE SCREEN without any additional arguments opens a new Screen Design window.  The name UNTITLED is assigned to the screen definition.  When you exit the Screen Design window you are prompted to save the screen definition with a different name.

If a <file> name is included, the screen is saved under that name.  An .SCX extension is automatically assigned.  If a screen file with that name already exists, you are asked if you want to overwrite the existing file (if SAFETY is SET ON).

?

The Open dialog appears when the question mark (?) is included.  A list of existing report files is displayed.  Choose one of the existing reports or enter the name of a new report to create.

NOWAIT

When CREATE SCREEN is issued in a program, a Screen Design window is opened and program execution pauses until the Screen Design window is closed.

The NOWAIT option continues program execution after the Screen Design window has been opened.  The program doesn't wait for the Screen Design window to be closed, but continues execution on the program line immediately following that containing CREATE SCREEN NOWAIT.  Including the NOWAIT option has no effect on the CREATE SCREEN command, when it is issued in the Command window.

SAVE

During program execution, SAVE leaves the Screen Design window open after another window is brought forward.  Including the SAVE option has no effect when issued from the Command window.

In FoxPro for MS-DOS, you can close a Screen Design window opened with the SAVE option by pressing Ctrl+W, Ctrl+End, Ctrl+Q or Esc, by clicking the close box or by choosing the Close option from the Edit menu.

In FoxPro for Windows, you can close a Screen Design window opened with the SAVE option by pressing Ctrl+W, Ctrl+End or Esc, by clicking the close box or by choosing Close from the Browse window Control menu or the Edit menu.

In FoxPro for Macintosh, you can close a Screen Design window opened with the SAVE option by pressing Ctrl+W, Ctrl+End or Esc, by clicking the close box or by choosing Close from the File menu.

WINDOW <window name1>

If you include WINDOW <window name1>, the Screen Design window takes on the characteristics of the specified window.  For example, if the window is created with the FLOAT option of DEFINE WINDOW, the Screen Design window can be moved.  The window need not be active or visible, but it must be defined.

The Screen Design window has a default size that can be larger than the window from which it takes it characteristics.  In this case, the Screen Design window still assumes the characteristics of the window in which it is placed.  The upper left corner of the Screen Design window is placed at the same coordinates as the upper left corner of the window, and can extend beyond the window's borders.

IN [WINDOW] <window name2>

If IN WINDOW <window name2> is included, the Screen Design window is opened within a parent window.  It doesn't assume the characteristics of the parent window in which it is placed.  A Screen Design window activated inside a parent window cannot be moved outside the parent window.  If the parent window is moved, the Screen Design window moves with it.

The parent window must first be defined with DEFINE WINDOW, and must be active and visible to access the Screen Design window.

IN SCREEN

You can place a Screen Design window on the desktop in FoxPro for MS-DOS or in the main window in FoxPro for Windows by including IN SCREEN.  This clause lets you explicitly place a Screen Design window on the desktop or main window in FoxPro for Windows when a user-defined window is active.  Screen Design windows are placed in the main FoxPro window by default.

IN MACDESKTOP

MACDESKTOP is available in FoxPro for Macintosh only.

Include the MACDESKTOP clause to place a Screen Design window on the Macintosh desktop. The Screen Design window resides at the same level as the main FoxPro window. The Screen Design window can be moved outside of the main FoxPro window and the main FoxPro window can be brought forward over the top of it. When you include the MACDESKTOP clause the Screen Design window behaves in the same manner as windows in FoxBASE+ for Macintosh.

Including the MACDESKTOP clause overrides the current SET MACDESKTOP setting. SET MACDESKTOP determines if Screen Design windows are placed on the main FoxPro window or the Macintosh desktop when the SCREEN or MACDESKTOP clause is not included. For more information about placing Screen Design windows on the main FoxPro window or the Macintosh desktop, see SET MACDESKTOP.


CREATE SCREEN SeeAlso
See Also

CREATE SCREEN Command - Quick Screen

MODIFY SCREEN Command


CREATE SCREEN Command - Quick Screen

See Also

Programmatically creates a screen.

Syntax

CREATE SCREEN <file1> | ?
FROM <file2>
[ROW | COLUMN]
[FIELDS <field list>]
[ALIAS]
[NOOVERWRITE]
[SIZE <expN1>, <expN2>]
[SCREEN]

Remarks

This form of CREATE SCREEN creates a quick screen without opening a screen layout window.  The screen is created as if you chose the Quick Screen ...  option while the Screen Design window is open.

Another form of CREATE SCREEN, discussed in the previous topic, opens the Screen Builder to let you interactively create a screen in a layout window.

For more information on interactively creating quick screens, refer to the Designing Screens with the Screen Builder chapter in the FoxPro User's Guide.

<file1>

When a file name <file1> is included, the screen file is saved under that name.  An .SCX extension is automatically assigned.  If a screen file with that name already exists and the NOOVERWRITE option isn't included, you are asked if you want to overwrite the existing file (if SAFETY is SET ON).

?

The Open dialog appears when the question mark (?) is included.  A list of existing report files is displayed.  Choose one of the existing reports or enter the name of a new report to create.

FROM <file2>

Specify the name of the table from which quick screen is created with <file2>.  The table doesn't have to be open.

ROW | COLUMN

If you include ROW, the quick screen is created with the fields and their names arranged from top to bottom.  If you do not include ROW or COLUMN, the quick screen defaults to this format.

If you include COLUMN, the quick screen is created with the fields and their names arranged from left to right across the screen.  If the total width of the fields is greater than the width of the screen, the fields may be displayed in the ROW format.

FIELDS <field list>

Including FIELDS lets you specify the fields from the table that appear in the quick screen.  Separate the fields in the <field list> with commas.

ALIAS

Include ALIAS to add the table alias to the field names in the quick screen.

NOOVERWRITE

NOOVERWRITE prevents an existing screen from being overwritten.  If a screen already exists with the name <file1>, the screen isn't created.

SIZE <expN1>, <expN2>

You can designate the window height and width by including the SIZE clause.  The window height in rows is specified by <expN1>, the window width in columns by <expN2>.

SCREEN

Including SCREEN creates a quick screen that is placed on the desktop in FoxPro for MS-DOS or in the main window in FoxPro for Windows.  This clause lets you explicitly place quick screen on the desktop or main FoxPro window when a user-defined window is active.  Quick screens are placed on the desktop or main FoxPro window, by default.


CREATE SCREEN - Quick Screen SeeAlso
See Also

CREATE SCREEN Command

MODIFY SCREEN Command


CREATE TABLE Command - SQL

See Also	Example

Creates a table having the specified fields.

Syntax

CREATE TABLE | DBF <dbf_name> (<fname1> <type> [(<precision>[, <scale>])
[, <fname2> ...]]) |
FROM ARRAY <array>

Remarks

Each new field is defined with a name, type, precision and scale.  These definitions can be obtained from the command itself or from an array.

The new table is opened in the lowest available work area, and can be accessed by its alias.  The new table is opened exclusively, regardless of the current setting of SET EXCLUSIVE.

Clauses

CREATE TABLE | DBF <dbf_name>

In this clause, <dbf_name> specifies the name of the table to create.  The <dbf_name> can include a path and can be a name expression.  The table is opened in a new work area (if a table is open in the current work area) and the new work area is selected.

(<fname1> <type> [(<precision>[, <scale>] [, <fname2> ...  ])

In this clause, <fname1> and <fname2> are names of fields in the new table.  Each <fname> can be a name expression.

<type> is a single letter indicating the data type for the field.  Some data types require that you specify a <precision> (field width) and <scale> (number of decimal places).

<type>, <precision> and <scale> may be:

Type	Precision	Scale	Description
C	n	-	Character string of width n
D	-	-	Date
F	n	d	Float of width n with d decimal places
L	-	-	Logical
M	-	-	Memo
N	n	d	Numeric of width n with d decimal places
G	-	-	General
P	-	-	Picture
<precision> and <scale> are ignored for D, L, M, G and P types.  If a <scale> isn't included for N or F types, the <scale> defaults to zero (no decimal places).

FROM ARRAY <array>

In this clause, <array> is the name of an existing array whose contents are the name, type, precision and scale for each field in the table.  The contents of the array can be defined with the AFIELDS( ) function.


CREATE TABLE - SQL Example

This example creates a table and displays its structure.

CLOSE DATABASES
CREATE TABLE employee ;
(name C(20), addr C(30), city C(30), zip C(5), salary N(8,2), ;
comments M)
DISPLAY STRUCTURE

This example dimensions and fills an array then creates a table from the array.

CLOSE DATABASES
CLEAR
USE invoices
DISPLAY STRUCTURE
COPY STRUCTURE EXTENDED TO temp
USE temp
DIMENSION cur_copy[1,4]
SCATTER TO cur_copy
CREATE DBF backup FROM ARRAY cur_copy
DISPLAY STRUCTURE


CREATE TABLE - SQL SeeAlso
See Also

AFIELDS( ) Function

CREATE Command

CREATE QUERY Command

INSERT Command - SQL

MODIFY QUERY Command

SELECT Command - SQL

SQL Commands Overview


CREATE VIEW Command

See Also

Creates a view file from the FoxPro environment.

Syntax

CREATE VIEW <file>

Remarks

CREATE VIEW builds a new view <file> containing information about the FoxPro environment.  SET VIEW restores the environment saved to a view file by CREATE VIEW.  View files created with CREATE VIEW are assigned a .VUE extension.

The information saved in a view file includes:

All tables, index, alternate and format files currently open in all work areas

All fields contained in the SET FIELDS list

All established relations between open tables

All filters in effect for open tables

The DEFAULT and PATH settings

The procedure file setting

The current help file

The current resource file

The SET SKIP status

The status bar state (ON or OFF)

View files are useful both in programs and while debugging.  Only one command, SET VIEW TO <view file>, needs to be executed to establish the entire environment needed to complete a task.  This prevents you from having to retype the command.  While debugging, the environment settings can be saved in a view file, testing can be performed, and the environment can be restored to continue program execution.


CREATE VIEW SeeAlso
See Also

SET VIEW Command


CTOD( ) Function

See Also	Example

Converts a character expression to a date expression.

Syntax

CTOD(<expC>)

Returns

Date

Remarks

CTOD( ), the character to date function, returns a date type value from a character expression.

Parameter

<expC>

The character expression <expC> is converted to a date value by CTOD( ).  <expC> must contain a valid date from 1/1/100 to 12/31/9999.

The default format for <expC> is mm/dd/yy.  You can use SET DATE and SET CENTURY to change the default format.  If the century isn't specified when entering a date (as in the character expression 12/25/91), the twentieth century is assumed.


CTOD( ) Example

STORE '7/4/1776' TO the_4th
? CTOD(the_4th)

STORE {09/15/92} TO today
STORE CTOD('12/25/92') TO christmas
STORE STR(christmas-today,3) TO days_left
? 'There are', days_left, 'days until Christmas'


CTOD() SeeAlso
See Also

DTOC( ) Function

SET CENTURY Command

SET DATE Command

SYS(1) Function - Julian System Date

SYS(10) Function - String from Day Number

SYS(11) Function - Julian Day Number


CURDIR( ) Function

See Also	Example

Returns the current MS-DOS directory.

Syntax

CURDIR([<expC>])

Returns

Character

Remarks

CURDIR( ) returns, as a character string, the current MS-DOS directory on a specified drive.

In FoxPro for Macintosh, CURDIR( ) returns, as a character string, the current folder on a specified volume. The folder returned uses MS-DOS shorthand notation. MS-DOS shorthand notation is supported in FoxPro for Macintosh to provide compatibility with applications created on other FoxPro platforms. See SET PATH for more information about MS-DOS and Macintosh shorthand notation. Use SYS(2027) to convert a folder or path containing MS-DOS shorthand notation to one using Macintosh shorthand notation.

Clauses

<expC>

The current directory is returned for the drive specified by <expC>.  If the drive is omitted, the current default drive is assumed (the FoxPro SET DEFAULT drive).  The null string is returned if the specified drive doesn't exist.

CURDIR( ) ignores the FoxPro SET PATH values.


CURDIR( ) Example

The following example stores the current directory to a variable, sets the default to the directory FoxPro was started in, displays the new directory, returns the default to the original directory, and displays the original directory.

CLEAR
? 'Current directory: ', CURDIR( )
old_dir = SET('DEFAULT') + SYS(2003)
SET DEFAULT TO (SYS(2004))
? 'FoxPro directory: ', CURDIR( )
SET DEFAULT TO (old_dir)
? 'Current directory:', CURDIR( )


CURDIR() SeeAlso
See Also

FULLPATH( ) Function


DATE( ) Function

See Also	Example

Returns the current system date, which is controlled by the operating system.

Syntax

DATE( )

Returns

Date

Remarks

No FoxPro commands or functions can directly change the system date.

The format of the character string returned by DATE( ) can be changed with SET CENTURY, SET DATE and SET MARK TO.


DATE( ) Example

The following example displays the current system date and the date with CENTURY on.

? DATE( )

SET CENTURY ON
? MDY(DATE( ))


DATE( ) SeeAlso
See Also

SET CENTURY Command

SET DATE Command

SET MARK TO Command

SYS( ) Functions Overview


DAY( ) Function

See Also	Example

Returns the numeric day of the month for a given date expression.

Syntax

DAY(<expD>)

Returns

Numeric

Remarks

DAY( ) returns a number from 1 through 31.

Parameters

<expD>

The date expression <expD> can be a date literal, a date type memory variable, an array element or a field.


DAY( ) Example

STORE {05/03/92} TO bdate
? CDOW(bdate)

? DAY(bdate)

? 'That date is', CMONTH(bdate),STR(DAY(bdate),2)


DAY() SeeAlso
See Also

CDOW( ) Function

DOW( ) Function

SYS( ) Functions Overview


DBF( ) Function

See Also	Example

Returns the name of a table open in a specified work area or a table name from a table alias.

Syntax

DBF([<expC> | <expN>])

Returns

Character

Parameters

<expC> | <expN>

<expN> is the work area number, and <expC> is the table alias.

If you omit <expC> and <expN>, the name of the table open in the current work area is returned.

The null string is returned by DBF( ) if a table isn't open in the work area you specify.  If a table doesn't have the alias you specify with <expC>, the message "Alias not found" is displayed.

For information on creating an alias for a table, see USE.

In FoxPro for MS-DOS and FoxPro for Windows, when SET FULLPATH is ON, the path to the table is returned with the table name. When SET FULLPATH is OFF, the drive the table resides on is returned with the table name. In FoxPro for Macintosh, the FULLPATH setting is ignored and the path to the table is always returned with the table name.


DBF( ) Example

The following example returns the name of a table from its work area and its alias, and returns the null string after all tables have been closed.

CLOSE DATABASES
USE salesman IN 2 ALIAS salesper
? DBF(2)
? DBF('salesper')
CLOSE DATABASES
? DBF( )	&& the null string is returned


DBF() SeeAlso
See Also

CDX( ) Function

FIELD( ) Function

NDX( ) Function

SET FULLPATH Command


DDE Functions

See Also

Exchange data between FoxPro for Windows and other Windows-based applications.

Remarks

Platform [image] FoxPro for Windows.

The DDE (Dynamic Data Exchange) functions in the following help topics provide support for data exchange between FoxPro for Windows and other Windows-based applications.  FoxPro for Windows can act as both a server and a client to send and receive data to and from other Windows-based applications.

A consistent naming convention is used in applications that support DDE and is employed in this documentation:

Service Name

A name that the server responds to when a client tries to access the server.  A server can support many service names.

Topic Name

A name that specifies a logical set of data.  For file based applications, topic names are usually file names.  In other applications, topic names are application specific.  To access the server, the client must specify a topic name in addition to the server's service name.

Item Name

A name that specifies a unit of data that the server can pass to the client requesting the data.

To request data from another application, create a FoxPro for Windows program that establishes FoxPro for Windows as a client.  Here is a brief outline for creating a simple FoxPro program that requests data from another application:

Establish a link to the server application with DDEInitiate( ).

If the link is successfully established, use DDERequest( ) to request data from the server application.  DDERequest( ) can be issued repeatedly to request additional data.

After the data has been received, issue DDETerminate( ) to terminate the link to the server application to free up system resources.

The functions above establish a cold link.  A cold link exists when the client initiates all the communications between the applications.  See DDEAdvise( ) for a discussion of other types of links.

The following is a brief outline for a program that establishes FoxPro for Windows as a server:

Use DDESetService( ) to create a service and specify the type of service.

Use DDESetTopic( ) to create a service topic and specify the procedure to execute when the topic is specified in a client request.

Create the procedure specified in DDESetTopic( ) to accept the parameters passed to the procedure.

Within the procedure, process the request and, if appropriate, return the requested data to the client.

Note that these DDE functions differ from previous FoxPro function conventions in the following ways:

The first four characters of these functions are not unique.

The function names exceed ten characters and cannot be abbreviated.

DDE Function	Description
DDEAbortTrans( )	Aborts an asynchronous DDE transaction.
DDEAdvise( )	Creates a notify link or an automatic link used in dynamic data exchange (DDE).
DDEEnabled( )	Enables or disables dynamic data exchange (DDE) processing or returns the status of DDE processing.
DDEExecute( )	Using dynamic data exchange (DDE), sends a command to another application.
DDEInitiate( )	Establishes a dynamic data exchange (DDE) channel between FoxPro for Windows and another Microsoft Windows-based application.
DDELastError( )	Returns an error number for the last dynamic data exchange (DDE) function.
DDEPoke( )	Sends data between client and server applications in a dynamic data exchange (DDE) conversation.
DDERequest( )	Requests data from a server application in a dynamic data exchange (DDE) conversation.
DDESetOption( )	Changes or returns dynamic data exchange (DDE) settings.
DDESetService( )	Creates, releases or modifies service names and settings in FoxPro for Windows.
DDESetTopic( )	In a dynamic data exchange (DDE) conversation, creates or releases a topic name from a service name.
DDETerminate( )	Closes a dynamic data exchange (DDE) channel established with DDEInitiate( ).


DDE Functions SeeAlso
See Also

DDEAbortTrans( ) Function

DDEAdvise( ) Function

DDEEnabled( ) Function

DDEExecute( ) Function

DDEInitiate( ) Function

DDELastError( ) Function

DDEPoke( ) Function

DDERequest( ) Function

DDESetOption( ) Function

DDESetService( ) Function

DDESetTopic( ) Function

DDETerminate( ) Function


DDEAbortTrans( ) Function

See Also

Aborts an asynchronous DDE transaction.

Syntax

DDEAbortTrans(<expN>)

Returns

Logical

Remarks

DDEAbortTrans( ) is supported in FoxPro for Windows only.

An asynchronous transaction allows FoxPro program execution to continue without waiting for the server application.

DDEExecute( ), DDEPoke( ) and DDERequest( ) wait for the period specified by DDESetOption( ) for a server application to respond unless you specify a user-defined function (UDF) to execute when the server application responds.  Specifying a UDF to execute in these functions creates an asynchronous transaction.

If DDEAbortTrans( ) is called before the server has processed the request, the UDF won't be called for the transaction.

True (.T.) is returned if the asynchronous transaction is successfully aborted.  False (.F.) is returned if the asynchronous transaction cannot be aborted.  Use DDELastError( ) to determine why the transaction couldn't be aborted.

Parameters

<expN>

<expN> is the transaction number returned by DDEExecute( ), DDEPoke( ) or DDERequest( ) when the transaction is sent to the server application.


DDEAbortTrans() SeeAlso
See Also

DDEExecute( ) Function

DDELastError( ) Function

DDEPoke( ) Function

DDERequest( ) Function


DDEAdvise( ) Function

See Also	Example

Creates a notify link or an automatic link used in dynamic data exchange (DDE).

Syntax

DDEAdvise(<expN1>, <expC1>, <expC2>, <expN2>)

Returns

Logical

Remarks

DDEAdvise( ) is supported in FoxPro for Windows only.

DDEAdvise( ) is used to create a notify link or an automatic link to an item name in a server application.  When a notify link is created with DDEAdvise( ), the server application notifies FoxPro for Windows that the item name has been modified.  If an automatic link is created, the server application notifies FoxPro for Windows that the item name has been modified and passes the new data to FoxPro.

Before you can create a link, you must establish a channel to the server application with DDEInitiate( ).

You can also use DDEAdvise( ) to turn off notification from the server.

DDEAdvise( ) returns a true value (.T.) if it executes successfully; otherwise, it returns false (.F.).

Parameters

<expN1>

Specify the channel number returned by DDEInitiate( ) with <expN1>.

<expC1>

Use <expC1> to specify the item name.  For example, Microsoft Excel uses row and column notation to refer to cells in a spreadsheet.  The item name R1C1 designates the cell in the first row and first column of the spreadsheet.

<expC2>

Use <expC2> to specify the user-defined function (UDF) that is executed when a notify link or an automatic link is established and the item <expC1> is modified.  When the UDF is executed, it is passed the following six parameters in the order given below:

Parameter	Contents
Channel Number	The channel number of the server application
Action	ADVISE or TERMINATE
Item	The item name; for example, R1C1 for a Microsoft Excel spreadsheet cell
Data	The new data (automatic link) or the null string (notify link)
Format	The data format; for example, CF_TEXT
Advise Status	The link type (0 = manual, 1 = notify, 2 = automatic)
The UDF should have six parameters in its PARAMETER statement to accept the values passed from the server application.  If a notify link is established, the UDF is executed and the null string is passed in the Data parameter.  You can issue DDERequest( ) later to retrieve the data.  If an automatic link is established, the UDF is executed and the data is passed in the Data parameter.

The Action parameter contains ADVISE when the link is being updated by the server.  The UDF is called, and the Action parameter contains TERMINATE when the link is closed by the client or server.

Any value returned by the UDF is ignored.

<expN2>

<expN2> is a numeric value that specifies the link type in the following way:

<expN2>	Link type
0	Manual
1	Notify
2	Automatic
You can turn off notification from the server application by specifying 0 for <expN2>.  If the item changes, the UDF isn't executed.


DDEAdvise( ) Example

The following short program demonstrates how you can establish a channel to a Microsoft Excel spreadsheet named Sheet1.  DDEAdvise( ) is used to establish two links to data in two cells (R1C1 and R1C2) in the spreadsheet.  The UDF NEWDATA is executed when data in either of the cells changes.  The UDF tests the Item and Advise parameters to determine which item changed and what kind of link has been established.

PUBLIC mchannum
mchannum = DDEInitiate('Excel', 'Sheet1')

IF mchannum != -1
= DDEAdvise(mchannum, 'R1C1', 'newdata', 1)	&& Notify link
= DDEAdvise(mchannum, 'R1C2', 'newdata', 2)	&& Automatic link
WAIT WINDOW 'Enter data in EXCEL's first two cells.'
ENDIF

PROCEDURE newdata
PARAMETERS channel, action, item, data, format, advise
IF action = 'ADVISE'
DO CASE
CASE item = 'R1C1'	&& Notify link
newvalue = DDERequest(channel, item)
? 'R1C1 notify link: ' + newvalue
CASE item = 'R1C2'	&& Automatic link
newvalue = data
? 'R1C2 automatic link: ' + newvalue
ENDCASE
ELSE
= DDETerminate(mchannum)
ENDIF


DDEAdvise() SeeAlso
See Also

DDEInitiate( ) Function

DDELastError( ) Function

DDESetOption( ) Function

DDETerminate( ) Function


DDEEnabled( ) Function

See Also

Enables or disables dynamic data exchange (DDE) processing or returns the status of DDE processing.

Syntax

DDEEnabled([<expL1> | <expN1>[, <expL2>]])

Returns

Logical

Remarks

DDEEnabled( ) is supported in FoxPro for Windows only.

Using DDEEnabled( ), you can globally enable or disable processing.   You can also enable or disable DDE processing for specific channels.

DDEEnabled( ) can be used to protect critical code or disable links for short periods.  When DDE processing is disabled, client requests are queued until DDE processing is enabled.

If DDEEnabled( ) is issued without any of its optional arguments, the global DDE processing status is returned.  DDE processing has been globally enabled if true (.T.) is returned.  DDE processing has been globally disabled if false (.F.) is returned.

Parameters

<expL1>

DDE processing can be enabled or disabled globally by specifying true (.T.) or false (.F.), respectively, with <expL1>.  If DDE processing is successfully enabled or disabled, true (.T.) is returned.  False (.F.) is returned if DDE processing cannot be enabled or disabled.

<expN1>

To return the DDE processing status for a specific channel number, specify with the channel number <expN1>.  DDE processing is enabled for the channel if true (.T.) is returned.  False (.F.) is returned if processing is disabled.

<expL2>

To enable DDE processing for a specific channel, include the channel number (<expN1>) and specify true (.T.) for <expL2>.  To disable DDE processing for a specific channel, include the channel number (<expN1>) and specify false (.F.) for <expL2>.


DDEEnabled() SeeAlso
See Also

DDEAbortTrans( ) Function

DDEAdvise( ) Function

DDEExecute( ) Function

DDEInitiate( ) Function

DDELastError( ) Function

DDEPoke( ) Function

DDERequest( ) Function

DDESetOption( ) Function

DDESetService( ) Function

DDESetTopic( ) Function

DDETerminate( ) Function


DDEExecute( ) Function

See Also	Example

Using dynamic data exchange (DDE), sends a command to another application.

Syntax

DDEExecute(<expN>, <expC1> [, <expC2>])

Returns

Logical

Remarks

DDEExecute is supported in FoxPro for Windows only.

The command sent with DDEExecute( ) must be understood by the application. Before you can execute the command, you must establish a channel to the server application with DDEInitiate( ).

For example, Microsoft Excel has an extensive set of macro commands, including DDE commands that let you request data from FoxPro for Windows from within Microsoft Excel. If you establish a channel to Microsoft Excel, you can then use DDEExecute( ) to send macro commands to Microsoft Excel from within FoxPro for Windows.

If the receiving application successfully executes the command, DDEExecute( ) returns true (.T.). If the receiving application cannot successfully execute the command or if the channel number you include is not valid, DDEExecute( ) returns false (.F.). If the optional asynchronous UDF <expC3> is included, a transaction number is returned; if an error occurs, -1 is returned.

Parameters

<expN>

<expN> is the channel number.

<expC1>

<expC1> is the command you want to send to the other application. The format of the command is determined by the application you are sending it to. Consult the application's documentation for the correct syntax.

<expC2>

Include the optional character expression <expC2> to permit asynchronous command execution requests. If <expC2> is omitted, a client waits for the period specified with DDESetOption( ). If you specify the name of a UDF with <expC2>, client program execution continues immediately after the command execution request is made.

When the server application finishes executing the command, the UDF specified with <expC2> is executed. The UDF is passed six parameters in this order:

Parameter	Contents

Channel Number	The channel number of the server application

Action	XACTCOMPLETE (successful execution)
XACTFAIL (failed command execution)

Item	The item name; for example, R1C1 for a Microsoft Excel spreadsheet cell

Data	The new data (REQUEST) or data passed (POKE or EXECUTED)

Format	The data format; for example, CF_TEXT

Transaction Number	The transaction number returned by DDEExecute( )

Use DDEAbortTrans( ) to cancel an uncompleted transaction. If the transaction fails, you can use DDELastError( ) to determine why it failed.

When you include <expC2>, DDEExecute( ) doesn't return a logical value. Instead, a transaction number is returned; if an error occurs, -1 is returned.


DDEExecute( ) Example

The following example uses DDEInitiate( ) to establish a channel between FoxPro for Windows and the Microsoft Excel spreadsheet Sheet1.  DDEExecute( ) is used to execute a Microsoft Excel command that maximizes the Microsoft Excel window.

mchannum = DDEInitiate('Excel', 'Sheet1')

IF mchannum != -1
mexecute = DDEExecute(mchannum, '[App.Maximize]')
IF mexecute != .F.
WAIT WINDOW 'EXCEL window has been zoomed out.'
ENDIF
= DDETerminate(mchannum)  && Close the channel
ENDIF


DDEExecute() SeeAlso
See Also

DDEAbortTrans( ) Function

DDEInitiate( ) Function

DDELastError( ) Function

DDESetOption( ) Function

DDETerminate( ) Function


DDEInitiate( ) Function

See Also	Example

Establishes a dynamic data exchange (DDE) channel between FoxPro for Windows and another Microsoft Windows-based application.

Syntax

DDEInitiate(<expC1>, <expC2>)

Returns

Numeric

Remarks

DDEInitiate( ) is supported in FoxPro for Windows only.

DDEInitiate( ) establishes a DDE channel between FoxPro for Windows and a DDE server application.  Once a channel is established, FoxPro can request data from the server by referencing the channel in subsequent DDE functions.  FoxPro for Windows acts as the client, requesting data from the server application through the channel.

If the channel is successfully established, DDEInitiate( ) returns the channel number.  Channel numbers are non-negative, and the number of channels you can establish is limited only by your system resources.

DDEInitiate( ) returns -1 if the channel cannot be established.  If the server application isn't open, FoxPro asks if you would like to open it.  If you choose Yes, FoxPro attempts to open the application.  (You can use DDELastError( ) to determine why a channel cannot be established.)

To avoid being asked whether you want to open the application, set the DDESetOption( ) SAFETY option.  You can also use RUN with the /N option to start the application.

A channel can be closed with DDETerminate( ).

Parameters

<expC1>

<expC1> is the service name of the server application which, in most cases, is the name of the executable file without its extension.  The default service name for FoxPro for Windows is FoxPro.  If you are establishing a channel to Microsoft Excel, <expC1> is Excel.

<expC2>

Use <expC2> to specify the topic name.  The topic is application specific and must be understood by the application.  For example, one topic supplied by most DDE servers is the System topic.


DDEInitiate( ) Example

The following example uses DDEInitiate( ) to establish a channel between FoxPro for Windows and a Microsoft Excel spreadsheet named Sheet1.  Excel is the service name, and Sheet1 is the topic name.  The channel number is stored to the memory variable MCHANNUM for use in subsequent DDE functions.

mchannum = DDEInitiate('Excel', 'Sheet1')

IF mchannum != -1
* Process client actions
= DDETerminate(mchannum)  && Close the channel
ENDIF


DDEInitiate() SeeAlso
See Also

DDEAdvise( ) Function

DDEEnabled( ) Function

DDEExecute( ) Function

DDELastError( ) Function

DDEPoke( ) Function

DDERequest( ) Function

DDESetOption( ) Function

DDETerminate( ) Function

RUN | ! Command


DDELastError( ) Function

See Also

Returns an error number for the last dynamic data exchange (DDE) function.

Syntax

DDELastError( )

Returns

Numeric

Remarks

DDELastError( ) is supported in FoxPro for Windows only.

You can use DDELastError( ) to help determine the cause of an error when a DDE function doesn't execute successfully.

DDELastError( ) returns 0 if the last DDE function executed successfully.  It returns a non-zero value if the last DDE function was unsuccessful.  The following table lists the error numbers and their descriptions.

Error Number	Description
1	Service busy
2	Topic busy
3	Channel busy
4	No such service
5	No such topic
6	Bad channel
7	Insufficient memory
8	Acknowledge timeout
9	Request timeout
0	No DDEInitiate( )
11	Client attempted server transaction
12	Execute timeout
13	Bad parameter
14	Low memory
15	Memory error
16	Connect failure
17	Request failure
18	Poke timeout
19	Could not display message
20	Multiple synchronous transactions
21	Server died
22	Internal DDE error
23	Advise timeout
24	Invalid transaction identifier
25	Unknown


DDELastError() SeeAlso
See Also

DDEAbortTrans( ) Function

DDEAdvise( ) Function

DDEEnabled( ) Function

DDEExecute( ) Function

DDEInitiate( ) Function

DDEPoke( ) Function

DDERequest( ) Function

DDESetOption( ) Function

DDESetService( ) Function

DDESetTopic( ) Function

DDETerminate( ) Function


DDEPoke( ) Function

See Also

Sends data between client and server applications in a dynamic data exchange (DDE) conversation.

Syntax

DDEPoke(<expN>, <expC1>, <expC2>[, <expC3>[, <expC4>]])

Returns

Logical

Remarks

DDEPoke( ) is supported in FoxPro for Windows only.

DDEPoke( ) sends data as a character string to the item name in the application specified by the channel number.

If the data is successfully sent, DDEPoke( ) returns true (.T.).  If the data cannot be sent, false (.F.) is returned.  If the asynchronous UDF <expC3> is included, a transaction number is returned; if an error occurs, -1 is returned.

Parameters

<expN>

Use the application's channel number (<expN>) to specify the application to send the data to.  If the channel number is a server channel, DDEPoke( ) sends the data in response to a request or a previously established notify or automatic link.

<expC1>

The data is sent to the item name specified with <expC1>.  The item name is application-specific and must be understood by the application.  For example, Microsoft Excel supports R1C1 as a valid item name that refers to the first cell in a spreadsheet.

<expC2>

The data sent to the item name is specified with <expC2>.

<expC3>

The character expression <expC3> specifies the format used to send the data.  The default format is CF_TEXT.  In this format, fields are delimited with tabs and records are delimited with a carriage return and a line feed.

<expC4>

Include the character expression <expC4> to permit asynchronous data transfer.  If <expC4> is omitted, a client waits for the period specified with DDESetOption( ).  If you specify the name of a UDF with <expC4>, client program execution continues immediately after the request is made.

When the data is available from the server application, the UDF specified with <expC4> is executed.  The UDF is passed six parameters in this order:

Parameter	Contents
Channel Number	The channel number of the server application
Action	XACTCOMPLETE (successful transaction) XACTFAIL (failed transaction)
Item	The item name; for example, R1C1 for a Microsoft Excel spreadsheet cell
Data	The new data (REQUEST) or data passed (POKE or EXECUTED)
Format	The data format; for example, CF_TEXT
Transaction Number	The transaction number returned by DDEPoke( )
Use DDEAbortTrans( ) to cancel an uncompleted transaction.  If the transaction fails, you can use DDELastError( ) to determine why it failed.

When you include <expC3>, DDEPoke( ) returns a transaction number if successful or -1 if an error occurs.


DDEPoke() SeeAlso
See Also

DDEAbortTrans( ) Function

DDEInitiate( ) Function

DDELastError( ) Function

DDESetOption( ) Function

DDETerminate( ) Function


DDERequest( ) Function

See Also	Example

Requests data from a server application in a dynamic data exchange (DDE) conversation.

Syntax

DDERequest(<expN>, <expC1>[, <expC2>[, <expC3>]])

Returns

Character

Remarks

DDERequest( ) is supported in FoxPro for Windows only.

Before you can request data using DDERequest( ), you must establish a channel to the server application with DDEInitiate( ).

If the request for data is successful, DDERequest( ) returns the data as a character string.  If the request fails, DDERequest( ) returns the null string and DDELastError( ) returns a non-zero value.  If you include the asynchronous UDF <expC3>, DDERequest( ) returns a transaction number if successful or -1 if an error occurs.

Parameters

<expN>

<expN> is the channel number.

<expC1>

Use <expC1> to specify the item name.  The item name is application-specific and must be understood by the application.  For example, Microsoft Excel uses row and column notation to refer to cells in a spreadsheet.  The item name R1C1 designates the cell in the first row and first column of the spreadsheet.

<expC2>

The character expression <expC2> specifies a format for the data requested.  The default format is CF_TEXT.  In this format, fields are delimited with tabs and records are delimited with a carriage return and a line feed.

<expC3>

Include the character expression <expC3> to permit asynchronous data transfer.  If <expC3> is omitted, a client waits for the period specified with DDESetOption( ).  If you specify the name of a UDF with <expC3>, client program execution continues immediately after the request is made.

When the data is available from the server application, the UDF specified with <expC3> is executed.  The UDF is passed six parameters in this order:

Parameter	Contents
Channel Number	The channel number of the server application
Action	XACTCOMPLETE (successful transaction) XACTFAIL (failed transaction)
Item	The item name; for example, R1C1 for a Microsoft Excel spreadsheet cell
Data	The new data (REQUEST) or data passed (POKE or EXECUTED)
Format	The data format; for example, CF_TEXT
Transaction Number	The transaction number returned by DDERequest( )
Use DDEAbortTrans( ) to cancel an uncompleted transaction.  If the transaction fails, you can use DDELastError( ) to determine why it failed.

When you include <expC3>, DDERequest( ) returns a transaction number equal to or greater than 0 if successful, or -1 if an error occurs.


DDERequest( ) Example

The following example uses DDEInitiate( ) to establish a channel between FoxPro for Windows and a Microsoft Excel spreadsheet named Sheet1.  Excel is the service name and Sheet1 is the topic name.  The channel number is stored to a memory variable named MCHANNUM for use in subsequent DDE functions.

DDERequest( ) requests the item name R1C1, the data in the first row and column of the Sheet1 spreadsheet.

mchannum = DDEInitiate('Excel', 'Sheet1')

IF mchannum != -1
mrequest = DDERequest(mchannum, 'R1C1')
IF !EMPTY(mrequest) AND DDELastError( ) = 0	&& Successful
WAIT WINDOW 'R1C1 contents: ' + mrequest
ENDIF
= DDETerminate(mchannum)	&& Close the channel
ENDIF


DDERequest() SeeAlso
See Also

DDEAbortTrans( ) Function

DDEInitiate( ) Function

DDELastError( ) Function

DDESetOption( ) Function

DDETerminate( ) Function


DDESetOption( ) Function

See Also

Changes or returns dynamic data exchange (DDE) settings.

Syntax

DDESetOption(<expC>[, <expN> | <expL>])

Returns

Logical or numeric

Remarks

DDESetOption( ) is supported in FoxPro for Windows only.

Use DDESetOption( ) to change or return DDE settings.  Two options, TIMEOUT and SAFETY, are available.

Parameters

<expC>

<expC> is the setting option.

<expN>

<expN> is the timeout value.

<expL>

<expL> enables or disables dialog display.

Option <expC>	Setting	Default	Description
TIMEOUT	<expN> (number of milliseconds)	2000	The number of milliseconds DDE functions wait for the server application to respond; the current TIMEOUT value is returned if <expN> is omitted.
SAFETY	<expL> (true (.T.) or false (.F.))	.T.	Specifies if a dialog is displayed when you use DDEInitiate( ) to establish a channel to a server application and the application doesn't respond; the current SAFETY setting is returned if <expL> is omitted.


DDESetOption() SeeAlso
See Also

DDEAdvise( ) Function

DDEEnabled( ) Function

DDEExecute( ) Function

DDEInitiate( ) Function

DDEPoke( ) Function

DDERequest( ) Function

DDESetService( ) Function

DDETerminate( ) Function


DDESetService( ) Function

See Also

Creates, releases or modifies service names and settings in FoxPro for Windows.

Syntax

DDESetService(<expC1>, <expC2>[, <expC3> | <expL>])

Returns

Logical

Remarks

DDESetService( ) is supported in FoxPro for Windows only.

FoxPro for Windows can act as a dynamic data exchange (DDE) server to send data to client  Microsoft Windows-based applications.  DDESetService( ) is used to create, release or modify service names and settings in FoxPro for Windows.  Each service name can have a set of topic names created with DDESetTopic( ).  Client applications request data from DDE topic names.

DDESetService( ) returns true (.T.) if the service name is successfully created, released or modified.  If the service name cannot be created, released or modified, false (.F.) is returned.

DDESetService( ) can be used to return information about a service name.

FoxPro for Windows has the default service name FoxPro.  The FoxPro service name has one topic name called System.  The following table lists all the item names supported by the System topic.

Item Name	Item

Topics	A list of available topic names

Formats	A list of supported formats

Status	Busy or Ready

SysItems	A list of item names

You can use DDESetTopic( ) to modify the FoxPro service name or to release it.  For information about manipulating the FoxPro service name, see the DDESetTopic( ) options.

Parameters

<expC1>

<expC1> is the service name to create, release, modify or return information about.

<expC2>

Use <expC2> to create, release or modify a service name or to return information about a service name.  The following table lists the options you can specify with <expC2>, the default values for the options and a description of each option.

Option	Default Value	Description
DEFINE	-	Creates a new service name
RELEASE	-	Releases an existing service name
ADVISE	.F.	Enables or disables client notification of changes to item names
EXECUTE	.F.	Enables or disables command execution
POKE	.F.	Enables or disables client pokes to the service
REQUEST	.T.	Enables or disables requests to the service name
FORMATS	CF_TEXT	Specifies supported data formats
DEFINE

DEFINE creates a new service name.  For example, the following command creates the service name MYSERVICE:

mnewservice = DDESetService('myservice', 'DEFINE')

RELEASE

RELEASE releases an existing service name to free up system resources.  When a service name is released, all of the service's topic names are also released.

The following command releases the service name created in the previous example:

mrelease = DDESetService('myservice', 'RELEASE')

To release the default FoxPro service, issue this command:

mrelfox = DDESetService('FoxPro', 'RELEASE')

ADVISE

Use the ADVISE option to specify whether a client is notified when data changes in an item name or to return the current advise status for a service name.  Refer to DDEAdvise( ) for additional information about advising clients.

To enable client notification, specify true (.T.) for <expL>.  Specifying false (.F.) for <expL> disables client notification.

To return the current client notification status for the service name, omit <expL>.  DDESetService( ) returns true if client notification is enabled for the service name; it returns false if client notification is disabled.

EXECUTE

With the EXECUTE option, you can enable or disable command execution requests to a service name or determine the current execute status for a service name.

To enable client requests to execute a command, specify true (.T.) for <expL>.  Specifying false (.F.) for <expL> disables client requests to execute a command.  .F. is the default value.

To return the current command execution status for the service name, omit <expL>. DDESetService( ) returns true if client command execution requests are enabled for the service name; otherwise, it returns false.

The following commands enable command execution and disable data requests from client applications for the service name MYSERVICE.   The current command execution status for MYSERVICE is then displayed:

mexecute = DDESetService('myservice', 'EXECUTE', .T.)
mrequest = DDESetService('myservice', 'REQUEST', .F.)
? DDESetService('myservice', 'EXECUTE')

POKE

With the POKE option, you can enable or disable poke requests to the service name.  You can also determine the current poke status for a service name.  Refer to DDEPoke( ) for additional information about poking data to a server or a client.

To enable client poke requests, specify true (.T.) for <expL>.  Specifying false (.F.) for <expL> disables client poke requests.  .F. is the default value.

To return the current poke status for the service name, omit <expL>.  DDESetService( ) returns true if poke requests are enabled for a service name; it returns false if poke requests are disabled.

REQUEST

Use REQUEST to enable or disable client requests to a service name or to return the current request status for the service name.

To enable client requests to the service name, specify true (.T.) for <expL>.  Specifying false (.F.) disables client requests to the service name. .T. is the default value.

To return the current request status for a service name, omit <expL>.  DDESetService( ) returns true if client requests are enabled for the service name; it returns false if client requests are disabled.

The following commands disable requests from client applications to the service name MYSERVICE and displays the current request status for MYSERVICE:

mrequest = DDESetService('myservice', 'REQUEST', .F.)
? DDESetService('myservice', 'REQUEST')

FORMATS

Include FORMATS and <expC3> to specify the data formats supported by the service name.  Server requests for formats not specified with <expC3> are rejected.

<expC3>

You can specify data formats supported by the service name by specifying the formats with <expC3>.  Include a list of the supported formats separated by commas.  For example:

=DDESetService('myservice', 'FORMATS', 'CF_TEXT, CF_SYLK')

If <expC3> is omitted, only the CF_TEXT format is supported.

<expL>

<expL> specifies the state of the REQUEST, EXECUTE, POKE or ADVISE options.  Specify true (.T.) for <expL> to enable the option or false (.F.) to disable it.


DDESetService() SeeAlso
See Also

DDEEnabled( ) Function

DDELastError( ) Function

DDEPoke( ) Function

DDESetTopic( ) Function


DDESetTopic( ) Function

See Also	Example

In a dynamic data exchange (DDE) conversation, creates or releases a topic name from a service name.

Syntax

DDESetTopic(<expC1>, <expC2>[, <expC3>])

Returns

Character

Remarks

DDESetTopic( ) is supported in FoxPro for Windows only.

After a topic name is created, any client requests to the topic name cause FoxPro to execute the UDF specified with <expC3>.  The UDF is passed a set of parameters whose values are determined by the client request.  The UDF return value is passed to the client with DDEPoke( ).  The return value is a logical value indicating whether the topic name can provide the service requested by the client.

DDESetTopic( ) returns true (.T.) if it successfully creates or releases the topic name.  It returns false (.F.) if the topic name cannot be created or released.  Use DDELastError( ) to determine why a topic name cannot be created or released.

Parameters

<expC1>

Specify the service name with <expC1>.  Additional service names can be created with DDESetService( ).

<expC2>

Specify the topic name to create or release with <expC2>.  If you include <expC3>, DDESetService( ) creates the topic name <expC2>.  If you omit <expC3>, the topic name <expC2> is released.  If <expC2> is the null string, the UDF specified with <expC3> is executed for any topic name that isn't explicitly declared.

<expC3>

<expC3> is the name of the UDF executed when a client application makes a request to the topic name.  If <expC3> is omitted, the topic name <expC2> is released from the service name.

When the UDF is executed, it is passed the following six parameters in the order given below:

Parameter	Contents
Channel Number	The client channel number
Action	ADVISE, EXECUTE, INITIATE, POKE, REQUEST or TERMINATE
Item	The item name; for example, R1C1 for a Microsoft Excel spreadsheet cell
Data	Data from the client
Format	The data format; for example, CF_TEXT
Advise Status	The link type (0 = manual, 2 = notify or automatic)
The values of the Item, Data and Advise Status parameters depend on the Action parameter.  The following table lists the Action parameter values and the values contained in the Item, Data and Advise Status parameters.  A dash (-) indicates that the parameter value is the null string.

Action Value	Item Value	Data Value	Advise Status
INITIATE	-	Topic name	-
TERMINATE	-	-	-
POKE	Item name	New data	-
REQUEST	Item name	-	-
EXECUTE	-	New command	-
ADVISE	Item name	-	Link type
If the UDF successfully handles the client request, the UDF returns true (.T.).  If the request can't be handled or an error occurs, the UDF returns false (.F.).  If false is returned when the Action parameter value is INITIATE, the client topic name request is rejected. If false is returned when the value is POKE, REQUEST, or EXECUTE, the request is ignored. If false is returned when the value is ADVISE, the client request for a notify or automatic link is rejected.


DDESetTopic( ) Example

The following example creates a basic sample server called MYSERVER that supports FoxPro for Windows command execution from a client application.  The client application makes requests to MYSERVER through the DO topic, and macro substitution is used to execute the client's command.

*** Set FoxPro up as a DDE server ***

= DDESetService('myserver', 'DEFINE')
= DDESetService('myserver', 'EXECUTE', .T.)
= DDESetTopic('myserver', 'DO', 'DOTOPIC')
WAIT WINDOW 'Server portion service setup ... ' NOWAIT

*** Use FoxPro as a DDE client ***

dchannel = DDEInitiate('myserver','DO')
=DDEExecute(dchannel, 'WAIT WINDOW "Command Executed ... "')
=DDETerminate(dchannel)

PROCEDURE dotopic
PARAMETERS channel, action, item, data, format, advise
mresult = .F.

*** It's necessary to return .T. from an     ***
*** INITIATE action or no connection is made ***

IF action = 'INITIATE'
mresult = .T.
ENDIF

IF action = 'EXECUTE'
&data
mresult = .T.
ENDIF

IF action = 'TERMINATE'
WAIT WINDOW 'Goodbye ... ' NOWAIT
mresult = .T.
ENDIF
RETURN mresult

After running this example program, you have set up FoxPro service, which other applications can access.  If you have Microsoft Excel, you can run the following macro:

mychan = INITIATE("myserver","DO")
=EXECUTE(mychan,"WAIT WINDOW 'Hi, this is EXCEL speaking'")
=RETURN( )


DDESetTopic() SeeAlso
See Also

DDEEnabled( ) Function

DDELastError( ) Function

DDEPoke( ) Function

DDESetService( ) Function


DDETerminate( ) Function

See Also

Closes a dynamic data exchange (DDE) channel established with DDEInitiate( ).

Syntax

DDETerminate(<expN> | <expC>)

Returns

Logical

Remarks

DDETerminate( ) is supported in FoxPro for Windows only.

If the channel is successfully closed, DDETerminate( ) returns true (.T.).  If the channel cannot be closed, false (.F.) is returned.

Be sure to close channels as soon as they are no longer needed to conserve system resources.

All channels are automatically closed if you exit FoxPro for Windows by choosing Exit from the File menu or by issuing QUIT in the Command window or from within a program.

Parameters

<expN>

Specify the channel number to close with <expN>.

<expC>

Include the service name <expC> to close all channels to the service.


DDETerminate SeeAlso
See Also

DDEAbortTrans( ) Function

DDEAdvise( ) Function

DDEExecute( ) Function

DDEInitiate( ) Function

DDELastError( ) Function

DDEPoke( ) Function

DDERequest( ) Function

DDESetOption( ) Function


DEACTIVATE MENU Command

See Also	Example

Deactivates a user-defined menu and removes it from the screen but doesn't remove the menu definition from memory.

Syntax

DEACTIVATE MENU <menu name1>[, <menu name2> ...] | ALL

Remarks

DEACTIVATE MENU removes an active menu or set of menus from the desktop in FoxPro for MS-DOS, the main FoxPro window, or a user-defined window without removing the popup definition from memory.  A menu can be reactivated with ACTIVATE MENU and the menu name.

Tip   When you include the system menu bar (_MSYSMENU) in an application, you don't need to define, activate or deactivate the menu.  Instead, issue SET SYSMENU AUTOMATIC.  For more information about using the System menu, see the Menus chapter in the FoxPro Developer's Guide.

To release a specific menu or a set of menus from memory, use RELEASE MENUS.  You can release all menus from memory with CLEAR MENUS or CLEAR ALL.

Program control is returned to the program line immediately following the line that activated the menu unless DEFINE MENU BAR is used to create the menu or ACTIVATE MENU NOWAIT is used to activate the menu.

Clauses

<menu name1>[, <menu name2> ...]

These clauses specify the names of the menus to deactivate.  You can deactivate a set of menus by including a list of menu names separated by commas.

ALL

Including ALL deactivates all active menus.


DEACTIVATE MENU Example

This example uses DEACTIVATE MENU to deactivate a menu and remove it from the screen.

The current system menu bar is saved to memory with SET SYSMENU SAVE, and all the system menu pads are removed with SET SYSMENU TO.

Two menu pads are created with DEFINE PAD, and DEFINE POPUP creates a popup for each menu pad.  DEFINE BAR creates options on each of the popups.  When a menu pad is chosen, ON PAD uses ACTIVATE POPUP to activate the corresponding popup.  ACTIVATE MENU displays and activates the menu bar.

When an option is chosen from a popup, the CHOICE procedure is executed.  CHOICE displays the name of the chosen option and the name of the popup containing the option.  Program control continues on the line after ACTIVATE MENU.

Finally, the menu is deactivated and removed from the screen and is then released from memory with RELEASE MENUS EXTENDED.

*** Name this program DEACMENU.PRG ***

CLEAR

SET SYSMENU SAVE
SET SYSMENU TO

ON KEY LABEL ESC KEYBOARD CHR(13)

DEFINE MENU example BAR AT LINE 1

DEFINE PAD convpad OF example PROMPT '\<Conversions' COLOR SCHEME 3 ;
KEY ALT+C, ''
DEFINE PAD cardpad OF example PROMPT 'Card \<Info' COLOR SCHEME 3 ;
KEY ALT+I, ''

ON PAD convpad OF example ACTIVATE POPUP conversion
ON PAD cardpad OF example ACTIVATE POPUP cardinfo

DEFINE POPUP conversion MARGIN RELATIVE SHADOW COLOR SCHEME 4
DEFINE BAR 1 OF conversion PROMPT 'Ar\<ea' ;
KEY CTRL+E, '^E'
DEFINE BAR 2 OF conversion PROMPT '\<Length' ;
KEY CTRL+L, '^L'
DEFINE BAR 3 OF conversion PROMPT 'Ma\<ss' ;
KEY CTRL+S, '^S'
DEFINE BAR 4 OF conversion PROMPT 'Spee\<d' ;
KEY CTRL+D, '^D'
DEFINE BAR 5 OF conversion PROMPT '\<Temperature' ;
KEY CTRL+T, '^T'
DEFINE BAR 6 OF conversion PROMPT 'T\<ime' ;
KEY CTRL+I, '^I'
DEFINE BAR 7 OF conversion PROMPT 'Volu\<me' ;
KEY CTRL+M, '^M'

ON SELECTION POPUP conversion DO choice IN deacmenu WITH PROMPT( ), POPUP( )

DEFINE POPUP cardinfo MARGIN RELATIVE SHADOW COLOR SCHEME 4
DEFINE BAR 1 OF cardinfo PROMPT '\<View Charges' ;
KEY ALT+V, ''
DEFINE BAR 2 OF cardinfo PROMPT 'View \<Payments' ;
KEY ALT+P, ''
DEFINE BAR 3 OF cardinfo PROMPT 'Vie\<w Users' ;
KEY ALT+W, ''
DEFINE BAR 4 OF cardinfo PROMPT '\-'
DEFINE BAR 5 OF cardinfo PROMPT '\<Charges '

ON SELECTION POPUP cardinfo;
DO choice IN deacmenu WITH PROMPT( ), POPUP( )

ACTIVATE MENU example

DEACTIVATE MENU example
RELEASE MENU example EXTENDED
SET SYSMENU NOSAVE
SET SYSMENU TO DEFAULT
ON KEY LABEL ESC

PROCEDURE choice
PARAMETERS mprompt, mpopup

WAIT WINDOW 'You chose ' + mprompt + ;
' from popup ' + mpopup NOWAIT


DEACTIVATE MENU SeeAlso
See Also

ACTIVATE MENU Command

CLEAR ALL Command

CLEAR MENUS Command

CREATE MENU Command

DEFINE MENU Command

HIDE MENU Command

RELEASE Command

SHOW MENU Command


DEACTIVATE POPUP Command

See Also	Example

Deactivates a popup defined with DEFINE POPUP and removes it from the screen but doesn't remove the popup definition from memory.

Syntax

DEACTIVATE POPUP <popup name1>[, <popup name2> ...] | ALL

Remarks

DEACTIVATE POPUP removes an active menu popup or set of menu popups from the desktop in FoxPro for MS-DOS, the main FoxPro window, or a user-defined window without removing the popup definition from memory.  A popup can be reactivated by using ACTIVATE POPUP and the menu popup name.

Use RELEASE POPUPS with the menu popup name to release a specific menu popup or a set of menu popups from memory.  You can release all menu popups from memory with CLEAR POPUPS or CLEAR ALL.

Program control is returned to the line immediately following the line that activated the menu popup unless ACTIVATE POPUP NOWAIT is used to activate the menu.

Clauses

<popup name1>[, <popup name2> ...]

These clauses specify the names of the menu popups to deactivate.  You can deactivate a set of menu popups by including a list of menu popup names separated by commas.

ALL

Including ALL deactivates all active menu popups.


DEACTIVATE POPUP Example

In this example, DEACTIVATE POPUP is used to deactivate a popup when you choose a special menu pad.

The current system menu bar is saved to memory with SET SYSMENU SAVE, and all the system menu pads are removed with SET SYSMENU TO.

Two new system menu pads are created with DEFINE PAD, and DEFINE POPUP creates a popup for each menu pad.  DEFINE BAR creates options in each of the popups.  When a menu pad is chosen, ON PAD uses ACTIVATE POPUP to activate the corresponding popup.

When an option is chosen from a popup, the CHOICE procedure is executed.  CHOICE displays the name of the chosen option and the name of the popup containing the option.

If you choose the Disable Conversions option on the Card Info popup, the Conversions popup is deactivated with DEACTIVATE POPUP and released from memory with RELEASE POPUPS.  The Conversion menu pad is removed from the menu bar with RELEASE PAD and the Disable Conversions option in the Card Info popup is removed with RELEASE BAR.

If you choose the Exit option on the Card Info popup, the FoxPro system menu is restored.

*** Name this program DEACTPOP.PRG ***

CLEAR

SET SYSMENU SAVE
SET SYSMENU TO

DEFINE PAD convpad OF _MSYSMENU PROMPT '\<Conversions' COLOR SCHEME 3 ;
KEY ALT+C, ''
DEFINE PAD cardpad OF _MSYSMENU PROMPT 'Card \<Info' COLOR SCHEME 3 ;
KEY ALT+I, ''

ON PAD convpad OF _MSYSMENU ACTIVATE POPUP conversion
ON PAD cardpad OF _MSYSMENU ACTIVATE POPUP cardinfo

DEFINE POPUP conversion MARGIN RELATIVE SHADOW COLOR SCHEME 4
DEFINE BAR 1 OF conversion PROMPT 'Ar\<ea' KEY CTRL+E, '^E'
DEFINE BAR 2 OF conversion PROMPT '\<Length' ;
KEY CTRL+L, '^L'
DEFINE BAR 3 OF conversion PROMPT 'Ma\<ss' ;
KEY CTRL+S, '^S'
DEFINE BAR 4 OF conversion PROMPT 'Spee\<d' ;
KEY CTRL+D, '^D'
DEFINE BAR 5 OF conversion PROMPT '\<Temperature' ;
KEY CTRL+T, '^T'
DEFINE BAR 6 OF conversion PROMPT 'T\<ime' ;
KEY CTRL+I, '^I'
DEFINE BAR 7 OF conversion PROMPT 'Volu\<me' ;
KEY CTRL+M, '^M'

ON SELECTION POPUP conversion;
DO choice IN deactpop WITH PROMPT( ), POPUP( )

DEFINE POPUP cardinfo MARGIN RELATIVE SHADOW COLOR SCHEME 4
DEFINE BAR 1 OF cardinfo PROMPT '\<View Charges' ;
KEY ALT+V, ''
DEFINE BAR 2 OF cardinfo PROMPT 'View \<Payments' ;
KEY ALT+P, ''
DEFINE BAR 3 OF cardinfo PROMPT 'Vie\<w Users' ;
KEY ALT+W, ''
DEFINE BAR 4 OF cardinfo PROMPT '\-'
DEFINE BAR 5 OF cardinfo PROMPT '\<Charges '
DEFINE BAR 6 OF cardinfo PROMPT '\-'
DEFINE BAR 7 OF cardinfo PROMPT '\<Disable Conversions '
DEFINE BAR 8 OF cardinfo PROMPT 'E\<xit '

ON SELECTION POPUP cardinfo;
DO choice IN deactpop WITH PROMPT( ), POPUP( )

PROCEDURE choice
PARAMETERS mprompt, mpopup

WAIT WINDOW 'You chose ' + mprompt + ;
' from popup ' + mpopup NOWAIT

IF mprompt = 'Disable Conversions'
DEACTIVATE POPUP conversion
RELEASE POPUP conversion
RELEASE PAD convpad OF _MSYSMENU
RELEASE BAR 7 OF cardinfo
ENDIF

IF mprompt = 'Exit'
SET SYSMENU TO DEFAULT
ENDIF


DEACTIVATE POPUP SeeAlso
See Also

ACTIVATE POPUP Command

CLEAR ALL Command

CLEAR POPUPS Command

CREATE MENU Command

DEFINE POPUP Command

HIDE POPUP Command

RELEASE POPUPS Command

SHOW POPUP Command


DEACTIVATE WINDOW Command

See Also	Example

Deactivates specific user-defined windows or FoxPro system windows and removes them from the screen but not from memory.

Syntax

DEACTIVATE WINDOW <window name1>[, <window name2> ...] | ALL

Remarks

More than one window can be placed on the desktop in FoxPro for MS-DOS or the main FoxPro window at the same time, but output is directed only to the most recently activated window.  When more than one window is present, deactivating the current output window clears the contents of the window, removes the window from the screen and sends subsequent output to the previously activated window.  If there is no output window, output is directed to the desktop or main FoxPro window.

Use CLEAR WINDOWS or RELEASE WINDOWS to remove windows from both the screen and memory.

Clauses

<window name1>[,<window name2>...]

These clauses specify one or more windows to deactivate.

ALL

Including ALL deactivates all active windows.

SCREEN

The SCREEN option is available in FoxPro for Macintosh only.

Include SCREEN to deactivate and hide the main FoxPro window. You can also click the main FoxPro window close box to deactivate it.

To display the main FoxPro again, choose the Screen menu option from the Window menu or issue ACTIVATE WINDOW SCREEN or SHOW WINDOW SCREEN.


DEACTIVATE WINDOW Example

In this example, a window named Output is defined and activated.  After a record from INVOICES.DBF is displayed, the program waits for you to press a key and then deactivates the window.

CLOSE DATABASES
CLEAR
DEFINE WINDOW output FROM 2,1 TO 13,75 TITLE 'Output' ;
CLOSE FLOAT GROW SHADOW ZOOM
ACTIVATE WINDOW output
USE invoices
DISPLAY
WAIT
RELEASE WINDOW output


DEACTIVATE WINDOW SeeAlso
See Also

ACTIVATE WINDOW Command

CLEAR WINDOWS Command

DEFINE WINDOW Command

HIDE WINDOW Command

RELEASE WINDOWS Command

SHOW WINDOW Command


DECLARE Command

See Also

Creates one or more arrays.

Syntax

DECLARE <array1>(<expN1>[, <expN2>])
[, <array2>(<expN3>[, <expN4>])] ...

Remarks

Use DECLARE to create one- or two-dimensional arrays.  DECLARE is identical in operation and syntax to DIMENSION.  For more information, see DIMENSION.


DECLARE SeeAlso
See Also

APPEND FROM ARRAY Command

COPY TO ARRAY Command

DIMENSION Command

GATHER Command

PRIVATE Command

PUBLIC Command

SCATTER Command

SET COMPATIBLE Command

STORE Command


#DEFINE ... #UNDEF Preprocessor Directives

See Also	Example

Creates and releases compile-time constants.

Syntax

#DEFINE <constant name> <expr>
#UNDEF <constant name>

Remarks

The #DEFINE and #UNDEF preprocessor directives are used to create compile-time constants in programs.  By creating constants with #DEFINE instead of using system memory variables, you can reduce memory consumption, increase performance and simplify programs.

To create a constant with #DEFINE, specify the constant's name with <constant name> and its value with <expr>.  When the program is compiled, text substitution is performed and the constant value expression is substituted for the constant name wherever it appears in the program.  You can stop the substitution for the constant by issuing #UNDEF.

Substitution occurs only in program lines that follow the #DEFINE statement that creates the constant and that precede the #UNDEF statement for that constant.  The constant is available only to the program that creates the constant.

Clauses

<constant name>

To create a compile-time constant with #DEFINE, specify its name with <constant name>.  The constant name must be a legitimate FoxPro name that begins with a letter or an underscore and consists of up to 10 letters, digits or underscores.  To improve program readability and simplify debugging, use a standard naming convention for your constant names.

Important   Don't use FoxPro key words for constant names.

To stop text substitution for a constant created with #DEFINE, issue #UNDEF <constant name>.

<expr>

Specify the value of the compile-time constant with <expr>.  <expr> can be a name or an expression that evaluates to a character, numeric, date or logical value.

Important   Do not use system memory variables for <expr>.  System memory variables are not evaluated until run time.


#DEFINE ... #UNDEF Example

The following program creates a compile-time constant named MAXITEMS.  This constant is used in a FOR ...  NEXT loop to display the numbers 1 through 10.

#DEFINE maxitems 10

FOR i = 1 TO maxitems
? i
NEXT


DEFINE UNDEF SeeAlso
See Also

COMPILE Command

#IF ... #ENDIF Preprocessor Directive


DEFINE BAR Command

See Also	Example

Creates a menu option on a popup defined with DEFINE POPUP or a FoxPro menu system popup.

Syntax

DEFINE BAR <expN1> | <system option name> OF <popup name> PROMPT <expC1>
[BEFORE <expN2> | AFTER <expN3>]
[KEY <key label>[, <expC2>]]
[MARK <expC3>]
[MESSAGE <expC4>]
[SKIP [FOR <expL>]]
[COLOR SCHEME <expN4> | COLOR <color pair list>]

Remarks

DEFINE BAR is used with DEFINE POPUP to create popups.  A popup is created and assigned a name with DEFINE POPUP.  Menu options are placed on the popup with a series of DEFINE BARs.

When a menu option is chosen, another popup can be displayed or a routine can be executed.  A popup that displays another popup or a menu bar is called a cascading menu.  For more information on creating cascading menus, see ON BAR.

You can define more menu options than will fit on a popup.  This creates a scrollable popup.  Press Home to move to the first option or End to move to the last option.  In FoxPro for MS-DOS, click on the top or bottom border of the popup to scroll through the options.  In FoxPro for Windows and FoxPro for Macintosh, click the Up or Down Arrow on the popup to scroll through the options.

Using the FoxPro system menu bar and its popups is the preferred method of including popups in your applications.  If you use system menu bar popups, you don't have to define the popups.  For more information on using the system menu bar and its popups, see SET SYSMENU.

You can also create a popup that contains records or fields from a table or a list of files available on disk.  For more information, see the PROMPT FIELD, PROMPT STRUCTURE and PROMPT FILES clauses in DEFINE POPUP.

Clauses

<expN1>

<expN1> is the bar number of the popup option you create with DEFINE BAR.

<system option name>

Options that are available in FoxPro system menu popups can also be placed on popups you create.  You can place an option from a system menu popup on your popup by including <system option name>.  For example, to provide access to the FoxPro Calendar/Diary from a popup named Other, you could create the option with the following command:

Not all system menu popups options are available for user-defined popups.  Options on conditional menu pads (Browse, Screen, Project, etc.) are not available.

DEFINE BAR _MST_DIARY OF OTHER PROMPT 'Enter Appointments'

Whenever this option is chosen from the popup, the Calendar/Diary is opened.

Not all system menu popups are available for user-defined menus.  Options on conditional menu pads (Browse, Screen, Project, etc.) are not available.

For a list of system menu names, use SYS(2013).

OF <popup name>

Specify the name of the popup on which the options are placed with <popup name>.

PROMPT <expC1>

PROMPT <expC1> specifies the text that appears in the option.

A separating bar can be created and placed between options by specifying a backslash and a dash (\-) for <expC1>.  A separating bar is used to group options together.  For example, including the following command in a popup definition creates a separating bar between the third and fifth options:

DEFINE BAR 4 OF <popup name> PROMPT '\-'

You can create a hot key for a menu option by placing a backslash and a less-than sign (\<) before the character you would like to be the hot key.  A hot key is a key that you press to choose the corresponding option.  For example:

DEFINE POPUP receive
DEFINE BAR 1 OF receive PROMPT '\<Invoices'
DEFINE BAR 2 OF receive PROMPT 'In\<quiry'
ACTIVATE POPUP receive

The first popup option, BAR 1, is chosen by pressing I; the second option, BAR 2, is chosen by pressing Q.

BEFORE <expN2> | AFTER <expN3>

An option can be placed on a popup relative to another option on the popup by including the BEFORE or AFTER clause.  The popup must be created with DEFINE POPUP RELATIVE to include BEFORE or AFTER.

If BEFORE <expN2> is included, the option is placed to the left of the option specified with <expN2>.  If AFTER <expN3> is included, the option is placed to the right of the option specified with <expN3>.

You can include _MFIRST and _MLAST in the BEFORE and AFTER clauses to reference the first and last items on a popup, respectively.  If _MFIRST is included in the BEFORE clause, the popup option is the first option on the popup.  If _MFIRST is included in the AFTER clause, the popup option is the second item on the popup.  If _MLAST is included in the AFTER clause, the popup option is the last option on the popup.  If _MLAST is included in the BEFORE clause, the option is the next-to-last option on the popup.

Popups created with DEFINE POPUP RELATIVE don't include space for undefined menu bar options.  For example, if you define bars 1, 2, 4 and 5, a line is not reserved for option 3.  You can later insert option 3 into the popup, which will expand to accommodate the third option.

Run the following program examples and note the differences in the order and placement of the options on each popup:

*** RELATIVE Example ***

DEFINE POPUP relatyes RELATIVE FROM 1,1

DEFINE BAR 4  OF relatyes PROMPT '4444'
DEFINE BAR 3  OF relatyes PROMPT '3333'
DEFINE BAR 2  OF relatyes PROMPT '2222'
DEFINE BAR 1  OF relatyes PROMPT '1111'
DEFINE BAR 6  OF relatyes PROMPT '6666' BEFORE 4

ACTIVATE POPUP relatyes

*** NON-RELATIVE Example ***

DEFINE POPUP notrelat FROM 1,10
DEFINE BAR 4  OF notrelat PROMPT '4444'
DEFINE BAR 3  OF notrelat PROMPT '3333'
DEFINE BAR 2  OF notrelat PROMPT '2222'
DEFINE BAR 1  OF notrelat PROMPT '1111'
DEFINE BAR 6  OF notrelat PROMPT '6666'
ACTIVATE POPUP notrelat

KEY <key label>[, <expC2>]

In addition to pressing a hot key, you can choose an option by pressing another key or a key combination.  <key label> designates the key or key combination used to choose the option.  See ON KEY LABEL for a list of available keys and key combinations and their key label names.

Note   If a keyboard macro is already defined with the same key label, the keyboard macro takes precedence, and the option cannot be chosen with the specified key or key combination.

On the popup, the key label is displayed to the right of an option name.  Include <expC2> to replace the key label with your own text.  For example, including KEY Ctrl+B places the text "Ctrl+B" on the popup to the right of the option name.  If you specify KEY Ctrl+B, "^B", "^B" will appear on the popup as a reminder of the key combination used to choose the option.  The key label can be suppressed by including the null string for <expC2>.

MARK <expC3> [image] FoxPro for MS-DOS only

A mark character can be placed to the left of an option name on a popup with SET MARK OF.  The default mark character is a diamond ( [image]) in FoxPro for MS-DOS and a check in FoxPro for Windows and FoxPro for Macintosh.

In FoxPro for MS-DOS, the MARK clause can be included to change the default mark character to <expC3>.  (Specifying a mark character doesn't mark an option.  Use SET MARK OF to mark an option.)  If <expC3> includes more than one character, only the first character is used as the mark character.

The MARK clause is ignored in FoxPro for Windows and FoxPro for Macintosh.

Mark characters specified with a DEFINE BAR take precedence over mark characters specified with MARK in DEFINE POPUP.  SET MARK OF is used to toggle mark characters on or off, and can also be used to specify a mark character for an individual popup option or for all popup options in FoxPro for MS-DOS.

MESSAGE <expC4>

A message can be displayed when an option is selected by including MESSAGE <expC4>.  In FoxPro for MS-DOS, the message <expC4> is centered on the last line of the desktop by default; the message location can be changed with SET MESSAGE.

In FoxPro for Windows and FoxPro for Macintosh, the message is placed in the graphics-based status bar. If the graphics-based status bar has been turned off with SET STATUS BAR OFF, the message is centered on the last line of the main FoxPro window.

SKIP [FOR <expL>]

A popup option can be disabled based on a logical condition. If you include the SKIP FOR clause, the logical expression <expL> is evaluated, and, based on the result (true or false), the option is disabled or enabled. If <expL> evaluates to true (.T.), the option is disabled and cannot be selected or chosen. If <expL> evaluates to false (.F.), the option is enabled.

You can also disable a pop-up option by placing a backslash (\) before the text of the prompt. For example:

DEFINE BAR 1 OF receive PROMPT '\Invoices'

The first menu option, BAR 1, appears in disabled colors and cannot be selected or chosen. In FoxPro for MS-DOS, a bar disabled with SKIP or the \ cannot be selected. In FoxPro for Windows and FoxPro for Macintosh, a disabled bar can be selected but it cannot be chosen. A message for a disabled bar is still displayed when it is selected.

Menus you create that include SKIP FOR expressions may not behave properly when the spellchecker or wizards are active.

SKIP FOR expressions typically depend on the value of skip variables, but the skip variables are not visible to your menus when the spell checker or wizards are active. In the initialization code of the spell checker and wizard applications SPELLCHK.APP and GENGRAPH.APP respectively), PRIVATE ALL is intentionally issued. This hides skip variables from user-defined menus and causes a "Variable not found" error when you make a menu choice.

To correct this situation, the following code is placed at the beginning of the spell checker and wizard applications:

IF TYPE("_memvarmask") = "C" and !EMPTY(_memvarmask)
PRIVATE ALL EXCEPT &_memvarmask
ELSE
PRIVATE ALL
ENDIF

Suppose a certain menu option should be skipped when the memory variable named "skipvar" evaluates to true. You should include the following lines in your menu startup code to take advantage of the _MEMVARMASK variable:

PUBLIC _memvarmask
_memvarmask = "skipvar"
STORE .T. TO skipvar             && Skip initially.

To create a set of skip variables, include the following lines in your menu startup code:

PUBLIC _memvarmask
_memvarmask = "skip*"
STORE .T. TO skipthis, skipthat  && Skip initially.

When you run the spell checker and wizards, they don't hide variables in SKIP FOR expressions, preventing the "Variable not found" errors you may experience when the spell checker

Note that _MEMVARMASK isn't a system memory variable.

COLOR SCHEME <expN4> | COLOR <color pair list>

Use the COLOR or COLOR SCHEME clauses to specify the colors for an individual bar, overriding the default colors or the colors specified with DEFINE POPUP.  The COLOR and COLOR SCHEME clauses of DEFINE POPUP let you specify the colors of all popup options, mark characters and messages.

A color scheme is a set of 10 predefined color pairs.  The color pairs in a color scheme can be changed with SET COLOR OF SCHEME.  In FoxPro for MS-DOS the color pairs in a color scheme can also be changed in the Color Picker.

A color pair is a set of two letters separated by a forward slash.  The first color letter specifies the foreground color and the second letter specifies the background color.

For example, this color pair specifies a red foreground on a white background:

R/W

For a list of colors and their corresponding color letters, see SET COLOR Commands or Color Table by Color Pair.

A color pair can also be specified with a set of 6 RGB (Red Green Blue) color values separated by commas.  The first 3 color values specify the foreground color and the second 3 color values specify the background color.  The color values can range from 0 through 255.

The R/W color pair in the example above can also be specified with this RGB color pair:

RGB(255,0,0,255,255,255)

By default, the colors of popup options are determined by color scheme 2 of the current color set.


DEFINE BAR Example

This example uses DEFINE BAR to create options on menu popups.

The current system menu bar is first saved to memory with SET SYSMENU SAVE, and then all system menu pads are removed with SET SYSMENU TO.

Two new system menu pads are created with DEFINE PAD, and DEFINE POPUP is used to create a popup for each menu pad.  DEFINE BAR is used to create options on each of the popups.  When a menu pad is chosen, ON PAD uses ACTIVATE POPUP to activate the corresponding popup.

When an option is chosen from a popup, ON SELECTION POPUP uses PROMPT( ) and   POPUP( ) to pass the option number and popup name to the CHOICE procedure.  CHOICE displays the prompt of the chosen option and the name of the popup containing the option.  If the Exit option is chosen from the Card Info popup, the original FoxPro system menu is restored.

*** Name this program DEFINBAR.PRG ***

CLEAR

SET SYSMENU SAVE
SET SYSMENU TO

DEFINE PAD convpad OF _MSYSMENU PROMPT '\<Conversions' COLOR SCHEME 3 ;
KEY ALT+C, ''
DEFINE PAD cardpad OF _MSYSMENU PROMPT 'Card \<Info' COLOR SCHEME 3 ;
KEY ALT+I, ''

ON PAD convpad OF _MSYSMENU ACTIVATE POPUP conversion
ON PAD cardpad OF _MSYSMENU ACTIVATE POPUP cardinfo

DEFINE POPUP conversion MARGIN RELATIVE SHADOW COLOR SCHEME 4
DEFINE BAR 1 OF conversion PROMPT 'Ar\<ea' KEY CTRL+E, '^E'
DEFINE BAR 2 OF conversion PROMPT '\<Length' ;
KEY CTRL+L, '^L'
DEFINE BAR 3 OF conversion PROMPT 'Ma\<ss' ;
KEY CTRL+S, '^S'
DEFINE BAR 4 OF conversion PROMPT 'Spee\<d' ;
KEY CTRL+D, '^D'
DEFINE BAR 5 OF conversion PROMPT '\<Temperature' ;
KEY CTRL+T, '^T'
DEFINE BAR 6 OF conversion PROMPT 'T\<ime' ;
KEY CTRL+I, '^I'
DEFINE BAR 7 OF conversion PROMPT 'Volu\<me' ;
KEY CTRL+M, '^M'

ON SELECTION POPUP conversion;
DO choice IN definbar WITH PROMPT( ), POPUP( )

DEFINE POPUP cardinfo MARGIN RELATIVE SHADOW COLOR SCHEME 4
DEFINE BAR 1 OF cardinfo PROMPT '\<View Charges' ;
KEY ALT+V, ''
DEFINE BAR 2 OF cardinfo PROMPT 'View \<Payments' ;
KEY ALT+P, ''
DEFINE BAR 3 OF cardinfo PROMPT 'Vie\<w Users' ;
KEY ALT+W, ''
DEFINE BAR 4 OF cardinfo PROMPT '\-'
DEFINE BAR 5 OF cardinfo PROMPT '\<Charges '
DEFINE BAR 6 OF cardinfo PROMPT '\-'
DEFINE BAR 7 OF cardinfo PROMPT 'E\<xit '

ON SELECTION POPUP cardinfo;
DO choice IN definbar WITH PROMPT( ), POPUP( )

PROCEDURE choice
PARAMETERS mprompt, mpopup

WAIT WINDOW 'You chose ' + mprompt + ;
' from popup ' + mpopup NOWAIT

IF mprompt = 'Exit'
SET SYSMENU TO DEFAULT
ENDIF


DEFINE BAR SeeAlso
See Also

ACTIVATE POPUP Command

DEACTIVATE POPUP Command

DEFINE POPUP Command

HIDE POPUP Command

RELEASE BAR Command

SET MESSAGE Command

SHOW POPUP Command


DEFINE BOX Command

See Also

Draws a box around printed text.

Syntax

DEFINE BOX FROM <column1> TO <column2> HEIGHT <expN1>
[AT LINE <expN2>]
[SINGLE | DOUBLE | <border string>]

Remarks

Included for backward compatibility - use the Screen Builder instead.

This command draws a box around text only in printed reports and only if the BOX system memory variable is set to true (.T.).  Use @ ...  BOX or @ ... TO to draw boxes on the desktop in FoxPro for MS-DOS, the main FoxPro window or a user-defined window.

A box can be printed only if SET PRINTER is ON.  Boxes can be drawn only around output created with the ? or ?? command.  Boxes cannot be drawn around output created with @ ... SAY.

Two functions that are useful with DEFINE BOX are PCOL( ) and PROW( ).  These functions return the current print column and print row positions.

Clauses

FROM <column1> TO <column2>

The upper-left corner of the box appears in print column <column1>.  The upper-right corner appears in column <column2>.

HEIGHT <expN1>

The height of the box is specified with <expN1>.  Box height is affected by the value of the system memory variable _PSPACING.  For example, if <expN1> is set to 5 and _PSPACING is 3, the height of the box is 15 lines.

AT LINE <expN2>

The top of the box is drawn beginning at the current print line unless you include AT LINE <expN2> in DEFINE BOX.  <expN2> is the number of the line at which you want the top of the box to be drawn.

SINGLE | DOUBLE | <border string>

The default border of the box is a single line.  You can specify a different border style with the SINGLE, DOUBLE or <border string> clause.  Include SINGLE to draw a single-line border; include DOUBLE to draw a double-line border.  You can define your own border with <border string>.  The syntax for the border string is identical to that in SET BORDER.  For more information, see SET BORDER.


DEFINE BOX SeeAlso
See Also

@ ... BOX Command

_BOX System Memory Variable

PCOL( ) Function

PROW( ) Function

_PSPACING System Memory Variable

SET BORDER Command

SET PRINTER Commands


DEFINE MENU Command

See Also	Example

Creates a menu bar.

Syntax

DEFINE MENU <menu name>
[BAR [AT LINE <expN1>]]
[IN [WINDOW] <window name> | IN SCREEN]
[KEY <key label>]
[MARK <expC1>]
[MESSAGE <expC2>]
[NOMARGIN]
[COLOR SCHEME <expN2> | COLOR <color pair list>]

Remarks

A menu system usually contains a horizontal menu bar with popups under each of the menu bar pads.  As you move from pad to pad on the menu bar, a popup appears under each pad.  You can then choose an option from a popup.

You use DEFINE MENU to create the menu bar of the menu system you're building.  You define each of the pads on the menu bar using a series of DEFINE PADs, and you specify which popup is displayed under each menu pad with ONPAD ... ACTIVATE POPUP.  Then, you create a popup for each of the menu pads using DEFINE POPUP and display the entire menu system with ACTIVATE MENU.

Choosing a menu bar pad doesn't have to activate a popup.  When a pad is chosen, another menu bar can be activated with ON PAD ...  ACTIVATE MENU, or a routine can be executed with ON SELECTION PAD ... DO.

Tip   Using the FoxPro system menu bar is the preferred method of placing menus in your applications.  If you use the FoxPro system menu bar, you don't need to issue DEFINE MENU.

Clauses

<menu name>

<menu name> is the name of the menu bar you want to create.

BAR [AT LINE <expN1>]

Including the BAR clause creates a bar menu that behaves like the FoxPro System menu bar.  The menu bar has these characteristics:

Once a selection is made, the menu bar is no longer active.

A horizontal menu bar one line high is drawn across the width of the desktop in FoxPro for MS-DOS, the main FoxPro window or the user-defined window it is placed in.

The placement of the pads is handled automatically.

If the size or number of pads you define exceeds the size of the screen or a window in which the menu bar is placed, the menu bar scrolls.

You can specify the row in which the menu is placed with the AT LINE clause.  The row number is specified with <expN1>.

IN [WINDOW] <window name> | IN SCREEN

By default, menu bars are placed on the desktop or main FoxPro window unless there is an active user-defined window.  If there is an active user-defined window, the menu bar is placed in the active window.

You can place a menu bar in a specific user-defined window by including the IN or IN WINDOW clause in DEFINE MENU.  Specify the name of the window in which you want to place the menu bar with <window name>.

Include IN SCREEN to explicitly place the menu bar on the desktop or the main FoxPro window.

KEY <key label>

A menu bar can be activated by pressing a key or a combination of keys.  <key label> to specifies the key or key combination used to activate the menu bar.  See ON KEY LABEL for a list of available keys and key combinations and their key label names.  Including the KEY clause is equivalent to issuing the following command:

ON KEY LABEL <key label> ACTIVATE MENU <menu name>

Note   If a keyboard macro is already defined with the same key label, the keyboard macro takes precedence, and the menu bar cannot be activated with the specified key or key combination.

MARK <expC1> [image] FoxPro for MS-DOS only

A mark character can be placed to the left of each pad in a menu bar with SET MARK OF.  The default mark character is a diamond ( [image]) in FoxPro for MS-DOS and a check in FoxPro for Windows and FoxPro for Macintosh. Include the MARK clause to change the default mark character to <expN3>.  (Specifying a mark character doesn't mark a pad.  Use SET MARK OF to mark a pad.)  If <expC1> includes more than one character, only the first character is used as the mark character.

You can use the mark character <expC1> to indicate that a certain condition exists - a popup is available for the pad, an option controlled by the pad is on or off, and so forth.

The MARK clause is ignored in FoxPro for Windows and FoxPro for Macintosh.

The MARK clause sets the mark character for all pads in the menu bar.  Mark characters specified with DEFINE PAD take precedence over mark characters specified with the MARK clause in DEFINE MENU.  SET MARK OF is used to toggle marks on or off and can also be used to specify a mark character for an individual menu pad or for all menu pads.

MESSAGE <expC2>

A message can be displayed when a pad is selected by including MESSAGE <expC2>.  In FoxPro for MS-DOS, the message <expC2> is centered on the last line of the desktop by default; the message location can be changed with SET MESSAGE.

In FoxPro for Windows and FoxPro for Macintosh, the message is placed in the graphics-based status bar. If the graphics-based status bar has been turned off with SET STATUS BAR OFF, the message is centered on the last line of the main FoxPro window.

NOMARGIN

By default, one space is placed to the left and right of each menu pad.  Include NOMARGIN to remove the spaces.

COLOR SCHEME <expN2> | COLOR <color pair list>

You can specify the color of all elements of the menu bar by including the number of an existing color scheme in the COLOR SCHEME clause or a set of color pairs in the COLOR clause.

A color scheme is a set of 10 predefined color pairs.  The color pairs in a color scheme can be changed with SET COLOR OF SCHEME.  In FoxPro for MS-DOS the color pairs in a color scheme can also be changed in the Color Picker.

A color pair is a set of two letters separated by a forward slash.  The first color letter specifies the foreground color and the second letter specifies the background color.

For example, this color pair specifies a red foreground on a white background:

R/W

For a list of colors and their corresponding color letters, see SET COLOR Commands Overview or Color Table by Color Pair.

A color pair can also be specified with a set of 6 RGB (Red Green Blue) color values separated by commas.  The first 3 color values specify the foreground color and the second 3 color values specify the background color.  The color values can range from 0 through 255.

The R/W color pair in the example above can also be specified with this RGB color pair:

RGB(255,0,0,255,255,255)

By default, the colors of menu bars created with DEFINE MENU are controlled by color scheme 2.


DEFINE MENU Example

This example uses DEFINE MENU to create a user-defined menu system.

The current system menu bar is first saved to memory with SET SYSMENU SAVE, and then the system menu pads are cleared with SET SYSMENU TO.

DEFINE MENU creates the menu bar, and two menu pads are created with DEFINE PAD.  DEFINE POPUP creates a popup for each menu pad.  DEFINE BAR creates options on each of the popups.  When a menu pad is chosen, ON PAD uses ACTIVATE POPUP to activate the corresponding popup.  ACTIVATE MENU displays and activates the menu bar.

When an option is chosen from a popup, the CHOICE procedure is executed.  CHOICE displays the name of the chosen option and the name of the popup containing the option.

*** Name this program DEFIMENU.PRG ***

CLEAR

SET SYSMENU SAVE
SET SYSMENU TO

ON KEY LABEL ESC KEYBOARD CHR(13)

DEFINE MENU example BAR AT LINE 1

DEFINE PAD convpad OF example PROMPT '\<Conversions' COLOR SCHEME 3 ;
KEY ALT+C, ''
DEFINE PAD cardpad OF example PROMPT 'Card \<Info' COLOR SCHEME 3 ;
KEY ALT+I, ''

ON PAD convpad OF example ACTIVATE POPUP conversion
ON PAD cardpad OF example ACTIVATE POPUP cardinfo

DEFINE POPUP conversion MARGIN RELATIVE SHADOW COLOR SCHEME 4
DEFINE BAR 1 OF conversion PROMPT 'Ar\<ea' ;
KEY CTRL+E, '^E'
DEFINE BAR 2 OF conversion PROMPT '\<Length' ;
KEY CTRL+L, '^L'
DEFINE BAR 3 OF conversion PROMPT 'Ma\<ss' ;
KEY CTRL+S, '^S'
DEFINE BAR 4 OF conversion PROMPT 'Spee\<d' ;
KEY CTRL+D, '^D'
DEFINE BAR 5 OF conversion PROMPT '\<Temperature' ;
KEY CTRL+T, '^T'
DEFINE BAR 6 OF conversion PROMPT 'T\<ime' ;
KEY CTRL+I, '^I'
DEFINE BAR 7 OF conversion PROMPT 'Volu\<me' ;
KEY CTRL+M, '^M'

ON SELECTION POPUP conversion DO choice IN defimenu WITH PROMPT( ), POPUP( )

DEFINE POPUP cardinfo MARGIN RELATIVE SHADOW COLOR SCHEME 4
DEFINE BAR 1 OF cardinfo PROMPT '\<View Charges' ;
KEY ALT+V, ''
DEFINE BAR 2 OF cardinfo PROMPT 'View \<Payments' ;
KEY ALT+P, ''
DEFINE BAR 3 OF cardinfo PROMPT 'Vie\<w Users' ;
KEY ALT+W, ''
DEFINE BAR 4 OF cardinfo PROMPT '\-'
DEFINE BAR 5 OF cardinfo PROMPT '\<Charges '

ON SELECTION POPUP cardinfo;
DO choice IN defimenu WITH PROMPT( ), POPUP( )

ACTIVATE MENU example

DEACTIVATE MENU example
RELEASE MENU example EXTENDED
SET SYSMENU TO DEFAULT
ON KEY LABEL ESC

PROCEDURE choice
PARAMETERS mprompt, mpopup

WAIT WINDOW 'You chose ' + mprompt + ;
 	' from popup ' + mpopup NOWAIT


DEFINE MENU SeeAlso
See Also

ACTIVATE MENU Command

CNTPAD( ) Function

CREATE MENU Command

DEACTIVATE MENU Command

DEFINE PAD Command

GETPAD( ) Function

HIDE MENU Command

MRKPAD( ) Function

ON PAD Command

ON SELECTION PAD Command

PRMPAD( ) Function

RELEASE PAD Command

SET MARK OF Commands

SET SYSMENU Command

SHOW MENU Command


DEFINE PAD Command

See Also	Example

Creates a pad on a user-defined menu bar or a FoxPro system menu bar.

Syntax

DEFINE PAD <pad name> OF <menu name> PROMPT <expC1>
[AT <row, column>]
[BEFORE <pad name> | AFTER <pad name>]
[KEY <key label>[, <expC2>]]
[MARK <expC3>]
[SKIP [FOR <expL>]]
[MESSAGE <expC4>]
[COLOR SCHEME <expN> | COLOR <color pair list>]

Remarks

DEFINE PAD is used with DEFINE MENU to create a menu system.  DEFINE PAD creates a menu pad, which is an option on a menu bar that can be selected (highlighted) and chosen.  When a menu pad is chosen, a popup can be displayed with more options, another menu bar can be displayed, or a routine can be executed.

Every pad you place on a menu bar requires its own DEFINE PAD command.  A menu bar must be defined before you can place pads on it, and you must include the menu bar name in DEFINE PAD.

Using the FoxPro system menu bar is the preferred method of including menus in your applications.  If you use the system menu bar (_MSYSMENU), you don't have to first define the menu.  For more information on using the system menu bar and its popups, see SET SYSMENU.

Note   In FoxPro for Macintosh, if you use the system menu bar _MSYSMENU, don't add more menu pads than can be displayed across the screen. You can add menu pads beyond the Balloon Help menu pad, but they will not be accessible.

Clauses

<pad name>

<pad name> is the name of the menu pad you want to create.

OF <menu name>

<menu name> is the name of the menu bar in which the pad is to appear.

PROMPT <expC1>

PROMPT <expC1> specifies the text that appears in the menu pad.

You can create a hot key for a menu pad by placing a backslash and a less-than sign (\<) before the character you would like to be the hot key.  A hot key is key that can be pressed to choose the corresponding menu pad. For example:

DEFINE MENU receive
DEFINE PAD invoice OF receive PROMPT "\<Invoices"
DEFINE PAD inquire OF receive PROMPT "In\<quiry"
ACTIVATE MENU receive

The first pad, INVOICE, is chosen by pressing I; the second pad, INQUIRE, is chosen by pressing Q.

AT <row, column>

You can designate where a pad is displayed by including the AT clause in DEFINE PAD.  <row, column> are the coordinates of the upper-left corner of the pad on the desktop in FoxPro for MS-DOS, in the main FoxPro window or in a user-defined window.  To place a menu bar in a user-defined window, the menu bar must be created with DEFINE MENU IN WINDOW.

If you omit the AT clause, the upper-left corner of the first menu pad is placed on row 0 of the desktop, main FoxPro window or user-defined window.  The next menu pad is placed on the right of the first pad on row 0, and so on.

Note   You cannot include the AT clause to specify a location for pads in menu bars created with the BAR clause in DEFINE MENU.

Pads are activated in the order in which they are created.

BEFORE <pad name> | AFTER <pad name>

Include the BEFORE or AFTER clause to specify the location and activation order of a pad in relation to other pads in a menu bar.  The menu bar pad you specify in a BEFORE or AFTER clause should be defined before it is referenced.  If the pad isn't defined, the placement of the pad is determined by the order in which it is defined or by a location specified with the AT clause.

For a menu bar pad created without the AT clause, a BEFORE or AFTER clause determines the pad's physical placement and activation order.  If BEFORE is included, the pad is inserted into the menu bar to the left of the pad specified with <pad name>.  If AFTER is included, the pad is inserted into the menu bar to the right of the pad specified with <pad name>.  The activation order corresponds to the physical order of the pads in the menu bar.

For menu bars created without BAR, a BEFORE or AFTER clause determines the activation order of the pad.  The physical placement of a pad is determined by the location specified with the AT clause.

Run the following two program examples and note the differences in pad placement and activation order when menu bar pads are defined with and without the AT clause:

*** Program Example 1 without ATs ***

DEFINE MENU beforafter

DEFINE PAD one   OF beforafter PROMPT '1111'
DEFINE PAD two   OF beforafter PROMPT '2222'
DEFINE PAD three OF beforafter PROMPT '3333'
DEFINE PAD four  OF beforafter PROMPT '4444' BEFORE two

ACTIVATE MENU beforafter

*** Program Example 2 with ATs ***

DEFINE MENU beforafter

DEFINE PAD one   OF beforafter PROMPT '1111' AT 1,5
DEFINE PAD two   OF beforafter PROMPT '2222' AT 1,15
DEFINE PAD three OF beforafter PROMPT '3333' AT 1,25
DEFINE PAD four  OF beforafter PROMPT '4444' BEFORE two AT 1,35
WAIT WINDOW 'Press Esc to erase menu' NOWAIT

ACTIVATE MENU beforafter

KEY <key label>[, <expC2>]

In addition to pressing a hot key, you can choose a pad by pressing another key or a key combination.  <key label> specifies the key or key combination used to choose the pad.  See ON KEY LABEL for a list of available keys and key combinations and their key label names.

Note   If a keyboard macro is already defined with the same key label, the keyboard macro takes precedence, and the pad cannot be chosen with the specified key or key combination.

The key label is placed to the right of pads in menu bars created without the BAR clause.  The key label isn't displayed in menu bars created with the BAR clause or for pads in the system menu bar.  Include <expC2> to replace the key label with your own text.  For example, including KEY Ctrl+B places the text "Ctrl+B" to the right of the pad.  If you instead specify KEY Ctrl+B, "^B", "^B" will be displayed as a reminder of the key combination used to choose the pad.  The key label can be suppressed by including the null string for <expC2>.

MARK <expC3> [image] FoxPro for MS-DOS only

A mark character can be placed to the left of a pad in a menu bar with SET MARK OF.  The default mark character is a diamond ( [image]) in FoxPro for MS-DOS and a check ( [image]) in FoxPro for Windows and FoxPro for Macintosh.

In FoxPro for MS-DOS, the MARK clause can be included to change the default mark character to <expC3>.  (Specifying a mark character doesn't mark a pad.  Use SET MARK OF to mark a pad).

The MARK clause is ignored in FoxPro for Windows and FoxPro for Macintosh.

You can use a mark character to indicate that a certain condition exists - a popup is available for the pad, an option controlled by the pad is on or off, and so forth.

If <expC3> includes more than one character, only the first character is used as the mark character.

Mark characters specified with DEFINE PAD take precedence over mark characters specified with the MARK clause in DEFINE MENU.  SET MARK OF is used to toggle marks on or off and can also be used to specify a mark character for an individual menu pad or for all menu pads.

SKIP [FOR <expL>]

A pad can be disabled based on a logical condition. If you include SKIP FOR <expL>, the logical expression <expL> is evaluated, and, based on the result (true or false), the pad is disabled or enabled. If <expL> evaluates to true (.T.), the pad is disabled and cannot be selected or chosen. If <expL> evaluates to false (.F.), the pad is enabled.

Another method for disabling a menu pad is to place a backslash (\) before the text of the prompt. For example:

DEFINE PAD pageaccts OF receive PROMPT '\Age Accounts'

The pad Pageaccts is displayed in the menu bar in disabled colors and cannot be selected or chosen.

In FoxPro for MS-DOS, a menu pad disabled with SKIP or the \ cannot be selected. In FoxPro for Windows and FoxPro for Macintosh, a disabled menu pad can be selected but it cannot be chosen  a message for a disabled menu pad is still displayed when it is selected.

Menus you create that include SKIP FOR expressions may not behave properly when the spellchecker or wizards are active.

SKIP FOR expressions typically depend on the value of skip variables, but the skip variables are not visible to your menus when the spell checker or wizards are active. In the initialization code of the spell checker and wizard applications SPELLCHK.APP and GENGRAPH.APP respectively), PRIVATE ALL is intentionally issued. This hides skip variables from user-defined menus and causes a "Variable not found" error when you make a menu choice.

To correct this situation, the following code is placed at the beginning of the spell checker and wizard applications:

IF TYPE("_memvarmask") = "C" and !EMPTY(_memvarmask)
PRIVATE ALL EXCEPT &_memvarmask
ELSE
PRIVATE ALL
ENDIF

Suppose a certain menu option should be skipped when the memory variable named "skipvar" evaluates to true. You should include the following lines in your menu startup code to take advantage of the _MEMVARMASK variable:

PUBLIC _memvarmask
_memvarmask = "skipvar"
STORE .T. TO skipvar             && Skip initially.

To create a set of skip variables, include the following lines in your menu startup code:

PUBLIC _memvarmask
_memvarmask = "skip*"
STORE .T. TO skipthis, skipthat  && Skip initially.

When you run the spell checker and wizards, they don't hide variables in SKIP FOR expressions, preventing the "Variable not found" errors you may experience when the spell checker

Note that _MEMVARMASK isn't a system memory variable.

MESSAGE <expC4>

A message can be displayed when a pad is selected by including MESSAGE <expC4>.  In FoxPro for MS-DOS, the message <expC4> is centered on the last line of the desktop by default; the message location can be changed with SET MESSAGE.

In FoxPro for Windows and FoxPro for Macintosh, the message is placed in the graphics-based status bar. If the graphics-based status bar has been turned off with SET STATUS BAR OFF, the message is centered on the last line of the main FoxPro window.

COLOR SCHEME <expN> | COLOR <color pair list>

Include the number of an existing color scheme in the COLOR SCHEME clause or a set of color pairs in the COLOR clause to specify the colors of all pads, mark characters and messages in a menu bar.  You can also specify the colors of an individual pad, overriding the default colors or the colors specified with DEFINE MENU.

A color scheme is a set of 10 predefined color pairs.  The color pairs in a color scheme can be changed with SET COLOR OF SCHEME.  In FoxPro for MS-DOS the color pairs in a color scheme can also be changed in the Color Picker.

A color pair is a set of two letters separated by a forward slash.  The first color letter specifies the foreground color and the second letter specifies the background color.

For example, this color pair specifies a red foreground on a white background:

R/W

For a list of colors and their corresponding color letters, see SET COLOR Commands or Color Table by Color Pair.

A color pair can also be specified with a set of 6 RGB (Red Green Blue) color values separated by commas.  The first 3 color values specify the foreground color and the second 3 color values specify the background color.  The color values can range from 0 through 255.

The R/W color pair in the example above can also be specified with this RGB color pair:

RGB(255,0,0,255,255,255)

By default, the colors of pads in menu bars are determined by color scheme 2 of the current color set.


DEFINE PAD Example

This example uses DEFINE PAD to place menu pads in the FoxPro system menu bar.

The current system menu bar is first saved to memory with SET SYSMENU SAVE, and then all system menu pads are removed with SET SYSMENU TO.

Several system menu pads are created with DEFINE PAD.  When a menu pad is chosen, the CHOICE procedure is executed.  CHOICE displays the name of the chosen menu pad and the name of the menu bar, and toggles the menu pad's mark character on and off.  If the Exit menu pad is chosen, the original FoxPro system menu is restored.

*** Name this program DEFINPAD.PRG ***

CLEAR
SET TALK OFF
SET SYSMENU SAVE
SET SYSMENU TO

PUBLIC markpad
markpad = .T.

DEFINE PAD syspad    OF _MSYSMENU PROMPT '\<System'  COLOR SCHEME 3 ;
KEY ALT+S, ''
DEFINE PAD editpad   OF _MSYSMENU PROMPT '\<Edit'    COLOR SCHEME 3 ;
KEY ALT+E, ''
DEFINE PAD recordpad OF _MSYSMENU PROMPT '\<Record'  COLOR SCHEME 3 ;
KEY ALT+R, ''
DEFINE PAD windowpad OF _MSYSMENU PROMPT '\<Window'  COLOR SCHEME 3 ;
KEY ALT+W, ''
DEFINE PAD reportpad OF _MSYSMENU PROMPT 'Re\<ports' COLOR SCHEME 3 ;
KEY ALT+P, ''
DEFINE PAD exitpad   OF _MSYSMENU PROMPT 'E\<xit'    COLOR SCHEME 3 ;
KEY ALT+X, ''

ON SELECTION MENU _MSYSMENU ;
DO choice IN definpad WITH PAD( ), MENU( )

PROCEDURE choice
PARAMETER mpad, mmenu

WAIT WINDOW 'You chose ' + mpad + ;
' from menu ' + mmenu NOWAIT
SET MARK OF PAD (mpad) OF _MSYSMENU TO ;
! MRKPAD('_MSYSMENU', mpad)
markpad = ! markpad

IF mpad = 'EXITPAD'
SET SYSMENU TO DEFAULT
ENDIF


DEFINE PAD SeeAlso
See Also

ACTIVATE MENU Command

CREATE MENU Command

DEACTIVATE MENU Command

DEFINE MENU Command

GETPAD( ) Function

HIDE MENU Command

MRKPAD( ) Function

ON PAD Command

ON SELECTION PAD Command

PRMPAD( ) Function

SET MARK OF Commands

SET MESSAGE Command

SET SYSMENU Command

SHOW MENU Command


DEFINE POPUP Command

See Also	Example

Creates a popup.

Syntax

DEFINE POPUP <popup name>
[FROM <row1, column1>]
[TO <row2, column2>]
[IN [WINDOW] <window name> | IN SCREEN]
[FOOTER <expC1>]
[KEY <key label>]
[MARGIN]
[MARK <expC2>]
[MESSAGE <expC3>]
[MOVER]
[MULTISELECT]
[PROMPT FIELD <expr> | PROMPT FILES [LIKE <skel>] | PROMPT STRUCTURE]
[RELATIVE]
[SCROLL]
[SHADOW]
[TITLE <expC4>]
[COLOR SCHEME <expN> | COLOR <color pair list>]

Remarks

DEFINE POPUP creates a popup, which can contain a list of options that you define, the records from a field, a list of files, or a list of fields from a table.  To place a set of options that you define on a popup, use a series of DEFINE BARs.  To place records, files or fields on a popup, use the PROMPT FIELD, PROMPT FILES or PROMPT STRUCTURE clause of DEFINE POPUP.

When the popup is activated and displayed with ACTIVATE POPUP, you can choose one of the options.  Depending on the option chosen, a routine can be executed or another popup can be displayed and activated.  A popup that displays another popup or a menu bar when an option is chosen is called a cascading menu.  For more information on creating cascading menus, see ON BAR.

Clauses

<popup name>

<popup name> is the name of the popup you want to create.

FROM <row1, column1> TO <row2, column2>

You can specify where the popup is placed by including the FROM clause.  The upper-left corner of the popup is placed at the coordinates specified by <row1, column1>.  If the FROM clause is omitted, FoxPro places the upper-left corner of the popup in the first row and first column of the desktop, main FoxPro window or user-defined window.

You can also include <row2, column2> to specify the location of the lower-right corner of the popup to create a popup with a specific size.

If you include FROM <row1, column1> and omit TO <row2, column2>, FoxPro automatically sizes the popup.  The popup is as wide as the longest menu option (if the options are created with DEFINE BAR) and as long as needed to display all of the menu options.  The popup length is limited by the size of the desktop, main FoxPro window or user-defined window.  If a popup isn't large enough to contain all of the menu options, the menu options scroll within the popup.

If you include both FROM and TO clauses to create a popup with a specific size, you can then use ACTIVATE POPUP NOWAIT to display the popup without having first defined bars for the popup.  This lets you display a popup and then place options on it.

IN [WINDOW] <window name> | IN SCREEN

By default, popups are placed on the desktop or main FoxPro window unless there is an active user-defined window.  If there is an active user-defined window, the popup is placed in the active window.

You can place a popup in a specific user-defined window by including the IN or IN WINDOW clause.  Specify the name of the window in which you want to place the popup with <window name>.

You can explicitly place the popup on the desktop or main FoxPro window by including IN SCREEN.

FOOTER <expC1>

You can create a footer that is centered in the bottom border of the popup.  Include the FOOTER key word followed by <expC1>, which is the text you want to display in the bottom border of the popup.  If the footer is wider than the popup, the footer is truncated.

The FOOTER clause is ignored in FoxPro for Windows and FoxPro for Macintosh.

KEY <key label>

A popup can be activated by pressing a key or a combination of keys.  <key label> specifies the key or key combination used to activate the popup.  See ON KEY LABEL for a list of available keys and key combinations and their key label names.  Including KEY is equivalent to issuing the following command:

ON KEY LABEL <key label> ACTIVATE MENU <menu name>

Note   If a keyboard macro is already defined with the same key label, the keyboard macro takes precedence, and the popup cannot be activated with the specified key or key combination.

MARGIN

Including MARGIN places one extra space to the left and right of each popup option.  A mark character is displayed in the space to the left of an option, and an arrow indicating an additional cascading menu is available is displayed to the right of an option.  If MARGIN isn't included, the mark character overwrites the first character of the option name; a hierarchical arrow overwrites the last character of the option name.

MARK <expC2> [image] FoxPro for MS-DOS only

A mark character can be placed to the left of each option name on a popup with SET MARK OF.  The default mark character is a diamond ( [image]) in FoxPro for MS-DOS and a check ( [image]) in FoxPro for Windows and FoxPro for Macintosh.

In FoxPro for MS-DOS, MARK <expC2> can be included to change the default mark character to <expC2>.  (Specifying a mark character doesn't mark an option.  Use SET MARK OF to mark an option.)  If <expC2> includes more than one character, only the first character is used as the mark character.

The MARK clause is ignored in FoxPro for Windows and FoxPro for Macintosh.

The MARK clause sets the mark character for all options on the popup.  Mark characters specified with DEFINE BARs take precedence over mark characters specified with the MARK clause in DEFINE POPUP.  SET MARK OF is used to toggle mark characters on or off and can also be used to specify a mark character for an individual popup option or for all popup options.

MESSAGE <expC3>

A message can be displayed when the popup is active by including MESSAGE <expC3>.  In FoxPro for MS-DOS, the message <expC3> is centered on the last line of the desktop by default; the message location can be changed with SET MESSAGE.

In FoxPro for Windows and FoxPro for Macintosh, the message is placed in the graphical status bar. If the graphical status bar has been turned off with SET STATUS BAR OFF, the message is centered on the last line of the main FoxPro window.

MOVER

Options on a popup can be rearranged within the popup if MOVER is included.  When MOVER is included, a double-headed arrow ( [image]) is placed to the left of each option on the popup.

To move an option with the mouse, click on the double-headed arrow ( [image]) and drag the option up or down.  With the keyboard, first select an option, and then press Ctrl+Up Arrow or Ctrl+Down Arrow to move the option up or down.

You cannot rearrange options on a popup created with a PROMPT clause.

GETBAR( ) returns the bar number of a position on a popup and can be used to determine where each option is positioned on the popup.

MULTISELECT

Multiple options can be chosen from a popup when MULTISELECT is included in DEFINE POPUP.  When an option is chosen from a popup, the mark character is placed to the left of the option.

In FoxPro for MS-DOS, you can select multiple options from a popup with the keyboard by holding down the Shift key and selecting the options by pressing Enter or the Spacebar.  To select consecutive options, select one option, then hold down the Shift key and press the Up or Down Arrow key.

To select consecutive options, hold down the Shift key and drag the cursor through the options with the mouse.  To select nonconsecutive options with a mouse, hold down the Shift key and click each option.

In FoxPro for Windows, the KEYCOMP setting determines how you can select multiple options.  If KEYCOMP is set to DOS, multiple options can be selected in the manner described for FoxPro for MS-DOS.

If KEYCOMP is set to WINDOWS, you can select consecutive options from a popup with the keyboard.  To select consecutive options with the keyboard, select one option, then hold down the Shift key and press the Up or Down Arrow key.  To select consecutive options with a mouse, click on the first option you want to select and drag the cursor to the last option you want to select.  To select nonconsecutive options with a mouse, hold down the Ctrl key and click on each option.

In FoxPro for Macintosh, SET KEYCOMP determines how you can select multiple options.

If KEYCOMP is set to DOS, hold down the Shift key when you choose the items with the Spacebar. To select consecutive items, choose one item and hold down the Shift key while pressing the Up or Down Arrow key.

If KEYCOMP is set to WINDOWS,hold down the Shift key when you choose the items with the Spacebar. To choose consecutive items, choose one item and hold down the Shift key while pressing the Up or Down Arrow key.

If KEYCOMP is set to MAC, hold down the Ctrl key when you choose the items with the Spacebar. To choose consecutive items, choose one item and hold down the Shift key while pressing the Up or Down Arrow key. You can also choose consecutive items this way:  choose an item with the Spacebar ("anchor" the item), press the Up or Down Arrow key to move to the last item you'd like to choose, then press Shift+Spacebar.

You cannot make multiple selections from a popup created with a PROMPT clause.

MRKBAR( ) is used to determine which options are chosen from the popup.  Choosing an option from a popup created with MULTISELECT marks the option.  MRKBAR( ) returns a true (.T.) value if an option is marked.

If you include MULTISELECT in DEFINE POPUP, you may also want to include MARGIN to reserve space in each option for the mark character.

In the following example, a popup named Fruits is created.  MULTISELECT is included to create a popup that allows multiple options to be chosen.

In FoxPro for MS-DOS, each of the four options has a different mark character.  When options are chosen from the popup, the options are marked and a routine named YOURCHOICE displays the chosen options.

CLEAR
DEFINE POPUP fruits FROM 5,5 ;
MULTISELECT MARGIN && Create multi-choice popup
DEFINE BAR 1 OF fruits ;
PROMPT '\<Apples' MARK CHR(3)	&& First option
DEFINE BAR 2 OF fruits  ;
PROMPT '\<Bananas' MARK CHR(4)	&& Second option
DEFINE BAR 3 OF fruits  ;
PROMPT '\<Grapes' MARK CHR(5)	&& Third option
DEFINE BAR 4 OF fruits  ;
PROMPT '\<Lemons' MARK CHR(6)	&& Fourth option

@ 12,5 SAY 'Your choices:'

ON SELECTION POPUP fruits DO yourchoice	&& Choice routine
ACTIVATE POPUP fruits

PROCEDURE yourchoice && Executed when choice is made
@ 13,5 CLEAR
FOR count = 1 TO CNTBAR('fruits')	&& Loop for number of options
IF MRKBAR('fruits', count) = .T.	&& If option is marked,
? PRMBAR('fruits', count) AT 5	&& display option prompt
ENDIF
NEXT

PROMPT FIELD <expr>

If you include PROMPT FIELD and specify a field name from an open table with <expr>, the records in that field become the options on the popup.  The popup will contain an option for each record in the table.  When the popup is activated, the work area containing the table is selected.

Tip   You can take advantage of Rushmore optimization if you set a filter on the field specified with PROMPT FIELD used in the popup.  For further details on Rushmore optimization, see the Optimizing Your Application chapter in the FoxPro Developer's Guide.

<expr> can also contain multiple field names and expressions concatenated with the addition operator (+).  <expr> can also be the name of the field in a table open in another work area or a user-defined function (UDF).

The maximum number of options that may appear on a popup created with PROMPT FIELD in the standard version of FoxPro for MS-DOS is 32,767.  If the table has more records, the message "Popup too big, first <nnnnn> entries shown" is displayed.  In the 32-bit Extended version of FoxPro for MS-DOS and in FoxPro for Windows and FoxPro for Macintosh, there is no limit to the number of entries that can appear in a popup created with PROMPT FIELD.

PROMPT FILES [LIKE <skel>]

You can easily create a popup that displays the names of files available on disk.  If you include PROMPT FILES, a popup is created that displays the names of all files in the current directory.

An additional LIKE <skel> clause can be included to selectively place the names of files on the popup.  The file specification skeleton <skel> supports wildcard characters.  For example, to create a popup that displays the names of tables in the default drive and directory, include the following command:

PROMPT FILES LIKE *.DBF

You can create a popup that displays the names of files on other drives and in other directories by including a drive specification, a directory specification or both.  For example, to create a popup that displays the names of program files in a directory called PROGRAMS on drive A, include this command:

PROMPT FILES LIKE A:\PROGRAMS\*.PRG

PROMPT STRUCTURE

PROMPT STRUCTURE displays the names of the fields in the current table on the popup according to the table's field structure.  When the popup is activated, the work area containing the table is selected.

RELATIVE

The order that options are inserted onto a popup can be controlled with RELATIVE.  If a popup is created without the RELATIVE clause, an option is positioned on a popup in an order dictated by the option's bar number.  Space on the popup is reserved for undefined options.  For example, if the first and third options are defined and the popup is activated, a blank line reserved for the second option is placed on the popup.

If a popup is created with RELATIVE, the options appear on the popup in the order in which they are defined.  Space in the popup isn't reserved for undefined options.

Defining a popup with RELATIVE also lets you make use of BEFORE and AFTER clauses in DEFINE BAR to position options on a popup relative to other options.  If a popup is created without RELATIVE, including BEFORE or AFTER in DEFINE BAR generates a syntax error.

Run the following two program examples and compare the placement of the options on each popup.

*** RELATIVE Example  ***

DEFINE POPUP relatyes RELATIVE FROM 1,1

DEFINE BAR 4  OF relatyes PROMPT '4444'
DEFINE BAR 3  OF relatyes PROMPT '3333'
DEFINE BAR 2  OF relatyes PROMPT '2222'
DEFINE BAR 1  OF relatyes PROMPT '1111'
DEFINE BAR 6  OF relatyes PROMPT '6666' BEFORE 4

ACTIVATE POPUP relatyes

*** NON-RELATIVE Example ***

DEFINE POPUP notrelat FROM 1,1

DEFINE BAR 4  OF notrelat PROMPT '4444'
DEFINE BAR 3  OF notrelat PROMPT '3333'
DEFINE BAR 2  OF notrelat PROMPT '2222'
DEFINE BAR 1  OF notrelat PROMPT '1111'
DEFINE BAR 6  OF notrelat PROMPT '6666'

ACTIVATE POPUP notrelat

SCROLL

If SCROLL is included in DEFINE POPUP, a scroll bar is placed to the right of the popup you create.  The scroll bar lets you move quickly through the popup with the mouse and provides a visual indication of your position on the popup.  The scroll bar is displayed only when there are more options than can fit on the popup or if the popup is too long to fit on the desktop, the main FoxPro window or the active user-defined window.

SHADOW [image] FoxPro for MS-DOS only

In FoxPro for MS-DOS, a shadow can be placed behind a popup if SHADOW is included when the popup is defined.  SET SHADOWS can be used to display or remove the popup's shadow.  For more information, see SET SHADOWS.

SHADOW is ignored in FoxPro for Windows and FoxPro for Macintosh.

TITLE <expC4>

You can specify a title that is displayed in the center of the top border of the popup.  <expC4> is the title you want to display in the top border of the popup.  If the title is wider than the popup, the title is truncated.

TITLE is ignored in FoxPro for Windows.

COLOR SCHEME <expN> | COLOR <color pair list>

You can specify the color of all elements of the popup by including the number of an existing color scheme in the COLOR SCHEME clause or a set of color pairs in the COLOR clause.

A color scheme is a set of 10 predefined color pairs.  The color pairs in a color scheme can be changed with SET COLOR OF SCHEME.  In FoxPro for MS-DOS the color pairs in a color scheme can also be changed in the Color Picker.

A color pair is a set of two letters separated by a forward slash.  The first color letter specifies the foreground color and the second letter specifies the background color.

For example, this color pair specifies a red foreground on a white background:

R/W

For a list of colors and their corresponding color letters, see SET COLOR Commands Overview or Color Table by Color Pair.

A color pair can also be specified with a set of 6 RGB (Red Green Blue) color values separated by commas.  The first 3 color values specify the foreground color and the second 3 color values specify the background color.  The color values can range from 0 through 255.

The R/W color pair in the example above can also be specified with this RGB color pair:

RGB(255,0,0,255,255,255)

By default, the colors of popups created with DEFINE POPUP are controlled by color scheme 2.


DEFINE POPUP Example

This example uses DEFINE POPUP to create popups that are activated when a menu pad in the menu bar is chosen.

The current system menu bar is first saved to memory with SET SYSMENU SAVE, and then all system menu pads are removed with SET SYSMENU TO.

Two new system menu pads are created with DEFINE PAD, and DEFINE POPUP creates a popup for each menu pad.  DEFINE BAR creates options on each of the popups.  When a menu pad is chosen, ON PAD uses ACTIVATE POPUP to activate the corresponding popup.

When an option is chosen from a popup, ON SELECTION POPUP uses PROMPT( ) and POPUP( ) to pass the option number and popup name to the CHOICE procedure.  CHOICE displays the prompt of the chosen option and the name of the popup containing the option.  If the Exit option is chosen from the Card Info popup, the original FoxPro system menu is restored.

*** Name this program DEFINPOP.PRG ***

CLEAR

SET SYSMENU SAVE
SET SYSMENU TO

DEFINE PAD convpad OF _MSYSMENU PROMPT '\<Conversions' COLOR SCHEME 3 ;
KEY ALT+C, ''
DEFINE PAD cardpad OF _MSYSMENU PROMPT 'Card \<Info' COLOR SCHEME 3 ;
KEY ALT+I, ''

ON PAD convpad OF _MSYSMENU ACTIVATE POPUP conversion
ON PAD cardpad OF _MSYSMENU ACTIVATE POPUP cardinfo

DEFINE POPUP conversion MARGIN RELATIVE SHADOW COLOR SCHEME 4
DEFINE BAR 1 OF conversion PROMPT 'Ar\<ea' KEY CTRL+E, '^E'
DEFINE BAR 2 OF conversion PROMPT '\<Length' ;
KEY CTRL+L, '^L'
DEFINE BAR 3 OF conversion PROMPT 'Ma\<ss' ;
KEY CTRL+S, '^S'
DEFINE BAR 4 OF conversion PROMPT 'Spee\<d' ;
KEY CTRL+D, '^D'
DEFINE BAR 5 OF conversion PROMPT '\<Temperature' ;
KEY CTRL+T, '^T'
DEFINE BAR 6 OF conversion PROMPT 'T\<ime' ;
KEY CTRL+I, '^I'
DEFINE BAR 7 OF conversion PROMPT 'Volu\<me' ;
KEY CTRL+M, '^M'

ON SELECTION POPUP conversion;
DO choice IN definpop WITH PROMPT( ), POPUP( )

DEFINE POPUP cardinfo MARGIN RELATIVE SHADOW COLOR SCHEME 4
DEFINE BAR 1 OF cardinfo PROMPT '\<View Charges' ;
KEY ALT+V, ''
DEFINE BAR 2 OF cardinfo PROMPT 'View \<Payments' ;
KEY ALT+P, ''
DEFINE BAR 3 OF cardinfo PROMPT 'Vie\<w Users' ;
KEY ALT+W, ''
DEFINE BAR 4 OF cardinfo PROMPT '\-'
DEFINE BAR 5 OF cardinfo PROMPT '\<Charges '
DEFINE BAR 6 OF cardinfo PROMPT '\-'
DEFINE BAR 7 OF cardinfo PROMPT 'E\<xit '

ON SELECTION POPUP cardinfo;
DO choice IN definpop WITH PROMPT( ), POPUP( )

PROCEDURE choice
PARAMETERS mprompt, mpopup

WAIT WINDOW 'You chose ' + mprompt + ;
' from popup ' + mpopup NOWAIT

IF mprompt = 'Exit'
SET SYSMENU TO DEFAULT
ENDIF


DEFINE POPUP SeeAlso
See Also

ACTIVATE POPUP Command

CNTBAR( ) Function

CREATE MENU Command

DEFINE BAR Command

GETBAR( ) Function

HIDE POPUP Command

MOVE POPUP Command

MRKBAR( ) Function

ON BAR Command

ON SELECTION BAR Command

POPUP( ) Function

PRMBAR( ) Function

PROMPT( ) Function

SET MARK OF Commands

SET MESSAGE Command

SIZE POPUP Command

SHOW POPUP Command


DEFINE WINDOW Command

See Also	Example

Creates a window and specifies its attributes.

Syntax

DEFINE WINDOW <window name1> FROM <row1, column1> TO <row2, column2> |
AT <row3, column3> SIZE <row4, column4>
[IN [WINDOW] <window name2> | IN SCREEN | IN DESKTOP]
| IN MACDESKTOP]
[FONT <expC1>[, <expN1>]]
[STYLE <expC2>]
[FOOTER <expC3>]
[TITLE <expC4>]
[HALFHEIGHT]
[DOUBLE | PANEL | NONE | SYSTEM | <border string>]
[CLOSE | NOCLOSE]
[FLOAT | NOFLOAT]
[GROW | NOGROW]
[MDI | NOMDI]
[MINIMIZE | NOMINIMIZE]
[SHADOW | NOSHADOW]
[ZOOM | NOZOOM]
[ICON FILE <expC5>]
[FILL <expC6> | FILL FILE <picture file>]
[COLOR SCHEME <expN2> | COLOR <color pair list>]

Remarks

DEFINE WINDOW creates a user-defined window and specifies its attributes.  After user-defined windows are created, they can be displayed on the desktop in FoxPro for MS-DOS or the main FoxPro window with ACTIVATE WINDOW or SHOW WINDOW.  The number of user-defined windows you can create is limited only by the amount of available memory and system resources.

Window definitions are placed in memory, and the user-defined window names are listed in the bottom portion of the Window menu popup.  The name of the user-defined window created first appears at the top of the list, followed by the name of each additional user-defined window.  The name of the user-defined window that output is currently directed to is marked with a diamond ( [image]) in FoxPro for MS-DOS and a check ( [image]) in FoxPro for Windows and FoxPro for Macintosh. If there is no output window, output is directed to the desktop or the main FoxPro window.

Activated windows remain on the desktop or main FoxPro window until DEACTIVATE WINDOW or HIDE WINDOW is issued.  DEACTIVATE WINDOW and HIDE WINDOW remove windows from the desktop or main FoxPro window but don't remove the window definitions from memory.  Windows can be placed back on the desktop or main FoxPro window with ACTIVATE WINDOW or SHOW WINDOW.

Use CLEAR WINDOWS or RELEASE WINDOWS to remove windows from the desktop or main FoxPro window and window definitions from memory.  Windows whose definitions have been removed from memory must be recreated with DEFINE WINDOW to be redisplayed.

Clauses

<window name1>

Specify the name of the window to create with <window name1>.  Window names can be up to 10 characters long.  They must begin with a letter or underscore, and cannot begin with a number.  They can contain any combination of letters, numbers and underscores.

FROM <row1, column1> TO <row2, column2>

The position of the upper-left corner of the window on the desktop or main FoxPro window is determined by the coordinates specified with <row1, column1>.  The position of the lower-right corner is specified with <row2, column2>.  These two sets of coordinates determine the window size.  A window can be defined with coordinates that lie outside the desktop or main FoxPro window border and can be larger than the desktop or main FoxPro window.  User-defined windows can also be placed inside other user-defined windows.

In FoxPro for Windows and FoxPro for Macintosh, the window's location and size are determined by the font of the window's parent.  The window's parent can be another user-defined window or the main FoxPro window.

AT <row3, column3>
SIZE <row4, column4>

The AT and SIZE clauses are useful for creating a user-defined window in FoxPro for Windows and FoxPro for Macintosh. When a window is created with the AT and SIZE clauses, the size of the window is determined by the window's font.

You can specify a font and font style for a user-defined window by including the FONT and STYLE clauses.  If you specify a font for the window and include the SIZE clause, its size is determined by the window's font height and width.  If you don't specify a font for a window, the window's font is the default system font - 10 point FoxFont.

FoxFont. In FoxPro for Macintosh, a 9 point Monaco font is used.

The location of the upper-left corner of the window you create is specified with AT <row3, column3>.  This location is determined by the current font of the window's parent.  Because the AT clause is identical to the FROM clause in all respects, the two clauses can be used interchangeably.

The SIZE clause can be used instead of the TO clause to ensure that text displayed in a specific font will fit in the window you create.  The size of the user-defined window in rows and columns is specified with <row4, column4>.

AT and SIZE can be also used to specify the location and size of a user-defined window in FoxPro for MS-DOS.  Since FoxPro for MS-DOS only supports a single font, the size of the window will always be the same.

IN [WINDOW] <window name2>

Include the IN clause to place a user-defined window in a parent window.  The user-defined window (the child window)  becomes integrated with the parent window it is placed in.  A child window placed in a parent window cannot be moved outside the parent window.  If the parent window is moved, the child window moves with it.

When a child window is placed in a parent window, the child window coordinates specified with the FROM and TO clauses or the AT and SIZE clauses are relative to the parent window, not the desktop or main FoxPro window.

In the following example, a parent window, TEST1, is created.  A child window, TEST2, is placed in the parent window.

CLEAR

DEFINE WINDOW test1 ;
FROM 1, 1 TO 20, 30 ;
TITLE "Test1"	&& Parent window.
ACTIVATE WINDOW test1

DEFINE WINDOW test2 ;
FROM 1, 1 TO 20, 20 ;
TITLE "Test2" ;
IN WINDOW test1	&& Child window.
ACTIVATE WINDOW test2

ACTIVATE SCREEN

WAIT WINDOW 'Press a key to clear the windows'

RELEASE WINDOW test1, test2
CLEAR

IN SCREEN

Include IN SCREEN to explicitly place a window on the desktop or the main FoxPro window.  Windows are placed on the desktop or the main FoxPro window by default.

IN DESKTOP

Include IN DESKTOP to place a user-defined window in the Microsoft Windows desktop, outside the main FoxPro window.  The position of the window is relative to the Windows desktop, and size of the window is determined by the current font of the main FoxPro window.

In FoxPro for Macintosh, if IN DESKTOP is included, the user-defined window is placed on the main FoxPro window and the main FoxPro window cannot be brought forward over the window.

In FoxPro for MS-DOS, if IN DESKTOP is included, the user-defined window is placed on the FoxPro desktop.  IN DESKTOP is identical to IN SCREEN in FoxPro for MS-DOS.

IN MACDESKTOP

MACDESKTOP is available in FoxPro for Macintosh only.

Include the MACDESKTOP clause to place a user-defined window on the Macintosh desktop. The user-defined window resides at the same level as the main FoxPro window. The window can be moved outside of the main FoxPro window and the main FoxPro window can be brought foward over the top of it. When you include the MACDESKTOP clause the user-defined window behaves in the same manner as user-defined screens in FoxBASE+ for Macintosh.

Including the MACDESKTOP clause overrides the current SET MACDESKTOP setting. SET MACDESKTOP determines if user-defined windows are activated on the main FoxPro window or the Macintosh desktop when the SCREEN or MACDESKTOP clause is not included. See SET MACDESKTOP for more information about placing windows on the main FoxPro window or the Macintosh desktop.

FONT <expC1>[, <expN1>]

Use the FONT clause to specify a font for output directed to the window.  <expC1> is the name of the font and <expN1> is the font size.  If <expN1> is omitted, a 9 point font is used.

For example, in FoxPro for Windows this command creates a window that displays output directed to the window in a 16-point Courier font:

DEFINE WINDOW Courierfont FROM 2, 2 TO 12, 22 FONT 'Courier', 16

In FoxPro for Windows, if the FONT clause is omitted, 10-point FoxFont is used. In FoxPro for Macintosh, a 9 point Monaco font is used.

In FoxPro for Windows, if the font you specify is not available, a font with similar font characteristics is substituted.

In FoxPro for Macintosh, if the font you specify is not available, the Chicago font is used.

In FoxPro for MS-DOS, the FONT clause is ignored.

STYLE <expC2>

In FoxPro for Windows and FoxPro for Macintosh, include the STYLE clause to specify a font style for output directed to the window.

The font style is specified with <expC2>.  If the STYLE clause is omitted, the normal font style is used.

In FoxPro for Windows, if the font style you specify is not available, a font style with similar characteristics is substituted.

In FoxPro for Macintosh, if the font you specify is not available, the normal font style is used.

The STYLE clause is ignored in FoxPro for MS-DOS.

Character	Font Style
B	Bold
I	Italic
N	Normal
O	Outline
Q	Opaque
S	Shadow
-	Strikeout *
T	Transparent
U	Underline
C	Condense*
E	Extend*

*The Condense and Extend styles are available only in FoxPro for Macintosh. The Strikeout style is available only in FoxPro for Windows.

You can include more than one character to specify a combination of font styles.  In FoxPro for Windows and FoxPro for Macintosh, the following commands specify the style Bold Italic:

DEFINE WINDOW bolditalic FROM 2, 2 TO 12, 22 STYLE 'BI'

The STYLE clause is ignored in FoxPro for MS-DOS.

FOOTER <expC3>

In FoxPro for MS-DOS, a window can be assigned a footer with the FOOTER clause. <expC3> is the text you want to display as the footer.  The footer is centered in the bottom border of the window.  If the footer is wider than the window, the footer is truncated.

In FoxPro for Windows and FoxPro for Macintosh, the FOOTER clause is ignored.

TITLE <expC4>

In FoxPro for MS-DOS, a window can be assigned a title with the TITLE clause.  The title <expC4> is centered in the top border of the window.  If the title is wider than the window, the title is truncated.

HALFHEIGHT

In FoxPro for MS-DOS, the HALFHEIGHT clause is ignored.

Use HALFHEIGHT to create windows with half-height title bars, which provide compatibility for windows created in FoxPro version 2.0 and imported into FoxPro for Windows and FoxPro for Macintosh.

When you use DEFINE WINDOW to create a window in FoxPro for Windows and FoxPro for Macintosh, a half-height title bar is used unless you include the SYSTEM keyword or you include a FONT clause.

If you include the HALFHEIGHT keyword, a half-height title bar is used regardless of whether the SYSTEM or FONT clause is included.

DOUBLE | PANEL | NONE | SYSTEM | <border string>

You can specify a border for a user-defined window by including the DOUBLE, PANEL, NONE, SYSTEM or <border string> clause.  The default border is a single line.

The DOUBLE option places a double-line border around the window.  The PANEL option places a wide border around the window.  The NONE option suppresses the border entirely.

Include the SYSTEM clause to emulate the look of system windows.  When you include certain other clauses (GROW, ZOOM, and so on), the appropriate window controls are placed in the top border of the window.

You can create your own custom border for a window with <border string>.  For more information on defining a custom border, see SET BORDER.

In FoxPro for Windows and FoxPro for Macintosh, including DOUBLE or a custom border string creates a window with the PANEL border.  Including the CLOSE, FLOAT, GROW, ZOOM, or MINIMIZE clauses places the appropriate controls on the window even if the SYSTEM window type definition clause is not included.

CLOSE | NOCLOSE

If the CLOSE clause is included, you can close a user-defined window from the File menu or with the keyboard or mouse.  Closing a window removes it from the desktop, the main FoxPro window or a parent user-defined window and removes its definition from memory.

In FoxPro for MS-DOS, you can close a window created with CLOSE by choosing the Close option from the File menu.

If the window was created with the SYSTEM clause, click on the close box in the upper-left corner of the window's border to close the window.  If the window wasn't created with the SYSTEM clause, a "hidden" close box is available in the upper-left corner of the window's border.  Clicking on this corner closes the window.

In FoxPro for Windows, you can close a window created with CLOSE by pressing Ctrl+F4 or by choosing the Close option from the File menu or the window's Control menu.

In FoxPro for Macintosh, you can close a window created with CLOSE by choosing the Close option from the File menu or clicking the window's Close box.

For more information on closing windows, see the Interface Basics chapter in the FoxPro User's Guide.

Include NOCLOSE or omit CLOSE to prevent a window from being closed.

FLOAT | NOFLOAT

A window can be moved if the FLOAT option is included in DEFINE WINDOW.

To move a window in FoxPro for MS-DOS, choose Move from the Window menu or press Ctrl+F7.  You can also click on the top border of the window and drag the window to a new location.

To move a window in FoxPro for Windows, choose Move from the window's Control menu or press Ctrl+F7.  Press the arrow keys to move the window.  You can also click on the top border of the window and drag the window to a new location.

To move a window in FoxPro for Macintosh, click on the top border of the window and drag the window to a new location.

MOVE WINDOW can also be used to move a window.For more information on moving windows, see the Interface Basics chapter in the FoxPro User's Guide.

Include NOFLOAT or omit FLOAT to prevent a user-defined window from being moved.

GROW | NOGROW

The size of a user-defined window can be changed if you include GROW in DEFINE WINDOW.

To change the size of a window in FoxPro for MS-DOS, choose Size from the Window menu or press Ctrl+F8.  To change the size of a window with the mouse, click on the lower-right corner of the window and drag it to change the window's size.

To change the size of a window in FoxPro for Windows, press Ctrl+F8 and then press the arrow keys.  If the window is created with the SYSTEM clause, you can choose Size from the window's Control menu and then press the arrow keys.  To change the size of a window with the mouse, position the pointer over any side or corner of the window and drag.

To change the size of a window in FoxPro for Macintosh, click on the lower-right corner of the window and drag it to change the window's size.

For more information on sizing windows, see the Interface Basics chapter in the FoxPro User's Guide.

Include NOGROW or omit GROW to prevent a window's size from being changed.

MDI | NOMDI

In FoxPro for Windows, you can create a user-defined window that is MDI (Multiple Document Interface)-compliant by including the MDI clause.  MDI is a specification that allows multiple document windows and determines their structure and behavior.

In FoxPro for MS-DOS and FoxPro for Macintosh, the MDI and NOMDI clauses are ignored.

When an MDI-compliant window is maximized, the following occur:

The window assumes the size of the main FoxPro window.  The window's controls disappear and its Control menu box appears in the FoxPro system menu bar.  The window's Restore button is also placed in the FoxPro system menu bar.

The window title is placed in FoxPro title bar and is separated from the FoxPro title by a hyphen.

If you activate another MDI-compliant window, it is automatically maximized.

Include NOMDI to create a window that is not MDI-compliant.  If you don't include either clause, the window is not MDI-compliant.

In FoxPro for MS-DOS, the MDI and NOMDI clauses are ignored.

MINIMIZE | NOMINIMIZE

In FoxPro for MS-DOS and FoxPro for Windows, a user-defined window can be minimized if you include MINIMIZE in DEFINE WINDOW.

User-defined windows cannot be minimized in FoxPro for Macintosh and the MINIMIZE clause is ignored.

To minimize a window in FoxPro for MS-DOS, double-click on the top border of the window, press Ctrl+F9 or choose Zoom [image] from the Window menu.  To return the window to its original size, repeat the same steps.  You can minimize a window and "dock" it  in the lower-right corner of the desktop by pressing the Shift key when you double-click on the top border of the window.

To minimize a window in FoxPro for Windows, choose Minimize from the window's Control menu, press Ctrl+F9 or click on the window's minimize button.  To return the window to its original size, double-click on the window's icon; or click on the window's icon and then choose Restore from the Control menu or press Ctrl+F5.

Windows created with NOMINIMIZE or without MINIMIZE cannot be minimized.

SHADOW | NOSHADOW

A user-defined window created with SHADOW has a darkened area behind it resembling a shadow.  Any text or objects covered by the shadow are still visible.  By default, windows don't have shadows.  You can change the default setting for shadows with SET SHADOWS.

Windows created with NOSHADOW or without SHADOW do not have shadows.

The SHADOW clause is ignored in FoxPro for Windows.

ZOOM | NOZOOM

A user-defined window can be enlarged to fill the entire desktop or main FoxPro window if ZOOM is included.  If a window is enlarged to full size, it can also be reduced to its original size.

In FoxPro for Windows, if IN DESKTOP is included, the window is enlarged to fill the entire Windows desktop.

In FoxPro for Macintosh, if IN MACDESKTOP is included, the window is enlarged to fill the entire Macintosh desktop.

To enlarge a window to fill the entire desktop in FoxPro for MS-DOS, choose Zoom [image] from the Window menu or press Ctrl+F10.  If the window was created with the SYSTEM clause, you can click on the Zoom control in the upper-right corner of the window's border.

If the window wasn't created with the SYSTEM option, a "hidden" Zoom control is available in the upper-right corner of the window's border.  Clicking on this corner enlarges the window to fill the entire desktop.

Repeat these steps to return the window to its original size.

To enlarge a window to fill the entire main FoxPro window or Windows desktop in FoxPro for Windows, choose Maximize from the window's Control menu, press Ctrl+F10, click on the window's Maximize button or double-click on the window's top border.  To return the window to its original size, choose Restore from the Control menu, press Ctrl+F5 or click on the Restore button.

To enlarge a window to fill the entire main FoxPro window or Macintosh desktop in FoxPro for Macintosh, click on the zoom control in the upper-right corner of the window's border.

Windows defined with NOZOOM or without ZOOM cannot be enlarged.

See the Interface Basics chapter in the FoxPro User's Guide for more information about zooming windows.

ICON FILE <expC5> [image] FoxPro for Windows only

In FoxPro for Windows, if you include the MINIMIZE keyword in DEFINE WINDOW, you can also include ICON FILE <expC5> to specify the icon displayed when the window is minimized.  You can specify an icon (.ICO) file only; you cannot specify a bitmap (.BMP) file.

ICON FILE is ignored in FoxPro for MS-DOS and FoxPro for Macintosh.

FILL <expC6> | FILL FILE <picture file>

In FoxPro for MS-DOS, the background of a window can be filled with a character by including FILL <expC6>.  If <expC6> contains more than one character, only the first character is used as the fill character.  You can also specify a fill character with CHR( ).

In FoxPro for Windows and FoxPro for Macintosh, the FILL clause is ignored.

FILL FILE <picture file> is a FoxPro for Windows and FoxPro for Macintosh clause that specifies wallpaper (the background) for a user-defined window.  The window is tiled with the specified <picture file>.In FoxPro for Windows, you can specify a .BMP bitmap file. In FoxPro for Macintosh, specify a picture file of PICT type or a .BMP bitmap file.

If you omit the extension for the picture file, FoxPro for Macintosh first looks for a picture file with the name you specified and a .BMP extension. If a picture file with a .BMP extension and the name you specified isn't found, FoxPro for Macintosh then looks for a file with the name you specified and a .PCT extension. If a picture file with a .PCT extension and the name you specified isn't found, FoxPro for Macintosh then looks for a picture file with the name you specified without an extension.

In FoxPro for MS-DOS, the FILL FILE clause is ignored.

COLOR SCHEME <expN2> | COLOR <color pair list>

The color of user-defined windows can be specified by including the number of an existing color scheme in the COLOR SCHEME clause or a set of color pairs in the COLOR clause.

A color scheme is a set of 10 predefined color pairs.  The color pairs in a color scheme can be changed with SET COLOR OF SCHEME.  In FoxPro for MS-DOS the color pairs in a color scheme can also be changed in the Color Picker.

A color pair is a set of two letters separated by a forward slash.  The first color letter specifies the foreground color and the second letter specifies the background color.

For example, this color pair specifies a red foreground on a white background:

R/W

For a list of colors and their corresponding color letters, see SET COLOR Commands Overview or Color Table by Color Pair.

A color pair can also be specified with a set of 6 RGB (Red Green Blue) color values separated by commas.  The first 3 color values specify the foreground color and the second 3 color values specify the background color.  The color values can range from 0 through 255.

The R/W color pair in the example above can also be specified with this RGB color pair:

RGB(255,0,0,255,255,255)

By default, the colors of windows created with DEFINE WINDOW are controlled by color scheme 1.


DEFINE WINDOW Example

In this example, a window named Output is created and activated.  The program waits for you to press a key and then hides the window.  The program waits for you to press a key again and then redisplays the window.

CLEAR DEFINE WINDOW output FROM 2,1 TO 13,75 TITLE 'Output' ;
CLOSE FLOAT GROW SHADOW ZOOM

ACTIVATE WINDOW output
WAIT WINDOW 'press any key to hide window output'
HIDE WINDOW output
WAIT WINDOW 'press any key to show window output'
SHOW WINDOW output
WAIT WINDOW 'press any key to release window output'
RELEASE WINDOW  output


DEFINE WINDOW SeeAlso
See Also

ACTIVATE WINDOW Command

DEACTIVATE WINDOW Command

Fonts

HIDE WINDOW Command

MODIFY WINDOW Command

MOVE WINDOW Command

RELEASE WINDOWS Command

SET BORDER Command

SHOW WINDOW Command


DELETE Command

See Also	Example

Marks records for deletion in the current table.

Syntax

DELETE
[<scope>]
[FOR <expL1>]
[WHILE <expL2>]
[NOOPTIMIZE]

Remarks

Records marked for deletion aren't physically removed from the table until PACK is issued.  Records marked for deletion can be recalled (unmarked) with RECALL.

Records can also be marked for deletion from within a Browse, Change or Edit window or from the Record menu.  See the FoxPro User's Guide for more information.

Clauses

<scope>

The scope clauses are:  ALL, NEXT <expN>, RECORD <expN>, and REST.  These are explained in the Overview of the FoxPro Language chapter in the FoxPro Language Reference.  Commands which include <scope> operate only on the table in the active work area.

You can specify a scope of records to mark for deletion.  Only the records that fall within the range of records specified by the scope are marked for deletion.

The default scope for DELETE is the current record (NEXT 1).

FOR <expL1>

Including the FOR clause lets you conditionally delete records.  If the FOR clause is included, only the records that satisfy the logical condition <expL1> are marked for deletion.

Rushmore optimizes a query created with DELETE ... FOR if <expL1> is an optimizable expression and the table is indexed on DELETED( ).  For best performance, use an optimizable expression in the FOR clause.  A discussion of Rushmore optimizable expressions appears in the Optimizing Your Application chapter in the FoxPro Developer's Guide.

WHILE <expL2>

If the WHILE clause is included, records are marked for deletion for as long as <expL2> evaluates to true (.T.).

NOOPTIMIZE

To disable Rushmore optimization of DELETE, include NOOPTIMIZE.  For more information, see SET OPTIMIZE and the discussion of Rushmore optimization in the Optimizing Your Application chapter in the FoxPro Developer's Guide.


DELETE Example

In this example, all customer records with Brookline in the CITY field are marked for deletion.  The marked records are then unmarked with RECALL.

USE DATABASES
USE customer
DELETE FOR city = 'Brookline'
GOTO TOP
WAIT WINDOW 'First record marked deleted ... press Esc' NOWAIT
BROWSE FIELDS city
RECALL FOR city = 'Brookline'
GOTO TOP
WAIT WINDOW 'First record now unmarked ... press Esc' NOWAIT
BROWSE FIELDS city
USE


DELETE SeeAlso
See Also

DELETED( ) Function

PACK Command

RECALL Command

SET DELETED Command


DELETE FILE Command

See Also	Example

Deletes a file from disk.

Syntax

DELETE FILE
[<file> | ?]

Remarks

Caution   Any file deleted with this command cannot be retrieved.  Even if SET SAFETY is ON, you are not warned before the file is deleted.

The file you want to delete cannot be open when DELETE FILE is issued.  If you delete a table that has an associated .FPT memo file, be sure to delete the memo file.  The file name must include a path if it is on a different drive or in a different directory than the default, and the file name extension must be included.  The file name cannot contain MS-DOS wildcard characters.


DELETE FILE Example

In this example, the structure of CUSTOMER.DBF and all records in which the state is Ohio are copied to a table named BACKUP.  The data in BACKUP is then copied to a text file, TEMP, which is opened and then deleted when the user closes it.

CLOSE DATABASES
USE customer
COPY STRUCTURE TO backup
USE backup
APPEND FROM customer FOR state = 'OH'
COPY TO temp TYPE DELIMITED
WAIT WINDOW 'Press Esc to close and erase temp.txt' NOWAIT
MODIFY FILE temp.txt
DELETE FILE temp.txt
? IIF(FILE('temp.txt'),'file not deleted','file deleted')
USE
DELETE FILE backup.dbf


DELETE FILE SeeAlso
See Also

ERASE Command

FILER Command

SET SAFETY Command


DELETE TAG Command

See Also

Removes a tag or tags from a .CDX compound index file.

Syntax

DELETE TAG <tag name1>
[OF <cdx file1>]
[, <tag name2> [OF <cdx file2>]] ...
or
DELETE TAG ALL
[OF <cdx file>]

Remarks

Compound index files, created with INDEX, contain tags corresponding to index entries.  DELETE TAG is used to remove a tag or tags from open compound index files.  You can delete only tags from compound index files open in the current work area.  If you remove all the tags from a compound index file, the file is deleted from the disk.

FoxPro looks first for a tag in the structural compound index file (if one is open).  If the tag isn't in the structural compound index file, FoxPro then looks for the tag in the other open compound index files.

Clauses

<tag name1> OF <cdx file1>[, <tag name2> [OF <cdx file2>]] ...

To remove a tag in a compound index file, specify its name with <tag name1>.  You can delete multiple tags with one DELETE TAG by including a list of tag names separated by commas.

If two or more tags with the same name exist in the open index files, you can remove a tag from a specific index file by including OF <cdx file>.

ALL [OF <cdx file>]

You can remove every tag from a compound index file by including the ALL key word.  If the current table has a structural compound index file, all tags are removed from the index file, the index file is deleted from the disk, and the flag in the table's header indicating the presence of an associated structural compound index file is removed.  Use ALL with OF <cdx file> to remove all tags from an open compound index file other than the structural compound index file.


DELETE TAG SeeAlso
See Also

COPY INDEXES Command

COPY TAG Command

INDEX Command

TAG( ) Function


DELETED( ) Function

See Also	Example

Returns a logical value that indicates whether the current record is marked for deletion.

Syntax

DELETED([<expC> | <expN>])

Returns

Logical

Remarks

If the record is marked for deletion, a true value (.T.) is returned; otherwise, a false value (.F.) is returned.

Records can be marked for deletion with DELETE, and they can be unmarked with RECALL.  Records can also be deleted or recalled from within the Browse, Change and Edit windows.

Queries that test the deleted status of records can be optimized by Rushmore if the table is indexed on DELETED( ).  See the Optimizing Your Application chapter in the FoxPro Developer's Guide for more information on using Rushmore to optimize queries.

Parameters

<expC> | <expN>

DELETED supports optional arguments that let you return the deleted status of the current record in a non-current work area.

You can check the status of the current record in a table open in another work area by specifying the work area number with <expN> or the table alias with <expC>.  If a table isn't open in the work area you specify, DELETED( ) returns false.

If you omit <expC> and <expN>, the deleted status is returned for the current record in the current work area.


DELETED( ) Example

This example marks all but the first two records in INVOICES for deletion and uses DELETED( ) to scan the table for all records that aren't marked for deletion and then adds their total inventory value to the value of the I_COST variable.

CLOSE DATABASES
SET TALK OFF
CLEAR
USE invoices
GOTO 3
DELETE REST
i_cost = 0
?'INO   ITOTAL'
?
SCAN FOR NOT DELETED( )
? ino, itotal
i_cost = i_cost + itotal
ENDSCAN
?'      _______'
? i_cost, ' Total cost of current inventory'
GOTO TOP
RECALL ALL


DELETED() SeeAlso
See Also

DELETE Command

PACK Command

RECALL Command

SET DELETED Command


DESCENDING( ) Function

See Also

Returns a logical value that indicates if an index tag was created with the DESCENDING keyword or the DESCENDING keyword was included in USE, SET INDEX or SET ORDER.

Syntax

DESCENDING([<cdx file>,] <expN1>[, <expN2> | <expC>])

Returns

Logical

Remarks

In FoxPro, you can order records in a table in descending order in two ways:

You can include the DESCENDING keyword in the INDEX command to create a descending order index tag in a compound .CDX.

You can include the DESCENDING keyword in USE, SET INDEX or SET ORDER to specify a descending order for the master index tag or the master single-entry .IDX index file.

DESCENDING( ) can be used to determine if an index tag was created in descending order.  A logical true value (.T.) is returned if the index tag you specify was created with DESCENDING keyword.

DESCENDING( ) can also be used to determine if the master index tag or master index file is in descending order.  A logical true value (.T.) is returned if the DESCENDING keyword was included in USE, SET INDEX or SET ORDER for the master index tag or a single-entry .IDX index file you specify.

Parameters

If you don't include any of the optional parameters, DESCENDING( ) returns a value for the master index tag or master index file.  If you don't include any of the optional parameters and a master index tag or index file isn't in effect (for example, you've issued SET ORDER TO to place the table in natural record order), DESCENDING( ) returns false (.F.).

<cdx file>

You can specify the name of a compound index file with <cdx file>.  The compound index file you specify can be the structural compound index file automatically opened with the table or an independent compound index file.

<expN1>

The numeric expression <expN1> specifies which index tag or index file DESCENDING( ) tests. <expN1> is typically an integer that starts at 1 and is increased by 1 to return additional values for each index tag.

If <expN1> is 1, a value for the master single-entry .IDX index file or master index tag (if one is present) is returned.

As <expN1> increases, values for each tag in the structural compound index (if one is present) are returned as <expN1> increases.  The values are returned for the tags in the order in which the tags are created in the structural compound index.

After values for all the tags in the structural compound index are returned, values for each tag in any open independent compound indexes are then returned.  The values are returned from the tags in the order in which the tags are created in the independent compound indexes.

The null string is returned if <expN1> is greater than the total number of open single-entry .IDX files and structural compound and independent compound index tags.

<expN2> | <expC>

DESCENDING( ) returns a value for index files or tags open for the table in the current work area.  To return values for index files or tags open in a specific work area, include the work area number <expN2> or the table alias <expC>.

If no table has the alias you specify, the message "Alias not found" is displayed.


DESCENDING( ) SeeAlso
See Also

INDEX Command

SET INDEX Command

SET ORDER Command

USE Command


DIFFERENCE( ) Function

See Also	Example

Returns an integer, 0 through 4, representing the relative phonetic difference between two character expressions.

Syntax

DIFFERENCE(<expC1>, <expC2>)

Returns

Numeric

Remarks

DIFFERENCE( ) is useful for searching tables when the exact spelling of an entry isn't known.

The more similarly the two expressions are spelled, the higher the number returned by DIFFERENCE( ).  If the character expressions are spelled very similarly, DIFFERENCE( ) returns 4.  For two character expressions with little in common phonetically, DIFFERENCE( ) returns 0.

Parameters

<expC1>, <expC2>

The character expressions that are compared by DIFFERENCE( ) are specified with <expC1> and <expC2>.


DIFFERENCE( ) Example

STORE 'Smith'   TO name1
STORE 'Smythe'  TO name2
STORE 'Smittie' TO name3
STORE '' TO name4
? DIFFERENCE(name1, name2)

? DIFFERENCE(name1, name3)

? DIFFERENCE(name1, name4)


DIFFERENCE() SeeAlso
See Also

SOUNDEX( ) Function


DIMENSION Command

See Also	Examples

Creates one- or two-dimensional arrays of memory variables.

Remarks

DIMENSION is identical in operation and syntax to DECLARE.

Syntax

DIMENSION <array1>(<expN1>[, <expN2>])
[, <array2>(<expN3>[, <expN4>])] ...

Clauses

<array1>

The name of the array you create is specified with <array1>.  Multiple arrays can be created with a single DIMENSION by including additional array names (<array2>, <array3> and so on).

<expN1>[, <expN2>]

After you specify the name of the array to create, you must specify the size of the array with <expN1> and <expN2>.

If you include just <expN1>, a one-dimensional array is created.  One-dimensional arrays have one column and <expN1> rows.  For example, the following command creates a one-dimensional array named ARRAYONE that contains one column and ten rows.

DIMENSION arrayone(10)

To create a two-dimensional array, include both <expN1> and <expN2>.  <expN1> specifies the number of rows in the array, and <expN2> specifies the number of columns.  The following example creates a two-dimensional array named ARRAYTWO containing two rows and four columns:

DIMENSION arraytwo(2,4)

You must specify a size for each array you create with DIMENSION.  In this example, three arrays are created: ARRAYONE and ARRAYTWO from the previous examples and a third array called ARRAYTHREE:

DIMENSION arrayone(10), arraytwo(2,4), arraythree(3,3)

You can use either square brackets or parentheses to enclose the expressions in DIMENSION or DECLARE.  For example, the following two commands create identical arrays:

DIMENSION arrayone(10), arraytwo[2,4], arraythree(3,3)
DIMENSION arrayone[10], arraytwo(2,4), arraythree[3,3]

Array Elements

The size of an array determines how many elements it can contain.  Each element in an array can store a single piece of information.  To determine how many elements an array contains and how much information it can store, multiply the number of rows (<expN1>) in the array by the number of array columns (<expN2>).

Array elements can contain any type of data and are initialized to false (.F.) when the array is first created.  You can initialize all the elements in an array to the same value with STORE if SET COMPATIBLE is FOXPLUS or OFF (the default setting).  For example:

DIMENSION y(10,3)
STORE 'initial' TO y

Subscripts

Elements in an array are referenced by their subscripts.  Each array element has a unique numeric subscript that identifies it.  If the array is one-dimensional, an element's subscript is the same as its row number.  For example, the subscript for the element in the third row of a one-dimensional array is 3.  Elements in two-dimensional arrays are referenced by two subscripts:  The first subscript indicates the row location of the element, and the second subscript indicates the column location.  For example, the subscripts for the element in the third row and fourth column of a two-dimensional array are 3,4.  For a further discussion of array element subscripts, see ASUBSCRIPT( ).

The subscript or subscripts for the first element in an array always start with 1.  If an array is two-dimensional, it can also be referenced by a single subscript.  Use AELEMENT( ) to return the single subscript from a pair of array row and column subscripts.  Use ASUBSCRIPT( ) to return the row and column subscripts from a single subscript.

Redimensioning Arrays

You can change the size and dimensions of an array by issuing DIMENSION again.  The size of an array can be increased or decreased, one-dimensional arrays can be converted to two dimensions, and two-dimensional arrays can be reduced to one dimension.

If the number of elements in an array is increased, the contents of all the elements in the original array are copied to the newly redimensioned array.  The additional array elements are initialized to false (.F.).


DIMENSION Example
DIMENSION Examples

The following example demonstrates the result of increasing the size of a one-dimensional array.  (Note that if you type these commands in the Command window the array will be PUBLIC, but it will be PRIVATE if you copy them into a program and run it.)

DIMENSION marray(2)
STORE 'A' TO marray(1)
STORE 'B' TO marray(2)
DISPLAY MEMORY LIKE marray

DIMENSION marray(4)
DISPLAY MEMORY LIKE marray

If the number of elements in an array is decreased, the elements and any data they contain are deleted.

When a one-dimensional array is redimensioned to two dimensions, the contents of the original one-dimensional array are copied to the new array in an element-to-row order.

In the following example, a one-dimensional array is converted to a two-dimensional array.  The contents of the elements of the one-dimensional array are copied to the first row of the new array, followed by the second row and so on.  The additional elements are initialized to false (.F.).

DIMENSION marrayone(4)
STORE 'E' TO marrayone(1)
STORE 'F' TO marrayone(2)
STORE 'G' TO marrayone(3)
STORE 'H' TO marrayone(4)
DISPLAY MEMORY LIKE marrayone

DIMENSION marrayone(2,3)
DISPLAY MEMORY LIKE marrayone

When a two-dimensional array is converted to one dimension, the contents of the original two-dimensional array are copied to the new array in a row-to-element order:  the first element in the first row becomes the first element in the one-dimensional array, the second element in the first row becomes the second element, and so on.

Use ADEL( ) or AINS( ) to delete or insert array elements, rows and columns.  Use APPEND FROM ARRAY, COPY TO ARRAY, SCATTER and GATHER to transfer data between table records and arrays.

In this example, a two-dimensional array is created and loaded with data.  The array elements and the data they contain are displayed.

DIMENSION sample(2,3)
STORE 'Goodbye' TO sample(1,2)
STORE 'Hello' TO sample(2,2)
STORE 99 TO sample(6)
STORE .T. TO sample(1)
DISPLAY MEMORY LIKE sample


DIMENSION SeeAlso
See Also

ACOPY( ) Function

ADEL( ) Function

ADIR( ) Function

AELEMENT( ) Function

AFIELDS( ) Function

AFONT( ) Function

AINS( ) Function

ALEN( ) Function

APPEND FROM ARRAY Command

ASCAN( ) Function

ASORT( ) Function

ASUBSCRIPT( ) Function

COPY TO ARRAY Command

DECLARE Command

EXTERNAL Command

GATHER Command

PRIVATE Command

PUBLIC Command

SCATTER Command

SET COMPATIBLE Command

STORE Command


DIR or DIRECTORY Command

See Also	Examples

Displays the contents of a disk directory.

Syntax

DIR | DIRECTORY
[ON <drive>]
[[LIKE] [<path>] [<skel>]]
[TO PRINTER [PROMPT] | TO FILE <file>]

Remarks

Use DIR to display information about files.  DIR without the LIKE clause displays:

The names of all tables in the directory.

The number of records in each table.

The date each table was last updated.

The size of each table in bytes (tables in the original FoxBASE format are noted as such).

The number of tables displayed.

The total number of bytes remaining on the disk.

The table information for the current drive and directory is displayed unless otherwise specified with <drive> and/or <path>.

Clauses

ON <drive>

<drive> is the name of the drive on which the directory is located.

[LIKE] [<path>] [<skel>]

<path> is the MS-DOS path of the directory.  The path can include the drive name if ON <drive> is omitted.

Include <skel> to display information about file types other than tables.  <skel> is a file specification skeleton that supports wildcard characters.  For example, to list all program files in the current directory, use the following command:

DIR *.PRG

In FoxPro for Windows and FoxPro for Macintosh, you can use the following command to list all files without extensions:

DIR *.

TO PRINTER [PROMPT] | TO FILE <file>

Include TO PRINTER to send the directory information to the printer.

In FoxPro for Windows and FoxPro for Macintosh, you can include the optional PROMPT clause to display a dialog before printing starts. In this dialog you can adjust printer settings, including the number of copies and page numbers to print. The printer settings that you can adjust depend on the currently installed printer driver. Place the PROMPT key word immediately after TO PRINTER.  PROMPT is ignored in FoxPro for MS-DOS.

The PROMPT clause is ignored in FoxPro for MS-DOS.

In this dialog, you can adjust printer settings.  You can specify the number of copies and page numbers to print and direct print output to a file.  The Windows Printer Setup dialog can be opened to adjust additional printer settings.  The printer settings you can adjust depend on the currently installed printer driver.

Include TO FILE <file> to send the information to the file specified with <file>.


DIR or DIRECTORY Example
DIR or DIRECTORY Examples

DIR	&& Display tables in the current directory
DIR *.CDX	&& Display index files in the current directory
DIR V*.DBF	&& Display tables that begin with V


DIR or DIRECTORY SeeAlso
See Also

DISPLAY FILES Command

FILER Command


DISKSPACE( ) Function

See Also	Example

Returns the number of bytes available on the default disk drive.

Syntax

DISKSPACE( )

Returns

Numeric

Remarks

This function is useful for determining whether sufficient space is available to back up files or to execute commands such as SORT that require additional disk space for temporary work files.

On some networks, the value returned by DISKSPACE( ) may not be accurate for large network drives.


DISKSPACE( ) Example

This example uses DISKSPACE( ) to determine whether sufficient disk space is available to perform a sort.

*** Check DISKSPACE before sort ***

CLOSE DATABASES
USE customer

*** Get size of table header ***

dbf_top = HEADER( )

*** Calculate size of table ***

file_size = dbf_top + (RECSIZE( ) * RECCOUNT( ) + 1)

IF DISKSPACE( ) > (file_size * 3)
@ 5,0 SAY 'Sufficient diskspace to Sort.'
ELSE
@ 5,0 SAY 'Insufficient diskspace. Sort cannot be done.'
ENDIF


DISKSPACE() SeeAlso
See Also

HEADER( ) Function

RECSIZE( ) Function


@ ... GET - Invisible Buttons
@ ... GET [image] Invisible Buttons

See Also	Example

Creates invisible buttons.

Syntax

@ <row, column>
GET <memvar> | <field>
FUNCTION <expC1> | PICTURE <expC2>
[DEFAULT <expN1>]
[SIZE <expN2>, <expN3> [, <expN4>]]
[ENABLE | DISABLE]
[MESSAGE <expC5>]
[VALID <expL1> | <expN5>]
[WHEN <expL2>]
[COLOR SCHEME <expN6>
| COLOR <color pair list>]

Remarks

This variation of @ ... GET creates invisible buttons, which are rectangular regions of the main FoxPro window or a user-defined window that you can select. You can use @ ... SAY to place characters on the rectangular button regions. When you select an invisible button, the characters in the button are highlighted. Issue READ or READ CYCLE to activate the buttons.

If you use the Screen Builder to create your data-entry screens, you might not have to use this command at all. The Screen Builder automatically generates the commands that create invisible buttons.

Clauses

<row, column>

Row and column are numeric expressions with values 0 or greater that determine where the first button in a set of invisible buttons appears.

The first row is number 0 in the main FoxPro window or a user-defined window. Rows are numbered from top to bottom. In FoxPro for Windows, row 0 is the row immediately under the FoxPro system menu bar. In FoxPro for Macintosh, row 0 is the row immediately under the FoxPro title bar. In FoxPro for MS-DOS, row 0 is the row the FoxPro system menu bar occupies. See SET SYSMENU for information about manipulating the system menu bar so you can place output on row 0 in FoxPro for MS-DOS.

The first column is number 0 in the main FoxPro window or a user-defined window. Columns are numbered from left to right.

When the first button in a set of invisible buttons is directed to a user-defined window, the row and column coordinates are relative to the user-defined window, not the main FoxPro window.

In FoxPro for Windows and FoxPro for Macintosh, a position in the main FoxPro window or in a user-defined window is determined by the font of the main FoxPro window or the user-defined window. Most fonts can be displayed in a wide variety of sizes, and some are proportionally spaced. A row corresponds to the height of the current font; a column corresponds to the average width of a letter in the current font.

In FoxPro for Windows and FoxPro for Macintosh, you can position the first button in a set of invisible buttons in a window with decimal fractions for row and column coordinates. In FoxPro for MS-DOS, decimal fractions used for row and column coordinates are rounded to the nearest integer value.

<memvar> | <field>

When you choose an invisible button, a number corresponding to your choice is stored to a memory variable, an array element or a field. For example, if you create four invisible buttons and choose the third button, 3 is stored to the memory variable, array element or field named by <memvar> or <field>. The initial value of <memvar> or <field> determines which button is initially selected.

FUNCTION <expC1> | PICTURE <expC2>

When creating invisible buttons, you must include the FUNCTION clause, the PICTURE clause or both. There is no advantage to any of the three methods. The FUNCTION or PICTURE clause contains the invisible button specification code *I.

The FUNCTION clause character expression <expC1> must begin with *I. To create more than one invisible button, include a semicolon for each additional button. For example, this clause creates three invisible buttons:

... FUNCTION '*I ;;' ...

Note that the clause contains only two semicolons.

The PICTURE clause character expression <expC2> uses the same syntax as the FUNCTION character expression, except the PICTURE clause expression must begin with @ followed by *I and a space. For example, this clause creates three invisible buttons:

... PICTURE '@*I ;;' ...

You can also include both the FUNCTION and PICTURE clauses to create invisible buttons. If both are included, FUNCTION <expC1> must contain *I to create the invisible buttons and can also include a space followed by semicolons to create additional invisible buttons. PICTURE <expC2> can include semicolons to create additional invisible buttons.

The following examples illustrate the various forms of syntax you can use to create invisible buttons. Five invisible buttons are created and a number corresponding to each button chosen is stored to MCHOICE. The first button is placed in the second row and column. Each button is two rows high and four columns wide, and the buttons are separated by a single row.

FUNCTION clause only:

STORE 1 TO mchoice
@ 2,2 GET mchoice FUNCTION '*I ;;;;' SIZE 2, 4, 1
READ

STORE 1 TO mchoice
STORE '*I ;;;;' TO mfunc
@ 2,2 GET mchoice FUNCTION mfunc SIZE 2, 4, 1
READ

PICTURE clause only:

STORE 1 TO mchoice
@ 2,2 GET mchoice PICTURE '@*I ;;;;' SIZE 2, 4, 1
READ

STORE 1 TO mchoice
@ 2,2 GET mchoice PICTURE '@*I' + ' ;;;;' SIZE 2, 4, 1
READ

FUNCTION and PICTURE clauses:

STORE 1 TO mchoice
@ 2,2 GET mchoice FUNCTION '*I' PICTURE ' ;;;;' SIZE 2, 4, 1
READ

STORE 1 TO mchoice
@ 2,2 GET mchoice FUNCTION '*I ;;' PICTURE ';;' SIZE 2, 4, 1
READ

PICTURE and FUNCTION Options N, T, H and V

Additional options can be combined with the *I specification code to modify the behavior (N and T options) and appearance (H and V options) of invisible buttons. These options are described below:

Option	Description

N	Does not terminate the READ when an invisible button is chosen. This is the default behavior.

T	Terminates the READ when an invisible button is chosen.

H	Positions the invisible buttons in a horizontal row.

V	Positions the invisible buttons in a vertical row. This is the default position.

You can combine the H and V options with the T and N options in the following ways: NH, NV, TH and TV. For example, the following clause creates a vertical set of buttons and doesn't cause the READ to terminate when one of the buttons is selected:

... FUNCTION '*INV ... '

Disabled Invisible Buttons

You can disable an invisible button so that it cannot be selected. When a button is disabled, it appears in disabled colors. To disable an invisible button, place two backslashes (\\) before the semicolon corresponding to the button in the FUNCTION or PICTURE clause.

In the following example, five invisible buttons are created. The second and fourth buttons are disabled by placing two backslashes before the second and fourth semicolons respectively. If you are using FoxPro for Windows, set the font for the main FoxPro window to 9-point FoxFont to draw the box characters correctly.

CLEAR
STORE 1 TO mchoice

*** Draw boxes for the invisible-button regions. ***

@ 4,2  SAY CHR(218) + CHR(196) + CHR(196) + CHR(191)
@ 5,2  SAY CHR(192) + CHR(196) + CHR(196) + CHR(217)
@ 7,2  SAY CHR(218) + CHR(196) + CHR(196) + CHR(191)
@ 8,2  SAY CHR(192) + CHR(196) + CHR(196) + CHR(217)
@ 10,2 SAY CHR(218) + CHR(196) + CHR(196) + CHR(191)
@ 11,2 SAY CHR(192) + CHR(196) + CHR(196) + CHR(217)
@ 13,2 SAY CHR(218) + CHR(196) + CHR(196) + CHR(191)
@ 14,2 SAY CHR(192) + CHR(196) + CHR(196) + CHR(217)
@ 16,2 SAY CHR(218) + CHR(196) + CHR(196) + CHR(191)
@ 17,2 SAY CHR(192) + CHR(196) + CHR(196) + CHR(217)

@ 4,2 GET mchoice FUNCTION '*I ;\\;;\\;' SIZE 2, 4, 1
READ

DEFAULT <expN1>

When you choose an invisible push button, your choice is saved in the memory variable, array element or field you specify. If you specify a memory variable that doesn't exist, it is automatically created and initialized if you include the DEFAULT. However, an array element isn't created if you specify an array element in a DEFAULT clause. The DEFAULT clause is ignored if the memory variable already exists or you specify a field.

Note   If the DEFAULT clause isn't included and the memory variable specified with <memvar> doesn't exist, the error message "Variable not found" appears.

The DEFAULT expression <expN1> determines the initial value of <memvar>. Here are examples of DEFAULT clauses for invisible buttons:

@ 2,2 GET mchoice FUNCTION '*I ;;;;' DEFAULT 1
READ
STORE 3 TO mbutton
@ 2,2 GET mchoice FUNCTION '*I ;;;;' DEFAULT mbutton
READ

SIZE <expN2>, <expN3> [, <expN4>]

The SIZE clause determines the size and spacing of invisible buttons. The numeric expressions <expN2> and <expN3> control the height and width of each button respectively. The default for the height and width is 0.

By default, no space is placed between vertical buttons, and a single column is placed between horizontal buttons. The spacing between invisible buttons is determined by <expN4>. If you create vertical buttons, <expN4> designates the number of rows between buttons. If you create horizontal buttons, <expN4> designates the number of columns between buttons.

ENABLE | DISABLE

Invisible buttons are enabled by default when READ is issued. You can prevent a set of buttons from being activated when READ is issued by including DISABLE. Disabled invisible push buttons cannot be chosen and are displayed in disabled colors. To disable individual invisible buttons instead of the entire set of buttons, see "Disabled Invisible Buttons" earlier in this section. Use SHOW GET ENABLE to enable a set of disabled invisible buttons.

MESSAGE <expC5>

The MESSAGE clause character expression <expC5> appears when an invisible button is selected. In FoxPro for MS-DOS, the message is centered on the last line of the main FoxPro window by default. The message location can be changed with SET MESSAGE.

In FoxPro for Windows and FoxPro for Macintosh, the message is placed in the graphics-based status bar. If the graphics-based status bar has been turned off with SET STATUS BAR OFF, the message is placed on the last line of the main FoxPro window.

VALID <expL1> | <expN5>

You can include an optional VALID expression <expL1> or <expN5> that is evaluated when an invisible button is chosen. That is, VALID isn't evaluated when you select (move to) an invisible button, but when you actually choose a button.

Typically, <expL1> or <expN5> is a user-defined function. With a user-defined function you can select, enable or disable other objects, open a Browse window, open another data-entry screen or move to a new record. CLEAR READ can be included in the user-defined function (UDF) to terminate the READ.

<expL1>

When a logical value is returned to the VALID clause, the logical value is ignored and the invisible buttons remain the current control. However, you can specify a UDF that returns a logical value to the VALID clause and activates another object.

<expN5>

A VALID clause that includes a numeric expression is used to specify which object is activated after an invisible button is chosen. Objects are @ ... GET input fields, check boxes, lists, popups, spinners, text-editing regions and each individual button in a set of push, radio and invisible buttons.

The numeric expression <expN5> has one of three effects:

When <expN5> = 0, the chosen invisible button remains the active button.

When <expN5> is positive, <expN5> indicates the number of objects to advance. For example, when you're positioned on the last button in a set of invisible buttons and VALID returns 1, the next object is activated. If <expN5> is greater than the number of objects remaining, the READ is terminated (unless READ CYCLE is issued to activate the objects).

When <expN5> is negative, <expN5> indicates the number of objects to move back. For example, when you're positioned on the first button in a set of invisible buttons and VALID returns -1, the previous @ ... GET input field or control is activated. If <expN5> moves back past the first object, the READ is terminated (unless READ CYCLE is issued to activate the objects).

WHEN <expL2>

The WHEN clause allows or prohibits selection of the invisible buttons based on the logical value of <expL2>, which must evaluate to a logical true (.T.) before any of the invisible buttons can be selected. If <expL2> evaluates to false (.F.), none of the invisible buttons can be selected and are skipped if placed between other objects.

COLOR SCHEME <expN6> | COLOR <color pair list>

If you do not include a COLOR clause, invisible button colors are determined by the color scheme for the main FoxPro window; if invisible buttons are placed in a user-defined window, the window's color scheme determines the invisible button colors.

The colors of invisible buttons can be specified by including the number of an existing color scheme in the COLOR SCHEME clause or a set of color pairs in the COLOR clause.

A color scheme is a set of 10 predefined color pairs. The color pairs in a color scheme can be changed with SET COLOR OF SCHEME. In FoxPro for MS-DOS, the color pairs in a color scheme can also be changed in the Color Picker.

A color pair is a set of two letters separated by a forward slash. The first letter specifies the foreground color and the second letter specifies the background color.

For example, this color pair specifies a red foreground on a white background:

R/W

For a list of colors and their corresponding color letters, see SET COLOR Overview or Color Table by Color Pair.

A color pair can also be specified with a set of six RGB (Red Green Blue) color values separated by commas. The first three color values specify the foreground color and the second three color values specify the background color. The color values can range from 0 through 255.

The R/W color pair in the example above can also be specified with this RGB color pair:

RGB(255,0,0,255,255,255)

Color pair 6 determines the color of the selected invisible button.


@ ... GET - Invisible Buttons Example
@ ... GET [image] Invisible Buttons Example

The following example demonstrates invisible buttons. @ ... SAY places four sets of characters (hearts, diamonds, clubs and spades) in the main FoxPro window. Four invisible buttons are created that line up with the characters. When an invisible button is chosen, the SHOWCARD routine is executed that indicates which button has been chosen. If you are using FoxPro for Windows, set the font for the main FoxPro window to 9-point FoxFont to draw the box characters correctly.

STORE 0 TO mchoice
ACTIVATE SCREEN
CLEAR
@ 2,2  SAY REPLICATE(CHR(3),2)  && Hearts
@ 3,2  SAY REPLICATE(CHR(3),2)
@ 2,10 SAY REPLICATE(CHR(4),2)  && Diamonds
@ 3,10 SAY REPLICATE(CHR(4),2)
@ 2,18 SAY REPLICATE(CHR(5),2)  && Clubs
@ 3,18 SAY REPLICATE(CHR(5),2)
@ 2,26 SAY REPLICATE(CHR(6),2)  && Spades
@ 3,26 SAY REPLICATE(CHR(6),2)
@ 1,1,4,4    BOX
@ 1,9,4,12   BOX
@ 1,17,4,20  BOX
@ 1,25,4,28  BOX

*** The next line creates four invisible buttons and ***
*** executes the procedure SHOWCARD when a button is chosen. ***

@ 1,1 GET mchoice PICTURE '@*IH ;;;' SIZE 4, 4, 4 VALID SHOWCARD( );
MESSAGE 'Pick a card, any card!' COLOR ,,,,,R/W
READ CYCLE

PROCEDURE SHOWCARD   && procedure executed when a button is chosen
@ 6,1 CLEAR
DO CASE
CASE _CUROBJ = 1	&& First button chosen
@ 6,1 SAY 'Hearts'
CASE _CUROBJ = 2	&& Second button chosen
@ 6,9 SAY 'Diamonds'
CASE _CUROBJ = 3	&& Third  button chosen
@ 6,17 SAY 'Clubs'
CASE _CUROBJ = 4	&& Fourth button chosen
@ 6,25 SAY 'Spades'
ENDCASE
RETURN .T.


@ ... GET - Invisible Buttons SeeAlso
See Also

@ ... SAY

@ ... GET

Controls Overview

_CUROBJ System Memory Variable

OBJNUM( )

READ

SHOW GETS

User-Defined Functions (UDFs)


@ ... GET - Lists
@ ... GET [image] Lists

See Also	Example

Creates a list.

Syntax

@ <row, column>
GET <memvar> | <field>
FROM <array> [RANGE <expN1> [, <expN2>]]
| POPUP <pop-up name>
[FUNCTION <expC1>] | [PICTURE <expC2>]
[FONT <expC3> [, <expN3>]]
[STYLE <expC4>]
[DEFAULT <expr>]
[SIZE <expN4>, <expN5>]
[ENABLE | DISABLE]
[MESSAGE <expC5>]
[VALID <expL1> | <expN6>]
[WHEN <expL2>]
[COLOR SCHEME <expN7>
| COLOR <color pair list>]

Remarks

This variation of @ ... GET creates a list. A list is a set of items from which you can choose one item. To choose an item from a list, select the item and press Enter or double-click on the item.

If you use the Screen Builder to create your data-entry screens, you might not have to use this command at all. The Screen Builder automatically generates the commands that create lists.

The list appears inside a box, often with a scroll bar to the right. The scroll bar lets you move quickly through the items with the mouse and provides a visual indication of your position in the list. Another quick way to move around in the list is to press the Home key to go to the first item, or the End key to go to the last item. This method works even if the list does not have a scroll bar.

The items in the list are obtained from an array or a popup. Include FROM <array> to build the from an array. Include POPUP <pop-up name> to build the list from a popup created with DEFINE POPUP.

Issue READ or READ CYCLE to activate the list.

Clauses

<row, column>

Row and column are numeric expressions with values of 0 or greater that determine where the list appears.

The first row is number 0 in the main FoxPro window or a user-defined window. Rows are numbered from top to bottom. In FoxPro for Windows, row 0 is the row immediately under the FoxPro system menu bar. In FoxPro for Macintosh, row 0 is the row immediately under the FoxPro title bar. In FoxPro for MS-DOS, row 0 is the row the FoxPro system menu bar occupies. See SET SYSMENU for information about manipulating the system menu bar so you can place output on row 0 in FoxPro for MS-DOS.

The first column is number 0 in the main FoxPro window or a user-defined window. Columns are numbered from left to right.

When the list is directed to a user-defined window, the row and column coordinates are relative to the user-defined window, not the main FoxPro window.

In FoxPro for Windows and FoxPro for Macintosh, a position in the main FoxPro window or in a user-defined window is determined by the font of the main FoxPro window or the user-defined window. Most fonts can be displayed in a wide variety of sizes, and some are proportionally spaced. A row corresponds to the height of the current font; a column corresponds to the average width of a letter in the current font.

In FoxPro for Windows and FoxPro for Macintosh, you can position the list in a window with decimal fractions for row and column coordinates. In FoxPro for MS-DOS, decimal fractions used for row and column coordinates are rounded to the nearest integer value.

<memvar> | <field>

When you choose an item from a list, a value corresponding to your choice is stored to the memory variable or array element <memvar>, or the field <field>. <memvar> or <field> must be of numeric or character type. If <memvar> or <field> is numeric, the chosen item's position in the list is stored. If <memvar> or <field> is character, the chosen item's prompt is stored.

Initial Option Selection

When a list appears, the value of <memvar> or <field> determines which list option (if any) is initially selected. For example, if the value of <memvar> or <field> is 4, the fourth option in the list is selected when the list is activated by READ. If <memvar> or <field> doesn't correspond to any of the options in the list (the value is less than 1 or greater than the number of options), no option is initially selected.

FROM <array>

The FROM <array> clause creates a list from an array. If the array is one-dimensional, the contents of the first array element are the first item in the list, the contents of the second array element are the second item and so on.

If the array is two-dimensional, the elements in the first column of the array are used to create the list items. The first element in the first column is the first item in the list, the second element in the first column is the second item, and so on.

RANGE <expN1> [, <expN2>]

List items by default starting with the contents of the first array element. You can designate a different starting element in the array by including RANGE <expN1>. For example, if the array is one-dimensional and <expN1> is 3, the third element in the array is the first item in the list, the fourth element is the second item, and so on.

An element's position number in a two-dimensional array is determined by counting along rows. For example, suppose you create the following 3-by-3 array:

a b c

d e f

g h i

Elements a, b, and c are in position numbers 1, 2, and 3. Elements d, e, and f are in position numbers 4, 5, and 6, and so on. If a two-dimensional array is used, only elements in the same column as array element <expN1> become items in the list. For example, if <expN1> is 2, the contents of elements b, e, and h are the list items. If <expN1> is 5, only the contents of elements e and h are included.

If you include a starting element <expN1>, you can also specify the number of elements in the list by including <expN2>. If <expN2> isn't included, the contents of all array elements from the starting element <expN1> through the last element in the column are items in the list.

If SHOW GETS is issued, the RANGE clause is reevaluated. If the value of <expN1> or <expN2> has changed, the list is updated to reflect the changes.

The contents of a list can be dynamically changed. You can insert and remove items by modifying the array. The ACOPY( ), ADEL( ), ADIR( ), AELEMENT( ), AFIELDS( ), AINS( ), ALEN( ), ASCAN( ), ASORT( ) and ASUBSCRIPT( ) functions facilitate the manipulation of arrays.

POPUP <pop-up name>

The list can also be built from a popup created with DEFINE POPUP. Each popup item is used to create an item in the list.

To create a list from a popup, first create the popup with DEFINE POPUP. Include in the POPUP <popup name> clause the name of the popup created with DEFINE POPUP.

You can create a popup (and thus, a list) containing records from a field in a table (PROMPT FIELDS), files available on disk (PROMPT FILES) or the names of the fields in a table (PROMPT STRUCTURE).

The following example demonstrates how to create a list from a popup. DEFINE POPUP is used to create a popup containing the names of table files available on disk. The table names appear as options in the list. MARGIN is included to provide an additional space for the mark character. The SCROLL option places a scroll bar to the right of the list.

CLEAR
SET TALK OFF
STORE 1 TO mchoice

DEFINE POPUP scrollopts FROM 0, 0 PROMPT FILES LIKE *.DBF ;
MARGIN SCROLL

@ 2,2 GET mchoice POPUP scrollopts SIZE 8, 20

READ	&& Activate the list.

FUNCTION <expC1> | PICTURE <expC2>

To terminate the READ when an item is chosen from the list, include FUNCTION '&T' or PICTURE '@&T'. Include FUNCTION '&N' or PICTURE '@&N' to prevent the READ from terminating when an item is chosen from the list. For example:

... FUNCTION '&T' ...
... PICTURE '@&T' ...

If a FUNCTION or PICTURE clause isn't included, the READ isn't terminated when an item is chosen.

In FoxPro for Macintosh, you can create a two- or three-dimensional list by including 2 or 3 after the & specification code. Include 2 to create a flat, two-dimensional list identical to lists in Macintosh dialogs. Include 3 to create a three-dimensional list identical to lists in FoxPro for Macintosh dialogs. A two-dimensional list is created by default if you omit the 2 and 3 specification codes.

In FoxPro for Macintosh, the following clause creates a three-dimensional list and doesn't cause the READ to terminate when an item is chosen from the list.

... FUNCTION '&N3' ...

FONT <expC3> [, <expN3>]

The character expression <expC3> is the name of the font, and the numeric expression <expN3> is the font size. For example, the following clause can be used to display the items in the list in 16-point Courier font:

FONT 'Courier', 16

If you include the FONT clause but omit the font size <expN3>, a 10-point font is used.

In FoxPro for Windows, if the font you specify is not available, a font with similar font characteristics is substituted.

In FoxPro for Macintosh, if the font you specify is not available, the Chicago font is used.

In FoxPro for MS-DOS, the FONT clause is ignored.

If the FONT clause is omitted and the list is placed in the main FoxPro window, the main FoxPro window font is used. If the FONT clause is omitted and the list is placed in a user-defined window, the user-defined window font is used.

STYLE <expC4>

In FoxPro for Windows and FoxPro for Macintosh, include the STYLE clause to specify a font style for the items in the list.

The font style is specified with <expC4>. If the STYLE clause is omitted, the normal font style is used.

In FoxPro for Windows, if the font style you specify is not available, a font style with similar characteristics is substituted.

In FoxPro for Macintosh, if the font you specify is not available, the normal font style is used.

The STYLE clause is ignored in FoxPro for MS-DOS.

Character	Font Style

B	Bold

C	Condense*

E	Extend*

I	Italic

N	Normal

O	Outline

S	Shadow

-	Strikeout*

U	Underline

*The Condense and Extend styles are available only in FoxPro for Macintosh. The Strikeout style is available only in FoxPro for Windows.

You can include more than one character to specify a combination of font styles. For example, the following clause specifies Bold Italic:

STYLE 'BI'

DEFAULT <expr>

When you choose an item from the list, your choice is saved in a memory variable, array element or field you specified. If you specify a memory variable that doesn't exist, it is automatically created and initialized if you include the DEFAULT clause. However, an array element isn't created if you specify an array element in a DEFAULT clause. The DEFAULT clause is ignored if the memory variable already exists or you specify a field.

Note   If the DEFAULT clause is omitted and the memory variable <memvar> doesn't exist, the error message "Variable not found" appears.

The DEFAULT expression <expr> determines the type of memory variable created and its initial value. <expr> must be of numeric or character type.

SIZE <expN4>, <expN5>

The width of the list is, by default, determined by the width of the longest item text in the list. The number of items in the pop-up or array by default determines the number of items displayed in the list. You can optionally specify the length and width of the list by including SIZE. The length of the list in rows is specified by <expN4>, and the width of the list in columns is specified by <expN5>.

If there are more items than can be displayed in the list at one time, a scroll bar is automatically placed to the right of the list items.

In FoxPro for Windows and FoxPro for Macintosh, the list's font determines the size of the editing region. The list's font is specified with the FONT clause. If the FONT clause is omitted, the list uses the font of its parent window (the main FoxPro window or a user-defined window).

ENABLE | DISABLE

Lists are by default enabled when READ is issued. You can prevent a list from being activated when READ is issued by including DISABLE. A disabled list cannot be selected and appears in disabled colors. Use SHOW GET ENABLE to enable a disabled list.

MESSAGE <expC5>

The MESSAGE clause character expression <expC5> appears when a list is selected. In FoxPro for MS-DOS, the message is centered on the last line of the main FoxPro window and the message location can be changed with SET MESSAGE.

In FoxPro for Windows and FoxPro for Macintosh, the message is placed in the graphics-based status bar. If the graphics-based status bar has been turned off with SET STATUS BAR OFF, the message is placed on the last line of the main FoxPro window.

VALID <expL1> | <expN6>

You can include an optional VALID expression <expL1> or <expN6> that is evaluated when an option is chosen from the list. That is, VALID isn't evaluated when you select an item, but when you actually choose an item by selecting it and pressing Enter or double-clicking on the item.

Typically, <expL1> or <expN6> is a user-defined function (UDF). With a user-defined function you can select, enable or disable other @ ... GET input fields or objects, open a Browse window, open another data-entry screen or move to a new record. CLEAR READ can be included in the user-defined function to terminate the READ.

<expL1>

When a logical value is returned to the VALID clause, the logical value is ignored and the list remains the current control. However, you can specify a UDF that returns a logical value to the VALID clause and then activates another object.

<expN6>

A VALID clause that includes a numeric expression is used to specify which object is activated after an item in the list is chosen. Objects are @ ... GET input fields, check boxes, lists, popups, spinners, text-editing regions and each individual button in a set of push, radio and invisible buttons.

The numeric expression <expN6> has one of these effects:

When <expN6> = 0, the list remains the active control.

When <expN6> is positive, <expN6> indicates the number of objects to advance. For example, when the list is selected and VALID returns 1, the next object is activated. If <expN6> is greater than the number of objects remaining, the READ is terminated (unless READ CYCLE is issued to activate the objects).

When <expN6> is negative, <expN6> specifies the number of objects to move back. For example, when you're positioned on a list and VALID returns -1, the previous object is activated. If <expN6> moves back past the first object, the READ is terminated (unless READ CYCLE is issued to activate the objects).

WHEN <expL2>

The WHEN clause allows or prohibits selection of a list based on the logical value of <expL2>, which must evaluate to a logical true (.T.) before any of the list can be selected. If <expL2> evaluates to a logical false (.F.), the list cannot be selected and is skipped over if placed between other objects.

COLOR SCHEME <expN7> | COLOR <color pair list>

If you do not include a COLOR clause, the list's colors are determined by the color scheme for the main FoxPro window; if a list is placed in a user-defined window, the window's color scheme determines the list's colors.

The colors of a list can be specified by including the number of an existing color scheme in the COLOR SCHEME clause or a set of color pairs in the COLOR clause.

A color scheme is a set of 10 predefined color pairs. The color pairs in a color scheme can be changed with SET COLOR OF SCHEME. In FoxPro for MS-DOS the color pairs in a color scheme can also be changed in the Color Picker.

A color pair is a set of two letters separated by a forward slash. The first letter specifies the foreground color and the second letter specifies the background color.

For example, this color pair specifies a red foreground on a white background:

R/W

For a list of colors and their corresponding color letters, see SET COLOR Overview or Color Table by Color Pair.

A color pair can also be specified with a set of six RGB (Red Green Blue) color values separated by commas. The first three color values specify the foreground color and the second three color values specify the background color. The color values can range from 0 through 255.

The R/W color pair in the example above can also be specified with this RGB color pair:

RGB(255,0,0,255,255,255)

Color Pair
Number	List Attribute

1	Disabled option

2	Enabled option

3	Border and scroll bar*

5	Message

6	Selected list item

9	Enabled list

10	Disabled list

*Controls drawn in background color. Bar drawn in dim of foreground color.

This example uses the array created in the previous example to override the color scheme of the main FoxPro window with another predefined color scheme:

ACTIVATE SCREEN
CLEAR
SET TALK OFF
STORE 1 TO mchoice

DEFINE POPUP scrollopts FROM 0,0 PROMPT FILES LIKE *.DBF ;
MARGIN SCROLL COLOR SCHEME 4

@ 2,2 GET mchoice POPUP scrollopts SIZE 8, 20
READ	&& Activate the list

The following example, which uses the array created in an example above, defines a list with the following color characteristics:

A selected list item is shown in bright white on a blue background (W+/B).

An enabled list is shown with yellow options on a blue background (GR+/B).

A disabled list is shown with white options on a blue background (W/B).

When you skip a color pair, you must include a comma where the color pair would have been.

Here are the commands:

CLEAR
SET TALK OFF
STORE 1 TO mchoice

DEFINE POPUP scrollopts FROM 0,0 PROMPT FILES LIKE *.DBF ;
MARGIN SCROLL COLOR ,GR+/B,,,,W+/B,,,,W/B

@ 2,2 GET mchoice POPUP scrollopts SIZE 8, 20
READ	&& Activate the list


@ ... GET - Lists Example
@ ... GET [image] Lists Example

SET TALK OFF
DEFINE WINDOW example FROM 4,3 TO 21,76 TITLE ' List Example ' ;
FLOAT SHADOW SYSTEM COLOR SCHEME 8

*** Fill the array cityarray with city data ***

SELECT DISTINCT city FROM customer INTO ARRAY cityarray
SELECT customer

*** Define a pop-up that contains the structure of customer ***

DEFINE POPUP popstru PROMPT STRUCTURE SCROLL MARGIN MARK CHR(16)

*** Define a pop-up containing data from the company field ***

DEFINE POPUP popfield PROMPT FIELD company SCROLL MARGIN MARK CHR(16)
ACTIVATE WINDOW example
@ 1,3 SAY 'Structure Popup:'

*** Get information using predefined popstru pop-up ***

@ 2,2 GET liststructure POPUP popstru SIZE 11, 20;
DEFAULT FIELD(1,'customer') WHEN refresh( );
VALID dispitem(liststructure) COLOR SCHEME 9
@ 13,3 SAY liststructure SIZE 1, 18
@ 1,26 SAY 'Field Popup:'

*** Get information using predefined popfield pop-up ***

@ 2,25 GET listfield POPUP popfield SIZE 11, 20 ;
DEFAULT company WHEN refresh( ) VALID dispitem(listfield);
COLOR SCHEME 9
@ 13,26 SAY listfield SIZE 1, 18
@ 1,50 SAY 'Array of City Names:'

*** Get information using predefined array ***

@ 2,49 GET arrayitem FROM cityarray SIZE 11, 20 ;
DEFAULT cityarray(1) WHEN refresh( ) VALID dispitem(arrayitem);
COLOR SCHEME 9
@ 13,50 SAY arrayitem SIZE 1,18
@ 14.5,63 GET ok FUNCTION '*t \!OK' DEFAULT 1 SIZE 1, 6
READ CYCLE SHOW popshow( )  && Activate gets
RELEASE WINDOW example
RELEASE POPUPS popstru, popfield

FUNCTION refresh

*** Refresh window information without calling subroutine ***

SHOW GETS OFF
FUNCTION dispitem

*** Display which item has been chosen ***

PARAMETER item
WAIT WINDOW 'You have chosen: ' + ALLTRIM(item) NOWAIT

FUNCTION popshow

*** Display current items for each list ***

@ 13,3 SAY liststructure	SIZE 1, 18
@ 13,26 SAY listfield	SIZE 1, 18
@ 13,50 SAY arrayitem	SIZE 1, 18


@ ... GET - Lists SeeAlso
See Also

@ ... SAY

@ ... GET

Controls Overview

_CUROBJ

Fonts

DEFINE POPUP

OBJNUM( )

SHOW GETS

User-Defined Functions (UDFs)


@ ... GET - Popups
@ ... GET [image] Popups

See Also	Example

Creates a popup.

Syntax

@ <row, column>
GET <memvar> | <field>
FUNCTION <expC1> | PICTURE <expC2>
[FONT <expC3> [, <expN1>]]
[STYLE <expC4>]
[DEFAULT <expr>]
[FROM <array>]
[RANGE <expN2> [, <expN3>]]
[SIZE <expN4>, <expN5>]
[ENABLE | DISABLE]
[MESSAGE <expC5>]
[VALID <expL1> | <expN6>]
[WHEN <expL2>]
[COLOR SCHEME <expN7> [, <expN8>]
| COLOR <color pair list>]

Remarks

This variation of @ ... GET creates a popup. When selected, the popup opens, displaying a set of options from which you can choose one. The set of options is specified in the FUNCTION and/or PICTURE clause containing the specification code for a popup [image] a caret (^).

If you use the Screen Builder to create your data-entry screens, you might not have to use this command at all. The Screen Builder automatically generates the commands that create pop-ups.

To open a popup in FoxPro for MS-DOS, press Enter or the Spacebar or click on the popup. You can open a popup in the same manner in FoxPro for Windows and FoxPro for Macintosh if KEYCOMP is set to DOS.

To open a popup in FoxPro for Windows when KEYCOMP is set to WINDOWS (the default setting), press the Spacebar, Alt+Up Arrow, or Alt+Down, Arrow or click on the popup.

To open a popup in FoxPro for Macintosh when KEYCOMP is set to MAC (the default setting), click the popup. When KEYCOMP is set to DOS or WINDOWS, you can open the popup by pressing the Spacebar or clicking the popup.

Clauses

<row, column>

Row and column are numeric expressions with values of 0 or greater that determine where the list appears.

The first row is number 0 in the main FoxPro window or a user-defined window. Rows are numbered from top to bottom. In FoxPro for Windows, row 0 is the row immediately under the FoxPro system menu bar. In FoxPro for Macintosh, row 0 is the row immediately under the FoxPro title bar. In FoxPro for MS-DOS, row 0 is the row the FoxPro system menu bar occupies. See SET SYSMENU for information about manipulating the system menu bar so you can place output on row 0 in FoxPro for MS-DOS.

The first column is number 0 in the main FoxPro window or a user-defined window. Columns are numbered from left to right.

When the list is directed to a user-defined window, the row and column coordinates are relative to the user-defined window, not the main FoxPro window.

In FoxPro for Windows and FoxPro for Macintosh, a position in the main FoxPro window or in a user-defined window is determined by the font of the main FoxPro window or the user-defined window. Most fonts can be displayed in a wide variety of sizes, and some are proportionally spaced. A row corresponds to the height of the current font; a column corresponds to the average width of a letter in the current font.

In FoxPro for Windows and FoxPro for Macintosh, you can position the list in a window with decimal fractions for row and column coordinates. In FoxPro for MS-DOS, decimal fractions used for row and column coordinates are rounded to the nearest integer value.

<memvar> | <field>

When you choose an option from the popup, your choice is stored to the memory variable or array element specified with <memvar> or a field specified with <field>. If you press Esc to exit the popup, the value of <memvar> or <field> isn't changed.

<memvar> or <field> must be of numeric or character type. If <memvar> or <field> is character, the prompt of the item you choose is stored to <memvar>. If <memvar> or <field> is numeric, the number representing the position of the item in the popup is stored to <memvar> or <field>.

Initial Option Selection

When a popup appears, the value of <memvar> or <field> determines which popup option (if any) is initially displayed on the face of the popup.

If <memvar> or <field> is numeric, the option in the specified numeric position in the list of options is initially displayed on the face of the popup. For example, if the memory variable, array element or field contains 1, the first popup option you specify is initially displayed. If the value of <memvar> or <field> doesn't correspond to any of the popup options (the value is less than 1 or greater than the number of options), the face of the popup is initially blank.

If <memvar> or <field> is of character type, a case-sensitive comparison is made between <memvar> or <field> and each popup option. When the comparison is made, all special characters and any leading or trailing spaces are ignored. If a match is found, the matching option is initially displayed on the face of the popup. If a match isn't found, the character value of <memvar> or <field> is initially displayed on the face of the popup and is added as a temporary option at the end of the list of options.

FUNCTION <expC1> | PICTURE <expC2>

When creating popups, you must include the FUNCTION clause, the PICTURE clause or both. There is no advantage to any of the three methods. The FUNCTION or PICTURE clause contains the popup specification code ^ and the set of popup options.

Options can also be specified in the FROM <array> clause. If the options are specified there, you do not need to include them in the FUNCTION or PICTURE clause.

However, if you include FROM <array>, ^ must still be included in the FUNCTION or PICTURE clause.

The FUNCTION character expression <expC1> must begin with ^. To create the options that appear in the popup list, include a space after ^ followed by a list of options separated by semicolons. The following example creates the option prompts Cash, Charge, Net 30 and Net 60:

... FUNCTION '^ Cash;Charge;Net 30;Net 60' ...

The PICTURE character expression <expC2> uses the same syntax as the FUNCTION character expression except the PICTURE expression must begin with @ followed by ^.

For example, the following PICTURE clause creates the option prompts Cash, Charge, Net 30 and Net 60:

... PICTURE '@^ Cash;Charge;Net 30;Net 60' ...

You can also include both the FUNCTION and PICTURE clauses to create popups. If both are included, the FUNCTION character expression <expC1> must contain ^ to create the popup, and can also include a space and the popup options. The PICTURE character expression <expC2> can include prompts to create additional options.

The following examples illustrate the various forms of syntax you can use to create a popup. In all the examples, a popup is placed in the second row and column. It contains four options with the prompts Cash, Charge, Net 30 and Net 60. It is initialized by the memory variable MCHOICE. When you choose one of the options from the popup, your choice is stored to MCHOICE.

FUNCTION clause only:

STORE 1 TO mchoice
@ 2,2 GET mchoice FUNCTION '^ Cash;Charge;Net 30;Net 60'
READ

STORE 1 TO mchoice
STORE '^ Cash;Charge;Net 30;Net 60' TO mfunc
@ 2,2 GET mchoice FUNCTION mfunc
READ

PICTURE clause only:

STORE 1 TO mchoice
@ 2,2 GET mchoice PICTURE '@^ Cash;Charge;Net 30;Net 60'
READ

STORE 1 TO mchoice
@ 2,2 GET mchoice PICTURE '@^' + ' Cash;Charge;Net 30;Net 60'
READ

FUNCTION and PICTURE clauses:

STORE 1 TO mchoice
@ 2,2 GET mchoice FUNCTION '^' ;
PICTURE ' Cash;Charge;Net 30;Net 60'
READ

STORE 1 TO mchoice
@ 2,2 GET mchoice FUNCTION '^ Cash;Charge' ;
PICTURE ';Net 30;Net 60'
READ

PICTURE and FUNCTION Options N,T, 2 and 3

Additional options can be placed after the caret ( ^ ) specification code in the FUNCTION or PICTURE clause to modify the behavior (N and T) and appearance (2 and 3) of the popup.

The 2 (two-dimensional) and 3 (three-dimensional) specification codes are only available in FoxPro for Macintosh.

Option	Description

N	Does not terminate the READ when an option is chosen. This is the default behavior.

T	Terminates the READ when an option is chosen.

2	Creates a flat (two-dimensional) popup identical to popups in Macintosh dialogs. This is the default popup in FoxPro for Macintosh.

3	Creates a three-dimensional popup identical to popups in FoxPro for Macintosh dialogs.

Popup Options with Special Features

When defining a prompt, you can assign special characteristics to a popup option. For example, you can assign a hot key to the option or disable the option by including special characters.

Hot Keys

In FoxPro for MS-DOS, a hot key is a highlighted letter in a prompt that you can type to immediately choose an option on an open popup. To assign a hot key, place a backslash and a less-than sign (\<) before the desired character of the popup option.

In FoxPro for Windows, a hot key is an underlined letter on a prompt that you can type to immediately choose an option on the popup. The popup doesn't have to be open to choose an option with a hot key if KEYCOMP is set to WINDOWS.

In FoxPro for Macintosh, if KEYCOMP is set to MAC (the default), hot keys aren't highlighted or underlined. If KEYCOMP is set to DOS or WINDOWS, hot keys are underlined.

The following example assigns the hot keys C and R to the Cash and Charge options, respectively:

STORE 1 TO mchoice
@ 2,2 GET mchoice FUNCTION '^ \<Cash;Cha\<rge;Net 30;Net 60'
READ

Disabled Options

You can disable an option so it can't be chosen. Disabled options are shown in disabled colors. To disable a popup option, place a backslash (\) before the option. To disable the entire popup, include the DISABLE keyword.

The Charge option is disabled in this example:

STORE 1 TO mchoice
@ 2,2 GET mchoice FUNCTION '^ Cash;\Charge;Net 30;Net 60'
READ

FONT <expC3> [, <expN1>]

The character expression <expC3> is the name of the font, and the numeric expression <expN1> is the font size. For example, the following clause can be used to display the options in the popup in 16-point Courier font:

FONT 'Courier', 16

If you include the FONT clause but omit the font size <expN1>, a 10-point font is used.

In FoxPro for Windows, if the font you specify is not available, a font with similar font characteristics is substituted.

In FoxPro for Macintosh, if the font you specify is not available, the Chicago font is used.

In FoxPro for MS-DOS, the FONT clause is ignored.

If the FONT clause is omitted and the popup is placed in the main FoxPro window, the main FoxPro window font is used. If the FONT clause is omitted and the popup is placed in a user-defined window, the user-defined window font is used.

STYLE <expC4>

In FoxPro for Windows and FoxPro for Macintosh, include the STYLE clause to specify a font style for the options in the popup.

The font style is specified with <expC4>. If the STYLE clause is omitted, the normal font style is used.

In FoxPro for Windows, if the font style you specify is not available, a font style with similar characteristics is substituted.

In FoxPro for Macintosh, if the font you specify is not available, the normal font style is used.

The STYLE clause is ignored in FoxPro for MS-DOS.

Character	Font Style

B	Bold

C	Condense*

E	Extend*

I	Italic

N	Normal

O	Outline

S	Shadow

-	Strikeout*

U	Underline

*The Condense and Extend styles are available only in FoxPro for Macintosh. The Strikeout style is available only in FoxPro for Windows.

You can include more than one character to specify a combination of font styles. For example, the following specifies Bold Italic:

STYLE 'BI'

DEFAULT <expr>

When you choose an option from a popup, your choice is saved in the memory variable, array element or field you specify. If you specify a memory variable that doesn't exist, it is automatically created and initialized if you include the DEFAULT clause. However, an array element isn't created if you specify an array element in a DEFAULT clause. The DEFAULT clause is ignored if the memory variable already exists or you specify a field.

Note   If the DEFAULT clause isn't included and the memory variable <memvar> doesn't exist, the error message "Variable not found" appears.

The DEFAULT expression <expr> determines the type of memory variable created and its initial value. <expr> must be a numeric or character expression. Here are examples of DEFAULT clauses for popups:

@ 2,2 GET mchoice FUNCTION '^ Cash;Charge;Net 30;Net 60' ;
DEFAULT 'Cash'
READ

@ 2,2 GET mchoice FUNCTION '^ Cash;Charge;Net 30;Net 60';
DEFAULT 3
READ

FROM <array>

The FROM <array> clause can be included to create the popup options from a predefined array. If you create popup options with FROM <array>, you must still specify @^ in the PICTURE clause or ^ in the FUNCTION clause. For example:

... FROM marray PICTURE '@^' ...
... FROM marray FUNCTION '^' ...

If FROM <array> is included, any option prompts specified in the PICTURE or FUNCTION clause are ignored.

The options that appear in the popup are taken from the elements of the array you specify with <array>. If the array is one-dimensional, the first element in the array creates the first option in the popup, the second array element creates the second option, and so on.

If the array is two-dimensional, only the elements in the first column of the array create the options in the popup. The first element in the array creates the first option in the popup, the second element in the first column creates the second option, and so on.

RANGE <expN2> [, <expN3>]

By default, popup options start with the first array element. You can designate a different starting element in the array by including the RANGE value <expN2>. For example, if the array is one-dimensional and <expN2> is 3, the third element in the array creates the first option in the popup, the fourth element creates the second option, and so on.

An element's position number in a two-dimensional array is determined by counting along rows. For example, suppose you create the following 3-by-3 array:

a b c

d e f

g h i

Elements a, b, and c are in position numbers 1, 2, and 3. Elements d, e, and f are in position numbers 4, 5, and 6, and so on. With two-dimensional arrays, only elements in the same column as array element <expN2> create the options on the popup. For example, if <expN2> is 2, the contents of elements b, e, and h are used to create the popup options. If <expN2> is 5, only the contents of elements e and h are used.

If you include a starting element <expN2>, you can also specify the number of elements used to create options by including the numeric expression <expN3>. The number of options appearing in the popup is determined by <expN3>. If <expN3> isn't included, the contents of all array elements in the specified column from the starting element <expN2> through the last element in the column are the popup options.

If the array is two-dimensional, <expN3> designates the number of elements used from the array column containing the starting element <expN2>. For example, if <expN2> is 2 and <expN3> is 3, the second array element and the next two elements in the same array column create options on the popup.

The contents of a popup can be dynamically changed. You can insert and delete options by modifying the array. When SHOW GETS is issued, the RANGE clause is reevaluated. If the value of the element numbered <expN2> or <expN3> has changed, the popup is updated to reflect the change.

The ACOPY( ), ADEL( ), ADIR( ), AELEMENT( ), AFIELDS( ), AINS( ), ALEN( ), ASCAN( ), ASORT( ) and ASUBSCRIPT( ) functions facilitate the manipulation of arrays.

The following program example demonstrates how a popup can be dynamically changed. Two radio buttons, Vegetable and Fruits, can be chosen. Another set of radio buttons specifies the color (red, yellow or green) of the vegetables or fruits. The popup is modified and refreshed as different buttons are chosen.

CLEAR
SET TALK OFF
STORE 1 TO color, fruitorveg, popchoice, start
DIMENSION poparray(4,3)
STORE 'Apples'	TO poparray(1,1)
STORE 'Bananas'	TO poparray(1,2)
STORE 'Limes'	TO poparray(1,3)
STORE 'Strawberries'	TO poparray(2,1)
STORE 'Lemons'	TO poparray(2,2)
STORE 'Grapes'	TO poparray(2,3)
STORE 'Radishes'	TO poparray(3,1)
STORE 'Corn'	TO poparray(3,2)
STORE 'Lettuce'	TO poparray(3,3)
STORE 'Beets'	TO poparray(4,1)
STORE 'Squash'	TO poparray(4,2)
STORE 'Celery'	TO poparray(4,3)
@ 9,2   SAY 'Color:'
@ 11,2  SAY 'Type:'
@ 9,10  GET color  FUNCTION '*RH \<Red;\<Yellow;\<Green' ;
SIZE 1, 9, 1 VALID PROC1( )
@ 11,10 GET fruitorveg FUNCTION '*RH \<Fruit;\<Vegetable' ;
SIZE 1, 12, 1 VALID PROC2( )
@ 4,14  GET popchoice FUNCTION '^' FROM poparray RANGE start,2
@ 14,17 GET ok FUNCTION '*T OK' DEFAULT 1 SIZE 1, 8
@ 10,0,10,41 BOX
@ 8,0,12,41  BOX
READ CYCLE

PROCEDURE PROC1
DO CASE
CASE COLOR = 1
IF fruitorveg = 1
start = 1
ELSE
start = 7
ENDIF
CASE COLOR = 2
IF fruitorveg = 1
start = 2
ELSE
start = 8
ENDIF
CASE COLOR = 3
IF fruitorveg = 1
start = 3
ELSE
start = 9
ENDIF
ENDCASE
STORE 1 TO popchoice
SHOW GETS
RETURN .T.

PROCEDURE PROC2
IF fruitorveg = 1
DO CASE
CASE color = 1
STORE 1 TO start
CASE color = 2
STORE 2 TO start
CASE color = 3
STORE 3 TO start
ENDCASE
ELSE
DO CASE
CASE color = 1
STORE 7 TO start
CASE color = 2
STORE 8 TO start
CASE color = 3
STORE 9 TO start
ENDCASE
ENDIF
STORE 1 TO popchoice
SHOW GETS
RETURN .T.

SIZE <expN4> [, <expN5>]

By default, the width of the popup is determined by the length of the longest option text in columns. You can optionally specify the width of the popup in columns by specifying <expN5>. For popups, the first SIZE argument <expN4> is ignored, because the height of a popup is determined by the number of options. You can include any numeric value for <expN4>.

In FoxPro for Windows and FoxPro for Macintosh, the popup font determines the size of the popup. The popup font is specified with the FONT clause. If the FONT clause is omitted, the popup uses the font of its parent window (the main FoxPro window or a user-defined window).

ENABLE | DISABLE

Popups are enabled by default when READ or READ CYCLE is issued. You can prevent a popup from being activated when READ or READ CYCLE is issued by including DISABLE. A disabled popup cannot be selected and appears in disabled colors. To disable individual popup options instead of the entire popup, see "Disabled Options" earlier in this section. Use SHOW GET ENABLE to enable a disabled popup.

MESSAGE <expC5>

The MESSAGE clause character expression <expC5> appears when the pop-up is selected. In FoxPro for MS-DOS, the message is centered by default on the last line of the main FoxPro window. The message location can be changed with SET MESSAGE.

In FoxPro for Windows and FoxPro for Macintosh, the message is placed in the graphics-based status bar. If the graphics-based status bar has been turned off with SET STATUS BAR OFF, the message is placed on the last line of the main FoxPro window.

VALID <expL1> | <expN6>

You can include an optional VALID expression <expL1> or <expN6> that is evaluated when a popup option is chosen. That is, VALID isn't evaluated when you select the popup, but when you choose an option in the popup.

Typically, <expL1> or <expN6> is a user-defined function (UDF). With a user-defined function (UDF) you can select, enable or disable other objects; open a Browse window, open another data-entry screen or move to a new record. CLEAR READ may be included in the user-defined function to terminate the READ.

<expL1>

When a logical value is returned to the VALID clause, the logical value is ignored and the pop-up remains the current control. However, you can specify a UDF that returns a logical value to the VALID clause and activates another object.

<expN6>

A VALID clause that includes a numeric expression is used to specify which object is activated after an option in the popup is chosen. Objects are @ ... GET input fields, check boxes, lists, popups, spinners, text-editing regions and each individual button in a set of push, radio and invisible buttons.

The expression <expN6> has one of these effects:

When <expN6> = 0, the popup remains the active control.

When <expN6> is positive, <expN6> specifies the number of objects to advance. For example, when the popup is the current object and VALID returns 1, the next object is activated. If <expN6> is greater than the number of objects remaining, the READ is terminated (unless READ CYCLE is issued to activate the objects).

When <expN6> is negative, <expN6> specifies the number of objects to move back. For example, if the popup is the current object and VALID returns -1, the previous object is activated. If <expN6> moves back past the first object, the READ is terminated (unless READ CYCLE is issued to activate the objects).

WHEN <expL2>

The WHEN clause allows or prohibits selection of a popup based on the logical value of <expL2>, which must evaluate to a logical true (.T.) before a popup can be selected. If <expL2> evaluates to a logical false (.F.), the popup cannot be selected and is skipped over if placed between other objects.

COLOR SCHEME <expN7> [, <expN8>] | COLOR <color pair list>

If you do not include a COLOR clause, popup colors are determined by the color scheme for the  main FoxPro window; if a popup is placed in a user-defined window, the window's color scheme determines the popup's colors.

The colors of a popup can be specified by including the number of an existing color scheme in the COLOR SCHEME clause or a set of color pairs in the COLOR clause.

A color scheme is a set of 10 predefined color pairs. The color pairs in a color scheme can be changed with SET COLOR OF SCHEME. In FoxPro for MS-DOS, the color pairs in a color scheme can also be changed in the Color Picker.

A color pair is a set of two letters separated by a forward slash. The first letter specifies the foreground color and the second letter specifies the background color.

For example, this color pair specifies a red foreground on a white background:

R/W

For a list of colors and their corresponding color letters, see SET COLOR Overview or Color Table by Color Pair.

A color pair can also be specified with a set of six RGB (Red Green Blue) color values separated by commas. The first three color values specify the foreground color and the second three color values specify the background color. The color values can range from 0 through 255.

The R/W color pair in the example above can also be specified with this RGB color pair:

RGB(255,0,0,255,255,255)

By default, the colors of a popup and its options are derived from the color scheme of the main FoxPro window or the active user-defined window and color scheme 2.

The first color scheme <expN7> determines the colors of the face of the popup when the popup is selected, enabled or disabled. It also determines the color of the message. The second color scheme <expN8> determines the color of the popup options and the border of the box containing the options.

The following table lists the color pairs in each color scheme and what each color pair controls in a popup.

Color Pair 	<exp7> or
Number	Output Window

5	Message

6	Selected popup

9	Enabled popups

10	Disabled popups

Color Pair 	<expN8> or
Number	Color Scheme 2

1	Disabled options

2	Enabled options

3	Border

6	Selected option

7	Hot keys

A color pair list only controls colors of the face of the popup when the popup is selected, enabled or disabled and the color of the message (popup color attributes controlled by color scheme <expN7>). For complete color control of a popup, specify two color schemes.

This example shows how to override the current color scheme with other predefined color schemes:

STORE 1 TO mchoice
@ 2,2 GET mchoice FUNCTION '^ Cash;Charge;Net 30;Net 60' ;
COLOR SCHEME 4, 5
READ


... GET - Popups Example
@ ... GET [image] Popups Example

The following example uses a popup to get a field for the browse order from the CUSTOMER table:

SET TALK OFF
DEFINE WINDOW popupex FROM 5,10 TO 15,55 ;
FLOAT DOUBLE COLOR SCHEME 5
CLOSE DATABASES
USE customer
DIMENSION dbftags(256)
dbftags(1) = 'Record #'
FOR i = 2 to 256
IF empty(tag(i-1))
i = i - 1
DIMENSION dbftags(i)
EXIT
ELSE
dbftags(i) = tag(i-1)
ENDIF
ENDFOR
dbforder = 'Record #'

ACTIVATE WINDOW popupex
@ 3.5,7  GET dbforder PICTURE '@^' FROM dbftags SIZE 3, 14
@ 0.5,2  TO 7.5,43
@ 0,5  SAY ' Customer Browse Order: '
@ 2.5,27 GET okcancel PICTURE '@*VT \!OK;\?Cancel' SIZE 1,10,2 DEFAULT 0
READ CYCLE
RELEASE WINDOW popupex

IF okcancel = 1
IF dbforder = "Record #"
SET ORDER TO
ELSE
SET ORDER TO (dbforder)
ENDIF
WAIT WINDOW 'Order set to '+dbforder NOWAIT
BROWSE WIDTH 10 NOWAIT
ELSE
WAIT WINDOW 'Order not set' NOWAIT
ENDIF


@ ... GET - Popups SeeAlso
See Also

@ ... SAY

@ ... GET

Controls Overview

_CUROBJ

Fonts

READ

SET KEYCOMP

SHOW GET

OBJNUM( )

User-Defined Functions (UDFs)


@ ... GET - Push Buttons
@ ... GET [image] Push Buttons

See Also

Creates a set of push buttons or picture push buttons.

Syntax

@ <row, column>
GET <memvar> | <field>
FUNCTION <expC1> | PICTURE <expC2>
[FONT <expC3> [, <expN1>]]
[STYLE <expC4>]
[DEFAULT <expr>]
[SIZE <expN2>, <expN3> [, <expN4>]]
[ENABLE | DISABLE]
[MESSAGE <expC5>]
[VALID <expL1> | <expN5>]
[WHEN <expL2>]
[COLOR SCHEME <expN6>
| COLOR <color pair list>]

Remarks

This variation of @ ... GET creates push buttons or picture push buttons. A single button or a group of buttons can be created. In FoxPro for MS-DOS, a push button is shown as a string of text between right and left angle brackets.

If you use the Screen Builder to create your data-entry screens, you might not have to use this command at all. The Screen Builder automatically generates the commands that create push buttons and picture push buttons.

The string of text, often called a prompt, is specified in the FUNCTION or PICTURE clause. Typically, a push button is used to trigger an action. The triggered action is specified in a VALID clause. A push button is activated by issuing READ or READ CYCLE.

You can create picture push buttons in FoxPro for Windows and FoxPro for Macintosh. Pictures on buttons replace the push button prompts.

Clauses

<row, column>

Row and column are numeric expressions with values of 0 or greater that determine where the first button in a set of push buttons appears.

The first row is number 0 in the main FoxPro window or a user-defined window. Rows are numbered from top to bottom. In FoxPro for Windows, row 0 is the row immediately under the FoxPro system menu bar. In FoxPro for Macintosh, row 0 is the row immediately under the FoxPro title bar. In FoxPro for MS-DOS, row 0 is the row the FoxPro system menu bar occupies. See SET SYSMENU for information about manipulating the system menu bar so you can place output on row 0 in FoxPro for MS-DOS.

The first column is number 0 in the main FoxPro window or a user-defined window. Columns are numbered from left to right.

When the first button in a set of push buttons is directed to a user-defined window, the row and column coordinates are relative to the user-defined window, not the main FoxPro window.

In FoxPro for Windows and FoxPro for Macintosh, a position in the main FoxPro window or in a user-defined window is determined by the font of the main FoxPro window or the user-defined window. Most fonts can be displayed in a wide variety of sizes, and some are proportionally spaced. A row corresponds to the height of the current font; a column corresponds to the average width of a letter in the current font.

In FoxPro for Windows and FoxPro for Macintosh, you can position the first button in a set of push buttons in a window with decimal fractions for row and column coordinates. In FoxPro for MS-DOS, decimal fractions used for row and column coordinates are rounded to the nearest integer value.

<memvar> | <field>

When you choose a push button, your choice is stored to the memory variable or array element <memvar> or to the field <field>. <memvar> or <field> must be of numeric or character type.

If <memvar> or <field> is of numeric type, a number corresponding to the push button choice is stored to the memory variable, array element or field specified with <memvar> or <field>. For example, if you create four push buttons and choose the third button, 3 is stored. If <memvar> or <field> is of character type, the prompt of the push button you choose is stored to the memory variable, array element or field specified with <memvar> or <field>.

FUNCTION <expC1> | PICTURE <expC2>

When creating push buttons, you must include the FUNCTION clause, the PICTURE clause or both. There is no advantage to any of the three methods. The FUNCTION or PICTURE clause contains the push button specification code, an asterisk (*), and the text for the individual push button prompts.

The FUNCTION character expression <expC1> must begin with *. To create the push button prompts, include a space after the asterisk followed by a list of the prompts separated by semicolons. One button is created for each prompt. For example, the following FUNCTION clause creates push buttons with the prompts OK and Cancel:

... FUNCTION '* OK;Cancel' SIZE 1, 8 ...

The PICTURE character expression <expC2> uses the same syntax as the FUNCTION  character expression except the PICTURE character expression must begin with @ followed by an asterisk (*). For example, the following PICTURE clause creates push buttons with the prompts OK and Cancel:

.. PICTURE '@* OK;Cancel' SIZE 1, 8 ...

You can also include both the FUNCTION and PICTURE clauses to create push buttons. If both are included, the FUNCTION character expression <expC1> must contain * to create the push buttons followed by a space and the push button prompts. The PICTURE character expression <expC2> can include prompts to create additional push buttons.

The following examples illustrate the various forms of syntax you can use to create push buttons. Two push buttons are created: OK and Cancel. The first button (OK) is placed in the second row and second column. A number corresponding to the button chosen is stored to the memory variable MCHOICE.

FUNCTION clause only:

STORE 1 TO mchoice
@ 2,2 GET mchoice FUNCTION '* OK;Cancel' SIZE 1, 8
READ

STORE 1 TO mchoice
STORE '* OK;Cancel' TO mprompts
@ 2,2 GET mchoice FUNCTION mprompts SIZE 1, 8
READ

PICTURE clause only:

STORE 1 TO mchoice
@ 2,2 GET mchoice PICTURE '@* OK;Cancel' SIZE 1, 8
READ

STORE 1 TO mchoice
@ 2,2 GET mchoice PICTURE '@*' + ' OK;Cancel' SIZE 1, 8
READ

FUNCTION and PICTURE clauses:

STORE 1 TO mchoice
@ 2,2 GET mchoice FUNCTION '*' ;
PICTURE ' OK;Cancel' SIZE 1, 8
READ

Push Buttons with Picture Prompts

In FoxPro for Windows and FoxPro for Macintosh, the prompt for a push button can also be the name of a picture file. In FoxPro for Windows, the picture file can be a bitmap file with a .BMP extension. In FoxPro for Macintosh, you can use a picture file of PICT type or a .BMP bitmap file.

When a push button uses a picture file for a prompt, the push button mimics the behavior of a push button with a text prompt. For example, the picture file appears on a button but the push button isn't displayed. Like choosing a push button, choosing the picture prompt stores the push button's value to <memvar> or <field>.

To use a picture file in a push button, add B to the push button specification code. The FUNCTION and PICTURE clause specification codes that create a push button are * and @*, respectively. To create a push button with picture prompts, use the codes *B and @*B, followed by a space and the picture filename. If the picture file is not located in the default directory or folder, include the path to the picture file with the picture filename.

Note   The pictures aren't clipped, reduced or enlarged to fit the push button. Use the SIZE clause to adjust the size of the push buttons to accommodate the pictures.

If you omit the extension for the picture file, FoxPro for Macintosh first looks for a picture file with the name you specified and a .BMP extension. If a picture file with a .BMP extension and the name you specified isn't found, FoxPro for Macintosh then looks for a file with the name you specified and a .PCT extension. If a picture file with a .PCT extension and the name you specified isn't found, FoxPro for Macintosh then looks for a picture file with the name you specified without an extension.

Picture Masks and Push Buttons

In FoxPro for Windows and FoxPro for Macintosh, a picture push button has three states: up, down and disabled. FoxPro automatically controls the appearance of a picture push button when it is in each of these three states, but you can override the default appearance by using a picture mask.

A mask is used to control the transparent areas of a picture push button. By default, the white areas are transparent. If a mask is present, the white areas of the mask, not the picture file, are transparent.

A mask is a monochrome picture file. In FoxPro for Windows, a mask is a .BMP with an .MSK extension. In FoxPro for Macintosh, a mask can be a .BMP with an .MSK extension or a PICT type file with a .PCM extension. The mask must have the same base name as the picture file and the appropriate extension. FoxPro automatically looks for a mask for a picture file in the same directory or folder where the picture file is located.

In most cases, a mask isn't necessary. If you don't need anything in your picture to appear white or your picture file has a white background, the picture push button will appear as desired in the up, down and disabled states.

When a picture push button has a mask and is in the up or down state, any white areas in the picture file appear transparent, allowing the color of the button face to show through. However, you can maintain the white color of certain areas.

Suppose that you have a picture file with a dog on a white background; the dog has white eyes and the button face is red. You want the background of the button to appear red but you want the dog's eyes to be white, not red. Make a mask that is the same size as the picture file but includes only two colors, black and white. Leave the background of the mask white but make the dog [image] including his eyes [image] completely black. When the button appears, the background is red to match the button face but the dog's eyes are white.

When a picture push button is disabled, any white areas in the picture file appear transparent so the color of the button face shows through. Any non-white areas appear dark gray. If the button has a mask, all white areas in the mask are transparent so the color of the button face shows through, and all black areas appear dark gray.

PICTURE and FUNCTION Options N, T, H, V, 2 and 3

Additional options can be combined with the * specification code to modify the behavior (N and T) and appearance (H, V, 2 and 3) of push buttons.

The 2 (two-dimensional) and 3 (three-dimensional) specification codes are only available in FoxPro for Macintosh.

Option	Description

N	Does not terminate the READ when a push button is chosen.

T	Terminates the READ when a push button is chosen. This is the default behavior.

H	Position the push buttons in a horizontal row.

V	Position the push buttons in a vertical column. This is the default orientation.

2	Creates flat (two-dimensional) black-and-white push buttons identical to push buttons in Macintosh dialogs.

3	Creates three-dimensional push buttons identical to push buttons in FoxPro for Macintosh dialogs. This is the default push button type in FoxPro for Macintosh.

You can combine the T or N option with the H, V and 2 or 3 options. For example, the following clause creates a horizontal row of buttons and doesn't cause the READ to terminate when one of the buttons is chosen:

... FUNCTION '*NH ... '

In FoxPro for Macintosh, the following clause creates a horizontal row of two-dimensional buttons and doesn't cause the READ to terminate when one of the buttons is chosen:

... FUNCTION '*NH2 ... '

Push Buttons with Special Features

You can assign a hot key to a button, disable a button, or create a default or escape button. To assign these special features to a push button, you must include special characters when defining the prompt. The special characters are removed when the prompt is stored to <memvar> or <field>.

Hot Keys

In FoxPro for MS-DOS, a hot key is a highlighted letter in the push button prompt that you can type to immediately choose a push button. Pressing the hot key selects the button and chooses it. To assign a hot key, place a backslash and a less-than sign (\<) before the desired character of the push button prompt.

A hot key doesn't choose the push button if the current object is a GET field, a text-editing region, a pop-up or a list.

If the current object is an @ ... GET input field or a text-editing region, pressing the hot key enters the character in the field or the text-editing region. If the current object is a popup or a list, pressing the hot key selects the first option on the popup or list whose prompt begins with the hot key character.

In FoxPro for Windows, a hot key is an underlined letter in the push button prompt that you can type to immediately choose the button. If the current object is an @ ... GET input field, a text-editing region, a popup or a list and KEYCOMP is set to WINDOWS, you can press the Alt key and the hot key to choose the push button.

In FoxPro for Macintosh, if KEYCOMP is set to MAC (the default), hot keys aren't highlighted or underlined. If KEYCOMP is set to DOS or WINDOWS, hot keys are underlined.

The following example creates the OK and Cancel buttons with hot keys O and C, respectively:

STORE 1 TO mchoice
@ 2,8 GET mchoice FUNCTION '*  \<OK;\<Cancel'
READ

Disabled Push Buttons

You can disable a push button so it can't be selected or chosen. Disabled push buttons are shown in disabled colors. To disable a single push button, place two backslashes (\\) before the button's prompt. To disable a set of push buttons, include the DISABLE keyword.

The OK push button is disabled in the following example:

STORE 1 TO mchoice
@ 2,2 GET mchoice FUNCTION '* \\OK;Cancel'
READ

Default Push Buttons

A default push button is typically used to exit a data-entry screen, dialog or routine and accept any changes made in the screen, dialog or routine. To create a default push button, place a backslash and an exclamation point (\!) before the push button's prompt.

The following example specifies the OK button as the default push button:

STORE 1 TO mchoice
@ 2,2 GET mchoice FUNCTION '*  \!OK;Cancel'
READ

In FoxPro for MS-DOS, the default push button is enclosed in double angle brackets to distinguish it from other push buttons. The default push button is automatically chosen when you press Ctrl+Enter or Ctrl+W. You can specify only one default push button for each READ.

In FoxPro for Windows, the default push button is surrounded by a thick border. Press Enter, Ctrl+Enter or Ctrl+W to choose the default push button. The KEYCOMP setting determines the behavior of default push buttons in FoxPro for Windows in the following ways:

If you SET KEYCOMP TO DOS, the behavior of the default push button is the same as the behavior of a default push button in FoxPro for MS-DOS.

If you SET KEYCOMP TO WINDOWS, the default push button changes as you move between buttons. The push button specified with \! is the default button when objects besides push buttons are active. When a push button is active, it becomes the default push button.

In FoxPro for Macintosh, the default push button is surrounded by a thick border. The KEYCOMP setting determines the behavior of default push buttons in FoxPro for Macintosh in the following ways:

If you SET KEYCOMP TO DOS, the default push button is always the same and is chosen by pressing Ctrl+Enter.

If you SET KEYCOMP TO WINDOWS, the default button in a dialog is surrounded by a bold border and is always the same. It is chosen by pressing Enter or Ctrl+Enter. However, pressing Enter when a text editing region is the current control moves the cursor to the next line in the text editing region. In text editing regions, press Ctrl+Enter to chose the default button.

If you SET KEYCOMP TO MAC, the default button in a dialog is surrounded by a bolder border and is always the same. It is chosen by pressing Enter. However, pressing Enter when a text editing region is the current control moves the cursor to the next line in the text editing region. In text editing regions, press Ctrl+Enter to chose the default button.

Escape Push Buttons

An escape push button is automatically chosen when you press the Esc key. An escape button is typically used to exit a data-entry screen, dialog or routine and discard any changes made in the screen, dialog or routine. You can specify only one escape push button for each READ.

In the absence of an escape push button, pressing Esc when editing an @ ... GET input field ends the editing and restores the original value to the field. If the field has a VALID procedure, the procedure isn't executed. When an escape push button is present, pressing Esc saves the contents of the current @ ... GET input field contents and executes the VALID procedure.

To create an escape push button, place a backslash and a question mark (\?) before the push button's prompt.

The following example specifies the Cancel push button as the escape push button:

STORE 1 TO mchoice
@ 2,2 GET mchoice FUNCTION '* OK;\?Cancel'
READ

Push Buttons with Combined Characteristics

You can create a push button with more than one special feature. In the following example, the OK button is the default button and is assigned O as its hot key character. The Cancel button is the escape button and is assigned C as its hot key character. The hot key designators immediately precede the desired hot key character.

STORE 1 TO mchoice
@ 2, 2 GET mchoice FUNCTION '*  \!\<OK;\?\<Cancel'
READ

FONT <expC3> [, <expN1>]

The character expression <expC3> is the name of the font, and the numeric expression <expN1> is the font size. For example, the following clause can be used to display the push button prompts in 16-point Courier font:

FONT 'Courier', 16

If you include the FONT clause but omit the font size <expN1>, a 10-point font is used.

In FoxPro for Windows, if the font you specify is not available, a font with similar font characteristics is substituted.

In FoxPro for Macintosh, if the font you specify is not available, the Chicago font is used.

In FoxPro for MS-DOS, the FONT clause is ignored.

If the FONT clause is omitted and the push buttons are placed in the main FoxPro window, the main FoxPro window font is used. If the FONT clause is omitted and the push buttons are placed in a user-defined window, the user-defined window font is used.

STYLE <expC4>

In FoxPro for Windows and FoxPro for Macintosh, include the STYLE clause to specify a font style for the push button prompts. If the font style you specify is not available, a font style with similar characteristics is substituted.

The font style is specified with <expC4>. If the STYLE clause is omitted, the normal font style is used.

Character	Font Style

B	Bold

C	Condense*

E	Extend*

I	Italic

N	Normal

O	Outline

S	Shadow

-	Strikeout*

U	Underline

*The Condense and Extend styles are available only in FoxPro for Macintosh. The Strikeout style is available only in FoxPro for Windows.

You can include more than one character to specify a combination of font styles. For example, the following clause specifies Bold Italic:

STYLE 'BI'

The STYLE clause is ignored in FoxPro for MS-DOS.

DEFAULT <expr>

When you choose a push button, your choice is saved in the memory variable, array element or field you specify. If you specify a memory variable that doesn't exist, it is automatically created and initialized if you include DEFAULT. However, an array element isn't created if you specify an array element in a DEFAULT clause. The DEFAULT clause is ignored if the memory variable already exists or you specify a field.

Note   If the DEFAULT clause isn't included and the memory variable you specify doesn't exist, the error message "Variable not found" appears.

The DEFAULT expression <expr> determines the type of memory variable created and its initial value. <expr> must be of numeric or character type. The following are examples of DEFAULT clauses for push buttons:

@ 2,2 GET mchoice FUNCTION '* OK;Cancel' DEFAULT 'OK'
READ

@ 2,2 GET mchoice FUNCTION '* OK;Cancel' DEFAULT 2
READ

STORE 'OK' TO button
@ 2,2 GET mchoice FUNCTION '* OK;CANCEL' DEFAULT button
READ

SIZE <expN2>, <expN3> [, <expN4>]

The numeric expression <expN2> specifies the height in rows of the push buttons. In FoxPro for MS-DOS, a push button is always one line high, so the numeric expression <expN2> is ignored.

By default, the width of each individual button is determined by the length of the push button prompt text. The numeric expression <expN3> specifies the width (in columns) of each push button. A push button will never be sized smaller than its prompt.

By default, no rows are placed between vertical buttons and a single column is placed between horizontal buttons. The spacing between push buttons is specified with <expN4>. If you create vertical push buttons, <expN4> specifies the number of rows between the buttons. If you create horizontal buttons, <expN4> specifies the number of columns between the buttons.

In FoxPro for Windows and FoxPro for Macintosh, the push button font determines the size of the push buttons. The push button font is specified with the FONT clause. If the FONT clause is omitted, the push buttons use the font of the parent window (the main FoxPro window or a user-defined window).

The following example demonstrates how the SIZE clause controls the button spacing:

CLEAR
@ 2,2 GET mchoice FUNCTION '* OK;Cancel' ;
DEFAULT 1 SIZE 2, 10, 1
@ 2,16 GET mchoice FUNCTION '* OK;Cancel' ;
DEFAULT 1 SIZE 2, 10, 2
READ

ENABLE | DISABLE

Push buttons by default are enabled when READ or READ CYCLE is issued. You can prevent a set of buttons from being selected when READ or READ CYCLE is issued by including DISABLE.

Disabled push buttons cannot be selected and are displayed in the disabled colors. To disable individual push buttons instead of the entire set, see "Disabled Push Buttons" earlier in this section. Use SHOW GET ENABLE to enable a set of disabled push buttons.

MESSAGE <expC5>

The MESSAGE clause character expression <expC5> appears when a push button is selected. In FoxPro for MS-DOS, the message is centered by default on the last line of the main FoxPro window. The message location can be changed with SET MESSAGE.

In FoxPro for Windows and FoxPro for Macintosh, the message is placed in the graphics-based status bar. If the graphics-based status bar has been turned off with SET STATUS BAR OFF, the message is placed on the last line of the main FoxPro window.

VALID <expL1> | <expN5>

You can include an optional VALID expression <expL1> or <expN5> that is evaluated when a push button is chosen. That is, VALID isn't evaluated when you select (move to) a button, but when you actually choose a button by pressing Enter or Spacebar or clicking the button.

Typically, <expL1> or <expN5> is a user-defined function (UDF). With a user-defined function you can select, enable or disable other objects, open a Browse window, open another data-entry screen, or move to a new record. CLEAR READ can be included in the user-defined function to terminate the READ.

<expL1>

When a logical value is returned to the VALID clause, the logical value is ignored and the push buttons remain the active control. However, you can specify a UDF that returns a logical value to the VALID clause and activates another object.

<expN5>

A VALID clause that includes a numeric expression is used to specify which object is activated after a push button is chosen. Objects are @ ... GET input fields, check boxes, lists, popups, spinners, text-editing regions and each individual button in a set of push, radio and invisible buttons.

The expression <expN5> has one of three effects:

When <expN5> = 0, the push button you choose remains the active button.

When <expN5> is positive, <expN5> indicates the number of objects to advance. For example, when the last button in a set of push buttons is selected and VALID returns 1, the next object is activated. If <expN5> is greater than the number of objects remaining, the READ is terminated (unless READ CYCLE is issued to activate the objects).

When <expN5> is negative, <expN5> indicates the number of objects to move back. For example, when the first button in a set of push buttons is selected and VALID returns -1, the previous object is activated. If <expN5> moves back past the first object, the READ is terminated (unless READ CYCLE is issued to activate the objects).

The following is an example of what you can do with a user-defined function. Five buttons are displayed vertically. The button choices are used to position the record pointer. The N option is included so the READ isn't terminated when you choose a button. When you choose a button, the user-defined function GOREC is executed.

CLOSE DATABASES
USE customer

SET TALK OFF
DEFINE WINDOW one FROM 3,5 TO 18,20 FLOAT DOUBLE COLOR SCHEME 5
ACTIVATE WINDOW one
@ 1,2 GET mchoice FUNCTION '*NV Next;Prior;Top;Bottom;Quit';
SIZE 2, 10, 1 VALID GOREC( ) DEFAULT 1
READ CYCLE
CLEAR WINDOW

PROCEDURE gorec
DO CASE
CASE mchoice = 1
SKIP
IF EOF( )
SKIP -1
ENDIF
CASE mchoice = 2
SKIP -1
IF BOF( )
 	SKIP
ENDIF
CASE mchoice = 3
GO TOP
CASE mchoice = 4
GO BOTTOM
CASE mchoice = 5
CLEAR READ
ENDCASE
@ 12,6 SAY ALLTRIM(STR(RECNO( )))
RETURN

WHEN <expL2>

The WHEN clause allows or prohibits selection of a set of push buttons based on the logical value of <expL2>, which must evaluate to a logical true (.T.) before the push buttons can be selected. If <expL2> evaluates to a logical false (.F.), the push buttons cannot be selected and are skipped over if placed between other objects.

COLOR SCHEME <expN6> | COLOR <color pair list>

If you do not include a COLOR clause, push button colors are determined by the color scheme for the main FoxPro window; if push buttons are placed in a user-defined window, the window's color scheme determines the push button colors.

The colors of push buttons can be specified by including the number of an existing color scheme in the COLOR SCHEME clause or a set of color pairs in the COLOR clause.

A color scheme is a set of 10 predefined color pairs. The color pairs in a color scheme can be changed with SET COLOR OF SCHEME. In FoxPro for MS-DOS, the color pairs in a color scheme can also be changed in the Color Picker.

A color pair is a set of two letters separated by a forward slash. The first letter specifies the foreground color and the second letter specifies the background color.

For example, this color pair specifies a red foreground on a white background:

R/W

For a list of colors and their corresponding color letters, see SET COLOR Overview or Color Table by Color Pair.

A color pair can also be specified with a set of six RGB (Red Green Blue) color values separated by commas. The first three color values specify the foreground color and the second three color values specify the background color. The color values can range from 0 through 255.

The R/W color pair in the example above can also be specified with this RGB color pair:

RGB(255,0,0,255,255,255)

In FoxPro for Windows and FoxPro for Macintosh, the COLOR clause does not affect the color of push buttons. Only the message color (if the message is not displayed in the status bar) is affected by the COLOR clause.

The following table lists the color pairs and what each color pair in the list controls.

Color Pair	Push Button
Number	 Attribute

5	Message

6	Selected button prompt (supported in FoxPro for MS-DOS only)

7	Hot keys (supported in FoxPro for MS-DOS only)

9	Enabled button prompt (supported in FoxPro for MS-DOS only)

10	Disabled button prompt (supported in FoxPro for MS-DOS only)

The following example creates OK and Cancel push buttons with the hot keys O and C respectively. In addition, the buttons have the following color characteristics:

The selected button is shown with a bright white prompt on a blue background (W+/B).

Hot key characters are shown in red on a blue background (R/B).

Enabled buttons are shown with a yellow prompt on a blue background (GR+/B).

Disabled buttons are shown with a white prompt on a blue background (W/B).

When you skip a color pair, you must include a comma where the color pair is omitted.

Here are the commands:

STORE 1 TO mchoice
@ 2,2 GET mchoice FUNCTION '* \<OK;\<CANCEL;\\DISABLED';
COLOR ,,,,,W+/B,R/B,,GR+/B,W/B
READ


@ ... GET - Push Buttons SeeAlso
See Also

@ ... SAY

@ ... GET

Controls Overview

_CUROBJ

Fonts

OBJNUM( )

READ

SET KEYCOMP

SHOW GET

User-Defined Functions (UDFs)


@ ... GET - Radio Buttons
@ ... GET [image] Radio Buttons

See Also	Example

Creates a set of radio buttons or picture radio buttons.

Syntax

@ <row, column>
GET <memvar> | <field>
FUNCTION <expC1> | PICTURE <expC2>
[FONT <expC3> [, <expN1>]]
[STYLE <expC4>]
[DEFAULT <expr>]
[SIZE <expN2>, <expN3> [, <expN4>]]
[ENABLE | DISABLE]
[MESSAGE <expC5>]
[VALID <expL1> | <expN5>]
[WHEN <expL2>]
[COLOR SCHEME <expN6>
| COLOR <color pair list>]

Remarks

This variation of @ ... GET creates a set of radio buttons. As their name suggests, radio buttons are similar to the buttons of a car radio [image] choosing a button makes your choice current and releases your previous choice. A bullet next to a radio button indicates that it is the current choice.

If you use the Screen Builder to create your data-entry screens, you might not have to use this command at all. The Screen Builder automatically generates the commands that create radio buttons and picture radio buttons.

The string of text to the right of each button is called a prompt. The text of the prompt is specified with the FUNCTION or PICTURE clause. Issue READ or READ CYCLE to activate the buttons.

You can create picture radio buttons in FoxPro for Windows and FoxPro for Macintosh. Pictures replace the radio button prompts.

Clauses

<row, column>

Row and column are numeric expressions with values of 0 or greater that determine where the first button in a set of radio buttons appears.

The first row is number 0 in the main FoxPro window or a user-defined window. Rows are numbered from top to bottom. In FoxPro for Windows, row 0 is the row immediately under the FoxPro system menu bar. In FoxPro for Macintosh, row 0 is the row immediately under the FoxPro title bar. In FoxPro for MS-DOS, row 0 is the row the FoxPro system menu bar occupies. See SET SYSMENU for information about manipulating the system menu bar so you can place output on row 0 in FoxPro for MS-DOS.

The first column is number 0 in the main FoxPro window or a user-defined window. Columns are numbered from left to right.

When the first button in a set of radio buttons is directed to a user-defined window, the row and column coordinates are relative to the user-defined window, not the main FoxPro window.

In FoxPro for Windows and FoxPro for Macintosh, a position in the main FoxPro window or in a user-defined window is determined by the font of the main FoxPro window or the user-defined window. Most fonts can be displayed in a wide variety of sizes, and some are proportionally spaced. A row corresponds to the height of the current font; a column corresponds to the average width of a letter in the current font.

In FoxPro for Windows and FoxPro for Macintosh, you can position the first button in a set of radio buttons in a window with decimal fractions for row and column coordinates. In FoxPro for MS-DOS, decimal fractions used for row and column coordinates are rounded to the nearest integer value.

GET <memvar> | <field>

When you choose a radio button, your choice is stored to the memory variable or array element <memvar> or to the field <field>. <memvar> or <field> must be of numeric or character type.

If <memvar> or <field> is of numeric type, a number corresponding to your radio button choice is stored to the memory variable, array element or field specified with <memvar> or <field>. For example, if you create three radio buttons and choose the second button, 2 is stored. If <memvar> or <field> is of character type, the prompt of the radio button you choose is stored to the memory variable, array element or field specified with <memvar> or <field>.

Initial Radio Button Selection

When a set of radio buttons appears, the value of <memvar> or <field> determines which radio button (if any) is initially selected.

If <memvar> or <field> is numeric, the radio button corresponding to the numeric value is initially selected. For example, if <memvar> or <field> is 1, the first radio button you define is initially selected. If <memvar> or <field> doesn't correspond to any of the buttons (the value is less than 1 or greater than the number of radio buttons) no button is initially selected.

If <memvar> or <field> is of character type, a case-sensitive comparison is made between <memvar> or <field> and each radio button prompt. When the comparison is made, all special characters and any leading or trailing spaces are removed from the button prompts. If a match is found, the matching button is initially selected. If a match can't be found, no button is initially selected.

FUNCTION <expC1> | PICTURE <expC2>

When creating a set of radio buttons, you must include the FUNCTION clause, the PICTURE clause or both. There is no advantage to any of the three methods. The FUNCTION or PICTURE clause contains the radio button specification code *R and the text for the individual radio button prompts.

The FUNCTION character expression <expC1> must begin with *R. To create the radio button prompts, include a space after *R  followed by a list of the prompts separated by semicolons. One button is created for each prompt. For example, the following FUNCTION clause creates three radio buttons with the prompts None, Single and Double:

... FUNCTION '*R None;Single;Double' ...

The PICTURE character expression <expC2> uses the same syntax as the FUNCTION  expression except the PICTURE expression must begin with @ followed by *R. For example, the following PICTURE clause creates three radio buttons with the prompts None, Single and Double:

... PICTURE '@*R None;Single;Double' ...

You can also include both the FUNCTION and PICTURE clauses to create radio buttons. If both are included, the FUNCTION character expression <expC1> must contain *R to create the radio buttons and can also include a space and some radio button prompts. The PICTURE character expression <expC2> can include prompts to create additional radio buttons.

The following examples illustrate the various forms of syntax you can use to create a set of radio buttons. The radio buttons begin in the second row and second column. Three radio buttons are created with the prompts None, Single and Double. A number corresponding to the button chosen is stored to the memory variable MCHOICE.

FUNCTION clause only:

STORE 1 TO mchoice
@ 2,2 GET mchoice FUNCTION '*R None;Single;Double'
READ

STORE 1 TO mchoice
STORE '*R None;Single;Double' TO mfunc
@ 2,2 GET mchoice FUNCTION mfunc
READ

PICTURE clause only:

STORE 1 TO mchoice
@ 2,2 GET mchoice PICTURE '@*R None;Single;Double'
READ

FUNCTION and PICTURE clause:

STORE 1 TO mchoice
@ 2,2 GET mchoice FUNCTION '*R' PICTURE ' None;Single;Double'
READ

STORE 1 TO mchoice
@ 2,2 GET mchoice FUNCTION '*R None;Single' PICTURE ';Double'
READ

Radio Buttons with Picture Prompts

In FoxPro for Windows and FoxPro for Macintosh, the prompt for a radio button can also be the name of a picture file. In FoxPro for Macintosh, you can use a picture file of PICT type or a .BMP bitmap file.

When a radio button uses a picture file for a prompt, the radio button mimics the behavior of a radio button with a text prompt. For example, the picture file appears but the radio button isn't displayed. Like choosing a radio button, choosing the picture prompt stores the radio button's value to <memvar> or <field>.

To use a picture file in a radio button, add B to the radio button specification code. The FUNCTION and PICTURE clause specification codes that create a radio button are *R and @*R, respectively. To create a radio button with picture prompts, use the codes *RB and @*RB, followed by a space and the picture filename. If the picture file is not located in the default directory or folder, include the path to picture file with the picture filename.

Note   The pictures aren't clipped, reduced or enlarged to fit the radio button. Use the SIZE clause to adjust the size of the radio buttons to accommodate the pictures.

If you omit the extension for the picture file, FoxPro for Macintosh first looks for a picture file with the name you specified and a .BMP extension. If a picture file with a .BMP extension and the name you specified isn't found, FoxPro for Macintosh then looks for a file with the name you specified and a .PCT extension. If a picture file with a .PCT extension and the name you specified isn't found, FoxPro for Macintosh then looks for a picture file with the name you specified without an extension.

Picture Masks and Radio Buttons

In FoxPro for Windows and FoxPro for Macintosh, a picture radio button has three states: up, down and disabled. FoxPro automatically controls the appearance a picture radio button when it is in each of these three states, but you can override the default appearance by using a picture mask.

A mask is used to control the transparent areas of a picture radio button. By default, the white areas are transparent. If a mask is present, the white areas of the mask, not the picture file, are transparent.

A mask is a monochrome picture file. In FoxPro for Windows, a mask is a .BMP with an .MSK extension. In FoxPro for Macintosh, a mask can be a .BMP with an .MSK extension or a PICT type file with a .PCM extension. The mask must have the same base name as the picture file and the appropriate extension. FoxPro automatically looks for a mask for a picture file in the same directory or folder where the picture file is located.

In most cases, a mask isn't necessary. If you don't need anything in your picture to appear white or your picture file has a white background, the picture radio button will appear as desired in the up, down and disabled states.

When a picture radio button has a mask and is in the up or down state, any white areas in the picture file appear transparent, allowing the color of the button face to show through. However, you can maintain the white color of certain areas. Suppose that you have a picture file with a dog on a white background; the dog has white eyes and the button face is red. You want the background of the button to appear red but you want the dog's eyes to be white, not red. Make a mask that is the same size as the picture file but includes only two colors, black and white. Leave the background of the mask white but make the dog [image] including his eyes [image] completely black. When the button appears, the background is red to match the button face but the dog's eyes are white.

When a picture radio button is disabled, any white areas in the picture file appear transparent so the color of the button face shows through. Any non-white areas appear dark gray. If the button has a mask, all white areas in the mask are transparent so the color of the button face shows through, and all black areas appear dark gray.

PICTURE and FUNCTION Options N, T, H, V, 2 and 3

Additional options can be combined with the *R specification code to modify the behavior (N and T) and appearance (H, V, 2 and 3) of radio buttons.

The 2 (two-dimensional) and 3 (three-dimensional) specification codes are only available in FoxPro for Macintosh.

Option	Description

N	Does not terminate the READ when a radio button is chosen. This is the default behavior.

T	Terminates the READ when a radio button is chosen.

H	Positions the radio buttons in a horizontal row.

V	Positions the radio buttons in a vertical column. This is the default orientation.

2	Creates flat (two-dimensional) radio buttons identical to radio buttons in Macintosh dialogs. This is the default radio button type in FoxPro for Macintosh.

3	Creates three-dimensional radio buttons identical to radio buttons in FoxPro for Macintosh dialogs.

You can combine the T or N options with the H or V and 2 or 3 options. For example, the following clause creates a vertical row of radio buttons and doesn't cause the READ to terminate when a button is chosen:

... FUNCTION '*RNV ... '

In FoxPro for Macintosh, the following clause creates a vertical row of two-dimensional radio buttons and doesn't cause the READ to terminate when a button is chosen:

... FUNCTION '*RNV2 ... '

Radio Buttons with Special Features

You can assign a hot key to a radio button or disable a radio button. To assign these special features to a radio button, you must include special characters when defining the prompt. The special characters are removed when the prompt is stored to <memvar> or <field>.

Hot Keys

In FoxPro for MS-DOS, a hot key is a highlighted letter in a radio button prompt that you can type to immediately choose the radio button. Pressing the hot key selects the radio button and chooses it. To assign a hot key, place a backslash and a less-than sign (\<) before the desired character of the radio button prompt.

A hot key doesn't choose the radio button if the current object is a GET field, a text-editing region, a popup or a list.

If the current object is an @ ... GET input field or a text-editing region, pressing the hot key enters the character in the field or the text-editing region. If the current object is a pop-up or a list, pressing the hot key selects the first option in the popup or list whose prompt begins with the hot key character.

In FoxPro for Windows, a hot key is an underlined letter in the radio button prompt that you can type to immediately choose the radio button. If the current object is an @ ... GET input field, a text-editing region, a popup or a list and KEYCOMP is set to WINDOWS, you can press the Alt key and the hot key to choose the radio button.

In FoxPro for Macintosh, the KEYCOMP setting determines if hot keys are underlined. If KEYCOMP is set to DOS or WINDOWS, hot keys are underlined. If KEYCOMP is set to MAC, hot keys are not underlined but are still available.

The following example creates three radio buttons with the prompts None, Single and Double and assigns the hot keys N to None, S to Single and D to Double:

STORE 1 TO mchoice
@ 2,2 GET mchoice FUNCTION '*R' PICTURE '\<None;\<Single;\<Double'
READ

Disabled Radio Buttons

You can disable a radio button so it can't be selected or chosen. Disabled buttons are shown in disabled colors. To disable a single radio button, place two backslashes (\\) before the button's prompt. To disable a set of radio buttons, use DISABLE, which is discussed later in this section.

The radio button with the prompt Single is disabled in this example:

STORE 1 TO mchoice
@ 2,2 GET mchoice FUNCTION '*R' PICTURE 'None;\\Single;Double'
READ

FONT <expC3> [, <expN1>]

The character expression <expC3> is the name of the font, and the numeric expression <expN1> is the font size. For example, the following clause can be used to display the radio button prompts in 16-point Courier font:

FONT 'Courier', 16

If you include the FONT clause but omit the font size <expN1>, a 10-point font is used.

In FoxPro for Windows, if the font you specify is not available, a font with similar font characteristics is substituted.

In FoxPro for Macintosh, if the font you specify is not available, the Chicago font is used.

In FoxPro for MS-DOS, the FONT clause is ignored.

If the FONT clause is omitted and the radio buttons are placed in the main FoxPro window, the main FoxPro window font is used. If the FONT clause is omitted and the radio buttons are placed in a user-defined window, the user-defined window font is used.

STYLE <expC4>

In FoxPro for Windows and FoxPro for Macintosh, include the STYLE clause to specify a font style for the radio button prompts. If the font style you specify is not available, a font style with similar characteristics is substituted.

The font style is specified with <expC4>. If the STYLE clause is omitted, the normal font style is used.

Character	Font Style

B	Bold

C	Condense*

E	Extend*

I	Italic

N	Normal

O	Outline

Q	Opaque

S	Shadow

-	Strikeout*

T	Transparent

U	Underline

*The Condense and Extend styles are available only in FoxPro for Macintosh. The Strikeout style is available only in FoxPro for Windows.

You can include more than one character to specify a combination of font styles. For example, the following clause specifies Bold Italic:

STYLE 'BI'

The STYLE clause is ignored in FoxPro for MS-DOS.

DEFAULT <expr>

When you choose a radio button, your choice is saved in the memory variable, array element or field you specify. If you specify a memory variable that doesn't exist, it is automatically created and initialized if you include the DEFAULT clause. However, an array element isn't created if you specify an array element in a DEFAULT clause. The DEFAULT clause is ignored if the memory variable already exists or you specify a field.

If the DEFAULT clause isn't included and <memvar> doesn't exist, the error message "Variable not found" appears.

The DEFAULT expression <expr> determines the type of memory variable created and its initial value. <expr> must be of numeric or character type. Here are examples of DEFAULT clauses for radio buttons:

@ 2,2 GET mchoice FUNCTION '*R' + ;
'None;Single;Double' DEFAULT 'Single'
READ

@ 2,2 GET mchoice FUNCTION '*R None;Single;Double' ;
DEFAULT 2
READ

SIZE <expN2>, <expN3> [, <expN4>]

The size <expN2> clause specifies the height in rows of the radio buttons. In FoxPro for MS-DOS, a radio button is always one line high, so the numeric expression <expN2> is ignored.

By default, the width of each individual button is determined by the length of the radio button prompt text. <expN3> specifies the width (in columns) of each radio button.

By default, no rows are placed between vertical buttons and a single column is placed between horizontal buttons. The spacing between radio buttons in rows is specified with <expN4>.

In FoxPro for Windows and FoxPro for Macintosh, the radio button font determines the size of the editing region. The radio button font is specified with the FONT clause. If the FONT clause is omitted, the radio buttons use the font of the parent window (the main FoxPro window or a user-defined window).

This example demonstrates how the SIZE clause control's the button spacing:

CLEAR
@ 2,2 GET mchoice1 FUNCTION '*R'+ '\<None;\<Single;\<Double' ;
DEFAULT 'None' SIZE 1, 12, 1
@ 2,16 GET mchoice2 FUNCTION '*R'+ '\<None;\<Single;\<Double' ;
DEFAULT 'None' SIZE 1, 12, 3
READ

ENABLE | DISABLE

Radio buttons are by default enabled when READ or READ CYCLE is issued. You can prevent a set of radio buttons from being selected when READ or READ CYCLE is issued by including DISABLE.

Disabled radio buttons cannot be selected and are displayed in the disabled colors. To disable individual radio buttons instead of an entire set, see "Disabled Radio Buttons" earlier in this section. Use SHOW GET ENABLE to enable a set of disabled radio buttons.

MESSAGE <expC5>

The MESSAGE clause character expression <expC5> appears when a radio button is selected. In FoxPro for MS-DOS the message is by default centered on the last line of the main FoxPro window. The message location can be changed with SET MESSAGE.

In FoxPro for Windows and FoxPro for Macintosh, the message is placed in the graphics-based status bar. If the graphics-based status bar has been turned off with SET STATUS BAR OFF, the message is placed on the last line of the main FoxPro window.

VALID <expL1> | <expN5>

You can include an optional VALID expression <expL1> or <expN5> that is evaluated when a radio button is chosen. That is, VALID isn't evaluated when you select (move to) a radio button, but when you actually choose the radio button by pressing Enter, Spacebar or clicking on the radio button.

Typically, <expL1> or <expN5> is a user-defined function (UDF). With a user-defined function (UDF) you can select, enable or disable other objects, open a Browse window, open another data-entry screen or move to a new record. CLEAR READ can be included in the user-defined function to terminate the READ.

<expL1>

When a logical value is returned to the VALID clause, the logical value is ignored and the radio buttons remain the active control. However, you can specify a UDF that returns a logical value to the VALID clause and activates another object.

<expN5>

A VALID clause that includes a numeric expression is used to specify which object is activated after a radio button is chosen. Objects are @ ... GET input fields, check boxes, lists, popups, spinners, text-editing regions and each individual button in a set of push, radio and invisible buttons.

The expression <expN5> has one of three effects:

When <expN5> = 0, the chosen radio button remains the active button.

When <expN5> is positive, <expN5> indicates the number of objects to advance. For example, when the last radio button in a set of radio buttons is selected and VALID returns 1, the next object is activated. If <expN5> is greater than the number of remaining objects, the READ is terminated (unless READ CYCLE is issued to activate the objects).

When <expN5> is negative, <expN5> indicates the number of objects to move back. For example, when the first radio button in a set of radio buttons is selected and VALID returns -1, the previous object is activated. If <expN5> moves back past the first object, the READ is terminated (unless READ CYCLE is issued to activate the objects).

WHEN <expL2>

The WHEN clause allows or prohibits selection of a set of radio buttons based on the logical value of <expL2>, which must evaluate to a logical true (.T.) before the radio buttons can be selected. If <expL2> evaluates to a logical false (.F.), the radio buttons cannot be selected and are skipped over if placed between other objects.

COLOR SCHEME <expN6> | COLOR <color pair list>

If you do not include a COLOR clause, radio button colors are determined by the color scheme for the main FoxPro window; if radio buttons are placed in a user-defined window, the window's color scheme determines the radio button colors.

The colors of radio buttons can be specified by including the number of an existing color scheme in the COLOR SCHEME clause or a set of color pairs in the COLOR clause.

A color scheme is a set of 10 predefined color pairs. The color pairs in a color scheme can be changed with SET COLOR OF SCHEME. In FoxPro for MS-DOS the color pairs in a color scheme can also be changed in the Color Picker.

A color pair is a set of two letters separated by a forward slash. The first letter specifies the foreground color and the second letter specifies the background color.

For example, this color pair specifies a red foreground on a white background:

R/W

For a list of colors and their corresponding color letters, see SET COLOR Overview or Color Table by Color Pair.

A color pair can also be specified with a set of six RGB (Red Green Blue) color values separated by commas. The first three color values specify the foreground color and the second three color values specify the background color. The color values can range from 0 through 255.

The R/W color pair in the example above can also be specified with this RGB color pair:

RGB(255,0,0,255,255,255)

The following table lists the color pairs and what each color pair in the list controls.

Color Pair 	Radio Button
Number	Attribute

5	Message

6	Selected radio prompt

7	Hot keys

9	Enabled radio prompt

10	Disabled radio prompt

This example shows how to override one color scheme with another predefined color scheme:

STORE 1 TO mchoice
@ 2,2 GET mchoice FUNCTION '*R None;Single;Double';
COLOR SCHEME 4
READ

The following example creates None, Single and Double radio buttons with the hot keys N for None and S for Single. In addition, the buttons have the following color characteristics:

The selected button is shown with a bright white prompt on a blue background (W+/B).

Hot key characters are shown in red on a blue background (R/B).

Enabled buttons are shown with a yellow prompt on a blue background (GR+/B).

Disabled buttons are shown with a white prompt on a blue background (W/B).

When you skip a color pair, you must include a comma where the color pair is omitted.

Here are the commands:

STORE 1 TO mchoice
@ 2,2 GET mchoice FUNCTION '*R \<None;\<Single;\\Double';
COLOR ,,,,,W+/B,R/B,,GR+/B,W/B
READ


@ ... GET - Radio Buttons Example
@ ... GET [image] Radio Buttons Example

CLOSE DATABASES
SET TALK OFF
CLEAR
USE customer

*** Define and activate window for GET information. ***

DEFINE WINDOW one FROM 3, 5 TO 13, 33 FLOAT DOUBLE COLOR SCHEME 5
ACTIVATE WINDOW one

*** Define a set of radio buttons. ***

@ 1,2 GET mchoice FUNCTION '*RNV Next;Prior;Top;Bottom';
SIZE 1, 10, 1 DEFAULT 'Next'

*** Define a set of push buttons to terminate the READ. ***

@ 3,15 GET okcancel FUNCTION '*V \!OK;\?Cancel' DEFAULT 1;
SIZE 1, 10, 1
READ CYCLE

*** If Cancel was selected, ***

IF okcancel = 2
WAIT WINDOW 'Cancel Selected' NOWAIT
ELSE

*** If OK is selected, move record pointer to user's choice. ***

DO CASE
CASE mchoice = 'Next'
SKIP
IF EOF( )
SKIP -1
ENDIF
CASE mchoice = 'Prior'
IF !BOF( )
SKIP -1
ENDIF
CASE mchoice = 'Top'
GO TOP
CASE mchoice = 'Bottom'
GO BOTTOM
ENDCASE

*** Display user's choice ***

WAIT WINDOW mchoice + ' Selected' NOWAIT
ENDIF
CLEAR WINDOW


@ ... GET - Radio Buttons SeeAlso
See Also

@ ... SAY

GET

Controls Overview

_CUROBJ

Fonts

OBJNUM( )

READ

SET KEYCOMP

SHOW GET

User-Defined Functions (UDFs)


DISPLAY Command

See Also

Displays the contents of records in the current table and the results of expressions.

Syntax

DISPLAY
[[FIELDS] <field list>]
[<scope>]
[FOR <expL1>]
[WHILE <expL2>]
[OFF]
[TO PRINTER [PROMPT] | TO FILE <file>]
[NOCONSOLE]
[NOOPTIMIZE]

Remarks

DISPLAY fills the entire desktop in FoxPro for MS-DOS, main FoxPro window or user-defined window with information and then pauses.  Press any key or click anywhere to see the next set of information.  DISPLAY is similar to LIST, except that LIST displays the same information in a continuous stream without pausing.

DISPLAY can also be used to display the results of expressions, which can consist of literals, memory variables and arrays, fields, and memo fields.  Field names and expressions are displayed unless SET HEADINGS is OFF.

Clauses

FIELDS <field list>

All fields from the table are displayed unless you include FIELDS <field list>.  Then, only the fields included in the field list are displayed.

Memo field contents aren't displayed unless the memo field name is explicitly included in the field list.  The displayed width of memo fields is determined by SET MEMOWIDTH.

<scope>

The scope clauses are:  ALL, NEXT <expN>, RECORD <expN>, and REST.  These are explained in the Overview of the FoxPro Language chapter in the FoxPro Language Reference.  Commands which include <scope> operate only on the table in the active work area.

You can specify a scope of records to display.  Only the records that fall within the range of records specified by the scope are displayed.

The default scope for DISPLAY is the current record (NEXT 1).

FOR <expL1>

Including the FOR clause lets you conditionally display records, filtering out undesired records.  If the FOR clause is included, only the records that satisfy the logical condition <expL1> are displayed.

Rushmore optimizes a query created with DISPLAY ... FOR if <expL1> is an optimizable expression.  For best performance, use an optimizable expression in the FOR clause.  A discussion of Rushmore optimizable expressions appears in the Optimizing Your Application chapter in the FoxPro Developer's Guide.

WHILE <expL2>

If the WHILE clause is included, records are displayed for as long as the logical expression <expL2> evaluates to true (.T.).

OFF

Include OFF to suppress record number display.  If OFF is omitted, the record number is displayed before each record.

TO PRINTER [PROMPT] | TO FILE <file>

Include TO PRINTER to direct output from DISPLAY to a printer.

In FoxPro for Windows and FoxPro for Macintosh, you can include the optional PROMPT clause to display a dialog before printing starts. Place the PROMPT key word immediately after TO PRINTER.  PROMPT is ignored in FoxPro for MS-DOS.

In this dialog you can adjust printer settings.  You can specify the number of copies and page numbers to print and direct print output to a file.  You can also adjust additional printer settings.  The printer settings you can adjust depend on the currently installed printer driver.

Include TO FILE <file> to direct output of the display to the disk file specified with <file>.

In FoxPro for MS-DOS, the output from DISPLAY directed to a file or a printer uses the settings from the printer driver setup if a printer driver setup is loaded.  Use a printer driver to print output from DISPLAY in different font styles and sizes.

NOCONSOLE

Include NOCONSOLE to suppress output to the desktop, main FoxPro window or the active user-defined window.

NOOPTIMIZE

To disable Rushmore optimization of DISPLAY, include NOOPTIMIZE.  For more information on NOOPTIMIZE, see SET OPTIMIZE and the discussion of Rushmore optimization in the Optimizing Your Application chapter in the FoxPro Developer's Guide.


DISPLAY SeeAlso
See Also

LIST Commands

SET HEADINGS Command

SET MEMOWIDTH Command


DISPLAY FILES Command

See Also

Displays information about specified files.

Syntax

DISPLAY FILES
[ON <drive>]
[LIKE <skel>]
[TO PRINTER [PROMPT] 	| TO FILE <file>]

Remarks

Use DISPLAY FILES to display information about files residing on a disk.  You can display information about all files on a specified disk drive or directory or only files that match a skeleton pattern containing wildcard characters.

Issuing DISPLAY FILES without any arguments displays information about tables in the current directory.  The information displayed includes:

The table name.

The number of records in the table.

The date and time of the last update to the table.

Clauses

ON <drive>

<drive> is the drive on which the files reside.

LIKE <skel>

If you include LIKE <skel>, FoxPro displays information only about files that match the skeleton pattern <skel>.  The skeleton pattern can contain wildcard characters.

TO PRINTER [PROMPT] | TO FILE <file>

Include TO PRINTER to direct output from DISPLAY FILES to a printer.

In FoxPro for Windows and FoxPro for Macintosh, you can include PROMPT to display a dialog before printing starts.  Place the PROMPT key word immediately after TO PRINTER.  PROMPT is ignored in FoxPro for MS-DOS.

In this dialog, you can adjust printer settings.  You can specify the number of copies and page numbers to print and direct print output to a file.  You can also adjust additional printer settings.  The printer settings you can adjust depend on the currently installed printer driver.

Include TO FILE <file> to direct output from DISPLAY FILES  to the disk file specified with <file>.

In FoxPro for MS-DOS, output from DISPLAY FILES directed to a file or a printer uses the settings from the printer driver setup if a printer driver setup is loaded.  Use a printer driver to print output from DISPLAY FILES in different font styles and sizes.


DISPLAY FILES SeeAlso
See Also

DIR or DIRECTORY Command

FILER Command

LIST Commands


DISPLAY MEMORY Command

See Also	Example

Displays the current contents of memory variables and arrays.

Syntax

DISPLAY MEMORY
[LIKE <skel>]
[TO PRINTER [PROMPT] | TO FILE <file>]
[NOCONSOLE]

Remarks

DISPLAY MEMORY shows the name, type, contents and status of all currently defined memory variables and memory variable arrays.  It also displays the number of memory variables defined, the number of bytes used and the number of additional memory variables available.

Information about system memory variables, menu bars and pads, popups and windows is also displayed.

The maximum number of memory variables you can create are listed in the capacities table of the FoxPro Developer's Guide.  These limits can be increased in your FoxPro configuration file.  For more information on configuring FoxPro, refer to the FoxPro Installation and Configuration manual.

Clauses

LIKE <skel>

You can selectively display information about memory variables and arrays by including the LIKE clause.  If you include LIKE <skel>, FoxPro displays the contents only of memory variables and arrays the match <skel>.  The file skeleton <skel> supports wildcard characters.  For example, to display all memory variables that begin with the letter A, use:

DISPLAY MEMORY LIKE A*

TO PRINTER [PROMPT] | TO FILE <file>

Include TO PRINTER to direct output from DISPLAY MEMORY to a printer.

In FoxPro for Windows and FoxPro for Macintosh, you can include PROMPT to display a dialog before printing starts. In this dialog you can adjust printer settings, including the number of copies and page numbers to print. The printer settings that you can adjust depend on the currently installed printer driver. Place the PROMPT key word immediately after TO PRINTER.  PROMPT is ignored in FoxPro for MS-DOS.

Include TO FILE <file> to direct output to the disk file specified with <file>.

In FoxPro for MS-DOS, output from DISPLAY MEMORY directed to a file or a printer uses the settings from the printer driver setup if a printer driver setup is loaded.  Use a printer driver to print output from DISPLAY MEMORY in different font styles and sizes.

NOCONSOLE

Include NOCONSOLE to suppress output to the desktop, the main FoxPro window or the active user-defined window.


DISPLAY MEMORY Example

In this example, several memory variables are created and assigned values.  DISPLAY MEMORY first displays all memory variables that begin with "sam" and then displays all memory variables that contain five letters and end with "exit."

STORE 'Goodbye' TO sample1
STORE 'Hello' TO sample2
STORE .T. TO texit
STORE .F. TO mexit
DISPLAY MEMORY LIKE sam*
DISPLAY MEMORY LIKE ?exit


DISPLAY MEMORY SeeAlso
See Also

DECLARE Command

DIMENSION Command

LIST Commands

STORE Command


DISPLAY STATUS Command

See Also

Displays the status of the FoxPro environment.

Syntax

DISPLAY STATUS
[TO PRINTER [PROMPT] | TO FILE <file>]
[NOCONSOLE]

Remarks

This form of DISPLAY lists information about the current FoxPro environment.  This information includes the following:

Table and index file information:

Active tables

Active memo files

Table aliases

Table relations

Active indexes

Index file keys

The controlling index file

Structural compound files

Compound index tags

The shared attribute status of each open table

The currently locked records in each table

The EXCLUSIVE use setting

The LOCK setting

The MULTILOCKS setting

The SET REFRESH value

The SET REPROCESS value

Open low-level file information:

Open low-level files

The file handle number for each low-level file

The file pointer position for each low-level file

Read/write attributes for each low-level file

Additional FoxPro environment information:

The procedure file in use

The processor type

The file search path

The default disk drive

The print destination

The margin setting

The current work area

SET command switch settings

Binary modules currently loaded

DDE information in FoxPro for Windows

Clauses

TO PRINTER [PROMPT] | TO FILE <file>

Include TO PRINTER to direct output from DISPLAY STATUS to a printer.

In FoxPro for Windows and FoxPro for Macintosh, you can include PROMPT to display a dialog before printing starts. In this dialog you can adjust printer settings, including the number of copies and page numbers to print. The printer settings that you can adjust depend on the currently installed printer driver. Place the PROMPT key word immediately after TO PRINTER.  PROMPT is ignored in FoxPro for MS-DOS.

Include TO FILE <file> to direct output to the disk file specified with <file>.

In FoxPro for MS-DOS, the output from DISPLAY STATUS directed to a file or a printer uses the settings from the printer driver setup if a printer driver setup is loaded.  Use a printer driver to print output from DISPLAY STATUS in different font styles and sizes.

NOCONSOLE

Include NOCONSOLE to suppress output to the desktop, the main FoxPro window or the active user-defined window.


DISPLAY STATUS SeeAlso
See Also

LIST Commands


DISPLAY STRUCTURE Command

See Also

Displays the structure of a table file.

Syntax

DISPLAY STRUCTURE
[IN <expN> | <expC>]
[TO PRINTER [PROMPT] | TO FILE <file>]
[NOCONSOLE]

Remarks

Use DISPLAY STRUCTURE to display the field structure of a table.  The name of each field in the table is displayed with its type and width.  If a field is numeric, the number of decimal places in the field is displayed.

DISPLAY STRUCTURE also displays the current number of records in the table and the date it was last updated.  If the table has an associated memo field, the memo field blocksize is shown.  The total width of all fields is also displayed.

The table can have a structural compound index that is opened with the table.  If a tag in the structural compound index has the same name as a field in the table and is indexed on that field, the order of the tag (ascending or descending) is displayed next to the field name.

If SET FIELDS is issued to limit access to fields in the table, an angle bracket (>) appears beside the names of fields that can be accessed.

IN <expN> | <expC>

DISPLAY STRUCTURE displays the structure of the table in the current work area.  You can display the structure of a table open in a different work area by specifying the work area number with <expN> or table alias with <expC>.

TO PRINTER [PROMPT] | TO FILE <file>

Include TO PRINTER to direct the output from DISPLAY STRUCTURE to a printer.

In FoxPro for Windows and FoxPro for Macintosh, you can include PROMPT to display a dialog before printing starts. In this dialog you can adjust printer settings, including the number of copies and page numbers to print. The printer settings that you can adjust depend on the currently installed printer driver. Place the PROMPT key word immediately after TO PRINTER.  PROMPT is ignored in FoxPro for MS-DOS.

Include TO FILE <file> to direct the output to the disk file specified with <file>.

In FoxPro for MS-DOS, the output from DISPLAY STRUCTURE directed to a file or a printer uses the settings from the printer driver setup if a printer driver setup is loaded.  Use a printer driver to print output from DISPLAY STRUCTURE in different font styles and sizes.

NOCONSOLE

Include NOCONSOLE to suppress output to the desktop, the main FoxPro window or the active user-defined window.


DISPLAY STRUCTURE SeeAlso
See Also

LIST Commands


DMY( ) Function

See Also	Example

Returns a specified date expression in Day Month Year format.

Syntax

DMY(<expD>)

Returns

Character

Remarks

DMY( ) returns a character string in a Day Month Year format (for example, 31 May 1965) from a date expression.  The month name isn't abbreviated.

If SET CENTURY is OFF, DMY( ) returns a character string in a DD Month YY format (for example, 31 May 65).  If SET CENTURY is ON, the format is DD Month YYYY (for example, 31 May 1965).

Parameter

<expD>

<expD> is the date expression you want to return in Day Month Year format.


DMY( ) Example

? DMY(DATE( ))

SET CENTURY ON
? DMY(DATE( ))


DMY() SeeAlso
See Also

MDY( ) Function

SET CENTURY Command

SET DATE Command


DO Command

See Also	Example

Executes a command or procedure file.

Syntax

DO <file>
[WITH <parm list>]
[IN <file>]

Remarks

DO executes a FoxPro program.  A program file can itself contain additional DO commands.  This nesting of DO commands is limited to a depth of 32.

When you use DO to run a program, the commands contained in the program file are executed until one of the following occurs:

RETURN is encountered.

CANCEL is executed.

Another DO is issued.

The end of the file is reached.

QUIT is executed.

When program execution is complete, control is returned to the calling program, the Command window, MS-DOS in FoxPro for MS-DOS, or Microsoft Windows in FoxPro for Windows or the Finder in FoxPro for Macintosh.

If you choose Do ...  from the Program menu and execute a program in a directory or on a drive other than the current directory or drive, FoxPro changes the default directory and drive to the directory and drive containing the program.

Clauses

<file>

<file> is the command or the name of the file to execute.

If you don't include an extension with the program you execute, FoxPro looks for and executes these versions of the program in the following order:

.EXE [image] The executable version

.APP [image] An application

.FXP [image] The compiled version

.PRG [image] The program

Multiple procedures within an executable version or an application (.APP) can have the same name.  When you issue DO in a procedure within an executable version or an application, only the main program of the executable version or application is searched for the specified procedure.

To use DO to execute a specific menu program, screen program or query, you must include its extension (.MPR, .SPR or .QPR).

In FoxPro for Macintosh, long program filenames are supported. Program filenames can be up to 31 characters. To distinguish a program filename with more than 10 characters from a procedure beginning with the same 10 characters, surround the program filename with quotation marks or include an extension after the program filename.

In all FoxPro versions, procedure and function names are significant to a limit of 10 characters. FoxPro cannot distinguish between two procedures or functions when the first 10 characters of their names match. This limit does not apply to program names.

If you plan on porting program files to other platforms such as FoxPro for MS-DOS or FoxPro for Windows, limit program filenames to 8 characters.

WITH <parm list>

Use the WITH clause to pass parameters to a program.  The parameters listed in <parm list> can be expressions, memory variables, literals, fields or user-defined functions (UDFs).  By default, parameters are passed to programs by reference.  You can pass a parameter by value by placing it in parentheses.  See SET UDFPARMS for a discussion of passing parameters by value or reference.  For more information on parameter passing, see PARAMETERS.  The maximum number of parameters you can pass to a program is 24.

IN <file>

Include the IN clause to execute a procedure in the program file specified with <file>.

When the file is located, the procedure is executed.  If the program file cannot be located, the message "File does not exist" is displayed.  If the program file is located but the specified procedure isn't in the program file, the message "Procedure not found" is displayed.


DO Example

In the following example, CUSTOMER.DBF is opened and the first record is displayed.  Choose a button to move forward or backward through the table or to the top or bottom of the table.  When you make a choice, FoxPro moves the record pointer by using DO to execute the appropriate procedure.  If you choose Quit, the program is exited.

CLOSE DATABASES
SET TALK OFF
DEFINE WINDOW customer FROM 3,3 TO 13,57 ;
FLOAT SHADOW DOUBLE
DEFINE WINDOW panel2 FROM 2, 61 TO 14,74 ;
FLOAT SHADOW DOUBLE COLOR SCHEME 5
USE customer
ACTIVATE WINDOW customer NOSHOW
@ 3,3 SAY 'Company'
@ 3,14 GET customer.company SIZE 1,35
@ 5,3 SAY 'Contact'
@ 5,14 GET customer.contact SIZE 1,35
@ 7,3 SAY 'City/State'
@ 7,14 GET customer.city SIZE 1,21
@ 7,36 GET customer.state
@ 7,39 GET customer.zip
@ 0,3 SAY 'Customer #'
@ 0,15 SAY cno SIZE 1,6
@ 0,36 SAY 'Record #'
@ 0,46 SAY RECNO( ) SIZE 1,3
ACTIVATE WINDOW panel2
@ 1,2 GET act PICTURE;
'@*VN Top;Prior;Next;Bottom;\?Quit' ;
SIZE 1,8,1 DEFAULT 0 VALID actvalid( )
READ CYCLE SHOW readshow( ) COLOR ,R/BG
RELEASE WINDOWS customer, panel2

FUNCTION actvalid
DO CASE
CASE act = 1
GO TOP
CASE act = 2
DO go_prev
CASE act = 3
DO go_next
CASE act = 4
GO BOTTOM
CASE act = 5
CLEAR READ
ENDCASE
SHOW GETS
RETURN 0

FUNCTION readshow
STORE WOUTPUT( ) TO currwind
IF SYS(2016) = 'customer' OR SYS(2016) = '*'
ACTIVATE WINDOW customer SAME
@ 0,15 SAY cno SIZE 1,6
@ 0,46 SAY RECNO( ) SIZE 1,3
ENDIF
IF NOT EMPTY(currwind)
ACTIVATE WINDOW (currwind) SAME
ENDIF
RETURN .T.
PROCEDURE go_prev
SKIP -1
IF BOF( )
GO TOP
ENDIF
RETURN

PROCEDURE go_next
SKIP 1
IF EOF( )
GO BOTTOM
ENDIF
RETURN


DO SeeAlso
See Also

CLEAR Commands

PARAMETERS Command

PARAMETERS( ) Function

PRIVATE Command

PROCEDURE Command

PUBLIC Command

SET DEVELOPMENT Command

SET PATH Command

SET PROCEDURE Command


DO CASE ... ENDCASE Command

See Also	Example

Executes the first statement block after DO CASE and before END CASE whose associated conditional statement evaluates to true (.T.).

Syntax

DO CASE
CASE <expL1>
<statements>
[CASE <expL2>
<statements>
 ...
CASE <expLN>
<statements>]
[OTHERWISE
<statements>]
ENDCASE

Remarks

DO CASE is used to execute a set of FoxPro commands based on the result of a logical condition.  When DO CASE is executed, successive logical cases are evaluated; the results of the evaluations determine which set of commands is executed.

When the first logically true (.T.) CASE clause is encountered, the statements following it are executed.  Execution of the statements continues until the next CASE or ENDCASE is reached.  Execution then resumes with the first command following ENDCASE.

If a CASE clause is logically false (.F.), the statements following it up to the next CASE clause are ignored.

One and only one CASE clause is executed [image] the first true CASE clause.  Any succeeding true CASE clauses are ignored.

If all of the CASE clauses evaluate to false (.F.), OTHERWISE determines if any additional statements are executed:

If OTHERWISE is included, the statements following OTHERWISE are executed and execution skips to the first command following ENDCASE.

If OTHERWISE is omitted, execution skips to the first command following ENDCASE.

Comments can be placed after DO CASE and ENDCASE on the same line.  The comments are ignored during program compilation and execution.


DO CASE ... ENDCASE Example

In this example, FoxPro evaluates each CASE clause until the MONTH variable is found in one of the lists.  The appropriate string is stored to the memory variable RPT_TITLE and the DO CASE structure is exited.

STORE CMONTH(DATE( )) TO month	&& The month today

DO CASE  You can place comments here!

CASE INLIST(month,'January','February','March')
STORE 'First Quarter Earnings' TO rpt_title

CASE INLIST(month,'April','May','June')
STORE 'Second Quarter Earnings' TO rpt_title

CASE INLIST(month,'July','August','September')
STORE 'Third Quarter Earnings' TO rpt_title

OTHERWISE
STORE 'Fourth Quarter Earnings' TO rpt_title
ENDCASE	Or you can place comments here!
WAIT WINDOW rpt_title NOWAIT


DO CASE ... ENDCASE SeeAlso
See Also

DO WHILE ... ENDDO Command

FOR ... ENDFOR Command

IF ... ENDIF Command

IIF( ) Function

SCAN ... ENDSCAN Command


DO WHILE ... ENDDO Command

See Also	Example

Executes a block of statements within a conditional loop.

Syntax

DO WHILE <expL>
<statements>
[LOOP]
[EXIT]
ENDDO

Remarks

A set of commands placed between DO WHILE and ENDDO is executed for as long as the logical expression <expL> remains true (.T.).  A DO WHILE statement must have a corresponding ENDDO statement.

Comments can be placed after DO WHILE and ENDDO on the same line.  The comments are ignored during program compilation and execution.

Clauses

<expL>

<expL> is a logical expression.  The statements placed between DO WHILE and ENDDO are executed while <expL> evaluates to true (.T.).

<statements>

<statements> is the set of FoxPro commands to be executed while <expL> evaluates to true (.T.).

LOOP

LOOP can be placed anywhere between DO WHILE and ENDDO.  LOOP returns program control directly back to DO WHILE.

EXIT

EXIT transfers program control from within the DO WHILE loop to the first command following ENDDO.  EXIT can be placed anywhere between DO WHILE and ENDDO.


DO WHILE ... ENDDO Example

In this example, the payments for the month of June are totaled in the DO WHILE loop until the end of the file (EOF) is encountered.  The DO WHILE loop is exited and the total is displayed.

CLOSE DATABASES
SET TALK OFF
USE invoices
junetot = 0
DO WHILE .T.	You can place comments here!
IF EOF( )
EXIT
ENDIF
IF CMONTH(idate)  'June'
SKIP
LOOP
ENDIF
junetot = junetot + itotal
SKIP
ENDDO	Or you can place comments here!
? 'Total of invoice totals for June is '
?? junetot


DO WHILE ... ENDDO SeeAlso
See Also

DO CASE ... ENDCASE Command

EXIT Command

FOR ... ENDFOR Command

IF ... ENDIF Command

IIF( ) Function

SCAN ... ENDSCAN Command


DOW( ) Function

See Also	Example

Returns the day of the week from a given date expression.

Syntax

DOW(<expD>)

Returns

Numeric

Remarks

The value returned by DOW( ) ranges from 1 (Sunday) through 7 (Saturday).

Parameters

<expD>

DOW( ) returns the day number for the date expression <expD>.


DOW( ) Example

STORE {06/06/92} TO daynum
? DOW(daynum)

? CDOW(daynum)


DOW() SeeAlso
See Also

CDOW( ) Function

DAY( ) Function

SYS( ) Functions Overview


DTOC( ) Function

See Also	Example

Returns a character type date from a date expression.

Syntax

DTOC(<expD>[, 1])

Returns

Character

Remarks

DTOC( ) returns a character string corresponding to the date expression <expD>.  The date format is determined by SET CENTURY and SET DATE.

Parameters

<expD>

<expD> can be a date type memory variable, an array element, the name of a field, or a function that returns a date.

1

If the optional argument 1 is included, the date is returned in a format suitable for indexing.  This is particularly useful in combination with TIME( ) for maintaining the table records in chronological sequence.

For example, to order table records in entry sequence, you could use this command:

INDEX ON DTOC(invdate, 1) + invtime TAG Timeindx

INVDATE and INVTIME are fields containing the date and time when the data was entered in the record.


DTOC( ) Example

STORE CTOD('10/31/92') TO thisdate
? DTOC(thisdate)

STORE DTOC({10/31/92}+90) TO expiredate
? 'Your 90-day warranty expires', expiredate

? DTOC({10/31/92},1)


DTOC() SeeAlso
See Also

CTOD( ) Function

SET CENTURY Command

SET DATE Command

SYS( ) Functions Overview


DTOR( ) Function

See Also	Example

Converts degrees to radians.

Syntax

DTOR(<expN>)

Returns

Numeric

Remarks

DTOR( ) converts the value of a numeric expression given in degrees to an equivalent value in radians.  DTOR( ) is useful for working with the FoxPro trigonometric functions (ACOS( ), COS( ), RTOD( ), SIN( ), TAN( )).

Use RTOD( ) to convert radians to degrees.

Parameters

<expN>

<expN> is the numeric expression whose value you want to convert to radians.  An angle expressed in a degree:minute:second format should be converted to its decimal equivalent.


DTOR( ) Example

? DTOR(0)

? DTOR(45)

? DTOR(90)

? DTOR(180)

? COS(DTOR(90))


DTOR() SeeAlso
See Also

COS( ) Function

RTOD( ) Function

SIN( ) Function

TAN( ) Function


DTOS( ) Function

See Also

Returns a character-string date in the format YYYYMMDD from a specified date expression.

Syntax

DTOS(<expD>)

Returns

Character

Remarks

This function is useful for indexing tables on a date field.  It is equivalent to DTOC( ) when its optional 1 argument is included.

The character string returned by DTOS( ) isn't affected by SET DATE or SET CENTURY.

Parameters

<expD>

<expD> is the date expression you want to covert to an eight-digit character string.


DTOS() SeeAlso
See Also

CTOD( ) Function

DTOC( ) Function


EDIT Command

See Also

Displays fields for editing.

Syntax

EDIT
[FIELDS <field list>]
[<scope>]
[FOR <expL1>]
[WHILE <expL2>]
[FONT <expC1>[, <expN1>]]
[STYLE <expC2>]
[FREEZE <field>]
[KEY <expr1>[, <expr2>]]
[LAST]
[LEDIT]
[REDIT]
[LPARTITION]
[NOAPPEND]
[NOCLEAR]
[NODELETE]
[NOEDIT | NOMODIFY]
[NOLINK]
[NOMENU]
[NOOPTIMIZE]
[NORMAL]
[NOWAIT]
[PARTITION <expN2>]
[PREFERENCE <expC3>]
[REST]
[SAVE]
[TIMEOUT <expN3>]
[TITLE <expC4>]
[VALID [:F] <expL3> [ERROR <expC5>]]
[WHEN <expL4>]
[WIDTH <expN4>]
[[WINDOW <window name1>] [IN [WINDOW] <window name2> | IN SCREEN | IN MACDESKTOP]]
[COLOR SCHEME <expN5> | COLOR <color pair list>]

Remarks

EDIT works just like CHANGE.


EDIT SeeAlso
See Also

BROWSE Command

CHANGE Command

WTITLE( ) Function


EJECT Command

See Also	Example

Sends a form feed to the printer.

Syntax

EJECT

Remarks

EJECT advances the printer to the top of the next page. EJECT sends a form feed to the printer if the _PADVANCE system memory variable is set to FORMFEED.  If _PADVANCE is set to LINEFEEDS, EJECT issues line feeds to advance to the top of the next page.

EJECT resets PCOL( ) and PROW( ) values to the current column and row position of the printer's print head, but doesn't affect the value of the _PAGENO or _PLINENO system variables.


EJECT Example

In the following program example, the CUSTOMER fields COMPANY and ADDRESS1 are printed. (Make sure a printer is attached and turned on for this example.)  When the number of rows printed is greater than 62, the page is ejected.

USE customer
SET DEVICE TO PRINTER
DO WHILE NOT EOF( )
@ PROW( )+1,10 SAY 'Company: ' + company
@ PROW( )+1,10 SAY 'Address: ' + address1
@ PROW( )+1,1 SAY ''
IF PROW( ) > 62
EJECT
ENDIF
SKIP
ENDDO
SET DEVICE TO SCREEN


EJECT SeeAlso
See Also

EJECT PAGE Command

ON PAGE Command

SET DEVICE Command

SET PRINTER Commands

PCOL( ) Function

PROW( ) Function

System Memory Variables Overview


EJECT PAGE Command

See Also

Sends a conditional page advance to the printer.

Syntax

EJECT PAGE

Remarks

Use EJECT PAGE to advance streaming output. The advance depends upon the value in the _PADVANCE system memory variable and whether or not an ON PAGE is in effect.

If the system memory variable _PADVANCE is set to FORMFEED and an ON PAGE isn't in effect, EJECT PAGE performs the following actions:

Sends a formfeed to the printer if the printer is on line.

Sends linefeeds, as determined by the system memory variables _PLENGTH and _PLINENO to the screen and/or to an alternate file.

Increments the system memory variable _PAGENO by one.

Sets the system memory variable _PLINENO to 0.

If the system memory variable _PADVANCE is set to LINEFEEDS, and if an ON PAGE routine is in effect and _PLINENO is less than the page line number specified with the ON PAGE command, EJECT PAGE performs the following action:

Sends to the printer, the desktop (FoxPro for MS-DOS), the main FoxPro window and/or to an alternate file as many linefeeds as are necessary to advance to the top of the next page.

If an ON PAGE is not in effect, or if _PADVANCE is set to LINEFEEDS and _PLINENO is greater than the page line number specified with the ON PAGE, EJECT PAGE performs the following actions:

Sends linefeeds, as determined by the system memory variables _PLENGTH and _PLINENO to the printer, the desktop or main FoxPro window and/or to the alternate file if an alternate file is open.

Increments the system memory variable _PAGENO by one.

Sets the system memory variable _PLINENO to 0.


EJECT PAGE SeeAlso
See Also

EJECT Command

ON PAGE Command

SET ALTERNATE Commands

SET DEVICE Command

SET PRINTER Commands

PCOL( ) Function

PROW( ) Function

System Memory Variables Overview


EMPTY( ) Function

See Also	Example

Determines whether or not an expression is empty.

Syntax

EMPTY(<expr>)

Returns

Logical

Remarks

EMPTY( ) returns true (.T.) if the expression <expr> is empty; false (.F.) if the expression isn't empty.

Parameter

<expr>

The expression you include can be a character, numeric, date or logical expression, or the name of a memo or general field in an open table.  EMPTY( ) returns true (.T.) when expressions of the following data types contain the indicated data:

Data Type	Contains

Character	Nulls, spaces, tabs, carriage returns or line feeds or any combination of these

Numeric	0

Date	Null (i.e. CTOD(''))

Logical	False (.F.)

Memo	Empty (no contents)

General	Empty (no OLE object)


EMPTY( ) Example

In this example, a filter is set to browse only records whose memo field NOTES contains data.

USE salesman
SET FILTER TO NOT EMPTY(notes)	&& Non-empty memos
BROWSE LAST
SET FILTER TO


EMPTY() SeeAlso
See Also

LEN( ) Function


EOF( ) Function

See Also	Example

Determines whether or not the record pointer is positioned past the last record in the current or specified table.

Syntax

EOF([<expN> | <expC>])

Returns

Logical

Remarks

EOF( ) returns a logical true value (.T.) if the record pointer reaches the end of the file (EOF).  The end of the file is reached when the record pointer passes the last record in the table or index file. For example, when  a FIND, LOCATE or SEEK is unsuccessful, FoxPro moves the record pointer past the last record, and EOF( ) returns true (.T.).  EOF( ) returns false (.F.) if the record pointer isn't at the end of the file.

Parameter

<expN> | <expC>

You can test for the end of file for a table open in another work area by specifying the work area number <expN> or the table or work area alias <expC>.

EOF( ) returns false (.F.) if a table isn't open in the work area you specify.

If you do not specify a work area or alias, the table open in the selected work area is tested for the end of the file.


EOF( ) Example

In this example, the CUSTOMER table is opened and push buttons are displayed that enable you to move the record pointer forward or backward in the table.  When you choose a push button, FoxPro moves the record pointer.  Depending on the direction moved, FoxPro checks to see if the record pointer is at the end of the file (EOF) or at the beginning of the file (BOF).  If either condition is true, FoxPro displays a message and repositions the record pointer to the last or first record.

This example moves the record pointer to the last record in the table so selecting the Forward push button takes you immediately to the end of the file.

CLOSE DATABASES
SET TALK OFF
CLEAR
USE customer
GO BOTTOM
DEFINE WINDOW mskip FROM 9,10 TO 13,65 DOUBLE COLOR SCHEME 5
ACTIVATE WINDOW mskip
@ 1,5 GET mchoice FUNCTION '*HN \<Forward;\<Backward;\<Quit';
DEFAULT 0 SIZE 1,14 VALID CHOICE( )
READ CYCLE
RELEASE WINDOW mskip
PROCEDURE choice
DO CASE
CASE mchoice = 1
SKIP
IF EOF('CUSTOMER')
WAIT WINDOW 'End of file encountered' NOWAIT
SKIP -1
ENDIF
CASE mchoice = 2
SKIP -1
IF BOF('CUSTOMER')
WAIT WINDOW 'Beginning of file encountered' NOWAIT
GO TOP
ENDIF
CASE mchoice = 3
CLEAR READ
ENDCASE
ACTIVATE SCREEN
@ 2,1 SAY 'Company: '+ company
RETURN .T.


EOF() SeeAlso
See Also

BOF( ) Function


ERASE Command

See Also	Example

Erases a file from disk.

Syntax

ERASE <file> | ?

Remarks

Caution   Exercise caution when using ERASE.  Any file erased with this command cannot be retrieved.  You aren't warned before the file is erased, even if SET SAFETY is ON.

Clauses

<file>

Specify the file to be erased.   The file extension must be included.  Include the path with the file name if the file is on a different drive or directory than the current drive or directory.

ERASE doesn't support wildcard characters in <file>.

?

ERASE ? brings forward the Open dialog in which you can choose a file to delete.


ERASE Example

In this example, the structure of PARTS.DBF is first copied to a new table named TEMP.  Second, the table structure is modified and a new table named BACKUP is created.  Third, all the records in PARTS are appended to BACKUP.DBF.  Last, the AVGPRICE field is replaced with the average sales per unit and the temporary table TEMP is erased.

CLOSE DATABASES
USE items
COPY STRUCTURE EXTENDED TO temp
USE temp
APPEND BLANK
REPLACE field_name WITH 'avgprice'
REPLACE field_type WITH 'N'
REPLACE field_len WITH 10
REPLACE field_dec WITH 2
CREATE backup FROM temp
USE backup
APPEND FROM items
REPLACE ALL avgprice with ytdsales / ytdunits FOR ytdsales # 0
BROWSE
USE
ERASE temp.dbf


ERASE SeeAlso
See Also

DELETE FILE Command

FILER Command


ERROR( ) Function

See Also	Example

Returns the error number for the error that triggered ON ERROR.

Syntax

ERROR( )

Returns

Numeric

Remarks

ERROR( ) returns the number of the most recent error.  An ON ERROR must be active for ERROR( ) to return a value other than 0.

When an error is trapped during program execution, the error type can be identified with ERROR( ) in an ON ERROR routine.  The corresponding error message can be returned with MESSAGE( ).

The value the ERROR( ) function returns is reset by RETURN or  RETRY.

See the Error Messages appendix in the FoxPro Developer's Guide for a numerical listing of each error number and the corresponding error message.


ERROR( ) Example

This example demonstrates a simple error-handling routine that displays a message when an error is occurs.

CLEAR
ON ERROR DO errhand WITH ERROR( ), MESSAGE( )

*** The next line generates an error - there is no BRWSE command

BRWSE
ON ERROR
RETURN

*** Errhand ***

PROCEDURE errhand
PARAMETER errnum,message
@ 23,0 SAY Message+' ERROR: '+ STR(Errnum)
RETURN


ERROR() SeeAlso
See Also

MESSAGE( ) Function

ON ERROR Command

RETRY Command

RETURN Command


EVALUATE( ) Function

See Also

Evaluates a character expression and returns the result.

Syntax

EVALUATE(<expC>)

Returns

Character, numeric, date, logical or memo

Remarks

EVALUATE( ) is similar to TYPE( ) but returns the result of an expression instead of the expression type.  An expression containing EVALUATE( ) cannot be optimized by Rushmore.

Parameter

<expC>

The <expC> parameter specifies the expression to evaluate. <expC> can be a literal character string, or a valid FoxPro expression, memory variable, array element or field of any data type, enclosed in character string delimiters.

Whenever possible, use EVALUATE( ) or a name expression to replace macro substitution using the & operator.  EVALUATE and name expressions execute faster than macro substitution.


EVALUATE( ) SeeAlso
See Also

TYPE( ) Function


EXIT Command

See Also	Example

Exits a DO WHILE, FOR or SCAN loop.

Syntax

EXIT

Remarks

EXIT transfers control from within a DO WHILE ... ENDDO, FOR ... ENDFOR or SCAN ... ENDSCAN loop to the command immediately following ENDDO, ENDFOR or ENDSCAN.


EXIT Example

In this example, the payments for the month of May are totaled in a DO WHILE loop until the end of the file is encountered.  The DO WHILE loop is then exited and the total is displayed.

CLOSE DATABASES
SET TALK OFF
USE invoices
maytot = 0

DO WHILE .T.
IF EOF( )
EXIT
ENDIF
IF CMONTH(idate) != 'May'
SKIP
LOOP
ENDIF
maytot = maytot + itotal
SKIP
ENDDO
? 'Total of invoices for May is '
?? maytot


EXIT SeeAlso
See Also

DO WHILE ... ENDDO Command

FOR ... ENDFOR Command

SCAN ... ENDSCAN Command


EXP( ) Function

See Also	Example

Returns the value of e^x where x is a specified numeric expression.

Syntax

EXP(<expN>)

Returns

Numeric

Remarks

The value of e, the base of natural logarithms, is approximately 2.71828.  The number of decimal places displayed by EXP( ) is specified with SET DECIMALS.

Parameter

<expN>

The numeric expression <expN> is the exponent, x, in the exponential equation e^x.


EXP( ) Example

? EXP(0)

? EXP(1)


EXP() SeeAlso
See Also

LOG( ) Function

SET DECIMALS Command


EXPORT Command

See Also

Copies data from a FoxPro table to a file in a different format.

Syntax

EXPORT TO <file>
[FIELDS <field list> | FIELDS LIKE <skel> | FIELDS EXCEPT <skel>]
[<scope>]
[FOR <expL1>]
[WHILE <expL2>]
[NOOPTIMIZE]
[[TYPE] DIF | MOD | SYLK | WK1 | WKS | WR1 | WRK | XLS]]

Remarks

Use EXPORT to use FoxPro data in other software packages.

If the table you are exporting from is indexed, the new file created is created in the indexed order.

Clauses

<file>

Include the name of the file to which FoxPro exports data.  If you do not include an extension with the file name, the default extension for the specified file type is assigned.

FIELDS <field list>

Include FIELDS <field list> to specify which fields are copied to the new file.  If the FIELDS clause is omitted, all fields are copied to the new file.  Memo and general fields are not copied to the new file even if their names are included in the field list.

FIELDS LIKE <skel> | FIELDS EXCEPT <skel>

You can selectively copy fields to a new file by including the LIKE or EXCEPT clause or both. If you include LIKE <skel>, FoxPro copies fields that match <skel> to the new file. If you include EXCEPT <skel>, FoxPro copies all fields except those that match <skel> to the new file.

The skeleton <skel> supports wildcard characters. For example, to copy all fields that begin with the letters A and P to a new file, use:

EXPORT TO mytable FIELDS LIKE A*,P*

The LIKE clause can be combined with the EXCEPT clause:

EXPORT TO mytable FIELDS LIKE A*,P* EXCEPT PARTNO*

<scope>

The scope clauses are:  ALL, NEXT <expN>, RECORD <expN>, and REST.  These are explained in the Overview of the FoxPro Language chapter in the FoxPro Language Reference.  Commands which include <scope> operate only on the table in the active work area.

You can specify a scope of records to copy to the new file.  Only the records that fall within the range of records specified by the scope are copied to the new file.

The default scope for EXPORT is ALL records.

FOR <expL1>

If the FOR clause is included, only records that satisfy the logical condition <expL1> are copied to the new file.  Including the FOR clause lets you conditionally copy records, filtering out undesired records.

Rushmore optimizes an EXPORT ... FOR <expL1> command if <expL1> is an optimizable expression.  For best performance, use an optimizable expression in the FOR clause.  A discussion of Rushmore optimizable expressions appears in the Optimizing Your Application chapter in the FoxPro Developer's Guide.

WHILE <expL2>

If the WHILE clause is included, records are copied to the new file for as long as the logical expression <expL2> evaluates to true (.T.).

NOOPTIMIZE

To cause Rushmore not to optimize EXPORT, include NOOPTIMIZE.  For more information, see SET OPTIMIZE and the Rushmore discussion in the Optimizing Your Application chapter of the FoxPro Developer's Guide.

TYPE

You must specify the type of file to be created.  The TYPE key word is optional, but you must specify one of the following file types.

DIF

When you specify DIF, each field from a FoxPro table becomes a vector (column) and each record becomes a tuple (row) in a DIF (Data Interchange Format) file, used by VisiCalc.  The new file name is assigned a .DIF extension if an extension isn't included in <file>.

MOD

Use the MOD clause to export to a file in Microsoft Multiplan version 4.01 MOD format. The new file name is assigned an .MOD extension if you don't include an extension in <file>.

SYLK

A SYLK file is a Symbolic Link interchange format (used by Microsoft Multiplan) in which each field from a FoxPro table becomes a column in the spreadsheet and each record becomes a row.  By default, SYLK file names have no extension.

WK1

Include this option to create a Lotus 1-2-3 spreadsheet from a FoxPro table.  A .WK1 extension is assigned to the spreadsheet file name for use with Lotus 1-2-3 revision 2.x.  Each field from the table becomes a column in the new spreadsheet, and each record in the table becomes a spreadsheet row.

WKS

A Lotus 1-2-3 spreadsheet can be created from a FoxPro table with this option.  A .WKS extension is assigned to the spreadsheet file name for use with Lotus 1-2-3 revision 1-A.  Each field from the table becomes a column in the new spreadsheet, and each record becomes a row in the spreadsheet.

WR1

Include this option to create a Lotus Symphony spreadsheet from a FoxPro table.  A .WR1 extension is assigned to the spreadsheet for use with Symphony version 1.01.  Each field from the table becomes a column in the new spreadsheet, and each record in the table becomes a row in the spreadsheet.

WRK

A Lotus Symphony spreadsheet can be created from a FoxPro table with this option.  A .WRK extension is assigned to the spreadsheet file name for use with Symphony version 1.10.  Each field from the table becomes a column in the new spreadsheet, and each record in the table becomes a row in the spreadsheet.

XLS

Include XLS to create a spreadsheet you can use in Microsoft Excel.  Each field in the selected table becomes a column in the spreadsheet; each table record becomes a row in the spreadsheet.  An .XLS file name extension is assigned to the newly created spreadsheet file unless you specify a different extension.


EXPORT SeeAlso
See Also

APPEND FROM Command

COPY TO Command

IMPORT Command


EXTERNAL Command

See Also

Alerts the Project Manager to an undefined reference.

Syntax

EXTERNAL ARRAY | LABEL | LIBRARY | MENU | PROCEDURE | REPORT | SCREEN
<file list> | <array list>

Remarks

Use EXTERNAL to include files and to resolve undefined references in a project created by the FoxPro Project Manager.  EXTERNAL is used only by the Project Manager and is ignored during program execution.

For more information on creating projects with the Project Manager, see the Project [image] The Main Organizing Tool chapter in the FoxPro Developer's Guide.

Files whose names you specify with EXTERNAL are included in a project by the Project Manager.  You must include LABEL, LIBRARY, MENU, PROCEDURE, REPORT or SCREEN before the file names to tell the Project Manager the type of files to include in the project.

The Project Manager must also be alerted to file names contained in a name expression or macro substitution.  This assures that all necessary files are included in a project when the project is built.  It must also be alerted to arrays that are created in another procedure or UDF (user-defined function).

For more information on name expressions and macro substitution, see the & Function.  Whenever possible, use a name expression instead of macro substitution to improve performance.

Several key words in EXTERNAL identify an array or the different file types.  Follow the key word with the corresponding array or file names.  You can include multiple array or file names after the key word if you separate the names with commas.

Clauses

ARRAY

When an array is created in a program and then used in a lower-level program, include EXTERNAL ARRAY with the array name in the lower-level program.

In the following example, the first program creates an array named INVOICE.  The array is initialized and a lower-level program named DISPINVO is called.  DISPINVO displays the contents of the array created in the higher-level program.  The command EXTERNAL ARRAY INVOICE is included to alert the Project Manager.

DIMENSION invoice(4)
STORE 'Paid' TO invoice
DO dispinvo

*** Program dispinvo ***

PROCEDURE dispinvo
EXTERNAL ARRAY invoice
? invoice(1)
? invoice(2)
? invoice(3)
? invoice(4)
RETURN

*** End of dispinvo program ***

When an array is passed to a UDF or procedure, the corresponding array in the UDF or procedure must be identified to the project manager.  Include the ARRAY key word with name of the array included in the PARAMETER statement.

DIMENSION firstarray(2)  && Create an array
EXTERNAL ARRAY arraytwo  && Name of the array used in the UDF
SET TALK OFF
STORE 10 TO firstarray(1)
STORE  2 TO firstarray(2)
= ADDTWO(@firstarray)    && Pass the array by reference to a UDF

FUNCTION ADDTWO
PARAMETER arraytwo
CLEAR
arraytwo(1) = arraytwo(1) + 2
arraytwo(2) = arraytwo(2) + 2
? arraytwo(1)
? arraytwo(2)

LABEL

LABEL tells the Project Manager the file you include in an indirect file reference or macro substitution is a label definition file created with CREATE LABEL.

EXTERNAL LABEL dunlabel	&& LABEL FORM dunlabel must exist
STORE 'dunlabel' TO labelfile
LABEL FORM (labelfile) PREVIEW

LIBRARY

Include LIBRARY when a library file is referenced by indirect file referencing or macro substitution in SET LIBRARY.

EXTERNAL LIBRARY regress	&& LIBRARY regress must exist
STORE 'regress' TO statfunc
SET LIBRARY TO (statfunc)

MENU

If a menu definition file is included in an indirect file reference or macro substitution, include MENU and the menu file name.  Menus can be created with the FoxPro Menu Builder.  For more information about the menu builder, see the Menu Builder chapter in the FoxPro User's Guide.

EXTERNAL MENU pickfile  && MENU pickfile must exist
STORE 'pickfile' TO sysmenpad1
MODIFY MENU (sysmenpad1)

PROCEDURE

PROCEDURE is used to identify an external procedure or UDF.

EXTERNAL PROCEDURE delblank  && PROCEDURE delblank must exist
STORE 'delblank' TO trimblanks
DO (trimblanks) WITH 'A B C D E'

REPORT

REPORT alerts the Project Manager that the file you include in an indirect file reference or macro substitution is a report definition file created with CREATE REPORT.

EXTERNAL REPORT overdue  && REPORT overdue must exist
STORE 'overdue' TO reportfile
REPORT FORM (reportfile) PREVIEW

SCREEN

If a screen definition file is included in an indirect file reference or macro substitution, include SCREEN and the screen file name.  Screens can be created with the FoxPro Screen Builder.  For more information on the screen builder, see the Screen Builder chapter in the FoxPro User's Guide.

EXTERNAL SCREEN dataentr  && SCREEN dataentr must exist
STORE 'dataentr' TO reportfile
MODIFY SCREEN (reportfile)

<file list> | <array list>

You can include multiple file names or array names in EXTERNAL.  Separate the file or array names from each other with commas.  All files whose names are listed must be of the specified file type.


EXTERNAL SeeAlso
See Also

BUILD APP Command

BUILD PROJECT Command


FCHSIZE( ) Function

See Also

Changes the size of a file opened with a low-level file function.

Syntax

FCHSIZE(<expN1>, <expN2>)

Returns

Numeric

Remarks

You can increase the file's size or truncate the file after a specified byte.

When a file's size is increased, FoxPro allocates sectors for the file on the drive where the file is opened.  Since FCHSIZE( ) doesn't initialize the new file space, the space can contain previous data.  Be sure to manage the new file space.

The final size of the file in bytes is returned.  FoxPro returns -1  if FCHSIZE( ) is unable to change the file size, for example because of insufficient disk space, an invalid file handle is specified, or the file is read-only.

Tip   This function can be used to truncate a file to length 0.

Parameters

<expN1>

Include the file handle <expN1> of the file whose size you wish to change.  The file handle is returned by FOPEN( ) when you open the file or by FCREATE( ) when you create a file.  If a file is opened with FOPEN( ), it must be opened with write or read/write privileges in order for you to be able to change its size.

<expN2>

Specify the new file size in bytes in <expN2>.  If <expN2> is less than the original file size, the file is truncated.  If <expN2> is greater than the original file size, the file size is increased.


FCHSIZE() SeeAlso
See Also

FCLOSE( ) Function

FCREATE( ) Function

FEOF( ) Function

FFLUSH( ) Function

FGETS( ) Function

FOPEN( ) Function

FPUTS( ) Function

FREAD( ) Function

FSEEK( ) Function

FWRITE( ) Function


FCLOSE( ) Function

See Also

Flushes and closes a file or communication port opened with a low-level file function.

Syntax

FCLOSE(<expN>)

Returns

Logical

Remarks

If the file is successfully closed, FCLOSE( ) returns true (.T.) and releases the file handle.  If the file cannot be closed, FCLOSE( ) returns false (.F.).

CLOSE ALL also closes low-level files.

Parameter

<expN>

A numeric file handle is returned when you create a file with FCREATE( ) or open a file with FOPEN( ).  To close a low-level file with FCLOSE( ), specify the file handle in the numeric expression <expN>.

If you open a communications port with a low-level file function, it can be closed by specifying the file handle assigned to the port.

Ports cannot be opened with low-level file functions in FoxPro for Windows and FoxPro for Macintosh.


FCLOSE() SeeAlso
See Also

CLOSE ALL Command

FCHSIZE( ) Function

FCREATE( ) Function

FEOF( ) Function

FFLUSH( ) Function

FGETS( ) Function

FOPEN( ) Function

FPUTS( ) Function

FREAD( ) Function

FSEEK( ) Function

FWRITE( ) Function


FCOUNT( ) Function

See Also	Example

Returns the number of fields in the current or specified table.

Syntax

FCOUNT([<expN> | <expC>])

Returns

Numeric

Parameters

<expN> | <expC>

You can return the number of fields in a table open in another work area by specifying the work area number <expN> or the table or work area alias <expC>.

0 is returned if a table isn't open in the work area you specify.

If you don't specify a work area or alias, the number of fields is returned for the table open in the selected work area.


FCOUNT( ) Example

CLOSE DATABASES
SELECT 0
USE salesman
SELECT 0
USE customer
? FCOUNT('CUSTOMER')	&& The number of fields in Customer.dbf

? FCOUNT('SALESMAN')	&& The number of fields in Salesman.dbf


FCOUNT() SeeAlso
See Also

DBF( ) Function

FSIZE( ) Function

NDX( ) Function

SYS(7) Function - Current Format File


FCREATE( ) Function

See Also	Example

Creates and opens a low-level file.

Syntax

FCREATE(<expC>[, <expN>])

Returns

Numeric

Remarks

If a file with the name you specify already exists, it is overwritten.

FCREATE( ) assigns a file handle number to the file, which you can use to identify the file in other FoxPro low-level file functions.  FCREATE( ) returns the file handle number when a file is created, or returns -1 if a file cannot be created.

Tip   Assign the file handle number to a memory variable you can use with other low-level file I/O functions.

You cannot open a communication port with FCREATE( ).  Use FOPEN( ) to open a communication port.

Parameters

<expC>

Specify the name of the file to create with <expC>.  You can include a drive designator and path with the file name.  If a drive designator or path isn't included, the file is created in the default directory.

<expN>

Include the numeric expression <expN> to specify the MS-DOS attributes of the file.  The following table lists the file attributes you can specify.

<expN>	File Attributes

0	Read/Write (default)

1	Read Only

2	Hidden

3	Read Only/Hidden

4	System

5	Read Only/System

6	System/Hidden

7	Read Only/Hidden/System

Use DISPLAY STATUS or LIST STATUS to display or print information about files created and opened with FCREATE( ).  DISPLAY STATUS and LIST STATUS give the following information about each file opened or created with a low-level file function:

The drive, directory and file name.

The file handle number.

The file pointer position.

The read/write attributes.


FCREATE( ) Example

IF FILE('errors.txt')	&& Does file exist?
errfile = FOPEN('errors.txt',12)	&& If so, open read/write
ELSE
errfile = FCREATE('errors.txt')	&& If not create it
ENDIF
IF errfile < 0	&& Check for error opening file
WAIT 'Cannot open or create output file' WINDOW NOWAIT
ELSE	&& If no error, write to file
=FWRITE(errfile, 'Error information to be written here')
ENDIF

=FCLOSE(errfile)	&& Close file
MODIFY FILE errors.txt NOWAIT	&& Open file in edit window


FCREATE() SeeAlso
See Also

CLOSE ALL Command

FCHSIZE( ) Function

FCREATE( ) Function

FEOF( ) Function

FFLUSH( ) Function

FGETS( ) Function

FOPEN( ) Function

FPUTS( ) Function

FREAD( ) Function

FSEEK( ) Function

FWRITE( ) Function


FDATE( ) Function

See Also

Returns the last modification date for a file.

Syntax

FDATE(<file name>)

Returns

Date

Remarks

Include for compatibility with dBASE.

The date that FDATE( ) returns is assigned to the file by the operating system. The format of the value returned by FDATE( ) is determined by the current settings of SET DATE, SET MARK and SET CENTURY.

Use LUPDATE( ) to determine the last modification date for an open table.

Parameter

<file name>

Specifies the name of file whose last modification date FDATE( ) returns. <file name> can include a path with the file name. If a path is not included with the file name, FoxPro searches for the file in the default directory and in any directories specified with SET PATH.


FDATE() SeeAlso
See Also

FTIME( ) Function


FEOF( ) Function

See Also	Example

Determines whether or not the file pointer is positioned at the end of a file.

Syntax

FEOF(<expN>)

Returns

Logical

Remarks

This low-level file function returns true (.T.) if the file pointer is positioned at the end of a file opened with a low-level file function.  FEOF( ) returns false (.F.) if the file pointer isn't at the end of the file.

Parameter

<expN>

Include the file handle number <expN> of the file to check for the end of file condition.  FEOF( ) always returns true (.T.) if you specify a file handle number of a communications port opened with FOPEN( ).


FEOF( ) Example

*** Open the file test.txt ***

file_handle = FOPEN('test.txt')

*** Move the file pointer to BOF ***

m_position = FSEEK(file_handle, 0)

*** If file pointer is at BOF and EOF, the file is empty ***
*** Otherwise the file must have something in it ***

IF FEOF(file_handle)
WAIT WINDOW 'This file is empty!' NOWAIT
ELSE
WAIT WINDOW 'This file has something in it!' NOWAIT
ENDIF

= FCLOSE(file_handle)


FEOF() SeeAlso
See Also

FCHSIZE( ) Function

FCLOSE( ) Function

FCREATE( ) Function

FGETS( ) Function

FOPEN( ) Function

FPUTS( ) Function

FREAD( ) Function

FSEEK( ) Function

FWRITE( ) Function


FERROR( ) Function

See Also	Example

Returns a number corresponding to the most recent low-level file function error.

Syntax

FERROR( )

Returns

Numeric

Remarks

FERROR( ) returns 0 if a low-level file function executes successfully.  A positive value is returned if the function didn't execute successfully.  The following table lists each error number returned by FERROR( ) and the cause of the error.

Error number	Error Cause

2	File not found

4	Too many files open (out of file handles)

5	Access denied

6	Invalid file handle given

8	Out of memory

25	Seek error (can't seek before the start of a file)

29	Disk full

31	Error opening file


FERROR( ) Example

The following example creates and opens a temporary file.  If the file is successfully created, the program displays an input window where you can enter your first name, last name and position.  This information is written to the temporary file.

SET TALK OFF
CLEAR
tmpfile = SYS(3)	&& Create a temporary file name
handle = FCREATE(tmpfile)	&& Open the temporary file

IF handle < 0	&& Error generated creating file
DO CASE	&& Determine which error
CASE FERROR( ) = 4
reason = 'Too many files open (out of handles)'
CASE FERROR( ) = 5
reason = 'Access denied'
CASE FERROR( ) = 8
reason = 'Out of memory'
CASE FERROR( ) = 29
reason = 'Disk full'
CASE FERROR( ) = 31
reason = 'General Failure'
ENDCASE

*** Display the error ***

WAIT WINDOW 'Can't create file: '+ reason NOWAIT
RETURN
ELSE	&& File created successfully
DEFINE WINDOW wingets FROM 10,20 TO 18,60 ;
CLOSE FLOAT SHADOW SYSTEM ;
COLOR SCHEME 8 TITLE ' Name Entry '
ACTIVATE WINDOW wingets
@ 1,5 SAY "First Name:" GET fname DEFAULT SPACE (15)
@ 3,5 SAY "Last Name :" GET lname DEFAULT SPACE (15)
@ 5,5 SAY "Position  :" GET pos   DEFAULT SPACE (15)
READ
=FWRITE(handle,'First name: ')	&& Output info entered by the user
=FPUTS(handle,fname)
=FWRITE(handle,'Last name: ')
=FPUTS(handle,lname)
=FWRITE(handle, 'Position: ')
=FPUTS(handle,pos)
=FCLOSE(handle)	&& Close the file
DEACTIVATE WINDOW wingets
WAIT 'Press a key to view the file' WINDOW
ENDIF
IF !WEXIST('wingets')
DEFINE WINDOW wingets FROM 10,20 TO 18,60 ;
CLOSE FLOAT SHADOW SYSTEM ;
COLOR SCHEME 8 TITLE ' Name Entry '
ENDIF
MODIFY FILE (tmpfile) NOWAIT WINDOW wingets	&& View the file
CLEAR WINDOW	&& Remove the window


FERROR() SeeAlso
See Also

FCHSIZE( ) Function

FCLOSE( ) Function

FCREATE( ) Function

FEOF( ) Function

FFLUSH( ) Function

FGETS( ) Function

FOPEN( ) Function

FPUTS( ) Function

FREAD( ) Function

FSEEK( ) Function

FWRITE( ) Function


FFLUSH( ) Function

See Also	Example

Flushes to disk a file opened with a low-level function.

Syntax

FFLUSH(<expN>)

Returns

Logical

Remarks

FFLUSH( ) also releases the memory used by the file's buffer.

FLUSH is different from the FFLUSH( ) function.  FLUSH doesn't operate on low-level files but rather on tables and indexes.

Parameter

<expN>

Include the file handle <expN> of the file to flush to disk.


FFLUSH( ) Example

The following example opens and writes to a file named INPUT.DAT.  After writing the first two strings, the program flushes the buffers to ensure that the strings are written to disk.  It then writes the next two strings, flushes the buffers again and closes the file.

IF FILE('input.dat')
test_file = FOPEN('input.dat',2)
ELSE
test_file = FCREATE('input.dat')
ENDIF

io_bytes = FWRITE(test_file,'Test output')
io_bytes = FWRITE(test_file,' for low level file I/O')
flush_ok = FFLUSH(test_file)

io_bytes = FWRITE(test_file,'Test output2')
io_bytes = FWRITE(test_file,' for low level file I/O')
flush_ok = FFLUSH(test_file)

close_ok = FCLOSE(test_file)
MODIFY FILE input.dat NOWAIT


FFLUSH() SeeAlso
See Also

FCHSIZE( ) Function

FCLOSE( ) Function

FCREATE( ) Function

FEOF( ) Function

FGETS( ) Function

FOPEN( ) Function

FPUTS( ) Function

FREAD( ) Function

FSEEK( ) Function

FWRITE( ) Function


FGETS( ) Function

See Also	Example

Returns a series of bytes from a file or a communications port opened with a low-level file function until it encounters a carriage return.

Syntax

FGETS(<expN1>[, <expN2>])

Returns

Character

Remarks

You can read a file line by line by issuing a series of FGETS( ).

FGETS( ) returns a series of bytes as a character string.  Data is returned starting from the current file's pointer position and continuing until a carriage return is encountered.  The file pointer is then positioned on the byte immediately following the carriage return.  The carriage return isn't returned as part of the string, and line feeds are discarded.

Parameters

<expN1>

<expN1> specifies the numeric file handle of the file or communication port from which FGETS( ) returns data.

<expN2>

You can specify the number of bytes returned by FGETS( ) with <expN2>.  FGETS( ) returns <expN2> bytes unless a carriage return is encountered first.  FGETS( ) returns data between the starting file-pointer position and the carriage return if a carriage return is encountered within <expN2> bytes.

If <expN2> is omitted, FGETS( ) by default returns a maximum of 254 bytes.


FGETS( ) Example

*** TEST.TXT must exist ***

STORE FOPEN('test.txt') TO file_handle	&& Open the file

STORE FSEEK(file_handle, 0, 2) TO ifp_size	&& Move pointer to EOF

STORE FSEEK(file_handle, 0) TO ifp_top	&& Move pointer to BOF

IF ifp_size <= 0 	&& Is File empty?
WAIT WINDOW 'This file is empty!' NOWAIT

ELSE	&& If not
l_string = FGETS(file_handle, ifp_size)	&& Store contents
&& to memory
? l_string
ENDIF

= FCLOSE(file_handle)	&& Close the file


FGETS() SeeAlso
See Also

FCHSIZE( ) Function

FCLOSE( ) Function

FCREATE( ) Function

FEOF( ) Function

FFLUSH( ) Function

FOPEN( ) Function

FPUTS( ) Function

FREAD( ) Function

FSEEK( ) Function

FWRITE( ) Function


FIELD( ) Function

See Also	Example

Returns the name of a field, referenced by number, in the current or specified table.

Syntax

FIELD(<expN1>[, <expN2> | <expC>])

Returns

Character

Remarks

FCOUNT( ) can be used to determine the number of fields in a table.

Parameters

<expN1>

Use <expN1> to specify a field number.  If <expN1> is 1, the name of the first field in the table is returned, if <expN1> is 2 the name of the second field is returned and so on.  The null string is returned if <expN1> is greater than the number of fields.  Field names are returned in upper-case characters.

<expN2> | <expC>

If you don't specify a work area number, or a table or work area alias, a field name is returned from the table open in the current work area.

You can return a field name from a table open in another work area by specifying the work area number <expN> or the table or work area alias <expC>.  The null string is returned if a table isn't open in the work area you specify.


FIELD( ) Example

CLOSE DATABASES
CLEAR
USE customer
FOR mcount = 1 TO FCOUNT( )
? FIELD(mcount)
NEXT


FIELD() SeeAlso
See Also

DISPLAY STRUCTURE Command

FCOUNT( ) Function


FILE( ) Function

See Also

Returns a logical true (.T.) if the specified file is found on disk.

Syntax

FILE(<expC>)

Returns

Logical

Remarks

Use FILE( ) to find a file on disk.  A true value (.T.) is returned if the file can be found.  If the file cannot be found, FILE( ) returns false (.F.).

Parameter

<expC>

Specify the name of the file to locate with <expC>.  The character expression <expC> must include the file's extension.  FoxPro looks in the current directory for the file.  If the file cannot be found in the current directory, the path established with SET PATH is searched.

You can include a path with the file name to search for a file in a directory or on a drive other than the current directory or drive.  The path established with SET PATH is searched if you specify a path with the file name and COMPATIBLE is set OFF.  When  COMPATIBLE is set OFF, drive and directory specifiers are ignored.


FILE() SeeAlso
See Also

FULLPATH( ) Function

LOCFILE( ) Function

SYS(3) Function - Unique File Name


FILER Command

See Also

Opens the file maintenance desk accessory called Filer.

Syntax

FILER
[LIKE <skel>]
[NOWAIT]
[IN [WINDOW] <window name> | SCREEN]

Remarks

The Filer provides an efficient mechanism for maintaining order on your hard disk or floppies.  You can copy files, create directories, move files and delete files.  You can also view and change file attributes, find specific files, rename files or check the size of a file or a group of files.  For more information on the Filer, see the FoxPro User's Guide.

Clauses

LIKE <skel>

Include a file specification skeleton <skel> to display only those files that match the file skeleton.  The skeleton can contain the wildcard characters * and ?.

NOWAIT

When FILER is issued in a program, the Filer is opened and program execution pauses until the user closes the Filer. Program execution then continues with the line immediately following FILER.  Include NOWAIT to continue program execution after the Filer is opened.  The program doesn't wait for the Filer to be closed, but continues execution on the line immediately following FILER NOWAIT.

IN [WINDOW] <window name>

IN WINDOW <window name> opens the Filer in the parent window named <window name>.  The parent window must first be defined with DEFINE WINDOW.

The Filer can only be moved within the border of the parent window.  If you move the parent window, the Filer moves with it.

The Filer doesn't assume the characteristics of the parent window.  You can move, close and minimize the Filer in the parent window, and the Filer doesn't assume the colors of the parent window.

IN [WINDOW] SCREEN

You can place the Filer on the desktop in FoxPro for MS-DOS, or in the main FoxPro window by including IN SCREEN or IN WINDOW SCREEN.


FILER SeeAlso
See Also

COPY FILE Command

DELETE FILE Command

DIR or DIRECTORY Command

ERASE Command

RENAME Command


FILTER( ) Function

See Also	Example

Returns the filter expression specified in SET FILTER for the current or specified table.

Syntax

FILTER([<expN> | <expC>])

Returns

Character

Remarks

The null string is returned if a filter isn't in effect.  For more information about creating a filter, see SET FILTER.

Parameter

<expN> | <expC>

You can create a filter for every FoxPro work area.  If you don't specify a work area or alias, the filter expression for the currently selected work area is returned.

To return the filter expression for another work area, include the work area number <expN> or the table or work area alias <expC>.


FILTER( ) Example

CLOSE DATABASES
SET TALK ON
SELECT 0
USE customer

SET FILTER TO ono = '1'
? FILTER( )

STORE FILTER('customer') TO savefilt	&& Save filter expression
SET FILTER TO state = 'OH'
? FILTER( )

SET FILTER TO &savefilt	&& Restore filter
? FILTER( )


FILTER() SeeAlso
See Also

SET FILTER Command


FIND Command

See Also	Example

Searches an indexed table.

Syntax

FIND <expC>

Remarks

FIND is included for backward compatibility.  Use SEEK instead.

FIND moves the record pointer to the first record in the table whose index key matches the character expression <expC>.  FIND requires the selected table to be indexed.  The match with the index expression must be exact unless SET EXACT is OFF.

If a matching record is found, RECNO( ) returns the record number of the matching record, FOUND( ) returns true (.T.) and EOF( ) returns false (.F.).

If a match isn't found, RECNO( ) returns the number of records in the table plus one, FOUND( ) returns false (.F.) and EOF( ) returns true (.T.).

If SET NEAR is ON and FIND is unsuccessful, the record pointer is positioned immediately after the closest matching record.  If SET NEAR is OFF and FIND is unsuccessful, the record pointer is positioned at the end of the file. In either case,  RECNO( ) issued with an argument of 0 returns the record number of the closest matching record.


FIND Example

CLOSE DATABASES
USE customer ORDER company	&& Open file and set order
SET EXACT OFF
STORE 'Jeannie' TO mval
FIND &mval
IF FOUND( )
DISPLAY
ENDIF


FIND SeeAlso
See Also

EOF( ) Function

FOUND( ) Function

INDEX Command

LOCATE Command

RECNO( ) Function

SEEK Command

SET EXACT Command

SET NEAR Command


FKLABEL( ) Function

See Also	Example

Returns the name of the function key (F1, F2, F3 ...) from its corresponding function key number.

Syntax

FKLABEL(<expN>)

Returns

Character

Remarks

Function keys can be programmed with SET FUNCTION.

The value returned by FKLABEL( ) is affected by SET COMPATIBLE.  When COMPATIBLE is set to FOXPLUS (the default), the function keys are returned.  When COMPATIBLE is set to DB4, the function key and function key combinations (F1, Ctrl+F1, Shift+F1, F2, Ctrl+F2, Shift+F2 ...) are returned.

Parameter

<expN>

The function key number is specified in <expN>.  The value of <expN> should be from 0 through the number of function keys minus 1.  FKLABEL( ) returns the null string if <expN> is greater than the number of function keys minus 1.  The number of function keys can be determined with FKMAX( ).


FKLABEL( ) Example

? FKLABEL(0)

? FKLABEL(45)	&& Greater than FKMAX( ), returns the null string


FKLABEL() SeeAlso
See Also

FKMAX( ) Function

SET COMPATIBLE Command

SET FUNCTION Command


FKMAX( ) Function

See Also	Example

Returns the number of programmable function keys or function key combinations on your keyboard.

Syntax

FKMAX( )

Returns

Numeric

Remarks

The value returned by FKMAX( ) is affected by SET COMPATIBLE.  When COMPATIBLE is set to FOXPLUS (the default), the number of function keys is returned.  When COMPATIBLE is set to DB4, the number of function key and function key combinations (F1, Ctrl+F1, Shift+F1, F2, Ctrl+F2, Shift+F2 ...) is returned.


FKMAX( ) Example

SET COMPATIBLE DB4
? FKMAX( )

SET COMPATIBLE FOXPLUS
? FKMAX( )


FKMAX() SeeAlso
See Also

FKLABEL( ) Function

SET COMPATIBLE Command

SET FUNCTION Command


FLDLIST( ) Function

See Also

Returns the fields and calculated field expressions in a field list specified with SET FIELDS.

Syntax

FLDLIST([<expN>])

Returns

Character

Remarks

Included for compatibility with dBASE.

SET FIELDS is used to specify a set of fields in a table that can be accessed and displayed and to create calculated fields.

Parameter

<expN>

Specifies which field or calculated field expression is returned from the field list. If <expN1> is 1, the first field or calculated field expression is returned. If <expN1> is 2, the second field or calculated field expression is returned and so on. If <expN1> is greater than the number of fields and calculated field expressions in the field list, the null string is returned.

If <expN> is omitted, FLDLIST( ) returns the entire set of fields and calculated field expressions in the field list.


FLDLIST( ) SeeAlso
See Also

SET FIELDS


FLOCK( ) Function

See Also	Example

Attempts to lock the current or specified table.

Syntax

FLOCK([<expN> | <expC>])

Returns

Logical

Remarks

True (.T.) is returned if the table is successfully locked.  False (.F.) is returned if the table or a record in the table is locked by another user.

Note   If FLOCK( ) fails to lock a table, it returns false (.F.) and does not generate an error.  As a result, you can't use FLOCK( ) to trigger an ON ERROR routine.

When a table is locked, the table is available for both read and write access by the user who placed the lock.  Other users on the network have read-only access to the table.  See SET EXCLUSIVE and USE for information on how to lock a table and prevent access to it by other users.

A table remains locked until it is unlocked by the user who placed the lock.  The table can be unlocked by issuing UNLOCK, closing the table or quitting FoxPro.  Tables can be closed with USE, CLEAR ALL or CLOSE DATABASES.

By default, FLOCK( ) attempts to lock a table once.  Use SET REPROCESS to automatically retry a table lock when the first attempt fails.  SET REPROCESS determines the number of lock attempts, or the length of time lock attempts are made, when the initial lock attempt is unsuccessful.  For more information, see SET REPROCESS.

You can establish relations between two or more tables with SET RELATION.  Placing a file lock on a table that is related to one or more tables doesn't place a file lock on the related tables.  You must explicitly place and remove locks on the related tables.

Parameter

<expN> | <expC>

FLOCK( ) attempts to place a lock on the table in the current work area if you don't specify a work area number or a table or work area alias.  Include the work area number <expN> or the table or work area alias <expC> to place a lock on a table in another work area.

For additional information about record and file locking and sharing tables on a network, see the FoxPro in a Multi-User Environment chapter in the FoxPro Developer's Guide.


FLOCK( ) Example

CLOSE DATABASES
SET REPROCESS TO 3 SECONDS
SELECT * FROM parts INTO TABLE newparts

IF FLOCK( )

*** Year end sales & commission initialization ***

REPLACE ALL onhand  WITH 0.00
REPLACE ALL onorder WITH 0.00
WAIT 'Initialization Complete - Press any key' WINDOW NOWAIT

ELSE

*** File is locked, warn user ***

WAIT WINDOW 'Unable to open sales file, try again later!' NOWAIT
ENDIF

BROWSE
CLOSE DATABASES
ERASE newparts.dbf


FLOCK() SeeAlso
See Also

LOCK( ) Function

RLOCK( ) Function

SET REPROCESS Command

SET RELATION Command

UNLOCK Command

USE Command

SET EXCLUSIVE Command


FLOOR( ) Function

See Also	Example

Returns the nearest integer that is less than or equal to the specified numeric expression.

Syntax

FLOOR(<expN>)

Returns

Numeric

Remarks

FLOOR( ) rounds a positive number with a fractional portion down to the integer portion of the number, and rounds a negative number with a fractional portion down to the next lowest integer.

Parameter

<expN>

FLOOR( ) returns the nearest integer that is less than or equal to <expN>.


FLOOR( ) Example

STORE  10.9 TO num1
STORE -10.1 TO num2
STORE  10.0 TO num3
STORE -10.0 TO num4

? FLOOR(num1)

? FLOOR(num2)

? FLOOR(num3)

? FLOOR(num4)

WAIT WINDOW STR(FLOOR(num1+num3)) NOWAIT
@ 5,0 SAY FLOOR (18.1)


FLOOR() SeeAlso
See Also

CEILING( ) Function

INT( ) Function

ROUND( ) Function


FLUSH Command

See Also

Saves table and index modifications to disk.

Syntax

FLUSH

Remarks

FLUSH ensures that modifications you make to tables and their indexes are saved to disk.  Modifications to all open tables and indexes are written to disk.

FoxPro automatically saves changes to disk when:

You close a table with USE or CLOSE DATABASES.  Only information for the file or files you close is flushed to disk.

You unlock a record or file.  Only information for the record or file unlocked is flushed to disk.


FLUSH SeeAlso
See Also

CLOSE DATABASES Command

FFLUSH( ) Function

SET AUTOSAVE Command


FONTMETRIC( ) Function

See Also

Returns font attributes for the current installed fonts of the operating system.

Syntax

FONTMETRIC(<expN1>[, <expC1>, <expN2>[, <expC2>]])

Returns

Numeric

Remarks

WFONT( ) is supported in FoxPro for Windows and FoxPro for Macintosh.

WFONT( ) can be used to determine the current window font.

For additional information on installing or removing fonts for Microsoft Windows, see the "Control Panel" chapter in your Microsoft Windows User's Guide.

For additional information on installing or removing fonts for the Macintosh, see the "Printing" chapter in your Macintosh User's Guide.

Parameters

<expN1>

<expN1> determines the font attribute returned by FONTMETRIC( ).  An attribute for the current font for the active output window is returned if <expC1> and <expN2> are omitted.

The following table lists values for <expN1> and the corresponding font attributes returned.

<expN1>	Attribute

1	Character height in pixels

2	Character ascent (units above baseline) in pixels

3	Character descent (units below baseline) in pixels

4	Leading (space between lines) in pixels

5	Extra leading in pixels*

6	Average character width in pixels

7	Maximum character width in pixels

8	Font weight. FoxPro for Macintosh always returns 700 for bold fonts, and 400 for all others.

9	Italic (0 =no, nonzero=yes)

10	Underlined (0 = no, nonzero = yes)

11	Strikeout (0 = no, nonzero = yes)

12	First character defined in font

13	Last character defined in font

14	Default character (substituted for characters not in font)*

15	Word-break character. FoxPro for Macintosh always returns 32, a space in non-symbol fonts.

16	Pitch and family*

17	Character set*

18	Overhang (extra added width)*

19	Horizontal aspect for font device

20	Vertical aspect for font device

*These attributes are not available in FoxPro for Macintosh, and always return 0.

For more information about the numeric values returned by FONTMETRIC( ), see the TEXTMETRIC function in the Microsoft Windows Programmer's Reference.

<expC1>

To return an attribute for a specific installed font, specify the font's name with <expC1>.

<expN2>

Specify the point size with <expN2> of the font specified with <expC1>.

<expC2>

Specify a font style code with <expC2> to return an attribute for a  specific font style.  If <expC2> is omitted, the attribute is returned for the normal font style.

<expC2> can be a character or a combination of characters listed in the following font style table.  For example, the combination BI specifies the bold italic font style.

Character	Font Style

B	Bold

C	Condense*

E	Extend*

I	Italic

N	Normal

O	Outline

Q	Opaque

S	Shadow

-	Strikeout*

T	Transparent

U	Underline

*The Condense and Extend styles are only available in FoxPro for Macintosh. The Strikeout style is only available in FoxPro for Windows.


FONTMETRIC() SeeAlso
See Also

AFONT( ) Function

GETFONT( ) Function

SYSMETRIC( ) Function

TXTWIDTH( ) Function

WFONT( ) Function


FOPEN( ) Function

See Also	Example

Opens a file or communication port for use with low-level file functions.

Syntax

FOPEN(<expC>[, <expN>])

Returns

Numeric

Remarks

Ports cannot be opened in FoxPro for Windows and FoxPro for Macintosh.

If FOPEN( ) successfully opens a file or communications port, the file handle number of the file or port is returned.  FOPEN( ) returns -1 if the file or port cannot be opened.>

Tip   Assign the file handle number to a memory variable for use with other low-level file functions.

Information about files opened with FOPEN( ) can be displayed or sent to a printer with DISPLAY STATUS or LIST STATUS.  DISPLAY STATUS and LIST STATUS give the following information about each file opened with a low-level function:

The drive, directory and file name.

The file handle number.

The file pointer position.

The read/write attributes.

Use CLOSE ALL to close all files opened with a low-level function.

Parameters

<expC>

Include in <expC> the name of the file or communication port to open.  If <expC> is a file name, it can include a path to open files in directories or drives not in the current search path.  If a path isn't included, FoxPro searches for the file in the following order:

The current directory.

The path established with SET PATH.

If <expC> is a communications port, the port must first be initialized with the MS-DOS MODE command.  Specify the name of the port, for example COM1 or COM2.

Ports cannot be opened with low-level file functions in FoxPro for Windows and FoxPro for Macintosh.

<expN>

Use <expN> to specify read/write privileges or buffering scheme for the file you open.  The following table lists each number you can include in <expN>, and the read/write file privileges and buffering scheme it establishes.

<expN>	Read/Write Privileges	Buffered/Unbuffered
0	Read Only (default)	Buffered
1	Write -Only	Buffered
2	Read and Write	Buffered
10	Read-Only	Unbuffered
11	Write-Only	Unbuffered
12	Read and Write	Unbuffered
If <expN> isn't included, or if  <expN> evaluates to 0, the file is opened as read only and is buffered.  Communication ports should always be opened unbuffered.


FOPEN( ) Example

IF FILE('errors.txt')	&& Does file exist?
errfile = FOPEN('errors.txt',12)	&& If so, open read/write
ELSE
errfile = FCREATE('errors.txt')	&& If not create it
ENDIF
IF errfile < 0	&& Check for error opening file
WAIT 'Cannot open or create output file' WINDOW NOWAIT
ELSE	&& If no error, write to file
=FWRITE(errfile, 'Error information to be written here')
ENDIF

=FCLOSE(errfile)	&& Close file
MODIFY FILE errors.txt NOWAIT	&& Open file in edit window


FOPEN() SeeAlso
See Also

CLOSE ALL Command

FCHSIZE( ) Function

FCLOSE( ) Function

FCREATE( ) Function

FEOF( ) Function

FFLUSH( ) Function

FGETS( ) Function

FPUTS( ) Function

FREAD( ) Function

FSEEK( ) Function

FWRITE( ) Function


FOR ... ENDFOR Command

See Also	Example

Executes the commands after FOR and before ENDFOR within a loop a specified number of times.

Syntax

FOR <memvar> = <expN1> TO <expN2> [STEP <expN3>]
<statements>
[EXIT]
[LOOP]
ENDFOR | NEXT

Remarks

A memory variable or an array element is used as a counter to specify how many times the statements inside the loop are executed.

Program statements after FOR are executed until ENDFOR or NEXT is reached.  The counter <memvar> is then incremented by the value of <expN3>.  The counter is incremented by 1 if the STEP clause is omitted. The counter is then compared with the final value <expN2>.  If the counter is less than or equal to the final value <expN2>, the statements following the FOR clause are executed again.  If the counter is greater than the final value <expN2>, program execution branches outside the FOR ... ENDFOR loop and continues with the first command following ENDFOR or NEXT.

Note   The values of <expN1>, <expN2> and <expN3> are read initially only.  However,  changing the value of the counter <memvar> inside the loop affects the number of times the loop is executed.

If the value of <expN3> is negative and the initial value <expN1> is greater than the final value <expN2>, the counter is decreased each time through the loop.

Clauses

<memvar>

<memvar> is a memory variable or an array element that acts as a counter.  The memory variable or array element doesn't have to exist before FOR ... ENDFOR is executed.

<expN1> TO <expN2>

<expN1> is the initial value of the counter, and <expN2> is the final value of the counter.

STEP <expN3>

<expN3> is the amount the counter is incremented or decremented.  If <expN3> is negative, the counter is decremented.  If the STEP clause is omitted, the counter is incremented by 1.

<statements>

This clause specifies the FoxPro commands to be executed.  <statements> can include any number of commands.

EXIT

EXIT transfers control from within the FOR ... ENDFOR loop to the command immediately following the ENDFOR key word.  You can place EXIT anywhere between FOR and ENDFOR.

LOOP

LOOP can be placed anywhere between FOR and ENDFOR.  Including LOOP returns control directly back to the FOR clause without executing the statements between LOOP and ENDFOR.  The counter is incremented or decremented as if ENDFOR were reached.


FOR ... ENDFOR Example
FOR ... ENDFOR Examples

In the first example, the numbers 1 through 10 are displayed.

CLOSE DATABASES
CLEAR
FOR mcount = 1 TO 10
? mcount
ENDFOR

The second example uses memory variables for the initial, final and STEP values to display all even-numbered records from 2 through 10 in CUSTOMER.DBF.

SET TALK OFF
USE customer
GO TOP
STORE 2 TO I
STORE 10 TO J
STORE 2 TO K
FOR mcount = I TO J STEP K
GOTO mcount
DISPLAY UPPER (company)
ENDFOR
USE	&& Close customer


FOR ... ENDFOR  SeeAlso
See Also

DO CASE ... ENDCASE Command

DO WHILE ... ENDDO Command

IF ... ENDIF Command

SCAN ... ENDSCAN Command


FOR( ) Function

See Also

Returns the index filter expression of an open single-entry .IDX index file or an index tag.

Syntax

FOR([<expN1>[, <expN2> | <expC>]])

Returns

Character

Remarks

You can create filtered indexes in FoxPro.  If you include the optional FOR <expL> clause in INDEX, the index file acts as a filter on the table.  Only records that match the filter expression <expL> are available for display and access.  Index keys are created in the index file for just those records matching the filter expression.

USE and SET INDEX both support an index file name list that lets you open index files for a table.  Any combination of single-entry index file names, structural compound or independent compound index file names may be included in the index file name list.

FOR( ) is identical to SYS(2021) and is provided for compatibility with dBASE IV.

Parameters

If you don't include any of the optional parameters, FOR( ) returns the index filter expression for the master index file or index tag. If a master index file or index tag isn't in effect (for example, you've issued SET ORDER TO to place the table in natural record order), FOR( ) returns the null string.

<expN1>

The numeric expression <expN1> specifies which filter expression to return from the open index files or tags.  FOR( ) returns filter expressions from open index files and tags in the following order:

1	Filter expressions from single-entry index files (if any are open) are returned first.  The order the single-entry index files are included in USE or SET INDEX determines the order the filter expressions are returned.

2	Filter expressions for each tag in the structural compound index (if one is present) are returned next.  The filter expressions are returned from the tags in the order the tags are created in the structural index.

3	Filter expressions for each tag in any open independent compound indexes are returned last.  The filter expressions are returned from the tags in the order the tags are created in the independent compound indexes.

The null string is returned if an index or index tag is created without a FOR clause or <expN1> is greater than the total number of open single-entry files and structural compound and independent compound index tags.

<expN2> | <expC>

Filter expressions are returned from index files open in the current work area unless you include an optional work area or alias.  To return filter expressions from index files open in a specific work area, include the work area number <expN2> or the table alias <expC>.  If a table doesn't have the alias you specify, the message "Alias not found" is displayed.


FOR( ) SeeAlso
See Also

INDEX Command

SET INDEX Command

SET ORDER Command

SYS( ) Functions Overview

USE Command


FOUND( ) Function

See Also	Examples

Returns true if CONTINUE, FIND, LOCATE or SEEK is successful.

Syntax

FOUND([<expN> | <expC>])

Returns

Logical

Remarks

FOUND( ) returns a logical value that indicates whether the most recently executed CONTINUE, FIND, LOCATE or SEEK  was successful or the record pointer was moved in a related table.

True (.T.) is returned if the search is successful, and false (.F.) is returned if the search is unsuccessful.

Tip   This function is useful for determining whether a child table has a record that matches the parent record.

Parameters

<expN> | <expC>

FOUND( ) can return a value for each work area.  If you don't specify a work area or table alias, FOUND( ) returns a value for the table in the current work area.  To return a value for a table in a specific work area, include the work area number <expN> or the table alias <expC>.

If a table isn't open in the specified work area, FOUND( ) returns false (.F.).  If no table has the alias you specify, the message "Alias not found" is displayed.


FOUND( ) Example
FOUND( ) Examples

SET TALK WINDOW
SET SAFETY OFF
CLOSE DATABASES
USE invoices ORDER cno
SELECT 0
USE customer
SET RELATION TO cno INTO invoices
COPY TO newfile FOR FOUND('invoices')
SELECT 0
USE newfile
BROWSE
CLOSE DATABASES
ERASE newfile.dbf

In the following example, all customers from New York City are counted.

SET TALK OFF
CLOSE DATABASES
USE customer
STORE 0 TO mcount
LOCATE FOR city = 'New York'
DO WHILE FOUND( )
mcount = mcount + 1
CONTINUE
ENDDO
WAIT WINDOW 'Total customers from New York City: ' ;
+ LTRIM(STR(mcount)) NOWAIT
USE	&& Close table


FOUND() SeeAlso
See Also

CONTINUE Command

EOF( ) Function

FIND Command

LOCATE Command

SEEK Command


FPUTS( ) Function

See Also	Example

Writes a character string, carriage return and line feed to a file or a communication port opened with a low-level file function.

Syntax

FPUTS(<expN1>, <expC>[, <expN2>])

Returns

Numeric

Remarks

FPUTS( ) returns the number of bytes written to the file or port.  0 is returned if FPUTS( ) can't write to the file or port for any reason.

Parameters

<expN1>

FPUTS( ) writes to the file or communication port specified with the file handle number <expN1>.

<expC>

The character expression that FPUTS( ) writes to the file or port is specified with <expC>.

<expN2>

FPUTS( ) writes the entire character expression <expC> to the file or port unless <expN2> is included.  When <expN2> is included, <expN2> characters are written to the file or port.  If <expN2> is less than the number of characters in <expC>, only <expN2> characters are written to the file or port.  All of <expC> is written to the file or port if <expN2> is equal to or greater than the number of characters in <expC>.


FPUTS( ) Example
FPUTS( ) and FWRITE( ) Example

The following example creates and opens a temporary file.  If the file is successfully created, a window is displayed in which you can enter your first name, last name and position.  This information is written to the temporary file, which the FoxPro editor displays.  If the file isn't created, the FoxPro editor displays the empty file.

SET TALK OFF
CLEAR
tmpfile = SYS(3)	&& Create a temporary file name
handle = FCREATE(tmpfile)	&& Open the temporary file

IF handle < 0
DEFINE WINDOW alert FROM 7,17 TO 12,60 DOUBLE COLOR SCHEME 7

DO CASE	&& Unable to open the temporary file.
CASE FERROR( ) = 4
reason = 'Too many files open (out of handles)'
CASE FERROR( ) = 5
reason = 'Out of memory'
CASE FERROR( ) = 29
reason = 'Disk full'
CASE FERROR( ) = 31
reason = 'General Failure'
ENDCASE

ACTIVATE WINDOW alert
@ 1,7 SAY 'Unable to open file'
@ 2,7 SAY 'Reason: ' + reason
@ 3,7 SAY 'Press a key to exit'
=INKEY(0)
DEACTIVATE WINDOW alert
CANCEL
ELSE
STORE SPACE(15) TO fname, lname, pos
DEFINE WINDOW wingets FROM 10,20 TO 18,60 ;
CLOSE FLOAT SHADOW SYSTEM COLOR SCHEME 8 TITLE ' Name Entry '
ACTIVATE WINDOW wingets
@ 1,5 SAY 'First Name:' GET fname
@ 3,5 SAY 'Last Name :' GET lname
@ 5,5 SAY 'Position  :' GET pos
READ
=FWRITE(handle,'First name: ')
=FPUTS(handle,fname)
=FWRITE(handle,'Last name: ')
=FPUTS(handle,lname)
=FWRITE(handle,'Position: ')
=FPUTS(handle,pos)
=FCLOSE(handle)  && Close the file
DEACTIVATE WINDOW wingets
WAIT 'Press a key to view the file' WINDOW
ENDIF
IF !WEXIST('wingets')
DEFINE WINDOW wingets FROM 10,20 TO 18,60 ;
CLOSE FLOAT SHADOW SYSTEM ;
COLOR SCHEME 8 TITLE ' Name Entry '
ENDIF

MODIFY FILE (tmpfile) WINDOW wingets NOWAIT	&& See created file
CLEAR WINDOW


FPUTS() SeeAlso
See Also

FCHSIZE( ) Function

FCLOSE( ) Function

FCREATE( ) Function

FEOF( ) Function

FFLUSH( ) Function

FGETS( ) Function

FOPEN( ) Function

FREAD( ) Function

FSEEK( ) Function

FWRITE( ) Function


FREAD( ) Function

See Also	Example

Returns a specified number of bytes from a file or a communication port opened with a low-level function.

Syntax

FREAD(<expN1>, <expN2>)

Returns

Character

Parameters

<expN1>

FREAD( ) returns data from the file or communication port specified by the file handle number <expN1>.

<expN2>

The number of bytes returned by FREAD( ) is determined by <expN2> and the position of the file pointer.  FREAD( ) returns data starting from the current file pointer position and continues until it returns <expN2> bytes, or until it encounters the end of the file, whichever is first.


FREAD( ) Example

*** TEST.TXT must exist ***

STORE FOPEN('test.txt') TO file_handle	&& Open the file

STORE FSEEK(file_handle, 0, 2) TO ifp_size	&& Move pointer to EOF

STORE FSEEK(file_handle, 0) TO ifp_top	&& Move pointer to BOF

IF ifp_size <= 0	&& Is File empty?
WAIT WINDOW 'This file is empty!' NOWAIT
ELSE	&& If not empty
l_string = FREAD(file_handle, ifp_size)	&& Store to memory
? l_string
ENDIF

= FCLOSE(file_handle)	&& Close the file


FREAD() SeeAlso
See Also

FCHSIZE( ) Function

FCLOSE( ) Function

FCREATE( ) Function

FEOF( ) Function

FFLUSH( ) Function

FGETS( ) Function

FOPEN( ) Function

FPUTS( ) Function

FSEEK( ) Function

FWRITE( ) Function


FSEEK( ) Function

See Also	Example

Moves the file pointer in a file opened with a low-level file function.

Syntax

FSEEK(<expN1>, <expN2>[, <expN3>])

Returns

Numeric

Remarks

After moving the file pointer, FSEEK( ) returns the number of bytes the file pointer is from the beginning of the file.  The file pointer can also be moved with FREAD( ) and FWRITE( ).

Parameters

<expN1>

FSEEK( ) moves the file pointer in the file with the file handle number <expN1>.  A file handle number is returned by FCREATE( ) or FOPEN( ) when the file is created and/or opened.

<expN2>

The number of bytes to move the file pointer is specified by <expN2>.  The file pointer is moved toward the end of the file if <expN2> is positive.  The file pointer is moved toward the beginning of the file if <expN2> is negative.

<expN3>

By default, the file pointer is moved relative to the beginning of the file.  You can alternatively move the file pointer relative to the beginning or the end of the file by including <expN3>.  The following table lists each value for <expN3> and how it causes the file pointer to move.

<expN3>	Movement Relative to:

0	The beginning of the file (default)

1	The current file pointer position

2	The end of the file


FSEEK( ) Example

The following user-defined function uses FSEEK( ) to return the size of a file.  If you don't pass parameters to the UDF, it returns -2.  If the file cannot be found, the UDF returns -1.

FUNCTION fsize2
PARAMETERS mfile 	&& File to be checked
PRIVATE mhandle,fsize

IF PARAMETERS( ) = 0
RETURN -2	&& Return -2 if no parameter passed
ELSE
IF !FILE(mfile)
RETURN -1	&& Return -1 if file does not exist
ENDIF
ENDIF
mhandle = FOPEN(mfile)	&& Open file
fsize = FSEEK(mhandle,0,2)	&& Determine file size, assign to fsize
=FCLOSE(mhandle)	&& Close file
RETURN fsize	&& Return value


FSEEK() SeeAlso
See Also

FCHSIZE( ) Function

FCLOSE( ) Function

FCREATE( ) Function

FEOF( ) Function

FFLUSH( ) Function

FGETS( ) Function

FOPEN( ) Function

FPUTS( ) Function

FREAD( ) Function

FWRITE( ) Function


@ ... BOX Command

See Also	Examples

Draws a box using specified coordinates.

Syntax

@ <row1, column1>, <row2, column2> BOX
[<expC>]

Remarks

This command draws a box on the desktop in FoxPro for MS-DOS, in the main FoxPro window or in a user-defined window.

Clauses

<row1, column1>, <row2, column2>

<row1, column1> are the coordinates of the upper-left corner of the box, and <row2, column2> are the coordinates of the lower right corner of the box.  If row1 and row2 are the same, a horizontal line is drawn.  If column1 and column2 are the same, a vertical line is drawn.

<expC>

The characters used to draw the box can be specified by including <expC>, the character expression, which can include nine characters [image] one for each corner, one for each side and one to fill the box.  The characters are displayed starting with the upper-left corner and continuing clockwise.  If a ninth character is specified, it is used to fill the interior of the box.  If just one character is specified, it is used to draw the entire border.  If <expC> is omitted, the box is drawn using a single-line.


@ ... BOX Example
@ ... BOX Examples

This example draws a single-line box:

@ 10,20,14,60 BOX

The next example draws a box composed of shaded rectangles.  REPLICATE( ) returns nine rectangles, which @ ... BOX uses to draw each corner and side of the box. It then fills the box with the shaded rectangles.

@ 10,20,14,60 BOX REPLICATE(CHR(177),9)


@ ... BOX SeeAlso
See Also

@ ... TO Command


@ ... CLEAR Command

See Also	Examples

Clears a portion of the main FoxPro window, or a user-defined window.

Syntax

@ <row1, column1>
[CLEAR | CLEAR TO <row2, column2>]

Clauses

<row1, column1>

These are the coordinates of the upper-left corner of the area to clear.

<row2, column2>

If you omit CLEAR or CLEAR TO, FoxPro clears row1 from column1 to the end of the row.

If you include CLEAR, FoxPro clears a rectangular area whose upper-left corner begins at row1 and column1 and continues to the bottom-right corner of the desktop, main FoxPro window, or user-defined window.

If you include CLEAR TO <row2, column2>, FoxPro clears a rectangular area whose upper-left corner begins at row1 and column1 and ends at row2 and column2.


@ ... CLEAR Example
 @ ... CLEAR Examples

This example clears the screen, main FoxPro window, or user-defined window from the second row to the bottom of the desktop or window.

@ 2,0 CLEAR

The next example clears a rectangular region.  The upper-left corner of the area is cleared from row 10, column 0 to row 20, column 20.

@ 10,0 CLEAR TO 20,20


@ ... CLEAR SeeAlso
See Also

CLEAR Commands


@ ... FILL Command

See Also	Example

Changes the colors of existing text within an area of the screen.

Syntax

@ <row1, column1> FILL TO <row2, column2>
[COLOR SCHEME <expN> | COLOR <color pair list>]

Remarks

This command changes the colors of text within a rectangular area of the desktop in FoxPro for MS-DOS, the main FoxPro window, or a user-defined window.  You can set the foreground and background color attributes for existing text only.  Any text output to the same area after you issue @ ... FILL is displayed in the default screen colors.  For more information on defining colors, see SET COLOR Commands Overview.

Clauses

<row1, column1> ... TO <row2, column2>

The upper-left corner of the area is specified with <row1, column1>, and the bottom-right corner is specified with <row2, column2>.

COLOR SCHEME <expN> | COLOR <color pair list>

The color of the rectangular area can be specified by including the number of an existing color scheme in the COLOR SCHEME clause or a set of color pairs in the COLOR clause.

A color scheme is a set of 10 predefined color pairs.  The color pairs in a color scheme can be changed with SET COLOR OF SCHEME.  In FoxPro for MS-DOS the color pairs in a color scheme can also be changed in the Color Picker.

A color pair is a set of two letters separated by a forward slash.  The first color letter specifies the foreground color and the second letter specifies the background color.

For example, this color pair specifies a red foreground on a white background:

R/W

For a list of colors and their corresponding color letters, see SET COLOR Commands Overview or Color Table by Color Pair.

A color pair can also be specified with a set of 6 RGB (Red Green Blue) color values separated by commas.  The first 3 color values specify the foreground color and the second 3 color values specify the background color.  The color values can range from 0 through 255.

The R/W color pair in the example above can also be specified with this RGB color pair:

RGB(255,0,0,255,255,255)

Only the first color pair in the specified color scheme or color pair list determines the color of the area.

If you omit one of the color clauses, the rectangular portion is cleared.  An area can also be cleared with @ ... CLEAR.


@ ... FILL Example

The following example clears the desktop or the main FoxPro window and fills an area with color.

CLEAR
@ 4,1 FILL TO 10, 8 COLOR GR+/B


@ ... FILL SeeAlso
See Also

SET COLOR Commands Overview


@ ... MENU Command

See Also	Example

Creates a menu popup.

Syntax

@ <row, column> MENU <array>, <expN1>
[, <expN2>]
[TITLE <expC>]
[SHADOW]

Remarks

@ ... MENU is included for backward compatibility.  Use the Menu Builder to create menus and menu popups.

This command creates a menu popup.  A menu popup is a bordered box that contains a list of options you can choose from.  Menu popups are activated when READ MENU is issued. Only one menu popup can be active at a time.

DEFINE POPUP and ACTIVATE POPUP are another pair of commands that create and activate menu popups.  DEFINE POPUP and ACTIVATE POPUP operate independently of @ ... MENU and READ MENU.

Clauses

<row, column>

<row, column> are numeric expressions that specify where the top-left corner of the menu popup is placed on the desktop in FoxPro for MS-DOS, the main FoxPro window or a user-defined window.

<array>

<array> is a one-dimensional array containing the options that appear on the menu popup.  Menu options must be character type.

<expN1>

The numeric expression <expN1> is the total number of menu options available on the menu popup.  If the array has 10 elements and the value of <expN1> is 5, the first five elements of the array are available on the menu popup.

<expN2>

The numeric expression <expN2> is the number of menu options displayed on the menu popup.  If <expN1> is greater than <expN2>, <expN2> determines how many options are displayed on the popup.  If there are too many options to fit on the menu popup, you can scroll through them using the keyboard or the mouse.

TITLE <expC>

The character expression <expC> is the title displayed in the top border of the menu popup.

SHADOW

Behind a menu popup defined with SHADOW is a darkened area that resembles a shadow.  Text or objects covered by the shadow are still visible.  By default, popup menus don't have shadows.


@ ... MENU Example

SET TALK OFF
CLEAR
DIMENSION choices(3)
STORE 'Chicken' TO choices(1)
STORE 'Beef' TO choices(2)
STORE 'Fish' TO choices(3)
STORE 0 TO mchoice
@ 5,0 MENU choices,3 TITLE 'Dinner Choices'
READ MENU TO mchoice

DO CASE
CASE mchoice = 1
@ 10,0 SAY 'You will be having chicken for dinner.'
CASE mchoice = 2
@ 10,0 SAY 'You will be having beef for dinner.'
CASE mchoice = 3
@ 10,0 SAY 'You will be having fish for dinner.'
ENDCASE


@ ... MENU SeeAlso
See Also

CREATE MENU Command

DEFINE POPUP Command

MENU Command

MENU TO Command

READ MENU Command


@ ... GET - Spinners Command
@ ... GET [image] Spinners Command

See Also

Creates a spinner.

Syntax

@ <row, column> GET <memvar> | <field>
SPINNER <expN1>[, <expN2>[, <expN3>]]
[FUNCTION <expC1>]
[PICTURE <expC2>]
[FONT <expC3>[, <expN4>]]
[STYLE <expC4>]
[DEFAULT <expN5>]
[SIZE <expN6>, <expN7>]
[ENABLE | DISABLE]
[MESSAGE <expC5>]
[RANGE [<expN8>] [, <expN9>]]
[VALID <expL1> | <expN10> [ERROR <expC6>]]
[WHEN <expL2>]
[COLOR SCHEME <expN11> | COLOR <color pair list>]

Remarks

@ ... GET [image] Spinners is supported in FoxPro for Windows and FoxPro for Macintosh.

A spinner is a control that lets you "spin" through a set of numeric values displayed in a text box.

If you use the Screen Builder to create your data entry screens, you may not have to use this command at all.  The Screen Builder automatically generates the commands that create spinners.

Clicking the up and down arrows changes the numeric value.  You can also enter a value directly into the spinner text box.  When the value you want is displayed in the text box, press Enter or Tab to move to the next object.

Using the spinner syntax in FoxPro for MS-DOS creates a numeric @ ... GET editing region.  You must enter a numeric value into the editing region with the keyboard.  The increment value (<expN1>), the lower and upper limit values (<expN2>, <expN3>) and the FONT and STYLE clauses are ignored.

Clauses

<row, column>

The spinner is placed at the location designated by <row, column>.  The row and column coordinates are numeric expressions.  Row and column values can range from 0 through the maximum number of rows and columns on the desktop (FoxPro for MS-DOS), the main FoxPro window, or a user-defined window.  Rows are numbered from top to bottom. In FoxPro for Windows, row 0 is the row immediately under the FoxPro system menu bar. In FoxPro for Macintosh, row 0 is the row immediately under the FoxPro title bar.

In FoxPro for Windows the position and size of the spinner in the main FoxPro window or in a user-defined window are determined by the font of the main FoxPro window or the user-defined window.  Most fonts can be displayed in a wide variety of sizes, and some are proportionally spaced; thus, positions and sizes depend on the current font.  A row corresponds to the height of the current font.  A column corresponds to the average width of a letter in the current font.  For more information, see Fonts.

To facilitate precise positioning of a spinner in the main FoxPro window or in a user-defined window, you can use decimal fractions for row and column coordinates.

GET <memvar> | <field>

The numeric value contained in <memvar> or <field> is the initial value displayed in the spinner before READ or READ CYCLE is issued.

When you choose a value in the spinner, your choice is stored to the numeric memory variable or array element <memvar> or to the numeric field <field>.

SPINNER <expN1>[, <expN2>[, <expN3>]]

The values displayed in the spinner are specified with <expN1>, <expN2> and <expN3>.

The value displayed in the spinner text box is incremented or decremented by the value specified with <expN1>.  For example, if <expN1> is 2 and you click the up or down arrow, the value in the text box increases or decreases by 2.

The following example defines a spinner for the memory variable MCHOICE.  The spinner increments by 1 with a lower limit of -5 and an upper limit of 24.  The initial value displayed is 3.

@ 2,2 GET mchoice SPINNER 1, -5, 24 DEFAULT 3

The minimum value that can be displayed in the spinner is specified with <expN2>, and the maximum value that can be displayed is specified with <expN3>.  However, using the keyboard you can enter a value in the text box that lies outside the range specified with <expN2> and <expN3>.  Use VALID or RANGE to control the what values can be entered in the text box with the keyboard.

[FUNCTION <expC1>]
[PICTURE <expC2>]

When creating spinners, you can include the FUNCTION clause, the PICTURE clause or both.  There is no advantage to any of the three methods.  The FUNCTION and PICTURE clauses control how <memvar> or <field> is displayed and edited in the text box.

The following table shows how the FUNCTION clause <expC1> determines how values are displayed in the spinner text box.

<expC1>	Purpose

B	Left justifies the value in the text box.

I	Centers the value in the text box.

J	Right justifies the value in the text box.

K	Selects the entire value for editing when the cursor is moved to the spinner.

L	Displays leading zeros before the value.

Z	Displays the value as blank if it is 0.

^	Displays the value using scientific notation.

$	Displays the value in a currency format. The currency symbol appears to the left or right of the value depending on the setting of SET CURRENCY.

The PICTURE clause character expression <expC2> determines what values can be entered in the text box and how values are displayed.  The PICTURE clause expression <expC2> operates on individual characters in the spinner.  You should include enough mask characters to allow entry of the highest value you anticipate in addition to any signs or symbols.

The 2 (two-dimensional) and 3 (three-dimensional) specification codes are only available in FoxPro for Macintosh.

<expC2>	Purpose

9	Allows you to enter digits and signs ( ).

#	Allows you to enter digits, blanks and signs ( ).

$	Displays the current currency symbol (specified with SET CURRENCY).

*	Asterisks are displayed to the left of the value.

.	A period specifies the decimal point position.

,	Commas can be included to separate digits to the left of the decimal point.

2	Creates a flat (two-dimensional) spinner identical to spinners in Macintosh dialogs. This is the default spinner type in FoxPro for Macintosh.

3	Creates a three-dimensional spinner identical to spinners in FoxPro for Macintosh dialogs.

FONT <expC3>[, <expN4>]

The character expression <expC3> is the name of the font, and the numeric expression <expN4> is the font size.  If <expN4> is omitted, a 10 point font is used.  For example, the following command displays the text in the spinner in 16-point Courier font:

@ 2, 2 GET mchoice SPINNER 1, 1, 10 DEFAULT 3 FONT 'Courier', 16

If you include the FONT clause but omit the font size <expN4>, a 10 point font is used.

If the FONT clause is omitted and the spinner is placed in the main FoxPro window, the main FoxPro window font is used.  If the FONT clause is omitted and the spinner is placed in a user-defined window, the user-defined window font is used.

If the font you specify is not available, a font with similar font characteristics is substituted.

The FONT clause is ignored in FoxPro for MS-DOS.

STYLE <expC4>

In FoxPro for Windows and FoxPro for Macintosh, include the STYLE clause to specify a font style for the spinner.  If the font style you specify is not available, a font style with similar characteristics is substituted.

The font style is specified with <expC4>.  If the STYLE clause is omitted, the standard font style is used.

Character	Font Style

B	Bold

C	Condense*

E	Extend*

I	Italic

N	Normal

O	Outline

S	Shadow

-	Strikeout*

U	Underline

*The Condense and Extend styles are available only in FoxPro for Macintosh. The Strikeout style is available only in FoxPro for Windows.

You can include more than one character to specify a combination of font styles.  For example, the following command displays the text in the spinner in Bold Italic:

@ 2, 2 GET mchoice SPINNER 1, 1, 10 DEFAULT 3 STYLE 'BI'

DEFAULT <expN5>

When you exit a spinner, the value in the spinner is saved to the memory variable, array element or field you specify.  If you specify a memory variable that doesn't exist, it is automatically created and initialized to <expN5> if you include DEFAULT.  However, an array element isn't created if you specify an array element in a DEFAULT clause.  The DEFAULT clause is ignored if the memory variable already exists or you specify a field.

Note   If the DEFAULT clause isn't included and <memvar> doesn't exist, the error message "Variable not found" is displayed.

SIZE <expN6>, <expN7>

The SIZE <expN6> expression specifies the height of the spinner.  The height of the spinner is a multiple of the height of the current font or the font you specify when you create the spinner.  For example, if <expN6> is 2, the height of the spinner is twice the height of the current font or the font you specify.

The numeric expression <expN7> specifies the width of the spinner.  The width of the spinner is a multiple of the average width of a letter in the current font or the font you specify when you create the spinner.  For example, if <expN7> is 2, the width of the spinner is twice the width of the average width of the current font or the font you specify.

The spinner font determines the size of the spinner.  The spinner font is specified with the FONT clause.  If the FONT clause is omitted, the spinner uses the font of its parent window (the main FoxPro window or a user-defined window).

ENABLE | DISABLE

Spinners are enabled when READ or READ CYCLE is issued.  You can prevent a spinner from being selected by including DISABLE.  The spinner is disabled when READ or READ CYCLE is issued.

Disabled spinners cannot be selected and are displayed in the disabled colors.  Use SHOW GET ENABLE to enable a disabled spinner.

MESSAGE <expC5>

The optional MESSAGE clause character expression <expC5> is displayed when the spinner is selected.  The message is placed in the graphics-based status bar. If the graphics-based status bar has been turned off with SET STATUS BAR OFF, the message is placed on the last line of the main FoxPro window.

RANGE [<expN8>] [, <expN9>]

Use the RANGE clause to specify a range of acceptable spinner values.  If the value entered in the spinner text box isn't within the specified range, a message showing the correct range is displayed.  To override the default range message, create a routine using ON READERROR.

The lower boundary of the range is specified with <expN8>, the upper boundary with <expN9>.  Either <expN8> or <expN9> can be omitted, but not both.  If one bound is omitted, that end of the range isn't checked.

The range isn't checked if you press Enter without changing the initial spinner value.

VALID <expL1> | <expN10> [ERROR <expC6>]

You can include an optional VALID expression <expL1> or <expN10> that is evaluated when you attempt to exit the spinner.

Note   Unlike the RANGE check, the VALID check is always performed when you attempt to exit the spinner, unless you exit by pressing Esc. The RANGE check is only performed when a change is made to the initial spinner value.

Typically, <expL1> or <expN10> is a user-defined function.  With a user-defined function you can select, enable or disable other objects, open a Browse window, open another data entry screen or move to a new record.  CLEAR READ can be included in the user-defined function to terminate the READ.

<expL1>

If <expL1> evaluates to a logical true (.T.), the value in the spinner is considered correct and the spinner is exited.

If <expL1> evaluates false (.F.), the value entered in the spinner is considered incorrect and the spinner remains the active control.  A message appears in the graphics-based status bar directing you to reenter the data after pressing the Spacebar.

<expN10>

A VALID clause that includes a numeric expression is used to specify which object is activated after a spinner is chosen.  Objects include @ ... GET input fields, check boxes, lists, popups, spinners, text editing regions and each individual button in a set of push, radio and invisible buttons.

When <expN10> = 0, the spinner remains the active object and the MESSAGE <expC5> and ERROR <expC6> messages are suppressed.  A special error message routine can be written as part of a user-defined function called by the VALID clause.

When <expN10> is positive, <expN10> specifies the number of objects to advance.  For example, when the spinner is selected and VALID returns 1, the next object is activated.  If <expN10> is greater than the number of remaining objects, the READ is terminated (unless READ CYCLE is issued to activate the objects).

When <expN10> is negative, <expN10> specifies the number of objects to move back.  For example, when the spinner is selected and VALID returns -1, the previous object is activated.  If <expN10> moves back past the first object, the READ is terminated (unless READ CYCLE is issued to activate the objects).

ERROR <expC6>

The ERROR clause lets you specify a custom error message that is displayed when the VALID clause evaluates to false (.F.).  <expC6> is displayed in place of the default error message.

WHEN <expL2>

The optional WHEN clause allows or prohibits the selection of a spinner based on the logical value of <expL2> which must evaluate to a logical true (.T.) before the spinner can be selected.  If <expL2> evaluates to a logical false (.F.), the spinner cannot be selected and is skipped over if placed between other objects.

COLOR SCHEME <expN11> | COLOR <color pair list>

If you do not include a COLOR clause, spinner colors are determined by the color scheme for the main FoxPro window; if a spinner is placed in a user-defined window, the window's color scheme determines the spinner's colors.

The colors of a spinner can be specified by including the number of an existing color scheme in the COLOR SCHEME clause or a set of color pairs in the COLOR clause.

A color scheme is a set of 10 predefined color pairs.  The color pairs in a color scheme can be changed with SET COLOR OF SCHEME.

A color pair is a set of two letters separated by a forward slash.  The first color letter specifies the foreground color and the second letter specifies the background color.

For example, this color pair specifies a red foreground on a white background:

R/W

For a list of colors and their corresponding color letters, see SET COLOR Commands Overview or Color Table by Color Pair.

A color pair can also be specified with a set of 6 RGB (Red Green Blue) color values separated by commas.  The first 3 color values specify the foreground color and the second 3 color values specify the background color.  The color values can range from 0 through 255.

The R/W color pair in the example above can also be specified with this RGB color pair:

RGB(255,0,0,255,255,255)


@ ... GET - Spinners SeeAlso
See Also

@ ... SAY Command

@ ... GET Command

Controls Overview

_CUROBJ System Memory Variable

Fonts

OBJNUM( ) Function

READ Command

SHOW GET Command

USER-DEFINED FUNCTIONS (UDFs) Function


@ ... EDIT - Text Edit Regions Command
@ ... EDIT [image] Text Edit Regions Command

See Also

Creates a text editing region.

Syntax

@ <row, column> EDIT <memvar> | <field>
SIZE <expN1>, <expN2>[, <expN3>]
[FUNCTION <expC1>]
[FONT <expC2>[, <expN4>]]
[STYLE <expC3>]
[DEFAULT <expr>]
[ENABLE | DISABLE]
[MESSAGE <expC4>]
[VALID <expL1> | <expN5> [ERROR <expC5>]]
[WHEN <expL2>]
[NOMODIFY]
[SCROLL]
[TAB]
[COLOR SCHEME <expN6> | COLOR <color pair list>]

Remarks

This command creates a rectangular text editing region for editing a memory variable or array element <memvar> or a field or a memo field <field>.  The memory variable, array element or field must be of character type.

If you use the Screen Builder to create your data entry screens, you may not have to use this command at all.  The Screen Builder automatically generates the commands that create text editing regions.

Note   This control uses EDIT in its syntax instead of GET like other FoxPro controls such as check boxes, radio and push buttons.

When a text editing region is activated with READ or READ CYCLE, the contents of <memvar> or <field> are displayed in the region for editing.  When you exit the text editing region, your changes can be saved in the memory variable, array element or field specified with <memvar> or <field>.

Press Tab or Ctrl+Tab to save your changes and move to the next object.  To save your changes and move to the previous object, press Shift+Tab.  Press Esc to discard your changes and move to the next object.  If you're editing a memo field and a VALID clause is included, your changes may or may not be saved [image] the value returned by the VALID clause determines whether your changes are saved.  For more information, see the section on the VALID clause later in this topic.

All standard FoxPro editing features, such as cutting, copying and pasting, are available in the text editing region.  The text in the text editing region scrolls vertically, and words are wrapped horizontally.

Clauses

<row, column>

Row and column are numeric expressions with values of 0 or greater that determine where the text-editing region appears.

The first row is number 0 in the main FoxPro window or a user-defined window. Rows are numbered from top to bottom. In FoxPro for Windows, row 0 is the row immediately under the FoxPro system menu bar. In FoxPro for Macintosh, row 0 is the row immediately under the FoxPro title bar. In FoxPro for MS-DOS, row 0 is the row the FoxPro system menu bar occupies. See SET SYSMENU for information about manipulating the system menu bar so you can place output on row 0 in FoxPro for MS-DOS.

The first column is number 0 in the main FoxPro window or a user-defined window. Columns are numbered from left to right.

When the text-editing region is directed to a user-defined window, the row and column coordinates are relative to the user-defined window, not the main FoxPro window.

In FoxPro for Windows and FoxPro for Macintosh, a position in the main FoxPro window or in a user-defined window are determined by the font of the main FoxPro window or the user-defined window.  Most fonts can be displayed in a wide variety of sizes, and some are proportionally spaced. A row corresponds to the height of the current font.  A column corresponds to the average width of a letter in the current font.  For more information, see Fonts.

In FoxPro for Windows and FoxPro for Macintosh, you can position the text-editing region in a window with decimal fractions for row and column coordinates. In FoxPro for MS-DOS, decimal fractions used for row and column coordinates are rounded to the nearest integer value.

SIZE <expN1>, <expN2>[, <expN3>]

The SIZE clause must be included to specify the height and width of the text editing region.  The height of the text editing region in rows is specified by <expN1>, and the width in columns is specified by <expN2>.

If <expN1> is 1, a special one-line text editing region is created.  You can scroll horizontally in the one-line region.  Pressing Enter moves you to the next object.

The optional numeric expression <expN3> specifies the number of characters in the memory variable, array element or field that can be edited, starting with the first character.  If <expN3> is omitted, all of the memory variable, array element or field can be edited.

In FoxPro for Windows and FoxPro for Macintosh, the text-editing region font determines the size of the editing region.  The text editing region font is specified with the FONT clause.  If the FONT clause is omitted, the text editing region uses the font of its parent window (the main FoxPro window or a user-defined window).

FUNCTION <expC1>

You can include the I or J option in the FUNCTION clause to specify how text is justified in the text-editing region, and the 2 or 3 options to specify the appearance of the text-editing region. The 2 (two-dimensional) and 3 (three-dimensional) options are only available in FoxPro for Macintosh. Any additional characters included in the FUNCTION clause are ignored.

Option	Purpose

I	Centers text in the text editing region.

J	Right-justifies text.  Text in the editing region is left-justified by default.

2	Creates a flat (two-dimensional) text-editing region. This is the default text-editing region in FoxPro for Macintosh.

3	Creates a three-dimensional text-editing region identical to text-editing regions in FoxPro for Macintosh.

This example creates a text-editing region in which text is right-justified:

STORE 'This will be edited' TO text
@ 2,2 EDIT text FUNCTION 'J' SIZE 5, 50
READ

This example creates a three-dimensional text-editing region in FoxPro for Macintosh:

STORE 'This will be edited' TO text
@ 2,2 EDIT text FUNCTION '3' SIZE 5, 50
READ

FONT <expC2>[, <expN4>]

The character expression <expC2> is the name of the font, and the numeric expression <expN4> is the font size.  For example, the following clause can be used to display the text in the text-editing region in 16-point Courier font:

FONT 'Courier', 16

If you include the FONT clause but omit the font size <expN4>, a 10 point font is used.

If the FONT clause is omitted and the text editing region is placed in the main FoxPro window, the main FoxPro window font is used.  If the FONT clause is omitted and the text editing region is placed in a user-defined window, the user-defined window font is used.

If the font you specify is not available, a font with similar font characteristics is substituted.

The FONT clause is ignored in FoxPro for MS-DOS.

STYLE <expC3>

In FoxPro for Windows and FoxPro for Macintosh, include the STYLE clause to specify a font style for the text-editing region. If the font style you specify is not available, a font style with similar characteristics is substituted.

The font style is specified with <expC3>.  If the STYLE clause is omitted, the standard font style is used.

Character	Font Style

B	Bold

C	Condense*

E	Extend*

I	Italic

N	Normal

O	Outline

Q	Opaque

S	Shadow

-	Strikeout*

T	Transparent

U	Underline

*The Condense and Extend styles are available only in FoxPro for Macintosh. The Strikeout style is available only in FoxPro for Windows.

You can include more than one character to specify a combination of font styles.  For example, the following clause specifies Bold Italic:

STYLE 'BI'

The STYLE clause is ignored in FoxPro for MS-DOS.

DEFAULT <expr>

When you edit the text in a text-editing region, the text is read from and saved to the memory variable, array element or field specified with <memvar> or <field>.  If you specify a memory variable that doesn't exist, it is automatically created and initialized if you include the DEFAULT clause.  However, an array element isn't created if you specify an array element in a DEFAULT clause.  The DEFAULT clause is ignored if the memory variable already exists or you specify a table or memo field.

Note   If the DEFAULT clause isn't included and <memvar> doesn't exist, the error message "Variable not found" is displayed.

The DEFAULT expression <expr> determines the type of memory variable created and its initial value.  It must be of character or memo type.  Here are examples of DEFAULT clauses for text editing regions:

@ 2,2 EDIT text DEFAULT 'This will be edited' SIZE 5, 50
READ

@ 2,2 EDIT text DEFAULT SPACE(20) SIZE 5, 50
READ

ENABLE | DISABLE

Text editing regions are by default enabled when READ or READ CYCLE is issued.  Include DISABLE to prevent a text editing region from being selected when READ or READ CYCLE is issued  A disabled text editing region cannot be selected and is displayed in disabled colors.  Use SHOW GET ENABLE to enable a disabled text editing region.

MESSAGE <expC4>

The MESSAGE clause character expression <expC4> is displayed when a text editing region is selected.  In FoxPro for MS-DOS the message is centered on the last line of the desktop by default.  The message location can be changed with SET MESSAGE.

In FoxPro for Windows and FoxPro for Macintosh, the message is placed in the graphics-based status bar. If the graphics-based status bar has been turned off with SET STATUS BAR OFF, the message is placed on the last line of the main FoxPro window.

VALID <expL1> | <expN5>

You can include an optional VALID expression <expL1> or <expN5> that is evaluated when you exit the text editing region.

Typically, <expL1> or <expN5> is a user-defined function.  With a user-defined function you can select, enable or disable other objects, open a Browse window, open another data entry screen or move to a new record.  CLEAR READ can be included in the user-defined function to terminate the READ.

<expL1>

If <expL1> evaluates to true (.T.), your changes are saved if you press Tab, Ctrl+Tab or Shift+Tab to exit the text editing region.  If you press Esc, your changes are discarded.

If you press Tab, Ctrl+Tab or Shift+Tab to save changes to a memo field and <expL1> evaluates to false (.F.), a message is displayed prompting you for proper input.  If you then press Escape to exit the text editing region, your changes are saved.

If <expL1> evaluates to false and you are editing a memory variable, array element or field, pressing Escape exits the text editing region and discards your changes.

<expN5>

A VALID clause that includes a numeric expression is used to specify which object is activated after the text editing region is exited.

The expression <expN5> has one of these effects:

When <expN5> = 0, the text editing region remains the active control and the MESSAGE <expC4> and ERROR <expC5> messages are suppressed.  A special error message routine can be written as part of a user-defined function called by the VALID clause.

When <expN5> is positive, <expN5> specifies the number of objects to advance.  For example, when the text editing region is selected and VALID returns 1, the next object is activated.  If <expN5> is greater than the number of remaining objects, the READ is terminated (unless READ CYCLE is issued to activate the objects).

When <expN5> is negative, <expN5> specifies the number of objects to move back.  For example, when text editing region is selected and VALID returns -1, the previous object is activated.  If <expN5> moves back past the first object, the READ is terminated (unless READ CYCLE is issued to activate the objects).

ERROR <expC5>

When the VALID clause expression <expL1> evaluates to false (.F.), the default message "Invalid Input" is displayed.  Including the ERROR clause lets you replace this default message with the character expression <expC5>.

WHEN <expL2>

The WHEN clause allows or prohibits selection of the editing region based on the logical value of <expL2>, which must evaluate to a logical true value (.T.) before the text editing region can be selected.  If <expL2> evaluates to false (.F.), the region cannot be selected and is skipped if placed between other objects.

NOMODIFY

Including the NOMODIFY displays the text editing region but doesn't allow editing.  You can scroll through the region and copy text, but you can't modify the text.

SCROLL

If SCROLL is included, a scroll bar is placed to the right of the text editing region.  The scroll bar lets you move quickly through the text with the mouse and provides a visual indication of your position in the text editing region.  The scroll bar is displayed only when the text is too long to fit into the text editing region.

TAB

By default, pressing the Tab key doesn't insert a tab into the text in a text editing region.  Pressing Tab or Ctrl+Tab saves your changes, exits the text editing region and advances you to the next object.

If you include TAB, pressing Tab inserts a tab into the text at the current cursor location.  Press Ctrl+Tab to save your changes, exit the text editing region and advance to the next object.

COLOR SCHEME <expN6> | COLOR <color pair list>

By default, the colors of text editing regions are derived from color scheme 2, User Menus. If you do not include a COLOR clause, text editing region colors are determined by the color scheme for the desktop or the main FoxPro window; if text editing regions are placed in a user-defined window, the window's color scheme determines the text editing region colors.

The colors of text editing regions can be specified by including the number of an existing color scheme in the COLOR SCHEME clause or a set of color pairs in the COLOR clause.

A color scheme is a set of 10 predefined color pairs.  The color pairs in a color scheme can be changed with SET COLOR OF SCHEME.  In FoxPro for MS-DOS the color pairs in a color scheme can also be changed in the Color Picker.

A color pair is a set of two letters separated by a forward slash.  The first color letter specifies the foreground color and the second letter specifies the background color.

For example, this color pair specifies a red foreground on a white background:

R/W

For a list of colors and their corresponding color letters, see SET COLOR Commands Overview or Color Table by Color Pair.

A color pair can also be specified with a set of 6 RGB (Red Green Blue) color values separated by commas.  The first 3 color values specify the foreground color and the second 3 color values specify the background color.  The color values can range from 0 through 255.

The R/W color pair in the example above can also be specified with this RGB color pair:

RGB(255,0,0,255,255,255)

Color Pair Number	Editing Region Attribute

2	Enabled text editing region

3	Scroll bar*

5	Message

6	Selected text editing region

10	Disabled text editing region

* Controls drawn in background color.

Bar drawn in dim of foreground color.

The following example defines a text editing region with the following color characteristics:

When text is selected, the text is shown with bright white text on a blue background (W+/B).

When enabled, the region is shown with yellow text on a blue background (GR+/B).

When disabled, the region is shown with white text on a blue background (W/B).

When you skip a color pair, you must include a comma where the color pair is omitted.

Here are the commands:

STORE 'To be edited' TO text
@ 2,2 EDIT text SIZE 5, 50 COLOR ,GR+/B,,,,W+/B,,,,W/B
READ

The following example shows how to override the color scheme of the desktop or main FoxPro window with another predefined color scheme:

ACTIVATE SCREEN
STORE 'To be edited' TO text
@ 2,2 EDIT text COLOR SCHEME 4 SIZE 5, 50
READ


@ ... EDIT - Text Edit Regions SeeAlso
See Also

@ ... GET Command

@ ... SAY Command

Controls Overview

_CUROBJ System Memory Variable

Fonts

OBJNUM( ) Function

READ Command

SHOW GET Command

User-Defined Functions (UDFs)


FSIZE( ) Function

See Also	Example

Returns the size, in bytes, of a specified field.

Syntax

FSIZE(<expC1> [, <expN> | <expC2>])

Returns

Numeric

Remarks

Date, logical, memo and general fields have a constant default size of 8, 1, 10 and 10 bytes respectively.

The size of a field can be displayed with DISPLAY STRUCTURE and LIST STRUCTURE.

Parameters

<expC1>

Specify the name of the field with the character expression <expC1>.

<expN> | <expC2>

The size of the specified field is returned from the table in the current work area if you don't include a work area or table alias.  To return a field size from a table in another work area, include the work area number <expN> or the table alias <expC>.

If no table has the alias you specify, the message "Alias not found" is displayed.


FSIZE( ) Example

USE customer
? FSIZE('contact')

? FSIZE('cno')


FSIZE( ) SeeAlso
See Also

DISPLAY STRUCTURE Command

FCOUNT( ) Function

LIST Commands


FTIME( ) Function

See Also

Returns the last modification time for a file.

Syntax

FTIME(<file name>)

Returns

Character

Remarks

Included for compatibility with dBASE.

The time that FTIME( ) returns is assigned to the file by the operating system. The format of the value returned by FTIME( ) is determined by the current setting of SET HOURS.

Parameter

<file name>

Specifies the name of the file whose last modification time FTIME( ) returns. <file name> can include a path with the file name. If a path is not included with the file name, FoxPro searches for the file in the default directory and in any directories specified with SET PATH.


FTIME() SeeAlso
See Also

FDATE( ) Function


FULLPATH( ) Function

See Also

Returns the MS-DOS path for a specified file or the full path relative to another file.

Syntax

FULLPATH(<file name1>[, <expN> | <file name2>])

Returns

Character

Remarks

When used with SYS(2014), FULLPATH( ) can make applications portable.  That is, given the location of the current program and the location of other files used by the program, FULLPATH( ) and SYS(2014) can be used to obtain the paths for these files.  Once the paths are determined, the files can be accessed by the program.

For an example illustrating how to use FULLPATH( ) and SYS(2014) to locate a .DBF used in the creation of a screen, see FULLPATH( ) in the Fox Pro Language Reference.

Clauses

<file name1>

The FoxPro path is searched for the file specified with <file name1>.  Be sure to include the file name extension.  If the file is located in the FoxPro path, the path is returned with the file name.  The FoxPro path can be set with SET PATH.

If the file can't be found in the FoxPro path, a path and the file name is returned as if the file is found in the current default directory.  The default directory can be specified with SET DEFAULT.

<expN>

If <expN> is included, the MS-DOS path is searched instead of the FoxPro path for the specified file.  <expN> can have any numeric value.  If the file can't be located in the MS-DOS path, a path and the file name is returned as if the file had been found in the current default directory.

<file name2>

You can specify a second file name with <file name2>.  Be sure to include the file name extension.  FULLPATH( ) returns the path for the first file relative to the second file.


FULLPATH() SeeAlso
See Also

DBF( ) Function

FILE( ) Function

LOCFILE( ) Function

SYS(2014) Function - Minimum Path


FUNCTION Command

See Also	Example

Identifies the start of a user-defined function definition.

Syntax

FUNCTION <function name>

Remarks

In many programs, certain routines are frequently repeated.  Defining commonly used routines as separate functions reduces program size and complexity and facilitates program maintenance.

FUNCTION <function name> is a statement within a program.  It designates the beginning of a function in a program and identifies the function by name.

In FoxPro for MS-DOS and FoxPro for Windows, function names can be up to 10 characters long. In FoxPro for Macintosh, function names can be up to 31 characters long. To distinguish a program filename with more than 10 characters from a function beginning with the same 10 characters in FoxPro for Macintosh, surround the program filename with quotation marks or include an extension after the program filename.

In all FoxPro versions, function names are significant to a limit of 10 characters. FoxPro cannot distinguish between two functions when the first 10 characters of their names match. This limit does not apply to program names.

FUNCTION <function name> is followed by a series of commands that make up the function.  You can include RETURN as the last line of a function, although an implicit RETURN is automatically executed.

The next FUNCTION statement or the end of the file, whichever comes first, signals the end of the function.

When a function is executed with DO, the function is searched for in a specific order:

1	First, FoxPro searches the file containing the DO command.

2	If the function isn't found there, FoxPro searches the current procedure file (if one is open).

3	If the function isn't found in the current procedure file, FoxPro searches the programs in the execution chain.  Program files are searched from the most recently executed program through the first program executed.

4	If the function is still not found, FoxPro searches for a stand-alone program.  If a matching program file is found, the program is executed.  Otherwise, the error message "File does not exist" is generated.

Issue DO IN <file name> to search only the specified file.

By default, parameters are passed to functions by value.   For information on passing parameters to functions by reference, see SET UDFPARMS.  A maximum of 24 parameters can be passed to a function.


FUNCTION Example

The following example creates two functions: LONGDATE and QUARTER.  LONGDATE converts a date variable to a character string suitable for use in reports.  QUARTER returns the quarter of the year when passed a month number.  These two functions can be used to print a heading in a report.

SET CENTURY ON
@ 5,0 SAY longdate({08/19/89})
@ 6,5 SAY quarter(DATE( ))

FUNCTION longdate
PARAMETER mdate
RETURN CDOW(mdate) + ', ' + MDY(mdate)

FUNCTION quarter
PARAMETER qdate
DO CASE
CASE MONTH (qdate) > 9
RETURN 'Fourth Quarter'
CASE MONTH (qdate) > 6
RETURN 'Third Quarter'
CASE MONTH (qdate) > 3
RETURN 'Second Quarter'
OTHERWISE
RETURN 'First Quarter'
ENDCASE


FUNCTION SeeAlso
See Also

PARAMETERS Command

PARAMETERS( ) Function

PRIVATE Command

PROCEDURE Command

PUBLIC Command

RETURN Command

SET PROCEDURE Command

SET UDFPARMS Command

User-Defined Functions (UDFs)


FV( ) Function

See Also	Example

Returns the future value of an investment.

Syntax

FV(<expN1>, <expN2>, <expN3>)

Returns

Numeric

Remarks

FV( ) computes the future value of a series of constant periodic payments earning fixed compound interest.  The future value is the total of all payments and the interest.

Parameters

<expN1>

The constant periodic payment (which can be negative or positive) is specified with <expN1>.

<expN2>

The periodic interest rate is specified with <expN2>.  If the interest rate is annual but the payments are made monthly, divide the annual interest rate by 12.

<expN3>

<expN3> specifies the number of periods over which payments are made.  FV( ) assumes that the periodic payments are made at the end of each period.


FV( ) Example

STORE 500 TO payment	&& Monthly payment
STORE .075/12 TO interest 	&& 7.5% annual interest rate
STORE 48 TO periods	&& Four years (48 months)
? FV(payment, interest, periods)	&& Calculate future value


FV() SeeAlso
See Also

CALCULATE Command

PV( ) Function


FWRITE( ) Function

See Also	Example

Writes a character string to a file or a communication port opened with a low-level file function.

Syntax

FWRITE(<expN1>, <expC>[, <expN2>])

Returns

Numeric

Remarks

Unlike FPUTS( ), FWRITE( ) doesn't place a carriage return and a line feed at the end of the character string.

FWRITE( ) returns the number of bytes written to the file or communication port.  If FWRITE( ) can't write to the file or port for any reason, 0 is returned.

Parameters

<expN1>

FWRITE( ) writes to the file or communication port specified by the file handle number <expN1>.

<expC>

FWRITE( ) writes the character expression <expC> to the file or port specified with <expN1>.

<expN2>

FWRITE( ) writes the entire character expression to the file or port unless <expN2> is included.  When <expN2> is included, <expN2> characters are written to the file or port.  If <expN2> is less than the number of characters in <expC>, only <expN2> characters are written to the file or port.  All of the characters in <expC> are written to the file or port if <expN2> is equal to or greater than the number of characters in <expC>.


FWRITE() SeeAlso
See Also

FCHSIZE( ) Function

FCLOSE( ) Function

FCREATE( ) Function

FEOF( ) Function

FFLUSH( ) Function

FGETS( ) Function

FOPEN( ) Function

FPUTS( ) Function

FREAD( ) Function

FSEEK( ) Function


GATHER

See Also	Example

Stores data from a memory variable array or a set of memory variables to the current record of the active table.

Syntax

GATHER FROM <array> | MEMVAR
[FIELDS <field list> | FIELDS LIKE <skel> | FIELDS EXCEPT <skel>]
[MEMO]

Clauses

FROM <array>

If data is being copied from an array, the elements of the array are copied, starting with the first element, into the corresponding fields of the record. The contents of the first array element are copied to the first field of the record; the contents of the second array element are copied to the second field and so on.

If the array has fewer elements than the table has fields, the additional fields are ignored. If the array has more elements than the table has fields, the additional array elements are ignored.

MEMVAR

If MEMVAR is included, data is transferred to the current record from memory variables with the same names as the fields in the table.

Tip   You can create memory variables with the same names as fields by including MEMVAR or BLANK in SCATTER.

The contents of each memory variable are copied into the field with the same name as the memory variable. If a memory variable with the same name as a field doesn't exist, the field isn't changed.

FIELDS <field list>

If you include the FIELDS clause, only the fields specified in <field list> are replaced by the contents of the array elements or memory variables.

FIELDS LIKE <skel> | FIELDS EXCEPT <skel>

You can selectively replace fields with the contents of array elements or memory variables by including the LIKE or EXCEPT clause or both. If you include LIKE <skel>, FoxPro replaces the fields that match <skel>. If you include EXCEPT <skel>, FoxPro replaces all fields except those that match <skel>.

The skeleton <skel> supports wildcard characters.  For example, to replace all fields that begin with the letters A and P, use:

GATHER FROM myarray FIELDS LIKE A*,P*

The LIKE clause can be combined with the EXCEPT clause:

GATHER FROM myarray FIELDS LIKE A*,P* EXCEPT PARTNO*

MEMO

Include MEMO to include memo fields in the GATHER command. If MEMO isn't included, memo fields are skipped when GATHER stores data from an array or memory variables to the field. General and picture fields are always ignored in GATHER, even if the MEMO keyword is included.


GATHER Example

The following example illustrates the use of SCATTER and GATHER. SCATTER copies the data in the current record into memory variables, which are displayed in a window where they can be edited. When the last field is exited, the data is copied into the current record with GATHER. The TO clause isn't used with SCATTER and the FROM clause isn't used with GATHER in this example because you use the TO and FROM clauses only when copying data into and from arrays.

CLOSE DATABASES
SET TALK OFF
USE customer
SCATTER MEMVAR
DEFINE WINDOW menter FROM 5,10 to 20,70 PANEL
ACTIVATE WINDOW menter
@ 1,3 	SAY 'Customer: '	GET m.company
@ 3,3	SAY 'Address: '	GET m.address
@ 5,3	SAY 'City: '	GET m.city
@ 7,3	SAY 'State: '	GET m.state
@ 7,18	SAY 'Zip: '	GET m.zip
@ 13,13	SAY 'Press <Esc> to discard changes'
READ

IF LASTKEY( ) != 27
GATHER MEMVAR
ENDIF
DEACTIVATE WINDOW menter
USE


GATHER SeeAlso
See Also

APPEND FROM ARRAY

COPY TO ARRAY

DIMENSION

REPLACE FROM ARRAY Command

SCATTER


GETBAR( )

See Also	Example

Gets the number of a bar on a popup defined with DEFINE POPUP or a FoxPro system menu.

Syntax

GETBAR(<expC>, <expN>)

Returns

Numeric

Remarks

Use GETBAR( ) to determine the position of an option on a menu popup. This function is useful when options on a menu popup are added, removed or rearranged. Use DEFINE BAR to add an option to a menu popup or RELEASE BAR to remove an option. Popup options can be rearranged interactively if MOVER is included when the menu popup is created with DEFINE POPUP.

Parameters

<expC>, <expN>

Specify the popup name with <expC> and its position within the popup with <expN>. GETBAR( ) returns the bar number of the option in popup position <expN>. <expN> can range from 1 through the number of rows within the popup. 1 corresponds to the first row on the popup, 2 to the second row, and so on.


GETBAR( ) Example

The following example creates a popup named DEMOPOP. The MOVER keyword is included so the options in the popup can be rearranged. For information about rearranging popup options, see the MOVER section in DEFINE POPUP.

The popup is activated, and a series of GETBAR( ) functions returns the prompts for each option. After you rearrange the options, press CTRL+Z to display the new option order.

CLEAR
ON KEY LABEL CTRL+Z DO showorder
WAIT WINDOW "Press CTRL+Z to refresh." NOWAIT
DEFINE POPUP demopop MOVER FROM 2,2
DEFINE BAR 1 OF demopop PROMPT 'One'
DEFINE BAR 2 OF demopop PROMPT 'Two'
DEFINE BAR 3 OF demopop PROMPT 'Three'
DEFINE BAR 4 OF demopop PROMPT 'Four'
DO showorder
ACTIVATE POPUP demopop

PROCEDURE showorder
CLEAR
@ 3,12 SAY  '1 ' + PRMBAR('demopop', GETBAR('demopop',1))
@ 4,12 SAY  '2 ' + PRMBAR('demopop', GETBAR('demopop',2))
@ 5,12 SAY  '3 ' + PRMBAR('demopop', GETBAR('demopop',3))
@ 6,12 SAY  '4 ' + PRMBAR('demopop', GETBAR('demopop',4))
RETURN


GETBAR() SeeAlso
See Also

DEFINE BAR

DEFINE POPUP

RELEASE BAR


GETDIR( )

See Also

Displays the Select Folder dialog from which a directory or folder can be chosen.

Syntax

GETDIR([<expC1> [, <expC2>]])

Returns

Character

Remarks

GETDIR( ) returns the name of the directory or folder you choose as a character string.

If you do not choose a directory or folder (you choose Cancel or press Esc), GETDIR( ) returns the null string.

Parameters

<expC1>

Use <expC1> to specify the directory or folder that is initially displayed in the Select Directory dialog. When <expC1> is not specified, the Select Directory dialog opens with the default directory or folder displayed.

<expC2>

The prompt for the directory or folder list in the Select Directory dialog is specified with <expC2>.


GETDIR() SeeAlso
See Also

GETEXPR


GETENV( )

See Also	Example

Returns the contents of the specified MS-DOS environment variable.

Syntax

GETENV(<expC>)

Returns

Character

Remarks

FoxPro for MS-DOS and FoxPro for Windows only.

Two environment variables are always available [image] COMSPEC and PATH. You can create your own environment variables with the MS-DOS SET command.

For additional information on creating environment variables, see your MS-DOS manual.

In FoxPro for Macintosh, GETENV( ) always returns the null string.

Parameter

<expC>

The name of the MS-DOS environment variable is specified with <expC>. The null string is returned if the MS-DOS environment variable doesn't exist.

In FoxPro for Windows, you can locate the Windows directory with the WINDIR environmental variable, which is set by Windows when it starts.


GETENV( ) Example

? GETENV('PATH')


GETENV() SeeAlso
See Also

DISKSPACE( )

OS( )

VERSION( )


GETEXPR

See Also	Example

Displays the Expression Builder so you can create an expression and store the expression to a memory variable or array element.

Syntax

GETEXPR [<expC1>] TO <memvar>
[TYPE <expC2> [; <expC3>]]
[DEFAULT <expC4>]

Clauses

<expC1>

<expC1> is the prompt that appears in the Expression Builder. The prompt can be used to remind you what kind of expression to build.

TO <memvar>

The expression you create is stored as a character string to the memory variable or array element specified with <memvar>.  If the memory variable doesn't already exist, it is created. GETEXPR won't create an array element.

If you exit the Expression Builder by pressing Esc or by choosing Cancel, the null string is stored to the memory variable or array element. If a default expression is created with the DEFAULT clause, the default expression is stored to the memory variable if you exit the Expression Builder by pressing Esc or choosing Cancel.

TYPE <expC2> [; <expC3>]

<expC2> specifies the expression type: C for character, N for numeric, D for date and L for logical.

You can specify the error message <expC3> to be displayed if the expression isn't valid. If <expC3> is included with <expC2>, <expC2> and <expC3> must be separated by a semicolon (;). The combination of <expC2>, the semicolon and <expC3> must be enclosed in single or double quotes in matching pairs.

DEFAULT <expC4>

The DEFAULT clause lets you display the initial default expression <expC4> in the Expression Builder. You can accept the default expression or overwrite it with your own expression. If the DEFAULT clause is included, <expC4> is stored to the memory variable or array element if you exit the Expression Builder by pressing Esc or choosing Cancel.


GETEXPR Example

In this example, GETEXPR is used to get a LOCATE expression of the proper type. If LOCATE is successful, the company name is displayed; otherwise, a message is displayed.

CLOSE DATABASES
USE customer
GETEXPR 'Enter condition to locate ' TO temp;
TYPE 'L' DEFAULT 'COMPANY = ""'
LOCATE FOR &temp
IF FOUND( )
? 'Company: ' + company
ELSE
? 'Condition ' + temp + ' was not found '
ENDIF


GETEXPR SeeAlso
See Also

GETFILE( )

LOCFILE( )

PUTFILE( )


GETFILE( )

See Also	Example

Displays the Open dialog and returns the name of the file you chose.

Syntax

GETFILE([<expC1>] [, <expC2>] [, <expC3>] [, <expN>] [, <expC4>])

Returns

Character

Remarks

GETFILE( ) displays the FoxPro Open dialog, from which a file anywhere on disk can be chosen. GETFILE( ) returns the name of the file you choose and returns the null string if you press Esc or choose Cancel.

Parameters

<expC1>

The character expression <expC1> specifies the file extensions of the files displayed in the scrollable list when the All Files check box isn't checked. For a complete list of the filename extensions used by FoxPro, see the Filename Extension table in Appendix A in the FoxPro Developer's Guide.

<expC1> can take a variety of forms:

If <expC1> contains a single extension (for example, .PRG), only files with that extension are displayed.

<expC1> can contain a list of file extensions separated by semicolons. For example, including PRG;FXP displays all files with the extension .PRG or .FXP.

If the files have the same name but different extensions (for example, CUSTOMER.PRG and CUSTOMER.FXP), only the file with the extension listed first in <expC1> is displayed.

<expC1> can contain a list of file extensions separated by vertical bars (for example, PRG | FXP). In this case, all files with these extensions are displayed, even if the files have the same names.

If <expC1> contains just a semicolon (;), all files without an extension are displayed.

If <expC1> is the null string, all files in the current directory are displayed if <expC4> is not included.

<expC1> can also contain wildcard characters (* and ?). All files with extensions that meet the wildcard criteria are displayed. For example, if <expC1> is ?X?, all files with the extension .FXP, .EXE or .TXT are displayed.

<expC2>

The character expression <expC2> is the prompt displayed at the top of the Open dialog.

<expC3>

The character expression <expC3> replaces the text in the Open push button.

<expN>

The numeric expression <expN> specifies the number and type of push buttons that appear in the Open dialog. The following buttons appear in the dialog when <expN> is 0, 1 or 2:

<expN>	Push Buttons FoxPro for MS-DOS	Push Buttons FoxPro for Windows and FoxPro for Macintosh
0  (or omitted)	Open  Cancel	Open  Cancel
1	Open  New  Cancel	New Open Cancel
2	Open None Cancel	None Open Cancel
The null string is returned if <expN> is 1 or 2 and the New or None push button is chosen.

<expC4> - FoxPro for Macintosh only.

In FoxPro for Macintosh, you can include <expC4> to display files with a specific creator type in the scrollable list.

If you include the null string in <expC1>, only files that match the creator type specified in <expC4> are displayed in the scrollable list. If you include a file skeleton in <expC1>, files that match the file skeleton and have the creator type specified in <expC4> are displayed in the scrollable list.

For a list FoxPro file extensions and corresponding creator types, see the File Types and Extensions table in Appendix A of the Developer's Guide.


GETFILE( ) Example

CLOSE DATABASES
SELECT 0
dbf_file = GETFILE('DBF', 'Browse or Create a .DBF:', 'Browse',1)

DO CASE
CASE 'Untitled' $ dbf_file
CREATE (dbf_file)
CASE EMPTY(dbf_file)
RETURN
OTHERWISE
USE (dbf_file)
BROWSE
ENDCASE


GETFILE() SeeAlso
See Also

FULLPATH( )

GETEXPR

LOCFILE( )

PUTFILE( )


GETFONT( )

See Also

Displays the Font dialog and returns the name of the font you choose.

Syntax

GETFONT( )

Returns

Character

Remarks

GETFONT( ) is supported in FoxPro for Windows and FoxPro for Macintosh.

GETFONT( ) returns the name, size and style of the font you choose. Your choice is returned as a character string with the font name, size and style separated by commas.

GETFONT( ) returns the null string if you choose Cancel, Close from the Control menu or press Esc.

Note   FoxPro commands and functions can be abbreviated to four characters. In the case of GETFONT( ) and GETFILE( ), which both begin with the same four letters, precedence is given to GETFILE( ). Issuing GETF( ) displays the Open dialog.


GETFONT() SeeAlso
See Also

FONTMETRIC( )

SYSMETRIC( )

TXTWIDTH( )

WFONT( )


GETPAD( )

See Also	Example

Lets you determine the position of a pad on a user-defined menu bar or on the FoxPro system menu bar.

Syntax

GETPAD(<expC>, <expN>)

Returns

Character

Remarks

Pads on a menu bar may be added, removed or rearranged. Use DEFINE PAD to add a pad to a menu bar or RELEASE PAD to remove a pad.

Parameters

<expC>, <expN>

Specify the menu name with <expC> and the numeric pad position within the menu bar with <expN>. GETPAD( ) returns the pad name for the menu bar position specified in <expN>, which can range from 1 through the number of pads on the menu bar. 1 corresponds to the first pad on the menu bar, 2 to the second pad, and so on.


GETPAD( ) Example

The following program uses GETPAD( ) to test if the Edit menu pad is on the FoxPro system menu bar. If it is, the pad is released. (To restore the Edit menu bar to its default state, issue the command SET SYSMENU TO DEFAULT.)

FOR count = 1 TO CNTPAD('_msysmenu')	&& Number of pads
IF PRMPAD('_msysmenu', GETPAD('_msysmenu', count)) = 'Edit'
RELEASE PAD (GETPAD('_msysmenu', count)) OF _msysmenu
EXIT
ENDIF
ENDFOR


GETPAD() SeeAlso
See Also

DEFINE MENU

DEFINE PAD

RELEASE PAD


GO/GOTO

See Also	Example

Positions the record pointer on the specified record number in a table.

Syntax

GO [RECORD] <expN1> [IN <expN2> | IN <expC>]
or
GO TOP | BOTTOM [IN <expN2> | IN <expC>]
or
GOTO [RECORD] <expN1> [IN <expN2> | IN <expC>]
or
GOTO TOP | BOTTOM [IN <expN2> | IN <expC>]

Remarks

GO and GOTO can be used interchangeably. These commands operate on the table in the current work area unless you specify another work area with the IN clause.

Clauses

[RECORD] <expN1>

Moves the record pointer to the physical record number <expN1>. Note that you can leave out GO or GOTO entirely [image] you can specify just the record number. If you specify just the record number, you can move the record pointer only within the current work area.

IN <expN2> | IN <expC>

By default, GO or GOTO moves the record pointer in the table open in the current work area. To move the record pointer in a table in another work area, include the work area number <expN> or the table alias <expC>.

TOP | BOTTOM

GO TOP or GOTO TOP and GO BOTTOM or GOTO BOTTOM position the record pointer on the first and last records, respectively, in the current table. If the table has an ascending index in use, the first record is the record with the lowest key value, and the last record is the record with the highest key value. If the index is in descending order, the first record is the record with the highest key value, and the last record is the record with the lowest key value.


GO/GOTO Example

CLOSE DATABASES
USE invoices
USE customer IN 0
GO BOTTOM IN invoices
? RECNO('invoices')

GO BOTTOM
? RECNO( )

GO 5
? RECNO( )


GO/GOTO SeeAlso
See Also

RECNO( )

SELECT

SKIP


GOMONTH( )

See Also	Example

Returns the date that is a specified number of months before or after a given date.

Syntax

GOMONTH(<expD>, <expN>)

Returns

Date

Parameters

<expD>

<expD> is a date expression.

<expN>

<expN> is the number of months from the date specified with <expD>. If <expN> is positive, the date returned by GOMONTH( ) is <expN> months after <expD>. If <expN> is negative, the date returned is <expN> months before <expD>.


GOMONTH( ) Example

SET CENTURY ON
STORE GOMONTH({08/02/92}, 5) TO deadline
? deadline

? GOMONTH({12/31/92}, 2)

? GOMONTH({12/31/92}, -2)


GOMONTH() SeeAlso
See Also

CMONTH( )


HEADER( ) Function

See Also

Returns the number of bytes in the header of the current or specified table file.

Syntax

HEADER([<expN> | <expC>])

Returns

Numeric

Remarks

A table header contains information about the table itself, such as the field names and sizes and the presence of a memo file or structural index.

Parameters

<expN> | <expC>

If you omit the work area and alias, HEADER( ) returns the size of the header for the table open in the current work area.  To return the header size for a table open in a specific work area, include the work area number <expN> or the table alias <expC>.

HEADER( ) returns 0 if a table isn't open in the work area you specify.  If a table doesn't have the alias you specify, the message "Alias not found" is displayed.


HEADER SeeAlso
See Also

FSIZE( ) Function

RECSIZE( ) Function


HELP Command

See Also

Opens the Help window.

Syntax

HELP
[<topic>]
[IN [WINDOW] <window name> | IN [WINDOW] SCREEN]
| IN [WINDOW] MACDESKTOP]
[NOWAIT]

Remarks

The main Help window contains a list of help topics.

In FoxPro for MS-DOS, you can open the Help window by typing HELP in the Command window, pressing the F1 key or choosing Help ...  from the System menu.

In FoxPro for Windows, you can open the Help window by typing HELP in the Command window, pressing the F1 key or choosing Help ...  from the Help menu.

In FoxPro for Macintosh, you can open the Help window by typing HELP in the Command window, pressing the F1 key or [image] +? or by choosing Microsoft FoxPro Help ... from the Help menu.

For additional information on FoxPro Help, refer to Help Systems or the FoxPro User's Guide.

Clauses

<topic>

In FoxPro for MS-DOS and FoxPro for Macintosh, to open the Help window with a specific help subject already displayed, use <topic> to specify the topic you would like more information about.  If you include just a partial spelling of a <topic>, FoxPro opens the Help window and displays the topic with the closest matching title.

In FoxPro for Windows, including the <topic> parameter displays the Windows-style Search dialog with the topic selected.  If you include just a partial spelling of a topic, FoxPro opens the Search dialog with the closest matching topic selected.

IN [WINDOW] <window name>

The Help window can be opened from within a parent window, but it doesn't assume the characteristics of the parent window it is placed in.  If the Help window is activated inside a parent window, it cannot be moved outside the parent window.  If the parent window is moved, the Help window moves with it.  Before you can open the Help window from within a parent window, the parent window must first be defined with DEFINE WINDOW.

IN [WINDOW] SCREEN

You can also place the Help window on the desktop in FoxPro for MS-DOS or the main FoxPro window in FoxPro for Windows by including IN WINDOW SCREEN or IN SCREEN.

IN [WINDOW] MACDESKTOP

MACDESKTOP is available in FoxPro for Macintosh only, and can only be used with DBF-style Help.

Include the MACDESKTOP clause to place the Help window on the Macintosh desktop. The Help window resides at the same level as the main FoxPro window. The Help window can be moved outside of the main FoxPro window and the main FoxPro window can be brought forward over the top of it. When you include the MACDESKTOP clause the Help window behaves in the same manner as Help windows in FoxBASE+ for Macintosh.

Including the MACDESKTOP clause overrides the current SET MACDESKTOP setting. SET MACDESKTOP determines if the Help window is placed on the main FoxPro window or the Macintosh desktop when the SCREEN or MACDESKTOP clause is not included. For more information about placing the Help window on the main FoxPro window or the Macintosh desktop, see SET MACDESKTOP.

NOWAIT

When HELP is issued from within a program, the Help window is opened and program execution pauses until the Help window is closed.  Including NOWAIT continues program execution after the Help window has been opened.  The program doesn't wait for the Help window to be closed but continues program execution on the program line immediately following HELP NOWAIT.


HELP SeeAlso
See Also

SET HELP Command

SET HELPFILTER Command

SET TOPIC Command


HIDE MENU Command

See Also

Hides one or more active user-defined menu bars.

Syntax

HIDE MENU <menu name1>[, <menu name2> ...] | ALL
[SAVE]

Remarks

HIDE MENU removes the specified menu bar, a set of menu bars or all menu bars from the desktop in FoxPro for MS-DOS, the main FoxPro window or a user-defined window without removing the menu definition from memory.  Before it can be hidden, a menu bar must first be created with DEFINE MENU.  Hiding a menu bar isn't the same as deactivating it.  When a menu bar is hidden, it stays resident in memory and can be displayed on the desktop, the main FoxPro window or a user-defined window with ACTIVATE MENU or SHOW MENU.

Clauses

<menu name1>[, <menu name2> ...]

Include the name of the menu bar or a list of menu bars (separated by commas) to hide.

ALL

Include ALL to hide all defined menu bars.

SAVE

You can place an image of a menu bar on the screen or in a window by including SAVE.  Placing an image of a menu bar on the screen is useful during program development and testing.  Menu bar images can be cleared from the desktop, the main FoxPro window or a user-defined window with CLEAR.


HIDE MENU SeeAlso
See Also

ACTIVATE MENU Command

DEFINE MENU Command

DEFINE PAD Command

SHOW MENU Command


HIDE POPUP Command

See Also

Hides one or more active popups defined with DEFINE POPUP.

Syntax

HIDE POPUP <popup name1>[, <popup name2> ...] | ALL
[SAVE]

Remarks

HIDE POPUP removes the specified popup, a set of popups or all popups from the desktop in FoxPro for MS-DOS, the main FoxPro window or a user-defined window without removing the popup definition from memory.  Before it can be hidden a popup must first be created with DEFINE POPUP.  Hiding a popup isn't the same as deactivating it.  When a popup is hidden, it stays resident in memory and can be displayed on the desktop, the main FoxPro window or a user-defined window with ACTIVATE POPUP or SHOW POPUP.

Clauses

<popup name1>[, <popup name2> ...]

Include the name of the popup or a list of popups (separated by commas) to hide.

ALL

Include ALL to hide all defined popups.

SAVE

You can place an image of a popup on the desktop, main FoxPro window or a user-defined window by including SAVE.  Placing an image of a popup on the screen is useful during program development and testing.  Popup images can be cleared from the desktop, the main FoxPro window or a user-defined window with CLEAR.


HIDE POPUP SeeAlso
See Also

ACTIVATE POPUP Command

DEFINE BAR Command

DEFINE POPUP Command

SHOW POPUP Command


HIDE WINDOW Command

See Also	Example

Hides an active user-defined window or FoxPro system window.

Syntax

HIDE WINDOW [<window name1>[, <window name2>] ...] | ALL
[IN [WINDOW] <window nameN> | IN [WINDOW] 	| IN [WINDOW] MACDESKTOP]
[BOTTOM | TOP | SAME]
[SAVE]

Remarks

HIDE WINDOW removes a window or a set of windows from the desktop in FoxPro for MS-DOS, the main FoxPro window or a user-defined window.  You can use HIDE WINDOW to hide system windows, such as the Command window, the Calculator, the Calendar/Diary, and so on.

Hiding a window isn't the same as closing it.  When a window is hidden, it stays resident in memory and active.  Output can be sent to a hidden window but you cannot see it.

Releasing a window removes it from memory.  Windows removed from memory must be defined again to be redisplayed.  A window can be displayed with ACTIVATE WINDOW or SHOW WINDOW.

You can also hide a window by choosing Hide from the Window menu popup.  You can redisplay a window by choosing its name from the Window menu.

For additional information on hiding windows, see the FoxPro User's Guide.

Clauses

<window name1>[, <window name2> ...]

Include the name of the window or a list of windows (separated by commas) to hide.  If HIDE WINDOW is issued without any arguments, the active window is hidden.

ALL

Include ALL to hide all windows.

SCREEN

The SCREEN option is available in FoxPro for Macintosh only.

Include SCREEN to hide the main FoxPro window. You can also click the main FoxPro window close box to hide it.

To display the main FoxPro again, choose the Screen menu option from the Window menu or issue ACTIVATE WINDOW SCREEN or SHOW WINDOW SCREEN.

IN [WINDOW] <window nameN>

Windows can be hidden within a parent window.  You can specify the parent window within which a child window is hidden by including IN WINDOW.  Desk accessories (Filer, the Calculator, and so on) must be active before they can be hidden.

IN [WINDOW] SCREEN

You can also specifically hide a window on the desktop or main FoxPro window by including IN WINDOW SCREEN or IN SCREEN.

IN [WINDOW] MACDESKTOP

MACDESKTOP is available in FoxPro for Macintosh only.

Include the MACDESKTOP clause to hide a window on the Macintosh desktop. The window resides at the same level as the main FoxPro window.

Including the MACDESKTOP clause overrides the current SET MACDESKTOP setting. SET MACDESKTOP determines if a window is hidden on the main FoxPro window or the Macintosh desktop when the SCREEN or MACDESKTOP clause is not included. For more information about hiding windows on the main FoxPro window or the Macintosh desktop, see SET MACDESKTOP.

BOTTOM | TOP | SAME

Include BOTTOM, TOP or SAME to specify where windows are hidden with respect to other windows.  Including BOTTOM places a window behind all other windows;  including TOP places it in front of all other windows.  Issuing HIDE WINDOW with SAME hides a window without affecting its front to back placement.  The default is TOP.  To preserve the relative positions of multiple hidden windows when they are redisplayed with SHOW WINDOW ALL, include the SAME keyword when you hide them.

SAVE [image] FoxPro for MS-DOS only

SAVE displays an image of a window on the desktop or in a user-defined window after the window has been hidden.  Normally, windows are removed from the desktop or a user-defined window after they are hidden.  Use CLEAR to remove the window image from the desktop or a user-defined window.  You cannot save an image of the current output window.

SAVE is ignored in FoxPro for Windows and FoxPro for Macintosh.


HIDE WINDOW Example

In this example, a window named Output is defined and activated.  The program waits for you to press a key and then hides the window.  The program waits for you to press a key again and then displays the window.  Then press a key to remove the window from the screen and from memory.

DEFINE WINDOW output FROM 6,1 TO 19,75 TITLE 'Output' ;
CLOSE FLOAT GROW SHADOW ZOOM
ACTIVATE WINDOW output
WAIT WINDOW 'Press a key to hide this window'
HIDE WINDOW output
WAIT WINDOW 'Press a key to see the window again'
SHOW WINDOW output
WAIT WINDOW 'Press a key to remove the window'
DEACTIVATE WINDOW output
RELEASE WINDOW output


HIDE WINDOW SeeAlso
See Also

ACTIVATE WINDOW Command

DEACTIVATE WINDOW Command

DEFINE WINDOW Command

RELEASE WINDOW Command

SHOW WINDOW Command


HOME( ) Function

See Also	Example

Returns the name of the directory that FoxPro was started from.

Syntax

HOME( )

Returns

Character

Remarks

HOME( ) returns the name of the directory that FoxPro was started from.

HOME( ) is identical to SYS(2004) and is provided for compatibility with dBASE IV.


HOME( ) Example

? 'FoxPro launch directory: ', HOME()


HOME( ) SeeAlso
See Also

SYS( ) Functions Overview


#IF ... #ENDIF Preprocessor Directive

See Also	Example

Conditionally includes source code at compile time.

Syntax

#IF <expN1> | <expL1>
<statements>
[#ELIF <expN2> | #ELIF <expL2>
<statements>
 ...
#ELIF <expNn> | #ELIF <expLn>
<statements>]
[#ELSE
<statements>]
#ENDIF

Remarks

#IF ...  #ENDIF can improve the readability of source code, reduce compiled program size and improve performance in some cases.

When the #IF ... #ENDIF structure is compiled, successive logical or numeric expressions within the structure are evaluated; the evaluation results determine which set of FoxPro statements (if any) are included in the compiled code.

Clauses

#IF <expN1> | <expL1>

<statements>

The numeric expression <expN1> or logical expression <expL1> is evaluated.  If the expression is numeric and non-zero or the expression is logical and true (.T.), the statements immediately following #IF are included in the compiled code.  The #IF ... #ENDIF structure is exited, and the first program line following #ENDIF is then compiled.

If the expression following #IF is numeric and 0 or logical and false (.F.), the statements immediately following #IF are not included in the compiled code.  In this case, any following #ELIF directives are evaluated.

Note   Do not use system memory variables for <expN1> or <expL1>.  System memory variables are not evaluated until run time.

[#ELIF <expN2> | #ELIF <expL2> <statements>

 ...

 #ELIF <expNn> | #ELIF<expLn> <statements>]

If <expN1> is 0 or <expL1> is false, the #ELIF directives are then evaluated.  The first #ELIF expression <expN2> or <expL2>, if present, is evaluated.  If <expN2> is non-zero or <expL2> is true, the statements immediately following #ELIF are included in the compiled code.  The #IF ... #ENDIF structure is exited, and the first program line following #ENDIF is then compiled.

If <expN2> is 0 or <expL2> is false, the statements following #ELIF are not included in the compiled code, and the next #ELIF directive is evaluated.

[#ELSE <statements>]

If no #ELIF directives are included or if those that are included evaluate to 0 or false, the presence or absence of #ELSE determines whether any additional statements are included in the compiled code:

If #ELSE is included, the statements following #ELSE are included in the compiled code.

If #ELSE isn't included, none of the program statements between #IF and #ENDIF is included in the compiled code.  The #IF ... #ENDIF structure is exited, and compilation continues on the first program line following #ENDIF.


#IF ... #ENDIF Example

In the following example, the #IF ... #ENDIF structure determines which version of FoxPro compiles the program and then displays the appropriate message.

#IF 'WINDOWS' $ UPPER(VERSION( ))
? 'This is FoxPro for Windows'
#ELIF 'MAC' $ UPPER(VERSION( ))
? 'This is FoxPro for Mac'
#ELIF 'UNIX' $ UPPER(VERSION( ))
? 'This is FoxPro for UNIX'
#ELSE
? 'This is FoxPro for DOS'
#ENDIF


#IF ... #ENDIF SeeAlso
See Also

COMPILE Command

#DEFINE ... #UNDEF Preprocessor Directives


IF ... ENDIF Command

See Also	Example

Conditionally executes a set of commands based on the outcome of a logical expression.

Syntax

IF <expL>
<statements>
[ELSE
<statements>]
ENDIF

Remarks

In this structured programming command, the logical expression <expL> is evaluated.  If <expL> evaluates to true (.T.), any statements following IF and prior to ELSE or ENDIF (whichever occurs first) are executed.

If <expL> is false and ELSE is included, any statements after ELSE and before ENDIF are executed.

If <expL> is false and ELSE isn't included, all statements between IF and ENDIF are ignored.  In this case, program execution continues with the first command following ENDIF.

You can nest an IF ... ENDIF block within another IF ... ENDIF block.

Comments can be placed on the same line after IF, ELSE and ENDIF.  These comments are ignored during compilation and program execution.


IF ... ENDIF Example

CLOSE DATABASES
USE customer
GETEXPR 'Enter condition to locate ' TO temp;
TYPE 'L' DEFAULT 'COMPANY = ""'
LOCATE FOR &temp	&& Enter LOCATE expression
IF FOUND( )	&& Was it found?
? 'Company: ' + company	&& If so display a message
ELSE	&& If not found
? 'Condition ' + temp + ' was not found '	&& Display a message
ENDIF
USE


IF ... ENDIF SeeAlso
See Also

DO CASE ... ENDCASE Command

DO WHILE ... ENDDO Command

FOR ... ENDFOR Command

IIF( ) Function

SCAN ... ENDSCAN Command


IIF( ) Function

See Also	Example

Returns one of two values depending on the value of a logical expression.

Syntax

IIF(<expL>, <expr1>, <expr2>)

Returns

Character, Date, Logical or Numeric

Remarks

This function, also known as Immediate IF, evaluates a logical expression and then returns one of two expressions.  If the logical expression evaluates to a true value (.T.), IIF( ) returns the first expression.  If the logical expression evaluates to a false value (.F.), IIF( ) returns the second expression.

Parameters

<expL>

The logical expression that IIF( ) evaluates is specified with <expL>.

<expr1>, <expr2>

If <expL> evaluates to true (.T.), <expr1> is returned.  If <expL> evaluates to false (.F.), <expr2> is returned.

Tip   This function can be used in place of IF ... ENDIF for simple conditional expressions and is especially useful in report and label expressions that conditionally specify field contents.  The IIF( ) function also executes considerably faster than an equivalent IF ... ENDIF.


IIF( ) Example

This example uses IIF( ) to check if the NOTES field in the SALESMAN table is empty.  If it is empty, "No comments" is displayed; otherwise, the contents of the memo field are displayed.

CLOSE DATABASES
USE salesman
SCAN
? IIF(EMPTY(notes), 'No notes', notes)	&& Empty memo field?
ENDSCAN


IIF() SeeAlso
See Also

IF ... ENDIF Command


IMPORT Command

See Also

Imports data from an external file format to create a new FoxPro table.

Syntax

IMPORT FROM <file>
[TYPE]
FW2 | MOD | PDOX | RPD | WK1 | WK3 | WKS | WR1 | WRK | XLS

Remarks

Most software packages store their data in a file format that cannot be opened directly in FoxPro.  IMPORT creates a new FoxPro table from data stored in file formats that FoxPro cannot read.

A new table is created with the same name as the file the data is imported from.  A .DBF extension is assigned to the newly created table.

In FoxPro for Macintosh, you can interactively import data from files created in 4th Dimension version 3.0 and greater and Filemaker Pro version 2.1. To import data interactively, open the FoxPro table to which you'll import the data. Choose the Database menu, and then choose the Append From... option. In the Append From dialog, choose the File Type: popup.

Clauses

<file>

<file> is the name of the file to import data from.  If you don't include an extension with the file name, the default extension for the specified file type is assumed.

TYPE

The key word TYPE is optional, but you must include one of the following file types described below.

FW2

Include FW2 to import FW2 files, created by Framework II.

MOD

Include MOD to import MOD files, created by Microsoft Multiplan version 4.01.

PDOX

Include PDOX to import Paradox files.  Database files in Paradox versions 3.5 and 4.0 by Borland can be imported by including the PDOX option.

RPD

Include RPD to import RPD files, created by RapidFile.

WK1 | WK3 | WKS

Include WK1 to import data from a Lotus 1-2-3 spreadsheet.  Columns from the spreadsheet become fields in the table, and the spreadsheet rows become records in the table.  A WK1 extension is assigned to spreadsheets created in Lotus 1-2-3 revision 2.x;  a WK3 extension is assigned to spreadsheets created in Lotus 1-2-3 revision 3.x;  and a .WKS extension is assigned to spreadsheets created in Lotus 1-2-3, revision 1-A.

WR1 | WRK

Include WR1 to import data from a Lotus Symphony spreadsheet. Columns from the spreadsheet become fields in the table, and the spreadsheet rows become records in the table.  A WR1 extension is assigned to spreadsheets created in Symphony version 1.10, and a .WRK extension is assigned to spreadsheets created in Symphony version 1.01.

XLS

Include XLS to import data from Microsoft Excel spreadsheets versions 2.0, 3.0 and 4.0.  Columns from the spreadsheet become fields in the table, and the spreadsheet rows become records in the table.  Spreadsheet files created in Microsoft Excel have an .XLS extension.


IMPORT SeeAlso
See Also

APPEND FROM Command

COPY TO Command

EXPORT Command


INDEX Command

See Also	Example

Creates an index file to display table records in logical order.

Syntax

INDEX ON <expr> TO <idx file> | TAG <tag name> [OF <cdx file>]
[FOR <expL>]
[COMPACT]
[ASCENDING | DESCENDING]
[UNIQUE]
[ADDITIVE]

Remarks

Records in a table that has an index file are displayed and accessed in the order specified by the index expression.  The physical order of the records in the table isn't changed by an index file.

If TALK is SET ON, FoxPro reports how many records are indexed during the indexing process.  The record interval displayed during indexing can be specified with SET ODOMETER.

For more information about open index files, see DISPLAY STATUS.  This information includes the names of all open index files, their types (structural, .CDX, .IDX), their index expressions and the name of the master index file or master tag.

The number of index files (.IDX or .CDX) you can open is limited only by memory and system resources.  The number of files you can open is determined by the FILES setting in the MS-DOS CONFIG.SYS configuration file.  See your MS-DOS manual for more information on the MS-DOS FILES setting.

Index Types

FoxPro lets you create two types of index files:

Compound .CDX index files containing multiple index entries called tags

.IDX index files containing one index entry

You can also create a structural compound index file, which is automatically opened with the table.

Tip   Because structural compound index files are automatically opened when the table is opened, they are the preferred index type.

Include COMPACT to create compact .IDX index files.  Compound index files are always compact.

If you are sharing files between FoxPro and FoxBASE+ or FoxBASE+ for Macintosh, you must use non-compact .IDX index files.  Otherwise, if you build .IDX files, include COMPACT to benefit from FoxPro fast-access index technology.

Index Order and Updating

Only one index file (the master index file) or tag (the master tag) controls the order in which the table is displayed or accessed.  Certain commands (SEEK, for example) use the master index file or tag to search for records.  However, all open .IDX and .CDX index files are updated as changes are made to the table.  You can designate the master index file or tag with the INDEX clause of USE or with SET INDEX and SET ORDER.

User-Defined Functions

The index expression can contain a user-defined function (UDF).

Note   Care should be exercised when referencing a UDF in an index expression.  Referencing a user-defined function in an index expression increases the time it takes to create the index.

For example, a UDF can be used to extract the street name from a single field that includes both the street number and street name.  Assuming the street number is always numeric, the UDF can return the character portion of the field and pad it with spaces as needed to create a constant-length index key.  Records in the table can then be accessed in street name order.

FoxPro must be able to locate the UDF included in an index expression to update the index.  When FoxPro creates an index, the index expression is saved in the index file, but only a reference to the UDF is included in the index expression.

Clauses

<expr>

The index expression <expr> can include the name of a field or fields from the current table.  An index key based on the index expression is created in the index file for each record in the table.  FoxPro uses these keys to display and access records in the table.

Warnings

Although not recommended, <expr> can also be a system memory variable, an array element, or a field or field expression from a table in another work area.  Memo fields cannot be used alone in index file expressions; they must be combined with other character expressions.  If you access an index that contains a variable or field that no longer exists or cannot be located, the error message "Variable not found" is displayed.

The message "Warning: Index expression contains aliased fields" is displayed if a field you include in the index expression is prefaced by a table alias or work area letter.  FOR clauses are  optimized with Rushmore technology if aliased fields are included.  However, it is still highly recommended that you avoid using aliased fields when creating indexes.  In several cases (USE ... AGAIN, SQL queries, and so on), a different alias is automatically assigned to a table, and the index may not be properly updated or used.  Refer to the discussion of Rushmore technology in the Optimizing Your Application chapter in the FoxPro Developer's Guide.

If you attempt to build an index with a key that varies in length, the key will be padded with spaces.  Variable-length index keys aren't supported in FoxPro.

TO <idx file>

You can create an .IDX index file by including the TO <idx file> clause.  The index file is given the default extension .IDX, which can be overridden by explicitly including a different extension or by changing the default index extension in the FoxPro configuration file.  Standard MS-DOS rules for naming files must be observed when creating index files.

TAG <tag name> [OF <cdx file>]

You can create a compound index file by including TAG <tag name>.  A compound index file is a single-index file that can consist of any number of separate tags (index entries).  Each tag is identified by its unique tag name.  Tag names, like system memory variables, must begin with a letter or an underscore and can consist of any combination of up to 10 letters, digits or underscores.  The number of tags in a compound index file is limited only by available memory and disk space.

Multiple-entry compound index files are always compact.  It isn't necessary to include COMPACT when creating a compound index file.  Names of compound index files are given a .CDX extension.

Two types of compound index files can be created.  The first type, a structural compound index file, is created when you include TAG <tag name> without including the optional OF <cdx file> clause.  A structural compound index file always has the same base name as the table and is automatically opened when the table is opened.

If a table's structural compound index file cannot be located or is deleted or renamed, a dialog is displayed when you try to open the table.  If you choose the default Cancel push button, the table isn't opened.  Choosing Ignore opens the table and removes the flag in the table's header that indicates an associated structural compound index file is present.

Tip   To reassociate a structural compound index that has become dissociated from its table, issue the following command:

USE <filename> INDEX <filename>

The next time you open the table, the structural compound index is opened too.  Be sure to reindex the table if it has been modified since the structural compound index was dissociated.

You can create a non-structural compound index file by including OF <cdx file> after TAG <tag name>.  Unlike a structural compound index file, a non-structural compound index file must be explicitly opened with SET INDEX or the INDEX clause in USE.

If a compound index file has already been created and opened, issuing INDEX with TAG <tag name> adds a tag to the compound index file.  If a compound index file hasn't already been created, one is automatically created.

FOR <expL>

The FOR clause can be included to make an index file act as a filter for the table.  Only records that satisfy the filter expression <expL> are available for display and access; index keys are created in the index file for just those records matching the filter expression.

Rushmore optimizes an INDEX ... FOR <expL1> command if <expL1> is an optimizable expression.  For best performance, use an optimizable expression in the FOR clause.  A discussion of Rushmore optimizable expressions appears in the Optimizing Your Application chapter in the FoxPro Developer's Guide.

COMPACT

COMPACT creates a compact .IDX file.

ASCENDING | DESCENDING

.CDX files can be built in ascending or descending order.  By default, .CDX tags are created in ascending order (you can include ASCENDING as a reminder of the index file's order).  A table can be indexed in reverse order by including DESCENDING.

You can't include DESCENDING when creating .IDX index files.  You can, however, specify a descending order for an .IDX index file with SET INDEX and SET ORDER.

UNIQUE

Use UNIQUE to specify that only the first record encountered with a particular index key value is included in an .IDX file or a .CDX tag.  UNIQUE can be used to prevent the display of or access to duplicate records.  All records added with duplicate index keys are excluded from the index file.  Using the UNIQUE option of INDEX is identical to executing SET UNIQUE ON before issuing INDEX or REINDEX.

When a UNIQUE index or index tag is active and a record which is included in the index is changed in a manner that changes its index key, the index or index tag is updated.  However, the next duplicate record with the ORIGINAL index key is not added to the index until you reindex the file using REINDEX.

ADDITIVE

When you create an index file or files for a table with INDEX, any previously opened index files (except the structural compound index) are closed.  If the ADDITIVE key word is included, previously opened index files remain open.


Index Example

This example opens CUSTOMER.DBF and creates an index file named COMPLIST, which displays and processes records in the alphabetic order of the COMPANY field.

CLOSE DATABASES
USE customer
INDEX ON company TO complist

In the next example, CUSTOMER.DBF is again opened and an index file named CITYCOMP is created from a substring of the first five characters of the CITY field and the first six characters of the COMPANY field.  When this index file is used, records in the table are ordered according to the CITY field and, secondarily, according to the COMPANY field.

CLOSE DATABASES
USE customer
INDEX ON SUBSTR(city,1,5) + SUBSTR(company,1,6) TO citycomp

Here, a filtered index file is created.  INVOICES.DBF is opened.  The table is indexed on the IDATE field, but only records that have an amount greater than 500 are available for processing and display.

CLOSE DATABASES
USE invoices
INDEX ON idate FOR itotal > 500 TO bigbalnc

Index tags are created in this example.  The first tag is a structural compound index tag for ADDRESS1.  The second tag is created in a non-structural index file named CUSTCDX.  The last tag is also created in the non-structural CUSTCDX index file but in descending order.

CLOSE DATABASES
USE customer
INDEX ON address TAG address
INDEX ON company TAG company OF custcdx


INDEX SeeAlso
See Also

COPY INDEXES Command

COPY TAG Command

REINDEX Command

SET INDEX Command

SET ODOMETER Command

SET ORDER Command

SET TALK Command

SET UNIQUE Command

SORT Command

USE Command


INKEY( ) Function

See Also	Example

Returns a number corresponding to the first key pressed or mouse click in the typeahead buffer.

Syntax

INKEY( [<expN>] [, <expC>])

Returns

Numeric

Remarks

INKEY( ) returns 0 if a key isn't pressed.  If there are several keys in the typeahead buffer, the value of the first key entered in the buffer is returned.

Parameters

<expN>

<expN> specifies how many seconds INKEY( ) waits for a keystroke.  If <expN> isn't included, INKEY( ) immediately returns a value for a keystroke.  INKEY( ) waits indefinitely for a keystroke if <expN> is 0.

<expC>

Include <expC> to show or hide the cursor or check for a mouse click.  To show the cursor, include S in <expC>.  To hide the cursor, include H in <expC>.  If both S and H are included in <expC>, the last character in <expC> takes precedence.

By default, INKEY( ) doesn't detect a mouse click.  To check for a mouse click, include M in <expC>.  If M is included in <expC>, INKEY( ) returns the value 151 for a single mouse click.  Refer to the second example below to see how you can check for a double click.

To check for a mouse click and show the cursor, include both M and S.  To check for a mouse click and hide the cursor, include H and M.

When a keyboard macro is assigned to a key or key combination, you can include E in <expC> to expand the keyboard macro.  When E is included, INKEY( ) returns a value corresponding to the first keystroke assigned to the keyboard macro.  You can return successive values for each keystroke in a macro by repeatedly executing INKEY( ) with E included.  If E is not included, INKEY( ) returns the value for the key or key combination that triggers the keyboard macro.

Any characters besides H, M, S and E in <expC> are ignored.

The following table lists INKEY( ) function return values for keys alone and in combination with the Shift, Ctrl, and Alt keys.

Key	Alone	Shift	Cntl	Opt
F1	28	84	94	104
F2	-1	85	95	105
F3	-2	86	96	106
F4	-3	87	97	107
F5	-4	88	98	108
F6	-5	89	99	109
F7	-6	90	100	110
F8	-7	91	101	111
F9	-8	92	102	112
F10	-9	93	103	113
F11	133	136	137	139
F12	134	136	138	140
1	49	33		120
2	50	64	33	121
3	51	35		122
4	52	36		123
5	53	37		124
6	54	94	30	125
7	55	38		126
8	56	42		127
9	57	40		128
0	48	41		19
a	97	65	1	30
b	98	66	2	48
c	99	67	3	46
d	100	68	4	32
e	101	69	5	18
f	102	70	6	33
g	103	71	7	34
h	104	72	127	35
i	105	73	9	23
j	106	74	10	36
k	107	75	11	37
l	108	76	12	38
m	109	77	13	50
n	110	78	14	49
o	111	79	15	24
p	112	80	16	25
q	113	81	17	16
r	114	82	18	19
s	115	83	19	31
t	116	84	20	20
u	117	85	21	22
v	118	86	22	47
w	119	87	23	17
x	120	88	24	45
y	121	89	25	21
z	122	90	26	44
Ins	22	22	146	162
Home	1	1	29	151
Del	7	7	147	163
End	6	6	23	159
Page Up	18	18	31	153
Page Down	3	3	30	161
Up Arrow	5	5	141	152
Down Arrow	24	24	145	160
Right Arrow	4	4	2	157
Left Arrow	19	19	26	155
Esc	27	27	27	1
Enter	13	13	10	28
Backspace	127	127	127	14
Tab	9	15	148	165


INKEY( ) Example

In this example, a data entry window is displayed, and FoxPro waits for 20 seconds for keyboard input.  If a key isn't pressed or the mouse isn't clicked, the program is canceled.

SET TALK OFF
STORE 0 TO holdkey
STORE SPACE(40) TO mcustomer, maddress
STORE SPACE(24) TO mcity
STORE SPACE(2) TO mstate
STORE SPACE(10) TO mzip
DEFINE WINDOW menter FROM 7,10 TO 17,70 PANEL
ACTIVATE WINDOW menter
@ 1,3 SAY  'Customer: ' GET mcustomer
@ 3,3 SAY  'Address: '  GET maddress
@ 5,3 SAY  'City: '     GET mcity
@ 7,3 SAY  'State: '    GET mstate
@ 7,18 SAY 'Zip: '      GET mzip
@ 1,14 SAY ''
STORE INKEY(20, 'M') TO mkey
IF mkey = 0
DEACTIVATE WINDOW menter
CLEAR GETS
CLOSE ALL
ELSE
IF mkey # 151
KEYBOARD CHR(mkey)
ENDIF
READ
DEACTIVATE WINDOW menter
ENDIF

*** Mouse click and keyboard detection example ***
*** Establish the program environment ***

SET TALK OFF
SET ESCAPE OFF
CLEAR

*** Create and open a window ***

DEFINE WINDOW mousechk FROM 4,4 TO 20,75 DOUBLE
ACTIVATE WINDOW mousechk
@ 6,16 SAY 'Press a key or click the mouse to start'
@ 8,16 SAY '      or press the Esc key to quit'
inval1 = 0	&& Initialize inkey system memory variable

*** Main program loop ***

DO WHILE .T.
inval1 = INKEY(.06,'HM')	&& Get INKEY( ), hide cursor, checkmouse
IF inval1 = 0	&& No key or mouse press
LOOP
ENDIF
IF inval1 = 27	&& Esc key pressed, exit main loop
EXIT
ENDIF
IF inval1 = 151	&& Single mouse click
row = MROW( )	&& Get mouse pointer position
col = MCOL( )
timelimit = SECONDS( ) + _DBLCLICK  	&& Time for double click
inval2 = 0

*** Check for mouse click and mouse pointer inside window ***

DO WHILE SECONDS( ) < timelimit
inval2 = INKEY('HM')

*** double mouse click ***

IF inval2 = 151 AND col != -1 AND row != -1
CLEAR
@ 7,11 SAY 'Double click at '
?? 'Row ' + ALLTRIM(STR(row)) + ', Column ' ;
+ ALLTRIM(STR(col)) + ' of this window'
EXIT
ENDIF
ENDDO

*** Single mouse click and mouse pointer inside window ***

IF inval2 = 0 AND col != -1 AND row != -1
CLEAR
@ 7,11 SAY 'Single click at '
?? 'Row ' + ALLTRIM(STR(row)) + ', Column ' ;
+ ALLTRIM(STR(col)) + ' of this window'
ENDIF

*** Mouse pointer outside of window ***

IF col = -1 OR row = -1
CLEAR
@ 7,17 SAY 'Mouse clicked outside of this window'
LOOP
ENDIF
ENDIF

*** Keyboard character pressed ***

IF inval1 # 151 AND BETWEEN(inval1, 0, 256) && Good CHR( ) value
CLEAR
@ 7,18 SAY 'Character typed:'
?? ' ' + CHR(inval1) + ', ASCII code ' + ALLTRIM(STR(inval1))
ENDIF
ENDDO  	End of Main loop

*** Restore original environment ***

SET TALK ON
SET ESCAPE ON
CLEAR WINDOWS


INKEY() SeeAlso
See Also

_DBLCLICK System Memory Variable

LASTKEY( ) Function

ON KEY Command

READKEY( ) Function

SET TYPEAHEAD Command


INLIST( ) Function

See Also	Example

Determines whether or not an expression matches one in a series of expressions of the same data type.

Syntax

INLIST(<expr1>, <expr2>[, <expr3> ...])

Returns

Logical

Remarks

INLIST( ) searches for an expression in a set of expressions.  INLIST( ) returns true (.T.) if it finds the expression in the set of expressions.  If it doesn't find the expression in the set of expressions, INLIST( ) returns false (.F.).

Parameters

<expr1>

The expression searched for in the set of expressions is specified with <expr1>.

<expr2>[, <expr3> ...  ]

Specify the set of expressions to search with <expr2>, <expr3> and so on.  You must include at least one expression (<expr2>), and can include up to 24 expressions.

All the expressions in the list must be of the same data type (character, numeric, logical or date).


INLIST( ) Example

INLIST( ) determines the quarter of the year for the current month.  The current month is stored to the variable MONTH.  Each CASE statement uses INLIST( ) to determine whether the contents of MONTH can be found in a list of month names.  The name of the quarter returned is stored to the variable REPORTITLE.

SET TALK ON
STORE CMONTH(DATE( )) TO month
DO CASE
CASE INLIST(month,'January','February','March')
STORE 'First Quarter' TO reportitle
CASE INLIST(month,'April','May','June')
STORE 'Second Quarter' TO reportitle
CASE INLIST(month,'July','August','September')
STORE 'Third Quarter' TO reportitle
OTHERWISE
STORE 'Fourth Quarter' TO reportitle
ENDCASE
WAIT WINDOW reportitle


INLIST() SeeAlso
See Also

BETWEEN( ) Function


INPUT Command

See Also	Examples

Inputs data from the keyboard into a system memory variable or an array element.

Syntax

INPUT
[<expC>]
TO <memvar>

Remarks

INPUT is included for backward compatibility.  Use @ ... GET instead.

INPUT is similar to ACCEPT, which doesn't require that character strings be delimited and creates only character-type system memory variables.

Clauses

<expC>

Include <expC> to display a prompting message. <expC> is the message you want to display.

<memvar>

<memvar> is the system memory variable or an array element into which you want to input data entered from the keyboard.  If <memvar> is a system memory variable that doesn't exist, INPUT creates it.

The expression input from the keyboard determines the type of system memory variable or array element created.  If you input a numeric value, a numeric system memory variable or array element is created; if you input a character value, a character system memory variable or array element is created and so on.  If you input a character value, it must be delimited by brackets or single or double quotation marks.


INPUT Example

INPUT to mnum_exp
? mnum_exp

INPUT 'Enter company: ' TO mcompany
? mcompany


INPUT SeeAlso
See Also

@ ... GET Command

ACCEPT Command

READ Command

WAIT Command


INSERT Command

See Also

Inserts a new record into the current table immediately after the current record and displays the new record for editing.

Syntax

INSERT
[BEFORE]
[BLANK]

Remarks

INSERT is included for backward compatibility.  Use APPEND or INSERT [image] SQL instead.

If you issue INSERT without the BEFORE or BLANK clauses, an editing window is displayed so you can enter data into the new record. The new record is placed immediately after the current record; if the table has an index tag or index, the new record is placed at the end of the table.

If CARRY is SET ON and BLANK isn't included, data in the previous record is automatically copied into the new record.

Note   INSERT isn't recommended for use with large tables because an insertion near the front of the table forces rewriting of nearly every record.  This can take a very long time.  Use INSERT [image] SQL instead.

Clauses

BEFORE

If you issue INSERT BEFORE, an editing window is displayed so you can enter data into the new record. The new record is placed immediately before the current record; if the table has an index tag or index, the new record is placed at the end of the table.

BLANK

If you issue INSERT BLANK, an editing window isn't displayed and the new blank record is placed immediately after the current record. If the table has an index tag or index, the new blank record is placed at the end of the table.


INSERT SeeAlso
See Also

APPEND Command

CHANGE Command

EDIT Command

INSERT Command - SQL

SET CARRY Command


INSERT Command - SQL

See Also	Example

Appends a record to the end of a table that contains the specified field values.

Syntax

INSERT INTO <dbf name>
[(<field name1>[, <field name2>[, ...]])]
VALUES (<expr1>[, <expr2>[, ...]])

or

INSERT INTO <dbf name> FROM ARRAY <array name> | FROM MEMVAR

Remarks

The new record includes data listed in the INSERT command or included in the specified array.

Clauses

INSERT INTO <dbf name>

<dbf name> specifies the name of the table to which a record will be appended.  <dbf name> can include a path and can be a name expression.

If the table you specify isn't already open, it is opened exclusively in a new work area and the record is appended.  The new work area isn't selected; the current work area remains selected.

If the table you specify is open, INSERT appends the record to the table.  If the table is open in a work area other than the current work area, it isn't selected after the record is appended; the current work area remains selected.

[(<field name1>[, <field name2>[, ...]])]

VALUES (<expr1>[, <expr2>[, ...]])

These clauses specify values (<expr1>, <expr2>, ...) to include in the record that is being added to the table.  You must specify values in the order defined by the table structure unless you specify field names.

If you specify field names with <field name1>, <field name2> and so on, you can list the field names in any order.  Each field name can be a name expression.

FROM ARRAY <array name>

<array name> is the name of an existing array containing data for the record being added.

FROM MEMVAR

FROM MEMVAR copies data from system memory variables into the new record in the table specified with <dbf name>.  Data is copied only into fields that have corresponding system memory variables.  If system memory variables exist only for certain fields in the specified table, fields without corresponding system memory variables remain empty.


INSERT - SQL Example
INSERT [image] SQL Example

INSERT INTO parts (pno, descript, onhand, onorder, price, cost) ;
VALUES ('B6722', 'Royal Reindeer', 2, 6, 27.99, 20.65)

USE  customer
COPY STRUCTURE TO cust2
SCATTER  MEMVAR
INSERT INTO cust2 FROM MEMVAR


INSERT - SQL SeeAlso
See Also

CREATE QUERY Command

CREATE TABLE Command - SQL

MODIFY QUERY Command

SELECT Command - SQL


INSMODE( ) Function

See Also	Examples

Returns the current mode of the Insert key, or sets the Insert key mode on or off.

Syntax

INSMODE([<expL>])

Returns

Logical

Remarks

If the Insert key mode is on (a character is inserted in front of the character at the cursor), true (.T.) is returned.  If the Insert key mode is off (a character overwrites the character at the cursor), false (.F.) is returned.

Parameter

<expL>

The logical expression <expL> can be included to turn the Insert key mode on or off.  INSMODE(.T.) turns it on, and INSMODE(.F.) turns it off.  INSMODE( ) returns a logical value corresponding to the Insert key mode setting before INSMODE(.T.) or INSMODE(.F.) is issued.


INSMODE( ) Example
INSMODE( ) Examples

The first example uses INSMODE( ) to set the Insert key mode on, and the second example toggles the Insert key mode to the opposite state:

SET TALK ON
=INSMODE(.T.)	&& Set insert mode on
? INSMODE( )

= INSMODE(!INSMODE( ))	&& Toggle insert mode to opposite state
? INSMODE( )


INSMODE() SeeAlso
See Also

CAPSLOCK( ) Function

NUMLOCK( ) Function

SYS(2008) Function - Cursor Shape

SYS(2009) Function - Swap Cursor Shape


INT( ) Function

See Also	Examples

Evaluates a numeric expression and returns the integer portion of the expression.

Syntax

INT(<expN>)

Returns

Numeric

Parameter

<expN>

INT( ) returns the integer portion of the numeric expression <expN>.


INT( ) Example
INT( ) Examples

? INT(12.5)

? INT(6.25 * 2)

? INT(-12.5)

STORE -12.5 TO number
? INT(number)


INT() SeeAlso
See Also

CEILING( ) Function

FLOOR( ) Function

ROUND( ) Function


ISALPHA( ) Function

See Also	Example

Returns true (.T.) if the leftmost character in the specified character expression is an alphabetic character; otherwise, false (.F.) is returned.

Syntax

ISALPHA(<expC>)

Returns

Logical

Remarks

Any characters after the first character in <expC> are ignored by ISALPHA( ).

Parameter

<expC>

The character expression that ISALPHA( ) tests is specified with <expC>.


ISALPHA( ) Example

CLOSE DATABASES
USE salesman
? ISALPHA(name)

DISPLAY name

USE customer
? ISALPHA(cno)

DISPLAY cno


ISALPHA() SeeAlso
See Also

ISLOWER( ) Function

ISUPPER( ) Function

LOWER( ) Function

UPPER( ) Function


ISBLANK( ) Function

See Also

Determines whether or not an expression is blank.

Syntax

ISBLANK(<expr>)

Returns

Logical

Remarks

ISBLANK( ) returns true (.T.) if the expression <expr> is blank, or false (.F.) if the expression isn't blank.

APPEND BLANK and BLANK are used to create a blank record. BLANK can also be used to clear data from fields in a record. ISBLANK( ) can determine if a field is blank.

ISBLANK( ) differs from EMPTY( ). For example, EMPTY( ) returns true if a character expression contains any combination of nulls, spaces, tabs, carriage returns or line feeds; ISBLANK( ) returns true if a character expression contains only the null string or spaces.

Parameter

<expr>

<expr> can be a field in a table, a memory variable or array element or an expression.

For a field, ISBLANK( ) returns .T. if the field contains the following values.

Type	Contents
Character	Null string or spaces
Numeric	No value (Newly appended blank record or cleared with BLANK)
Date	Blank date ({  /  /  })
Logical	No value (Newly appended blank record or cleared with BLANK)
Memo	Empty (no memo contents)
General	Empty (no OLE object)


ISBLANK( ) SeeAlso
See Also

BLANK Command

EMPTY( ) Function

LEN( ) Function


ISCOLOR( ) Function

See Also	Example

Determines whether or not your computer's graphics card can display color.

Syntax

ISCOLOR( )

Returns

Logical

Remarks

In FoxPro for MS-DOS and FoxPro for Windows, ISCOLOR( ) returns true (.T.) if your computer has color capability (whether or not a color monitor is actually being used).  If your computer doesn't provide color support, false (.F.) is returned.

In FoxPro for Macintosh, ISCOLOR( ) returns true (.T.) if your Macintosh is currently displaying in color or grayscale. False (.F.) is returned in your Macintosh is displaying in black and white.


ISCOLOR( ) Example

IF ISCOLOR( )
SET COLOR SET TO color
ELSE
SET COLOR SET TO mono
ENDIF


ISCOLOR() SeeAlso
See Also

SET COLOR Commands Overview

SET DISPLAY Command

SYS(2006) Function - Current Graphics Card


ISDIGIT( ) Function

See Also	Example

Returns true (.T.) if the leftmost character of the specified character expression is a digit (0 [image] 9); otherwise, false (.F.) is returned.

Syntax

ISDIGIT(<expC>)

Returns

Logical

Remarks

Any characters after the first character in <expC> are ignored by ISDIGIT( ).

Parameter

<expC>

The character expression that ISDIGIT( ) tests is specified with <expC>.


ISDIGIT( ) Example

CLEAR
SET TALK ON
STORE SPACE(1) TO item
@ 10,10 GET item SIZE 1,40
READ

IF NOT ISALPHA(item) AND (NOT ISDIGIT(item))
? 'First character must be digit or alphabetic'
ENDIF


ISDIGIT() SeeAlso
See Also

ISALPHA( ) Function


ISLOWER( ) Function

See Also	Example

Returns true (.T.) if the leftmost character in the specified character expression is a lower-case alphabetic character.

Syntax

ISLOWER(<expC>)

Returns

Logical

Remarks

Any characters after the first character in <expC> are ignored by ISLOWER( ).

Parameter

<expC>

The character expression that ISLOWER( ) tests is specified with <expC>.


ISLOWER( ) Example

? ISLOWER('redmond')

? ISLOWER('Redmond')


ISLOWER() SeeAlso
See Also

ISALPHA( ) Function

ISUPPER( ) Function

LOWER( ) Function

UPPER( ) Function


ISREADONLY( ) Function

See Also	Example

Returns true (.T.) if a table is opened read-only.

Syntax

ISREADONLY([<expC> | <expN>])

Returns

Logical

Remarks

ISREADONLY( ) returns a logical true value if a table is opened read-only; otherwise, false (.F.) is returned.

A table can be opened read-only by including the NOUPDATE option when opening the table with USE, by checking the Read Only check box when opening the table from the Open dialog, or by assigning MS-DOS read-only attributes to the table. The Filer can be used to assign or remove MS-DOS read-only attributes to a table.

A cursor created with the SQL SELECT command is always read-only.

Parameter

<expC> | <expN>

If you don't specify a work area number or a table or work area alias, the read-only status is returned for the table open in the current work area.

You can return the read-only status for a table open in another work area by specifying the work area number <expN> or the table or work area alias <expC>. False is returned if a table isn't open in the work area you specify.


ISREADONLY( ) Example

CLOSE DATABASES

USE customer NOUPDATE

? ISREADONLY('customer')


ISREADONLY( ) SeeAlso
See Also

FILER Command

Open dialog

USE Command


ISUPPER( ) Function

See Also	Example

Returns true (.T.) if the first character in a character expression is an upper-case alphabetic character.

Syntax

ISUPPER(<expC>)

Returns

Logical

Remarks

Any characters after the first character in <expC> are ignored by ISUPPER( ).

Parameter

<expC>

The character expression that ISUPPER( ) tests is specified with <expC>.


ISUPPER( ) Example

? ISUPPER('Ready?')

? ISUPPER('ready?')


ISUPPER() SeeAlso
See Also

ISALPHA( ) Function

ISLOWER( ) Function

LOWER( ) Function

UPPER( ) Function


JOIN Command

See Also	Example

Creates a table by joining two existing tables.

Syntax

JOIN WITH <expN> | WITH <expC>
TO <file> FOR <expL>
[FIELDS <field list> | FIELDS LIKE <skel> | FIELDS EXCEPT <skel>]
[NOOPTIMIZE]

Remarks

JOIN is included for backward compatibility.  Use SELECT [image] SQL instead.

JOIN creates a new table from two other tables:  the current table and a second table identified by its work area number or alias.  JOIN positions the record pointer on the first record in the current table and searches through the records in the second table.

Important   This command can take a long time to execute depending on the size of the two tables being joined.  In addition, it is possible to exceed the available disk space with JOIN even if the sizes of the two tables are modest.

Clauses

WITH <expN> | WITH <expC>

Specify the work area number of the second table with <expN>.  Specify the table alias with <expC>.

TO <file>

<file> is the name of the table to create from the joined tables.

FOR <expL>

JOIN evaluates the logical expression <expL> for each record.  If <expL> is true, a new record is written to the new file.  JOIN then moves to the second record in the current table and repeats the procedure.

Rushmore optimizes a query created with JOIN ... FOR if <expL1> is an optimizable expression.  For best performance, use an optimizable expression in the FOR clause.  A discussion of Rushmore optimizable expressions appears in the Optimizing Your Application chapter in the FoxPro Developer's Guide.

FIELDS <field list>

You can specify a list of fields to be included in the new table by including a field list.  <field list> can include the names of fields from both the current table and from the aliased table.

FIELDS LIKE <skel> | FIELDS EXCEPT <skel>

You can selectively specify fields to be included in the new table by including the LIKE or EXCEPT clause or both. If you include LIKE <skel>, the fields that match <skel> are included in the new table. If you include EXCEPT <skel>, all fields except those that match <skel> are included in the new table.

The skeleton <skel> supports wildcard characters.  For example, to include all fields that begin with the letters A and P, use the following clause:

FIELDS LIKE A*,P*

The LIKE clause can be combined with the EXCEPT clause:

FIELDS LIKE A*,P* EXCEPT PARTNO*

NOOPTIMIZE

Include NOOPTIMIZE to disable Rushmore optimization of JOIN.  For more information, see SET OPTIMIZE or consult the discussion of Rushmore optimization in the Optimizing Your Application chapter in the FoxPro Developer's Guide.


JOIN Example

CLOSE DATABASES
USE customer ORDER cno

USE invoices ORDER cno IN 0

JOIN WITH invoices TO custinv FOR customer.cno = invoices.cno ;
FIELDS customer.cno, customer.company, invoices.ino
USE custinv
DISPLAY STRUCTURE
BROWSE
USE
ERASE custinv.dbf


JOIN SeeAlso
See Also

SET FIELDS Command

SET RELATION Command


KEY( ) Function

See Also	Example

Returns the key index expression of the master (controlling) index file.

Syntax

KEY([<cdx file>,] <expN1>[, <expN2> | <expC>])

Returns

Character

Remarks

KEY( ) returns the index expression of an open index file.  An index expression is specified when an index file is created with INDEX.  The index expression determines how a table is displayed and accessed when the index file is opened as the master controlling index file.

For more information on creating index files and index expressions, see INDEX.

Parameters

<cdx file>

KEY( ) can be used to return the index key expressions for tags in multiple entry compound index files.  Specify the name of the compound index file with <cdx file>.  The compound index file you specify can be the structural compound index file automatically opened with the table or an independent compound index file.

<expN1>

USE and SET INDEX both support an index file list that lets you open multiple indexes for a table.  Any combination of single-entry .IDX index files, structural compound index files or independent compound index files can be included in the index file list.

The numeric expression <expN1> specifies which index expression to return from the open index files.  KEY( ) returns index expressions from open index files in the following order:

1	Index expressions from single-entry .IDX index files (if any are open) are returned first.  The order in which the single-entry index files are included in USE or SET INDEX determines how the index expressions are returned.

2	Index expressions for each tag in the structural compound index (if one is present) are returned next.  The index expressions are returned from the tags in the order in which the tags are created in the structural compound index.

3	Index expressions for each tag in any open independent compound indexes are returned last.  The index expressions are returned from the tags in the order in which the tags are created in the independent compound indexes.

The null string is returned if <expN1> is greater than the total number of open single-entry .IDX files and structural compound and independent compound index tags.

<expN2> | <expC>

If you omit the work area and alias, index expressions are returned from index files open for the table in the current work area.  To return index expressions from index files open in a specific work area, include the work area number <expN2> or the table alias <expC>.

If no table has the alias you specify, the message "Alias not found" is displayed.


KEY( ) Example

CLEAR
CLOSE DATABASES
USE customer	&& customer has a structural compound index

? KEY(1)

? KEY(2)

? KEY(3)


KEY() SeeAlso
See Also

INDEX Command

REINDEX Command

SET INDEX Command

SYS(14) Function - Index Expression

USE Command


KEYMATCH( ) Function

See Also	Example

Searches an index file or index tag for an index key and returns true (.T.) if the index key is found.

Syntax

KEYMATCH(<index key> [, <expN1> [, <expN2> | <expC>]])

Returns

Logical

Remarks

KEYMATCH( ) searches an index file or index tag for an index key. A logical true value (.T.) is returned if the index key is found; otherwise, false (.F.) is returned. KEYMATCH( ) can be used to prevent duplicate index keys.

KEYMATCH( ) does not move the record pointer.

Parameters

<index key>

Specify the index key to search for in <index key>.  The index keys in an index file or index tag are determined by the index expression.  An index expression is specified when an index file or index tag is created with INDEX. KEY( ) and SYS(14) can be used to return the index expressions for index files and index tags.  See INDEX for more information on creating index files, index expressions and index keys.

If you don't include any of the optional parameters, KEYMATCH( ) searches the master index file or master index tag for the index key you specify.  If a master index file or index tag isn't in effect (for example, you've issued SET ORDER TO without any parameters to place the table in natural record order), KEYMATCH( ) generates the error message "Table is not ordered".

<expN1>

The numeric expression <expN1> specifies which index file or index tag is searched. <expN1> is typically an integer that starts at 1 and is increased by 1 to search additional index tags.

If <expN1> is 1, the master single-entry .IDX index file or master index tag (if one is present) is searched.

As <expN1> increases, subsequent tags in the structural compound index (if one is present) are searched.  The tags are searched in the order in which the tags were created in the structural compound index.

As <expN1> continues to increase and all the tags in the structural compound index have been searched, tags in any open independent compound indexes are then searched.  The tags are searched in the order in which the tags were created in the independent compound indexes.

The error message "Table is not ordered" is generated if <expN1> is greater than the total number of open single-entry .IDX files and structural compound and independent compound index tags.

<expN2> | <expC>

If you omit the work area and alias, KEYMATCH( ) searches index files or tags open for the table in the current work area.  To search index files or tags open in a specific work area, include the work area number <expN2> or the table alias <expC>.

If no table has the alias you specify, the message "Alias not found" is displayed.


KEYMATCH( ) Example

CLOSE ALL

USE customer ORDER cno

DEFINE WINDOW wtmp FROM 2,12 TO 20,80 FLOAT  ;

  CLOSE COLOR W/W+ TITLE "Keymatch Example" FONT "ARIAL",8

ACTIVATE WINDOW wtmp

@ 10,28 SAY "Press Enter to accept default," FONT 'ARIAL', 12

@ 12, 28 SAY "or, change value, then press Enter" FONT 'ARIAL', 12

@ 6,28 GET lcCno DEFA 'A1046' SIZE 1,8 FONT 'ARIAL', 10

READ

IF KEYMATCH(lcCno,1)

WAIT WINDOW  "Found it!" TIMEOUT 2

ELSE

WAIT WINDOW  "Didn't find it!" TIMEOUT 2

ENDIF

CLEAR WINDOW


KEYMATCH( ) SeeAlso
See Also

INDEX Command

KEY Command

SET INDEX Command

SYS(14) Function - Index Expression

USE Command


KEYBOARD Command

See Also	Example

Places the specified character expression in the keyboard buffer.

Syntax

KEYBOARD <expC>
[PLAIN] [CLEAR]

Remarks

Use KEYBOARD to stuff the keyboard buffer with an arbitrary character string that remains in the buffer until FoxPro looks for input.  At that point, the data in the keyboard buffer is read and acted upon as if the data had been entered directly from the keyboard.

You an use KEYBOARD to create self-running demonstration systems that showcase your applications.

Clauses

<expC>

The character expression <expC> is stuffed into the keyboard buffer.  The character expression can be a character string, a key label, a set of key labels, or a user-defined function (UDF) that returns a character expression.

If <expC> is a key label, it must be enclosed in braces and quotes.  For example,

KEYBOARD '{CTRL+LEFTARROW}'

For a listing of key labels, see ON KEY LABEL.

The keyboard buffer can be stuffed with up to 128 keystrokes.  Once the keyboard buffer is full, additional keystrokes are discarded.

PLAIN

If you have keyboard macros defined or ON KEY LABELs active, you can include PLAIN to bypass these key assignments.  PLAIN stuffs the keyboard with the literal key character, not the key assignment.

For example, if you have assigned a routine to the A key with ON KEY LABEL and A is included in <expC>, use PLAIN to stuff the keyboard with the letter A.  The routine assigned to A isn't executed.

CLEAR

If you include CLEAR, the keyboard buffer is emptied before the keyboard buffer is stuffed with <expC>.


KEYBOARD Example

In this example, a window is displayed and data is entered.  If the entered customer name is found in the CUSTOMER table, the remaining fields are automatically filled by stuffing the KEYBOARD buffer from the remaining fields.

CLOSE DATABASES
SET TALK OFF
SET SAFETY OFF
STORE SPACE(40) TO mcompany, maddress, mcomments
STORE SPACE(24) TO mcity
STORE SPACE(2) TO mstate
STORE SPACE(10) TO mzip

SELECT 1
USE customer
SET ORDER TO TAG company

DEFINE WINDOW menter FROM 7,10 TO 19,70 PANEL
ACTIVATE WINDOW menter

@ 1,3	SAY 'Company: '	GET mcompany VALID v_cust(TRIM(mcompany))
@ 3,3	SAY 'Address: '	GET maddress
@ 5,3	SAY 'City: '	GET mcity
@ 7,3	SAY 'State: '	GET mstate
@ 7,18	SAY 'Zip: '	GET mzip
@ 9,3	SAY 'Comments: '	GET mcomments
READ

DEACTIVATE WINDOW menter
USE 	&& Close table

FUNCTION v_cust
PARAMETER mcomp
SEEK UPPER(mcomp)

IF FOUND( )
KEYBOARD address + city + state + zip
ENDIF
RETURN .T.


KEYBOARD SeeAlso
See Also

CHRSAW( ) Function

ON KEY LABEL Command

PLAY MACRO Command

SET FUNCTION Command


LABEL Command

See Also

Prints labels from a table file and a label definition file.

Syntax

LABEL
[FORM <file1> | ?]
[ENVIRONMENT]
[<scope>]
[FOR <expL1>]
[WHILE <expL2>]
[NOCONSOLE]
[NOOPTIMIZE]
[PDSETUP]
[PREVIEW]
[SAMPLE]
[TO PRINTER [PROMPT] | TO FILE <file2>]

Remarks

The PDSETUP clause is supported in FoxPro for MS-DOS only.

Label definition files are created with MODIFY LABEL or CREATE LABEL.

The default extension for a label definition file is .LBX.  If the label definition file is on a drive other than the default drive or in a directory other than the current directory, the drive designator and directory must also be specified.

If LABEL is issued without any additional arguments, the Open dialog appears, displaying a list of existing label files to choose from.

Clauses

FORM <file1>

You can specify which labels to print by including the name of a label definition table with <file1>.

?

If you include the ? clause, the Open dialog appears, displaying a list of existing label files to choose from.

ENVIRONMENT

When you create or modify labels, you can save the current FoxPro environment with the label definition file.  Saving the FoxPro environment places an additional record in the label definition table.  This record contains the names of all open tables and index files, the index order, and any relationships between the tables.

Include ENVIRONMENT to restore the environment saved in the label definition file.

<scope>

The scope clauses are:  ALL, NEXT <expN>, RECORD <expN>, and REST.  These are explained in the Overview of the FoxPro Language chapter in the FoxPro Language Reference.  Commands which include <scope> operate only on the table in the active work area.

You can specify a scope of records printed.  Only the records that fall within the range of records specified by the scope are printed.

The default scope for LABEL is ALL records.

FOR <expL1>

Including the FOR clause lets you conditionally print records, filtering out undesired records.  If the FOR clause is included, only the records that satisfy the logical condition <expL1> are printed.

Rushmore optimizes a query created with LABEL ... FOR if <expL1> is an optimizable expression.  For best performance, use an optimizable expression in the FOR clause.  A discussion of Rushmore optimizable expressions appears in the Optimizing Your Application chapter in the FoxPro Developer's Guide.

WHILE <expL2>

If the WHILE clause is included, records are printed for as long as the logical expression <expL2> evaluates to true (.T.).

NOCONSOLE

Include NOCONSOLE to suppress the display of label output to the desktop in FoxPro for MS-DOS, the main FoxPro window or a user-defined window when labels are being printed or sent to a file.

NOOPTIMIZE

To disable Rushmore optimization, include NOOPTIMIZE.  For more information, see SET OPTIMIZE or consult the discussion of Rushmore optimization in the Optimizing Your Application chapter in the FoxPro Developer's Guide.

PDSETUP

In FoxPro for MS-DOS, when you create a label definition with the FoxPro Label Designer, you can specify a printer driver setup that determines the printed appearance of labels.  If you save the environment with the label definition, the printer driver setup is also saved.  If you include the PDSETUP key word when printing labels, the printer driver setup is loaded and used when the labels are printed.

In FoxPro for Windows and FoxPro for Macintosh, you can include PDSETUP to use a printer driver setup for printing character-based labels created in FoxPro for MS-DOS.  PDSETUP is ignored when you print graphics-based labels created in FoxPro for Windows and FoxPro for Macintosh.

PREVIEW

Including PREVIEW displays the labels in a preview window before printing but doesn't print the labels.  To print the labels, you must issue LABEL without the PREVIEW clause.

SAMPLE

SAMPLE can be used to test label alignment.  If you include SAMPLE, the prompt "Do you want more samples?" is displayed after a sample label is displayed or printed.  Choose Yes to retest your label alignment.

TO PRINTER [PROMPT] |TO FILE <file2>

Include TO PRINTER to send labels to the printer.

In FoxPro for Windows and FoxPro for Macintosh, you can include the optional PROMPT clause to display a dialog before printing starts. In this dialog you can adjust printer settings, including the number of copies and page numbers to print. The printer settings that you can adjust depend on the currently installed printer driver. Place the PROMPT key word immediately after TO PRINTER.  PROMPT is ignored in FoxPro for MS-DOS.

Include TO FILE to send character-based labels created in FoxPro for MS-DOS to the text file specified with <file2>.  The file created when you include TO FILE has the default extension .TXT.


LABEL SeeAlso
See Also

MODIFY LABEL Command

CREATE LABEL Command


LASTKEY( ) Function

See Also	Example

Returns an integer corresponding to the last key pressed.

Syntax

LASTKEY( )

Returns

Numeric

Remarks

The values returned by LASTKEY( ) are the same as the values returned by INKEY ( ).  See INKEY( ) for a list of keys and their return values.

The LASTKEY( ) is updated when you move between controls during a READ.


LASTKEY( ) Example

In this example, the data from the current record in the CUSTOMER table is placed in an array with SCATTER.  You can edit each field.  Press Esc to cancel your changes.    LASTKEY( ) tests to see whether the READ was exited by pressing Esc. If Esc has been pressed, GATHER restores the original values to the fields.

CLOSE DATABASES
SET TALK OFF
USE salesman
COPY TO temp
USE temp
SCATTER MEMVAR MEMO	&& save old values
DEFINE WINDOW menter FROM 5,10 to 20,70 PANEL
ACTIVATE WINDOW menter
@ 1,3   SAY 'Name: ' 	 GET m.name
@ 3,3   SAY 'Address: ' GET m.address
@ 5,3   SAY 'City: '    GET m.city
@ 7,3   SAY 'State: '   GET m.state
@ 7,18  SAY 'Zip: '     GET m.zip
@ 9,13  SAY 'Notes:'
@ 9,23 EDIT m.notes SIZE 3,26
@ 13,13 SAY 'Press Esc to discard changes'
READ

IF LASTKEY( ) != 27
GATHER MEMVAR	&& save changes
WAIT WINDOW 'Changes saved' NOWAIT
ELSE	&& no GATHER
WAIT WINDOW 'Changes not saved' NOWAIT
ENDIF
DEACTIVATE WINDOW menter
BROWSE
USE
ERASE temp.dbf


LASTKEY() SeeAlso
See Also

CHRSAW( ) Function

INKEY( ) Function

READKEY( ) Function


LEFT( ) Function

See Also	Example

Returns a specified number of characters from a character expression, starting with the leftmost character.

Syntax

LEFT(<expC>, <expN>)

Returns

Character

Parameters

<expC>

Characters are returned from the character expression specified with <expC>.

<expN>

The number of characters returned from the character expression is specified with <expN>.  If <expN> is greater than the length of <expC>, all of the character expression is returned.  The null string is returned if <expN> is negative or 0.

LEFT( ) is identical to SUBSTR( ) with a starting position of 1.


LEFT( ) Example

? LEFT('Redmond, WA', 7)


LEFT() SeeAlso
See Also

AT( ) Function

LTRIM( ) Function

RIGHT( ) Function

RTRIM( ) Function

SUBSTR( ) Function


LEN( ) Function

See Also	Example

Returns the number of characters in a character expression.

Syntax

LEN(<expC>)

Returns

Numeric

Parameter

<expC>

<expC> is the character expression whose length you want to determine.


LEN( ) Example

In the following example, the length of the field ONO is used to store spaces to a memory variable.  When you are prompted for input, enter a single digit number, such as 1.  When the READ command is terminated, LEN( ) is used again to see whether the memory variable is empty.  If it is empty, the program is exited.

CLOSE DATABASES
SET TALK OFF
CLEAR
USE customer ORDER ono
STORE .F. TO mexit
DO WHILE NOT mexit
STORE SPACE(LEN(ono)) TO mcustono
@ 10,10 SAY 'Enter customer ono to locate: ' GET mcustono
@ 12,15 SAY 'Leave entry blank to exit'
WAIT WINDOW 'Try numbers from 1-7' NOWAIT
READ
@ 20,0 CLEAR
IF LEN(TRIM(mcustono)) = 0
STORE .T. TO mexit
ELSE
SEEK mcustono
IF FOUND( )
@ 20,10 SAY 'Company is ' + company
ELSE
@ 20,10 SAY 'No company for customer: ' + mcustono
ENDIF
ENDIF
ENDDO
USE


LEN() SeeAlso
See Also

FSIZE( ) Function


LIKE( ) Function

See Also	Example

Determines whether or not a character expression is contained in another character expression.

Syntax

LIKE(<expC1>, <expC2>)

Returns

Logical

Remarks

LIKE( ) returns true (.T.) if <expC1> matches <expC2>.  LIKE( ) returns false (.F.) if <expC1> doesn't match <expC2>.

SET COMPATIBLE determines how LIKE( ) evaluates <expC1> and <expC2>.  If COMPATIBLE is SET ON, <expC1> and <expC2> have all trailing blanks removed before they are compared.  If COMPATIBLE is SET OFF, any trailing blanks in <expC1> and <expC2> are used in the comparison.

Parameters

<expC1>

<expC1> is the character expression that can contain the wildcard characters * and ?.  The question mark matches any single character in <expC2> and the asterisk matches any number of characters.  You can mix any number of wildcard characters in any combination in <expC1>.

<expC2>

LIKE( ) compares <expC2> with <expC1>.  <expC2> must match <expC1> letter for letter for LIKE( ) to return true.


LIKE( ) Example

In this example, all descriptions from PARTS.DBF with the first two letter "Ab" are displayed.

CLOSE DATABASES
USE parts
? 'All parts descriptions with first two letters "Ab"'
?
SCAN FOR LIKE('Ab*', descript)
? descript
ENDSCAN
USE


LIKE() SeeAlso
See Also

$ Function

AT( ) Function

ATC( ) Function

OCCURS( ) Function

RAT( ) Function

SET COMPATIBLE Command


LINENO( ) Function

See Also	Example

Returns the line number of a line being executed in a program relative to the first line of the main program.

Syntax

LINENO([1])

Returns

Numeric

Remarks

Program lines are counted starting from the top of the program.  Comment lines, continuation lines and blank lines are included in the line number count.  If a program is suspended during execution, LINENO( ) returns the number of the program line at which program execution is suspended.  LINENO( ) returns 0 if a program is canceled.

By default, line numbers are returned relative to the beginning of the main program.  If a procedure is called, line numbering continues from the top of the calling program.

LINENO( ) is useful for debugging programs.  You can set a breakpoint to stop program execution at a specific line number by specifying the following command in the Debug window:

LINENO( ) = <expN>

Program execution is suspended when the value of LINENO( ) is equal to <expN>.

Parameter

1

To return the line number relative to the first line of the current program or procedure, include 1.


LINENO( ) Example

This is a section of a simple error-handling routine.

ON ERROR DO bug_proc WITH LINENO( )
BRWS	&& Causes error
ON ERROR

*** Bug_Proc error handler ***

PROCEDURE bug_proc
PARAMETERS badline
WAIT WINDOW 'Error occurred at line:' + STR(badline)
RETURN


LINENO() SeeAlso
See Also

ERROR( ) Function

MESSAGE( ) Function

PROGRAM( ) Function

SYS(16) Function - Executing Program File Name


LIST Commands

See Also

Continuously displays .DBF or environment information.

Syntax

LIST
[FIELDS <expr list>]
[<scope>]
[FOR <expL1>]
[WHILE<expL1>]
[OFF]
[NOCONSOLE]
[NOOPTIMIZE]
[TO PRINTER [PROMPT] | TO FILE <file>]
or
LIST FILES
[ON <drive>]
[LIKE <skel>]
[TO PRINTER [PROMPT] | TO FILE <file>]
or
LIST MEMORY
[LIKE <skel>]
[NOCONSOLE]
[TO PRINTER [PROMPT] | TO FILE <file>]
or
LIST STATUS
[NOCONSOLE]
[TO PRINTER [PROMPT] | TO FILE <file>]
or
LIST STRUCTURE
[NOCONSOLE]
[TO PRINTER [PROMPT] | TO FILE <file>]

Remarks

These LIST commands are identical to the DISPLAY commands except for the following differences:

The scope for LIST defaults to ALL.

LIST doesn't prompt you after filling the desktop in FoxPro for MS-DOS, the main FoxPro window  or a user-defined window with information.

LIST doesn't display records flagged for deletion when DELETED is SET ON.

For more information about the LIST commands, see the corresponding commands in DISPLAY .


LIST SeeAlso
See Also

DISPLAY Command

DISPLAY FILES Command

DISPLAY MEMORY Command

DISPLAY STATUS Command

DISPLAY STRUCTURE Command

SET DELETED Command


LOAD Command

See Also

Places a binary file in memory.

Syntax

LOAD <file>
[SAVE]
[NOSAVE]

Remarks

In FoxPro for MS-DOS and FoxPro for Windows, use LOAD to place binary routines from disk in to memory.   A maximum of sixteen 64K files can be loaded into memory at one time.

In FoxPro for Macintosh, use LOAD to place an external command or external function in memory. An external command or function placed in memory with LOAD can then be executed with CALL. A maximum of sixteen external commands or functions can be loaded into memory at one time.

Before an external command or function can be placed in memory with LOAD, the external command resource file containing the external command or function must be opened with SET XCMDFILE.

Clauses

<file>

In FoxPro for MS-DOS and FoxPro for Windows,<file> is the name of the file to load into memory.  The default extension for a binary file is .BIN.  When you call a binary routine, omit the extension.  If a file you load has the same file name of a previously loaded file but a different file name extension, the new file replaces the previously loaded file.

In FoxPro for Macintosh, use <file> to specify the external command or function to place in memory.

FUNCTION

In FoxPro for Macintosh, you must include FUNCTION when loading an external function (XFNC) into memory.

SAVE

NOSAVE

In FoxPro for MS-DOS and FoxPro for Windows,LOAD and CALL support optional key words for use with binary routines that write to the main FoxPro window.

 SAVE and NOSAVE are ignored in FoxPro for Macintosh.

 You can include SAVE (NOSAVE is the default) when loading a binary routine, or both SAVE and NOSAVE when calling a binary routine.  If included with CALL, SAVE and NOSAVE override the key word included with LOAD.

If SAVE is included, FoxPro copies the current contents of video RAM into the FoxPro desktop or main FoxPro window upon return from the binary routine (assuming that the binary routine is writing directly to video RAM).

This means that anything written to the FoxPro desktop or main FoxPro window by the binary routine is known to FoxPro and is treated as if FoxPro had written it.  In particular, such externally written data isn't erased when a FoxPro object is dragged over it.

Unless necessary, don't include SAVE, because it takes FoxPro some time to scan and save the screen contents upon each return from the binary routine.

Creating a Binary File

Follow these steps when creating a binary file for FoxPro for MS-DOS and FoxPro for Windows:

1	Assemble the program and create an object file with this command:

MASM <file>

2	Link the object file and create an executable file with this command:

LINK <file>

3	Create a binary file with this command:

EXE2BIN <file>

In addition, follow these rules when creating a FoxPro binary file:

The first executable instruction must originate at an offset of 0.

The binary program must not change the length of memory variables passed as arguments.

The amount of memory used or allocated can't exceed the actual program size because the file size is used to determine the amount of memory allocated.

The SS and CS registers must be restored before control is returned to FoxPro.

A far return should be used to return control to FoxPro when the program is executed with LOAD and CALL.

When a program is terminated by an exit system call rather than a far return, you must execute assembly programs with the RUN command.

Caution   Carefully read the following assembly language interface warnings:

When using string variables, don't change the length of the strings.  It is possible that the free memory list could be corrupted if the length of a string variable is changed by even 1 byte.

When saving a string address from one call to the next, you should also reset the string address you store to just prior to using the string variable.


LOAD SeeAlso
See Also

CALL Command


LOCATE Command

See Also	Example

Sequentially searches the table for the first record that matches a given logical expression.

Syntax

LOCATE FOR <expL1>
[<scope>]
[WHILE <expL2>]
[NOOPTIMIZE]

Remarks

The table doesn't have to be indexed.

If LOCATE finds a matching record, its record number is displayed unless SET TALK is OFF, in which case, you can use RECNO( ) to return the number of the matching record.  If a matching record is found, FOUND( ) returns true (.T.), and EOF( ) returns false (.F.).

After LOCATE finds a matching record, you can issue CONTINUE to search the remainder of the table for additional matching records.  When CONTINUE is executed, the search process resumes, starting with the record immediately following the matching record.  You can issue CONTINUE repeatedly until the end of the scope or the end of the table is reached.

If a match isn't found, RECNO( ) returns the number of records in the table plus one, FOUND( ) returns false, and EOF( ) returns true.

LOCATE and CONTINUE are specific to the current work area.  If another work area is selected, the search process can be continued when the original work area is reselected.

You can also execute LOCATE by choosing Locate ...  from the Record menu.  See the Record Menu chapter in the FoxPro User's Guide for more information on using LOCATE interactively.

Clauses

FOR <expL1>

LOCATE sequentially searches the current table for the first record that matches the logical expression <expL1>.

Rushmore optimizes a query created with LOCATE FOR if <expL1> is an optimizable expression.  For best performance, use an optimizable expression in the FOR clause.  A discussion of Rushmore optimizable expressions appears in the Optimizing Your Application chapter in the FoxPro Developer's Guide.

<scope>

The scope clauses are:  ALL, NEXT <expN>, RECORD <expN>, and REST.  These are explained in the Overview of the FoxPro Language chapter in the FoxPro Language Reference.  Commands which include <scope> operate only on the table in the active work area.

You can specify a scope of records to locate.  Only the records that fall within the range of records specified by the scope are located.

The default scope for LOCATE is ALL records.

WHILE <expL2>

If the WHILE clause is included, records are searched for as long as the logical expression <expL2> evaluates to true (.T.).

NOOPTIMIZE

To disable Rushmore optimization of LOCATE, include NOOPTIMIZE.  For more information, see SET OPTIMIZE or consult the discussion of Rushmore optimization in the Optimizing Your Application chapter in the FoxPro Developer's Guide.


LOCATE Example

In this example, all records for customers from New York state are located.  The total count is then displayed on the screen.

CLOSE DATABASES
SET TALK OFF
USE customer
STORE 0 TO mcount
LOCATE FOR ALLTRIM(UPPER(state)) = 'NY'
DO WHILE FOUND( )
mcount = mcount + 1
CONTINUE
ENDDO
? 'Total customers from New York: '+ LTRIM(STR(mcount))


LOCATE SeeAlso
See Also

CONTINUE Command

EOF( ) Function

FIND Command

FOUND( ) Function

SEEK Command

SEEK( ) Function

RECNO( ) Function


LOCFILE( ) Function

See Also

Locates a file on disk and returns the file name with its path.

Syntax

LOCFILE(<expC1> [, <expC2>] [, <expC3>] [, <expC4>])

Returns

Character

Remarks

If the file can't be located, the Open dialog is brought forward so you can search for the file.

Parameters

<expC1>

The name of the file to locate is specified with <expC1>.  If <expC1> includes only a file name, LOCFILE( ) searches the default directory or folder first.   If the file isn't found in the default directory or folder, the FoxPro path is then searched.  Use SET PATH to specify the FoxPro path.

If <expC1> includes a path and a file name, the specified location is searched.  If the file can't be found in the specified location, LOCFILE( ) searches the default directory or folder and then the FoxPro path.

If the file is located, its file name and path are returned.

If the file can't be located in the default directory or folder, the FoxPro path or a specified location, the Open dialog is displayed.  The Open dialog can be used to locate the file.  When a file is chosen from the dialog, the file name is returned with the file's path, which is appended to the FoxPro path.

If you exit the Open dialog by choosing Cancel or pressing Escape, an alert "File doesn't exist" is displayed and LOCFILE( ) doesn't return a value.

<expC2>

If the file name you specify with <expC1> doesn't include an extension, FoxPro applies the file extensions listed in <expC2> to the file name and searches for the file again.

<expC2> also specifies the file name extensions of the files displayed in the Open dialog when the All Files check box isn't checked.  For a complete list of the file name extensions used by FoxPro, see the file name extension table in the FoxPro Developer's Guide.

<expC2> can take a variety of forms:

If <expC2> contains a single extension (for example, .PRG), only files with that extension are displayed.

<expC2> can contain a list of file extensions separated by semicolons.  For example, including PRG;FXP displays all files with the extensions .PRG and .FXP.

If files have the same name but different extensions (for example, CUSTOMER.PRG and CUSTOMER.FXP), only the file with the extension listed first in <expC2> is displayed.

<expC2> can contain a list of file name extensions separated by vertical bars (for example, PRG|FXP).  In this case, all files with any of these extensions are displayed, even if the files have the same names.

If <expC2> contains just a semicolon (;), all files without an extension are displayed.

If <expC2> is the null string, all files in the current directory are displayed if <expC4> is omitted.

<expC2> can also contain MS-DOS wildcard characters (* and ?).  All files with extensions that meet the wildcard criteria are displayed.  For example, if <expC2> is ?X?, all files with the extension .FXP, .EXE, or .TXT are displayed.

<expC3>

The optional character expression <expC3> is the prompt displayed at the top of the Open dialog.

<expC4> - FoxPro for Macintosh only.

In FoxPro for Macintosh, you can include <expC4> to display files with a specific creator type.

If you include the null string in <expC2>, only files that match the creator type specified in <expC4> are displayed. If you include a file skeleton in <expC2>, files that match the file skeleton and have the creator type specified in <expC4> are displayed.

For a list FoxPro file extensions and corresponding creator types, see the File Types and Extensions table in Appendix A of the Developer's Guide.


LOCFILE() SeeAlso
See Also

FILE( )

GETFILE( )

PUTFILE( )

SET PATH


LOCK( ) Function
LOCK( )

See Also	Example

Attempts to lock one or more records in the current or specified table.

Syntax

LOCK([<expN> | <expC1>] | [<expC2>, <expN> | <expC1>])

Returns

Logical

Remarks

LOCK( ) is identical to RLOCK( ).

If the lock or locks are successfully placed, a true (.T.) value is returned.  Locked records are available for both read and write access to the user who placed the locks; they are available for read-only access to all other users on the network.

Executing LOCK( ) doesn't guarantee that the record lock or locks will be successfully placed.  A record lock can't be placed on a record already locked by another user or in a table locked by another user.  If the record lock or locks can't be placed for any reason, a false value (.F.) is returned.

By default, LOCK( ) makes one attempt to lock a record.  Use SET REPROCESS to automatically retry a record lock when the first attempt fails.  SET REPROCESS determines the number of lock attempts or the length of time over which lock attempts are made when the initial lock attempt is unsuccessful.  For more information, see SET REPROCESS.

SET MULTILOCKS determines whether you can lock multiple records in a table.  If MULTILOCKS is SET OFF (the default), you can lock only a single record in a table.  When SET MULTILOCKS is ON, you can lock multiple records in a table.  For more information, see SET MULTILOCKS.

Parameters

<expN> | <expC1>

If you don't specify a work area or table alias, LOCK( ) attempts to lock the current record in the table in the current work area.

To attempt to lock the current record in a table open in another work area, include the work area number <expN> or the table alias <expC1>.

<expC2>

You must include <expC2> to attempt to lock multiple records.  MULTILOCKS must be SET ON and you must include the work area or alias of the table for which you are attempting to place multiple record locks.

<expC2> is a list of one or more record numbers.  LOCK( ) attempts to lock all of these records.  The record numbers specified with <expC2> are separated by commas.  For example, to attempt record locks on the first four records in a table, <expC2> must contain 1,2,3,4.

You can also lock multiple records by moving the record pointer to the record you would like to lock, issuing LOCK( ) or RLOCK( ) and then repeating these steps for each additional record.

If all the records specified with <expC> are successfully locked, true (.T.) is returned.  If even one of the records specified with <expC2> can't be locked, false (.F.) is returned and none of the records is locked.  However, any existing record locks remain in place.  Multiple record locking is an additive process [image] placing additional record locks doesn't release locks on other records.

The maximum number of records that can be locked in each work area is approximately 8,000.  It is always faster to lock the entire table rather than even a small number of records.

Unlocking Records

A table record can be unlocked only by the user who placed the lock.  You can release record locks by issuing UNLOCK, closing the table or exiting FoxPro.

UNLOCK can be used to release record locks in the current work area, a specific work area or in all work areas.  For more information, see UNLOCK.

Toggling MULTILOCKS from ON to OFF or from OFF to ON implicitly performs UNLOCK ALL [image] all record locks in all work areas are released.

Tables can be closed with USE, CLEAR ALL or CLOSE DATABASES.

For more information about record and file locking and sharing tables on a network, see the FoxPro in a Multi-User Environment chapter in the FoxPro Developer's Guide.


LOCK( ) Example

The following example locks and unlocks the first four records in CUSTOMER.DBF and SALESMAN.DBF.

CLOSE DATABASES
SET REPROCESS TO 3 AUTOMATIC
STORE '1,2,3,4' TO mreclist
old_exc = SET('EXCLUSIVE')
SET EXCLUSIVE OFF
SELECT 0
USE salesman
SELECT 0
USE customer
? LOCK('1,2,3,4', 'customer')	&& Lock 1st 4 records in customer
? RLOCK(mreclist, 'salesman')	&& Lock 1st 4 records in salesman
UNLOCK IN customer
UNLOCK IN salesman
SET EXCLUSIVE &old_exc


LOCK() SeeAlso
See Also

CLEAR Commands

CLOSE Commands

FLOCK( ) Function

RLOCK( ) Function

SET MULTILOCKS Command

SET REPROCESS Command

UNLOCK Command

USE Command


LOG( ) Function

See Also	Example

Returns the natural logarithm (base e) of the specified numeric expression.

Syntax

LOG(<expN>)

Returns

Numeric

Remarks

The base for the natural logarithm is the constant e.  The number of decimal places returned in the result is specified with SET DECIMALS.

Parameter

<expN>

LOG( ) returns the value of x in the equation ex = <expN>.   The numeric expression <expN> must be greater than 0.


LOG( ) Example

? LOG(1)

STORE EXP(2) TO esquared
? LOG(esquared)


LOG() SeeAlso
See Also

EXP( ) Function

LOG10( ) Function

SET DECIMALS Command


LOG10( ) Function

See Also	Example

Returns the common logarithm (base 10) of the specified numeric expression.

Syntax

LOG10(<expN>)

Returns

Numeric

Remarks

The base for the common logarithm is 10.  The number of decimal places returned in the result is specified with SET DECIMALS.

Parameter

<expN>

LOG10( ) returns the value of x in the equation 10x = <expN>.  The numeric expression <expN> must be greater than 0.


LOG10( ) Example

? LOG10(10)

STORE 100 TO baseten
? LOG10(baseten)

? LOG10(baseten^2)


LOG10() SeeAlso
See Also

EXP( ) Function

LOG( ) Function

SET DECIMALS Command


LOOKUP( ) Function

See Also	Example

Searches a table for the first record with a field matching the specified expression.

Syntax

LOOKUP(<field1>, <search expr>, <field2>[, <expC>])

Returns

Character, Numeric, Logical or Date

Remarks

If the search is successful, LOOKUP( ) moves the record pointer to the matching record and returns the contents of a specified field in the record.

If the search expression isn't found, LOOKUP( ) returns an empty string of the same length and data type as <field1>.  The record pointer is positioned at the end of the file.

If LOOKUP( ) is used to search a parent table, record pointers in all related child tables are moved to the related records.

This function can't be optimized with Rushmore optimization.

Clauses

<field1>

If the search is successful, the value of the field specified with <field1> is returned.  If the search is unsuccessful, an empty string of the same length and data type as <field1> is returned.

<search expr>

The search expression is specified with <search expr>.  The search expression is usually the contents of a field in the table, or it can correspond to the index expression of the active index or compound index tag.

<field2>

If the table doesn't have an active index, LOOKUP( ) performs a sequential search through the field specified with <field2>.

If the table has an active index, LOOKUP( ) performs a faster search of the primary index.

<expC>

<expC> is the name of a compound index tag for LOOKUP( ) to search.  A compound index search is the fastest search LOOKUP( ) can perform.


LOOKUP( ) Example

In the following example, LOOKUP( ) uses the active index tag, CITY, to search the CITY field for the first occurrence of the search string "Dallas."  If the search is successful, LOOKUP( ) returns the contents of the COMPANY field.  @ ... SAY displays the LOOKUP( ) return value.

CLOSE DATABASES
CLEAR
USE customer ORDER city
@ 2,2 SAY LOOKUP(company, 'Dallas', city, 'city')


LOOKUP() SeeAlso
See Also

FIND Command

INDEX Command

LOCATE Command

SEEK Command

SEEK( ) Function


LOWER( ) Function

See Also	Example

Returns a specified character expression in lower-case letters.

Syntax

LOWER(<expC>)

Returns

Character

Remarks

LOWER( ) converts all upper-case letters (A [image] Z) in the character expression to lower-case (a [image] z).  All other characters in the character expression remain unchanged.

Parameter

<expC>

<expC> is the character expression you want to convert to lower-case.


LOWER( ) Example

STORE 'FOX' TO name
? LOWER(name)


LOWER() SeeAlso
See Also

ISALPHA( ) Function

ISLOWER( ) Function

ISUPPER( ) Function

PROPER( ) Function

UPPER( ) Function


LTRIM( ) Function

See Also	Example

Returns the specified character expression with leading blanks removed.

Syntax

LTRIM(<expC>)

Returns

Character

Remarks

LTRIM( ) returns a character string that results from removing the leading blanks from a character expression.  This function is especially useful for removing the leading blanks that are inserted when you use STR( ) to convert a numeric value to a character string.

Parameter

<expC>

Include the character expression <expC> from which you want to trim the leading blanks.


LTRIM( ) Example

STORE 'Redmond' TO mcity
STORE '         Washington' TO mstate
? mcity, mstate

? mcity, LTRIM(mstate)


LTRIM() SeeAlso
See Also

ALLTRIM( ) Function

LEFT( ) Function

RIGHT( ) Function

RTRIM( ) Function

SUBSTR( ) Function

TRIM( ) Function


LUPDATE( ) Function

See Also	Example

Returns the date on which the current or specified table was last updated.

Syntax

LUPDATE([<expN> | <expC>])

Returns

Date

Remarks

This function is useful in update procedures.

Parameters

<expN> | <expC>

LUPDATE( ) returns the date of the last update to the table in the current work area.  To return the last update to a table open in a different work area, include the work area number <expN> or the table alias <expC>.

If no table is open in the work area you specify, LUPDATE( ) returns a blank date.  If no table has the alias you specify, the message "Alias not found" is displayed.


LUPDATE( ) Example

USE customer
? LUPDATE( )


LUPDATE() SeeAlso
See Also

DIR or Directory Command

FILER Command


MAX( ) Function

See Also	Example

Returns the expression with the highest ASCII or numeric value or the latest date from a list of character, numeric or date expressions.

Syntax

MAX(<expr1>, <expr2>[, <expr3> ... ])

Returns

Character, Date or Numeric

Remarks

MAX( ) (maximum) evaluates a set of expressions and returns the expression with the largest value.

When determining the maximum date value from a set of dates, MAX( ) returns the latest date.

MAX( ) returns the character expression with the maximum ASCII value from a set of character expressions.

Parameters

<expr1>, <expr2>[, <expr3> ... ]

<expr1>, <expr2>, and <expr3> are the set of expressions from which you want MAX( ) to return the expression with the highest value.

All the expressions must be of the same type (character, numeric or date).


MAX( ) Example

? MAX(54, 39, 40)

? MAX(2^8, 10*12, PI( ))

? MAX({07/12/99},DATE( ))


MAX() SeeAlso
See Also

CALCULATE Command

MIN( ) Function


MCOL( ) Function

See Also

Returns the screen or window column position of the mouse pointer.

Syntax

MCOL([<expC>])

Returns

Numeric

Remarks

MCOL( ) returns the column position of the mouse pointer on the desktop in FoxPro for MS-DOS, the main FoxPro window or a user-defined window.

Parameter

<expC>

MCOL( ) returns the desktop or main FoxPro window column position of the mouse pointer if <expC> is omitted and there is no active user-defined window.

If there is an active user-defined window and <expC> is omitted, MCOL( ) returns the mouse pointer column coordinate relative to the active user-defined window.  If you specify the window name with <expC>, MCOL returns the column coordinate relative to the specified window.  MCOL( ) returns -1 if the mouse pointer is positioned outside the user-defined window.

In FoxPro for MS-DOS, MCOL( ) returns 0 if <expC> is the name of a Browse window or the Debug window and the mouse pointer is positioned on the window's left border.  MCOL( ) returns -1 if the mouse pointer is positioned on the left border of any other windows.

MCOL( ) returns -1 if a mouse driver isn't loaded and there is no output window.

For an example using MCOL( ), see the second example for INKEY( ).


MCOL() SeeAlso
See Also

COL( ) Function

INKEY( ) Function

MROW( ) Function

ROW( ) Function

WCOLS( ) Function

WROWS( ) Function


MDOWN( ) Function

See Also

Determines whether or not the left mouse button is pressed.

Syntax

MDOWN( )

Returns

Logical

Remarks

MDOWN( ) returns a true (.T.) or false (.F.) value depending on whether or not the left mouse button is pressed.

In FoxPro for MS-DOS and FoxPro for Windows, MDOWN( ) returns values for just the left mouse button.

If the mouse button is depressed when MDOWN( ) is executed, true (.T.) is returned.  If the mouse button isn't depressed when MDOWN( ) is executed, false (.F.) is returned.


MDOWN() SeeAlso
See Also

MCOL( ) Function

MROW( ) Function


MDX( ) Function

See Also

Returns the name of the open .CDX compound index file that has the specified index position number.

Syntax

MDX(<expN1>[, <expN2> | <expC>])

Returns

Character

Remarks

MDX( ) is identical to CDX( ).

Index files can be opened for a table with the INDEX clause of the USE command or with SET INDEX.  A structural compound index file is automatically opened with its table.  Any .IDX index files specified with USE or in SET INDEX are ignored by this function.

TAG( ) can be used to return tag names from a compound index file; NDX( ) can be used to return the name of an open .IDX index file.

In FoxPro for MS-DOS and FoxPro for Windows, when SET FULLPATH is ON, the path to the .CDX is returned with the .CDX name. When SET FULLPATH is OFF, the drive that the .CDX resides on is returned with the .CDX name. In FoxPro for Macintosh, the FULLPATH setting is ignored and the path to the .CDX is always returned with the .CDX name.

Parameters

<expN1>

If the table has a structural compound index file and <expN1> is 1, the name of the structural compound index file (which is always the same as the name of the table) is returned.  If <expN1> is 2, the name of the first compound index file specified with USE or SET INDEX is returned.  If <expN1> is 3, the second compound index file name is returned, and so on.  If <expN1> is greater than the number of open compound index files, the null string is returned.

If the table doesn't have a structural compound index file and <expN1> is 1, the name of the first compound index file specified with USE or SET INDEX is returned.  If <expN1> is 2, the second compound index file name is returned, and so on.  If <expN1> is greater than the number of open compound index files, the null string is returned.

<expN2> | <expC>

If you omit the optional <expN2> and <expC> arguments, names of compound index files are returned for the current work area.  You can return the names of compound index files open in work areas other than the current one by specifying the work area number <expN2> or the table alias <expC>.


MDX() SeeAlso
See Also

CDX( ) Function

INDEX Command

NDX( ) Function

SET INDEX Command

SET FULLPATH Command

SYS(14) Function - Index Expression

TAG( ) Function

USE Command


MDY( ) Function

See Also	Example

Returns the specified date expression in Month Day Year format.

Syntax

MDY(<expD>)

Returns

Character

Remarks

MDY( ) returns a date expression in Month Day Year format with the name of the month spelled out.  If SET CENTURY OFF, the resulting character expression has the format Month DD, YY.  If SET CENTURY is ON, the format is Month DD, YYYY.

Parameter

<expD>

<expD> is the date expression you want to return in Month Day Year format.


MDY( ) Example

The following example creates a user-defined function that returns a date with the corresponding weekday.

*** LongDate ***

FUNCTION longdate
PARAMETERS mdate
RETURN CDOW(mdate) + ', ' + MDY(mdate)

To use this UDF:

SET CENTURY OFF

? Longdate({08/16/92})

SET CENTURY ON
? Longdate({08/16/92})


MDY() SeeAlso
See Also

DMY( ) Function

SET CENTURY Command

SET DATE Command


MEMLINES( ) Function

See Also	Example

Returns the number of lines in a memo field.

Syntax

MEMLINES(<memo field>)

Returns

Numeric

Remarks

The number of lines in a memo field is determined by the current value of SET MEMOWIDTH.

Parameter

<memo field>

<memo field> is the name of the memo field.  If the memo field is in a table that isn't open in the current work area, preface the memo field name with the table alias and a period.


MEMLINES( ) Example

The following example scans three records in the SALESMAN table and uses MEMLINES( ) to determine whether or not there is data in the NOTES memo field and when page breaks should occur.  The NAME data for the record is displayed, along with the notes (if there is data in the memo field) or a message indicating that there are no notes for that record.

CLOSE DATABASES
CLEAR
SET TALK OFF
USE salesman
SET MEMOWIDTH TO 65
mline = 1
GOTO 2
SCAN NEXT 3
memo_size = MEMLINES(notes)
IF memo_size = 0
STORE .T. TO nomemo
STORE 1 TO memo_size
ELSE
STORE .F. TO nomemo
ENDIF
IF mline + memo_size > 65
EJECT
mline = 1
ENDIF
@ mline,2 SAY 'Name : '+ name
mline = mline+1
@ mline,2 SAY 'Notes: '
?? IIF(nomemo, 'No notes ',notes)
mline = mline + memo_size + 2
IF mline > 24
mline = 1
CLEAR
ENDIF
ENDSCAN


MEMLINES() SeeAlso
See Also

MLINE( ) Function

SET MEMOWIDTH Command


MEMORY( ) Function

See Also	Example

Returns the amount of memory available to run an external program.

Syntax

MEMORY( )

Returns

Numeric

Remarks

In FoxPro for MS-DOS, MEMORY( ) returns the amount of memory below 640KB which is available to RUN an external program.  Any available expanded memory is not included in the value returned by this function, and the value will vary throughout a FoxPro for MS-DOS session.

In FoxPro for Windows and FoxPro for Macintosh, MEMORY( ) always returns 640.

MEMORY( ) is similar to SYS(12), with two exceptions:

MEMORY( ) returns the amount of available memory in kilobytes; SYS(12) returns the amount of memory in bytes.

MEMORY( ) returns a numeric expression.  SYS(12) returns its value as a character string.


MEMORY( ) Example

? MEMORY( )


MEMORY() SeeAlso
See Also

SYS(12) Function - Available Memory in Bytes

SYS(1001) Function - FoxPro Memory


MENU Command

See Also	Example

Creates a menu system.

Syntax

MENU BAR <array1>, <expN1>
or
MENU <expN2>, <array2>, <expN3>
[, <expN4>]
or
READ MENU BAR TO <memvar1> <memvar2>
[SAVE]

Remarks

MENU is included for backward compatibility.  Use the FoxPro Menu Builder to create menus.

These commands create a menu system.  A menu system consists of a menu bar across the top of the desktop in FoxPro for MS-DOS, the main FoxPro window, or the active user-defined window menu pads.  Each menu pad has an associated menu popup containing a list of options.

Commands

MENU BAR <array1>, <expN1>

MENU BAR is used to create the menu bar and pads.  Create a two-dimensional array of memory variables to contain the menu pad prompts and the messages that are displayed when the menu pads are selected.  The elements in the first column of the array specified with <array1> are the menu pad prompts, and the elements in the second column of the array are the messages.  Specify where the messages are displayed with SET MESSAGE.

The number of menu pads that appear in the menu bar is specified with <expN1>.

MENU <expN2>, <array2>, <expN3>[, <expN4>]

Use a series of MENU commands to create the menu popups that are displayed when a menu pad is selected.

The numeric expression <expN2> specifies which menu pad in the menu bar the popup is assigned to.  The one-dimensional array <array2> contains the prompts for the options on the popups.

If the first character of an array element is a backslash (\), the corresponding option can't be selected. If the element contains a backslash and a hyphen (\-), a separator is drawn between the popup option prompts.  You can create a hot key for an option by placing a backslash and a less-than sign (\<) before the desired character of the option prompt.  A hot key is a highlighted letter in FoxPro for MS-DOS or an underlined letter in FoxPro for Windows that you can type to immediately choose the desired option. In FoxPro for Macintosh, the KEYCOMP setting determines if a hot key is underlined.

The number of options on the popup is specified with <expN3>.

The number of options displayed on the popup is specified with <expN4>.  If there are more options on the popup than can be displayed at one time, you can scroll through the options in the popup.

READ MENU BAR TO <memvar1>, <memvar2>

This command activates the menu bar.  The values initially contained in the memory variables or array elements <memvar1> and <memvar2> specify which menu pad and popup option are selected when the menu bar is activated.  When you choose an option from a popup, the values stored to <memvar1> and <memvar2> correspond to the popup and popup option you chose.  If you press Esc to exit the menu, <memvar1> and <memvar2> contain 0.

SAVE

Include SAVE to display an image of the menu after an option is selected.


MENU Example

*** A program example of popup MENUS ***

SET STATUS OFF
SET ECHO OFF
SET TALK OFF
SET MESSAGE TO 24

*** Initialize the array for the menu bar ***

DIMENSION TOP(3,2)
TOP(1,1) = '  FILE  '
TOP(2,1) = '  EDIT  '
TOP(3,1) = '  DATA  '
TOP(1,2) = 'FILE SELECTIONS'
TOP(2,2) = 'EDIT SELECTIONS'
TOP(3,2) = 'DATA SELECTIONS'

*** Dimension and initialize an array for the File menu ***

DIMENSION M_FILE(7)
M_FILE(1) = '\<NEW'
M_FILE(2) = '\<OPEN'
M_FILE(3) = '\<CLOSE'
M_FILE(4) = '\-'	&& Insert a line between items
M_FILE(5) = '\<SAVE'
M_FILE(6) = '\<PRINT'
M_FILE(7) = '\<QUIT'

*** Dimension and initialize an array  for the Edit menu ***

DIMENSION M_EDIT(5)
M_EDIT(1) = '\<COPY'
M_EDIT(2) = '\<FIND'
M_EDIT(3) = '\<REPLACE'
M_EDIT(4) = '\<UNDO'
M_EDIT(5) = 'C\<LEAR'

*** Dimension and initialize an array for the Data menu ***

DIMENSION M_DATA(9)
M_DATA(1) = '\<BROWSE'
M_DATA(2) = '\<APPEND'
M_DATA(3) = '\<SORT'
M_DATA(4) = '\<JOIN'
M_DATA(5) = '\-'	&& Insert a line between menu items
M_DATA(6) = '\<TOTAL'
M_DATA(7) = 'A\<VERAGE'
M_DATA(8) = '\<COUNT'
M_DATA(9) = 'S\<UM'

*** Install the pull-down menu system

MENU BAR TOP,3	&& Install menu bar
MENU 1,M_FILE,7,7	&& Install file menu into menu bar
MENU 2,M_EDIT,5,5	&& Install edit menu into menu bar
MENU 3,M_DATA,9,9	&& Install data menu into menu bar

*** Initialize the placement of the menu option ***

COL = 1
ROW = 1

*** Activate the pull-down menu system ***

READ MENU BAR TO COL, ROW SAVE
CLEAR


MENU SeeAlso
See Also

@ ... MENU Command

CREATE MENU Command

DEFINE MENU Command


MENU - System Menu Names Overview
MENU [image] System Menu Names Overview

See Also

The FoxPro System Menu names.

Remarks

The following tables provide the names of system menu pads, menu popups and menu options.

These names let you use the FoxPro system menu bar.  The SYS(2013) function returns a space-delimited string containing these names.  You can also create a quick menu in the Menu Builder to see the system menu names.  For further information on the system menu bar, see the Menus chapter in the FoxPro Developer's Guide or the Menu Builder chapter in the FoxPro User's Guide.

The name of the FoxPro system menu bar is _MSYSMENU.

The lists of menu pads and popup names appear in this order:

FoxPro for MS-DOS System Menu Pads Names

FoxPro for MS-DOS System Menu Popup Names

FoxPro for MS-DOS File Menu Popup Names

FoxPro for MS-DOS Edit Menu Popup Names

FoxPro for MS-DOS Database Menu Popup Names

FoxPro for MS-DOS Record Menu Popup Names

FoxPro for MS-DOS Program Menu Popup Names

FoxPro for MS-DOS Window Menu Popup Names

FoxPro for Windows and FoxPro for Macintosh System Menu Pad Names

FoxPro for Windows and FoxPro for Macintosh File Menu Popup Names

FoxPro for Windows and FoxPro for Macintosh Edit Menu Popup Names

FoxPro for Windows and FoxPro for Macintosh Database Menu Popup Names

FoxPro for Windows and FoxPro for Macintosh Record Menu Popup Names

FoxPro for Windows and FoxPro for Macintosh Program Menu Popup Names

FoxPro for Windows and FoxPro for Macintosh Window Menu Popup Names

FoxPro for Windows Help Menu Popup Names

FoxPro for MS-DOS System Menu Pad Names

Menu Pad	Name
System	_MSM_SYSTM
File	_MSM_FILE
Edit	_MSM_EDIT
Database	_MSM_DATA
Record	_MSM_RECRD
Program	_MSM_PROG
Window	_MSM_WINDO
FoxPro for MS-DOS System Menu Popup Names

Popup and Options	Name
System popup	_MSYSTEM
About FoxPro...	_MST_ABOUT
Help...	_MST_HELP
Macros...	_MST_MACRO
1st Separator	_MST_SP100
Filer	_MST_FILER
Calculator	_MST_CALCU
Calendar/Diary	_MST_DIARY
Special Characters	_MST_SPECL
ASCII Chart	_MST_ASCII
Capture	_MST_CAPTR
Puzzle	_MST_PUZZL
FoxPro for MS-DOS File Menu Popup Names

Popup and Options	Name
File popup	_MFILE
New...	_MFI_NEW
Open...	_MFI_OPEN
Close	_MFI_CLOSE
Close All	_MFI_CLALL
1st Separator	_MFI_SP100
Save	_MFI_SAVE
Save as...	_MFI_SAVAS
Revert	_MFI_REVRT
2nd Separator	_MFI_SP200
Printer Setup..	._MFI_SETUP
Print...	_MFI_PRINT
3rd Separator	_MFI_SP300
Quit	_MFI_QUIT
FoxPro for MS-DOS Edit Menu Popup Names

Popup and Options	Name
Edit popup	_MEDIT
Undo	_MED_UNDO
Redo	_MED_REDO
1st Separator	_MED_SP100
Cut	_MED_CUT
Copy	_MED_COPY
Paste	_MED_PASTE
Clear	_MED_CLEAR
2nd Separator	_MED_SP200
Select All	_MED_SLCTA
3rd Separator	_MED_SP300
Goto Line...	_MED_GOTO
Find...	_MED_FIND
Find Again	_MED_FINDA
Replace and Find Again	_MED_FINDA
Find Again	_MED_REPL
Replace All	_MED_REPLA
4th Separator	_MED_SP400
Preferences...	_MED_PREF
FoxPro for MS-DOS Database Menu Popup Names

Popup and Options	Name
Database popup	_MDATA
Setup..	_MDA_SETUP
Browse	_MDA_BROW
1st Separator	_MDA_SP100
Append From...	_MDA_APPND
Copy To...	_MDA_COPY
Sort...	_MDA_SORT
Total...	_MDA_TOTAL
2nd Separator	_MDA_SP200
Average...	_MDA_AVG
Count...	_MDA_COUNT
Sum...	_MDA_SUM
Calculate...	_MDA_CALC
Report...	_MDA_REPRT
Label...	_MDA_LABEL
3rd Separator	_MDA_SP300
Pack	_MDA_PACK
Reindex	_MDA_RINDX
FoxPro for MS-DOS Record Menu Popup Names

Popup and Options	Name
Record popup	_MRECORD
Append	_MRC_APPND
Change	_MRC_CHNGE
1st Separator	_MRC_SP100
Goto...	_MRC_GOTO
Locate...	_MRC_LOCAT
Continue	_MRC_CONT
Seek...	_MRC_SEEK
2nd Separator	_MRC_SP200
Replace...	_MRC_REPL
Delete...	_MRC_DELET
Recall...	_MRC_RECAL
FoxPro for MS-DOS Program Menu Popup Names

Popup and Options	Name
Program popup	_MPROG
Do...	_MPR_DO
1st Separator	_MPR_SP100
Cancel	_MPR_CANCL
Resume	_MPR_RESUM
2nd Separator	_MPR_SP200
Compile...	_MPR_COMPL
Generate...	_MPR_GENER
FoxDoc	_MPR_DOCUM
FoxGraph...	_MPR_GRAPH
FoxPro for MS-DOS Window Menu Popup Names

Popup and Options	Name
Window popup	_MWINDOW
Hide	_MWI_HIDE
Hide All	_MWI_HIDEA
Show All	_MWI_SHOWA
Clear	_MWI_CLEAR
1st Separator	_MWI_SP100
Move	_MWI_MOVE
Size	_MWI_SIZE
Zoom	_MWI_ZOOM
Minimize	_MWI_MIN
Cycle	_MWI_ROTAT
Color...	_MWI_COLOR
2nd Separator	_MWI_SP200
Command	_MWI_CMD
Debug	_MWI_DEBUG
Trace	_MWI_TRACE
View	_MWI_VIEW
FoxPro for Windows and FoxPro for Macintosh System Menu Pad Names

Menu Pad	Name
File	_MSM_FILE
Edit	_MSM_EDIT
Database	_MSM_DATA
Record	_MSM_RECRD
Program	_MSM_PROG
Text	_MSM_TEXT
Window	_MSM_WINDO
Help	_MSM_SYSTM
* In FoxPro for Macintosh, use SET MACHELP and ON MACHELP to manipulate FoxPro Help in the Help menu.

FoxPro for Windows and FoxPro for Macintosh File Menu Popup Names

Popup and Options	Name
File popup	_MFILE
New...	_MFI_NEW
Open...	_MFI_OPEN
Close	_MFI_CLOSE
Close All	_MFI_CLALL
1st Separator	_MFI_SP100
Save	_MFI_SAVE
Save  As...	_MFI_SAVAS
Revert	_MFI_REVRT
2nd Separator	_MFI_SP200
Print Setup...	_MFI_SETUP
Print...	_MFI_PRINT
3rd Separator	_MFI_SP300
Exit	_MFI_QUIT
FoxPro for Windows and FoxPro for Macintosh Edit Menu Popup Names

Popup and Options	Name
Edit popup	_MEDIT
Undo	_MED_UNDO
Redo	_MED_REDO
1st Separator	_MED_SP100
Cut	_MED_CUT
Copy	_MED_COPY
Paste	_MED_PASTE
Paste Special	_MED_PSTLK
Clear	_MED_CLEAR
2nd Separator	_MED_SP200
Insert Object...	_MED_INSOB
Object...	_MED_OBJ
Change Link...	_MED_LINK
Convert to Static	_MED_CVTST
3rd Separator	_MED_SP300
Select All	_MED_SLCTA
4th Separator	_MED_SP400
Goto Line...	_MED_GOTO
Find...	_MED_FIND
Find Again	_MED_FINDA
Replace and Find Again	_MED_REPL
Replace All	_MED_REPLA
5th Separator	_MED_SP500
Preferences...	_MED_PREF
FoxPro for Windows and FoxPro for Macintosh Database Menu Popup Names

Popup and Options	Name
Database popup	_MDATA
Setup..	_MDA_SETUP
Browse	_MDA_BROW
1st Separator	_MDA_SP100
Append From...	_MDA_APPND
Copy To...	_MDA_COPY
Sort...	_MDA_SORT
Total...	_MDA_TOTAL
2nd Separator	_MDA_SP200
Average...	_MDA_AVG
Count...	_MDA_COUNT
Sum...	_MDA_SUM
Calculate...	_MDA_CALC
Report...	_MDA_REPRT
Label...	_MDA_LABEL
3rd Separator	_MDA_SP300
Pack	_MDA_PACK
Reindex	_MDA_RINDX
FoxPro for Windows and FoxPro for Macintosh Record Menu Popup Names

Popup and Options	Name
Record popup	_MRECORD
Append	_MRC_APPND
Change	_MRC_CHNGE
1st Separator	_MRC_SP100
Goto...	_MRC_GOTO
Locate...	_MRC_LOCAT
Continue	_MRC_CONT
Seek...	_MRC_SEEK
2nd Separator	_MRC_SP200
Replace...	_MRC_REPL
Delete...	_MRC_DELET
Recall...	_MRC_RECAL
FoxPro for Windows and FoxPro for Macintosh Program Menu Popup Names

Popup and Options	Name
Program popup	_MPROG
Do...	_MPR_DO
Cancel	_MPR_CANCL
Resume	_MPR_RESUM
1st Separator	_MPR_SP100
Debug	_MWI_DEBUG
Trace	_MWI_TRACE
2nd Separator	_MPR_SP200
Compile...	_MPR_COMPL
Generate...	_MPR_GENER
Macros...	_MST_MACRO
3rd Separator	_MPR_SP300
Beautify...	_MPR_BEAUT
FoxDoc	_MPR_DOCUM
FoxPro for Windows and FoxPro for Macintosh Window Menu Popup Names

Popup and Options	Name
Window popup	_MWINDOW
Hide	_MWI_HIDE
Hide All	_MWI_HIDEA
Show All	_MWI_SHOWA
Clear	_MWI_CLEAR
Cycle	_MWI_ROTAT
1st Separator	_MWI_SP100
Command	_MWI_CMD
View	_MWI_VIEW
FoxPro for Windows Help Menu Popup Names*

Popup and Options	Name
Help popup	_MSYSTEM
Contents	_MST_HELP
Search  For Help On...	_MST_HPSCH
How to Use Help	_MST_HPHOW
1st Separator	_MST_SP100
About FoxPro...	_MST_ABOUT
2nd Separator	_MST_SP200
Calculator	_MST_CALCU
Calendar/Diary	_MST_DIARY
Filer	_MST_FILER
Puzzle	_MST_PUZZL
* In FoxPro for Macintosh, use SET MACHELP and ON MACHELP to manipulate FoxPro Help in the Help menu.


MENU TO- System Menu Names SeeAlso
See Also

ACTIVATE MENU Command

ACTIVATE POPUP Command

DEFINE BAR Command

DEFINE MENU Command

DEFINE POPUP Command

SET SYSMENU Command

SYS(2013) Function - System Menu Name String


MENU TO Command

See Also

Activates a menu bar.

Syntax

MENU TO <memvar>

Remarks

MENU TO is included for backward compatibility.  Use the FoxPro Menu Builder to create menus.

Use MENU TO to activate menu popups created with @ ... PROMPT.

Clause

<memvar>

The value initially contained in the memory variable or array element <memvar> specifies which menu pad is selected when the menu bar is activated.  When you choose a menu pad, a value is stored to <memvar> corresponding to the menu pad you choose.  If you press Esc to exit the menu, <memvar> contains 0.


MENU TO SeeAlso
See Also

@ ... PROMPT Command

CREATE MENU Command

DEFINE MENU Command


MENU( ) Function

See Also	Example

Returns the name of the active menu bar as an upper-case character string.

Syntax

MENU( )

Returns

Character

Remarks

MENU( ) returns the null string if no menu is active.  Use DEFINE MENU and ACTIVATE MENU to create a menu and activate it.


MENU( ) Example

This example uses MENU( ) to pass the name of a menu bar to a procedure.  The current system menu bar is saved to memory with SET SYSMENU SAVE, and all system menu pads are removed with SET SYSMENU TO.

Several system menu pads are created with DEFINE PAD.  When you choose a menu pad, MENU( ) passes the name of the FoxPro system menu bar, _MSYSMENU, to the CHOICE procedure.  CHOICE displays the name of the menu pad you chose and the name of the system menu bar.  If you choose the Exit menu pad, the original FoxPro system menu is restored.

*** Name this program MENUEXAM.PRG ***

CLEAR

SET SYSMENU SAVE
SET SYSMENU TO

DEFINE PAD syspad    OF _MSYSMENU PROMPT '\<System'  COLOR SCHEME 3 ;
KEY ALT+S, ''
DEFINE PAD editpad   OF _MSYSMENU PROMPT '\<Edit'    COLOR SCHEME 3 ;
KEY ALT+E, ''
DEFINE PAD recordpad OF _MSYSMENU PROMPT '\<Record'  COLOR SCHEME 3 ;
KEY ALT+R, ''
DEFINE PAD windowpad OF _MSYSMENU PROMPT '\<Window'  COLOR SCHEME 3 ;
KEY ALT+W, ''
DEFINE PAD reportpad OF _MSYSMENU PROMPT 'Re\<ports' COLOR SCHEME 3 KEY ALT+P, ''
DEFINE PAD exitpad   OF _MSYSMENU PROMPT 'E\<xit'    COLOR SCHEME 3 ;
KEY ALT+X, ''
ON SELECTION MENU _MSYSMENU ;
DO choice IN menuexam WITH PAD( ), MENU( )

PROCEDURE choice
PARAMETER mpad, mmenu

WAIT WINDOW 'You chose ' + mpad + ;
' from menu ' + mmenu NOWAIT

IF mpad = 'EXITPAD'
SET SYSMENU TO DEFAULT
ENDIF


MENU() SeeAlso
See Also

ACTIVATE MENU Command

CREATE MENU Command

DEFINE MENU Command


MESSAGE( ) Function

See Also	Example

Returns the current error message as a character string or the contents of the program line that caused the error.

Syntax

MESSAGE([1])

Returns

Character

Remarks

Unlike ERROR( ), MESSAGE( ) isn't reset by RETURN or RETRY.

Parameter

1

If MESSAGE( ) is used in a routine created with ON ERROR, you can include the optional argument 1 to return the program source code that caused the error.  If the program source code isn't available, MESSAGE(1) returns one of the following:

The entire program line if the line is macro substituted.

A command if the line contains a command without any additional clauses.

A command followed by three dots (...) if the line contains a command and additional clauses.

In stand-alone executable files (created with the Distribution Kit in the Professional Edition of FoxPro), MESSAGE() and MESSAGE(1) both return the error message string.


MESSAGE( ) Example

This example displays output from MESSAGE( ) and MESSAGE(1).

ON ERROR DO Errhand

*** The next line should generate an error ***

USE Nodatabase

ON ERROR	&& restore system error handler

PROCEDURE Errhand
? 'Line of code with error: ' + MESSAGE(1)
? 'Error number: ' + STR(ERROR( ))
? 'Error message: ' + MESSAGE( )


MESSAGE() SeeAlso
See Also

ERROR( ) Function

ON ERROR Command


MIN( ) Function

See Also	Example

Returns the expression with the lowest ASCII or numeric value or the earliest date in a list of character, numeric or date expressions.

Syntax

MIN(<expr1>, <expr2>[, <expr3> ...])

Returns

Character, Date or Numeric

Remarks

MIN( ) (minimum) evaluates a set of numeric expressions and returns the expression with the smallest value.

When determining the minimum date value from a set of dates, MIN( ) returns the earliest date.

MIN( ) returns the character expression with the minimum ASCII value from a set of character expressions.

Parameters

<expr1>, <expr2>[, <expr3> ...]

<expr1>, <expr2>, and <expr3> are the set of expressions from which you want MIN( ) to return the expression with the lowest value.

All the expressions must be of the same type (character, numeric or date).


MIN( ) Example

? MIN(54, 39, 40)

? MIN(2^8, 10*12, PI( ))

? MIN({07/12/18},DATE( ))

? MIN('a','abc')

? MIN('a','XYZ')


MIN() SeeAlso
See Also

CALCULATE Command

MAX( ) Function


MLINE( ) Function

See Also	Example

Returns a specific line from a memo field as a character string.

Syntax

MLINE(<memo field>, <expN1>[, <expN2>]

Returns

Character

Remarks

MLINE( ) returns a specific line from a memo field.  The length and number of the lines in a memo field are determined by the current value of SET MEMOWIDTH (the default line length is 50 characters).

When searching a memo field for a character string, you can use ATLINE( ) or ATCLINE( ) to return the line number of the line at which the character string is found.  Use this line number in MLINE( ) to return the contents of the line from the memo field.

Parameters

<memo field>

MLINE( ) returns a line from the memo field whose name you specify with <memo field>.  If the memo field is in a table open in a noncurrent work area, preface the memo field with a period and the table alias.

<expN1>

<expN1> is the number of the line to be returned from the memo field.  The null string is returned if <expN1> is negative, 0 or greater than the number of lines in the memo field.

<expN2>

<expN2> is the offset from the beginning of the memo field.  If you include <expN2>, the <expN1>th line from offset <expN2> is returned.

The _MLINE system memory variable is typically used for <expN2>.  _MLINE is automatically adjusted each time MLINE( ) is called.

In recursive procedures that return lines from large memo fields, you can obtain the best performance by including _MLINE as <expN2>.


MLINE( ) Example

In the example below, two methods are used to return lines from a memo field.  Two loops use MLINE( ) to return lines from the memo field.  Note the improvement in performance in the second loop when the system memory variable _MLINE is used in MLINE( ).

CLEAR
SET TALK OFF
SET MEMOWIDTH TO 50
CLOSE DATABASES
CREATE TABLE tmemo (name c(10), notes m)
APPEND BLANK	&& Add a record
WAIT WINDOW 'Filling memo field - takes several seconds' NOWAIT

*** Fill the memo field  ***
FOR outerloop = 1 TO 5	&&  loop 5 times
FOR alphabet = 65 TO 90	&&  letters A to Z
REPLACE notes WITH REPLICATE(CHR(alphabet), 40) ;
+ CHR(13) ADDITIVE
NEXT
NEXT

*** Display all lines from the memo field ***
STORE MEMLINES(notes) TO numlines  && Number of lines in memo field
STORE SECONDS( ) TO begin	&& Beginning time
FOR count = 1 TO numlines	&& Loop for number of lines in memo field
?MLINE(notes, count)	&& Display each line
NEXT
? STR(SECONDS( ) - begin, 4, 2) + ' seconds'	&& Total time

*** Preferable method using _MLINE in MLINE( ) ***
*** Display all lines from the memo field ***

WAIT 'Press a key to see the preferred method' WINDOW
CLEAR
STORE 0 TO _MLINE 	&& Reset _MLINE to zero
STORE SECONDS( ) TO begin	&& Beginning time
FOR count = 1 TO numlines	&& Loop for # of lines in memo field
?MLINE(notes, 1, _MLINE)	&& Display each line
NEXT
? STR(SECONDS( ) - begin, 4, 2) + ' seconds'	&& Total time
SET TALK ON
CLOSE DATABASES
ERASE tmemo.dbf
ERASE tmemo.fpt


MLINE() SeeAlso
See Also

ATCLINE( ) Function

ATLINE( ) Function

COPY MEMO Command

MEMLINES( ) Function

_MLINE System Memory Variable

MODIFY MEMO Command

SET MEMOWIDTH Command


MOD( ) Function

See Also	Example

Divides one numeric expression by another numeric expression and returns the remainder.

Syntax

MOD(<expN1>, <expN2>)

Returns

Numeric

Remarks

MOD( ) (modulus) divides two numeric expressions and returns the remainder.  MOD( ) and the % operator return identical results.

Parameters

<expN1>

<expN1> is the dividend.  The number of decimal places in <expN1> determines the number of decimals places in the result.

<expN2>

<expN2> is the divisor.  A positive number is returned if <expN2> is positive, and a negative number is returned if <expN2> is negative.


MOD( ) Example

? MOD(36, 10)

? MOD(4*9, 90/9)

? MOD(25.250, 5.0)


MOD() SeeAlso
See Also

% Operator


MODIFY COMMAND / MODIFY FILE Commands

See Also

Opens a text editing window and allows you to modify or create a program or text file.

Syntax

MODIFY COMMAND [<file> | ?] | MODIFY FILE [<file> | ?]
[NOEDIT]
[NOWAIT]
[RANGE <expN1>, <expN2>]
[[WINDOW <window name1>] [IN [WINDOW] <window name2> | IN SCREEN | IN MACDESKTOP]]
[AS <expN3>]
[SAME]
[SAVE]

Remarks

The SAME clause is supported in FoxPro for Windows and FoxPro for Macintosh.

For more information on the FoxPro text editing window opened with MODIFY COMMAND and MODIFY FILE, see the Text Editor section of the Interface Basics chapter in the FoxPro User's Guide.

When modifications are made to a program or text file, the updated file is written to disk.  A backup file with a .BAK extension is created if you check the Backup check box in the Preferences dialog that appears when you choose Preferences ...  from the Edit menu popup.

The built-in FoxPro editor is used unless you specify an external editor with TEDIT in your configuration file.

Clauses

MODIFY COMMAND [<file> | ?]

Use MODIFY COMMAND to edit program files.  If <file> is a file name without an extension, a .PRG extension is assumed.  MODIFY COMMAND supports a file skeleton that can contain the wildcard characters * and ?.  A text editing window is opened for each program whose file name matches the file skeleton.

If you omit the file name, a text editing window opens for a file initially named UNTITLED.PRG. When you close the editing window you can save the file with a different name.

If you include ?, the Open dialog appears, displaying a list of existing .PRG (program), .MPR (menu program), .SPR (screen program) and .QPR (query program) files to choose from.

MODIFY FILE [<file> | ?]

Use MODIFY FILE to edit text files. If <file> is a file name without an extension, no extension is assumed. MODIFY FILE supports a file skeleton that can contain the wildcard characters * and ?.  A text editing window is opened for each text file whose name matches the file skeleton.

If you omit the file name, an editing window opens for a file initially named UNTITLED. When you close the editing window you can save the file with a different name.

If you include ?, the Open dialog appears, displaying a list of existing files with no extension and .TXT files to choose from.

AS <expN3>

Include the optional AS clause in MODIFY COMMAND or MODIFY FILE to automatically translate accented characters in a program or text file created on another FoxPro platform. Specify in the numeric expression <expN3> the code page of the FoxPro platform on which the program or text file was created. The file is saved in the code page <expN3> you specify. Choose Save As... from the File menu to save the file in a different code page.

Note   When a program from another codepage contains characters that cannot be represented in your current codepage, these characters are mapped to the closest matching character of the current code page. For example, line drawing characters in code page 437 are mapped to plus signs in code page 1252. This change is irrevocable once the file is saved to the current code page.

NOEDIT

If you include NOEDIT, the program or text file opened with MODIFY COMMAND or MODIFY FILE can't be changed but can be viewed and copied to the clipboard.

NOMENU

In FoxPro for Windows and FoxPro for Macintosh, you can include NOMENU to remove the Text menu pad from the FoxPro System menu bar, preventing changes to the font, font size, line spacing and indentation. The spell checker is also disabled.

NOWAIT

When you issue MODIFY COMMAND or MODIFY FILE from within a program, a text editing window is opened and program execution pauses until the text editing window is closed. Include NOWAIT to continue program execution after the text editing window is opened. The program continues executing on the program line immediately following MODIFY COMMAND NOWAIT or MODIFY FILE NOWAIT.

An implicit NOWAIT occurs if you open more than one text editing window with a single MODIFY COMMAND or MODIFY FILE command For example:

MODIFY COMMAND *.PRG.

RANGE <expN1>, <expN2>

RANGE lets you open a text editing window with a range of characters selected. Characters are selected starting at the position specified with <expN1> up to (but not including) the <expN2>th character. If <expN1> is equal to <expN2>, no characters are selected, and the cursor is placed at the position specified with <expN1>.

WINDOW <window name1>

If you include WINDOW <window name1>, the text editing window takes on the characteristics of the window you specify.  For example, if the window is defined with the FLOAT clause of DEFINE WINDOW, the text editing window can be moved.  The window you specify with <window name1> doesn't have to be active or visible, but it must be defined.

IN [WINDOW] <window name2>

If you include IN WINDOW <window name2>, the text editing window is opened within a parent window without assuming the characteristics of the parent window.  A text editing window activated inside a parent window can't be moved outside the parent window.  If the parent window is moved, the text editing window moves with it.

To access the text editing window, the parent window must first be defined with DEFINE WINDOW and must be visible.

IN SCREEN

By including IN SCREEN, you can explicitly place a text-editor window in the main FoxPro window when a user-defined window is active.  Text editor windows are placed on the desktop or main FoxPro window by default.

IN MACDESKTOP

MACDESKTOP is available in FoxPro for Macintosh only.

Include the MACDESKTOP clause to place a text-editing window on the Macintosh desktop. The text-editing window resides at the same level as the main FoxPro window. The text-editing window can be moved outside of the main FoxPro window and the main FoxPro window can be brought forward over the top of it. When you include the MACDESKTOP clause, the text-editing window behaves in the same manner as text-editing windows in FoxBASE+ for Macintosh.

Including the MACDESKTOP clause overrides the current SET MACDESKTOP setting. SET MACDESKTOP determines if text-editing windows are placed on the main FoxPro window or the Macintosh desktop when the SCREEN or MACDESKTOP clause is not included. For more information about placing text-editing windows on the main FoxPro window or the Macintosh desktop, see SET MACDESKTOP.

SAME [image] FoxPro for Windows and FoxPro for Macintosh

Include SAME to prevent the text editing window from coming forward as the active window.  If the text editing window is hidden, it is displayed but doesn't become the active window.

SAME is ignored in FoxPro for MS-DOS.

SAVE

Include SAVE to keep an image of a text-editing window in the main FoxPro window or a user-defined window after the text-editing window is closed. Text-editing windows are normally removed from the desktop, the main FoxPro window or a user-defined window after you close them.  Use CLEAR to erase a text editor window from the desktop, the main FoxPro window or a user-defined window.

SAVE is available only from within a program.  Including SAVE has no effect when it is issued in the Command window.


MODIFY COMMAND / FILE SeeAlso
See Also

DO Command

NOTE | * | && Commands


MODIFY GENERAL Command

See Also

Opens an editing window for the current record's general field containing an OLE object.

Syntax

MODIFY GENERAL <general field1>[, <general field2> ...]
[NOMODIFY]
[NOWAIT]
[[WINDOW <window name1>] [IN [WINDOW] <window name2> | IN SCREEN | IN MACDESKTOP]]

Remarks

MODIFY GENERAL is supported in FoxPro for Windows and FoxPro for Macintosh.

When the editing window is open, you can insert, modify or delete linked or embedded OLE objects.

For additional information about OLE objects in FoxPro for Windows and FoxPro for Macintosh, see the "Object Linking and Embedding (OLE)" chapter in the FoxPro Developer's Guide.

Clauses

<general field1>[, <general field2> ...]

Specify the names of the general fields to open with <general field1>, <general field2>, and so on.  You can open an editing window for a general field in a table open in a noncurrent work area by including the table alias with the field name.  You can open multiple general fields by including a list of general fields separated by commas.

NOEDIT

If you include NOEDIT, the OLE object contained in the general field can't be changed, but it can be viewed and copied to the clipboard.

NOWAIT

When you issue MODIFY GENERAL from within a program, the general field editing window is opened and program execution pauses until the editing window is closed.  Include NOWAIT to continue program execution after the general field editing window is opened.  The program continues executing on the program line immediately following MODIFY GENERAL NOWAIT.

NOWAIT is available only in a program.  Including NOWAIT has no effect on MODIFY GENERAL when it is issued in the Command window.

WINDOW <window name1>

If you include WINDOW <window name1>, the general field editing window takes on the characteristics of the window you specify with <window name1>.  For example, if the window is defined with the FLOAT clause of DEFINE WINDOW, the general field window can be moved.  The window you specify doesn't have to be active or visible, but it must be defined.

IN [WINDOW] <window name2>

If you include IN WINDOW <window name2>, the general field editing window is opened within a parent window without assuming the characteristics of the parent window.  A general field editing window activated inside a parent window can't be moved outside the parent window.  If the parent window is moved, the editing window moves with it.

To access the general field editing window, the parent window must first be defined with DEFINE WINDOW and must be visible.

IN SCREEN

By including IN SCREEN, you can explicitly place a general field editing window in the main window in FoxPro for Windows when a user-defined window is active.  A general field editing window is placed in the main FoxPro window by default.

IN MACDESKTOP

MACDESKTOP is available in FoxPro for Macintosh only.

Include the MACDESKTOP clause to place a general field-editing window on the Macintosh desktop. The general field-editing window resides at the same level as the main FoxPro window. The general field-editing window can be moved outside of the main FoxPro window and the main FoxPro window can be brought forward over the top of it. When you include the MACDESKTOP clause, the general field-editing window behaves in the same manner as windows in FoxBASE+ for Macintosh.

Including the MACDESKTOP clause overrides the current SET MACDESKTOP setting. SET MACDESKTOP determines if general field-editing windows are placed on the main FoxPro window or the Macintosh desktop when the SCREEN or MACDESKTOP clause is not included. For more information about placing general field editing windows on the main FoxPro window or the Macintosh desktop, see SET MACDESKTOP.


MODIFY GENERAL SeeAlso
See Also

@ ... SAY - Pictures & OLE Objects

APPEND GENERAL


MODIFY LABEL Command

See Also

Modifies or creates labels and saves them to a label definition file.

Syntax

MODIFY LABEL
[<file> | ?]
[[WINDOW <window name1>] [IN [WINDOW] <window name2> | IN SCREEN | IN MACDESKTOP]]
[NOENVIRONMENT]
[NOWAIT]
[SAVE]

Remarks

MODIFY LABEL lets you interactively modify existing labels or create new labels in the Label Design window in FoxPro for MS-DOS or the Report Layout window in FoxPro for Windows.

Issuing MODIFY LABEL without any additional arguments displays the Open dialog.  If you choose New from this dialog, the name Untitled is assigned to the Label Design or Report Layout window.  You can save the label file with a different name when you close the Label Design or Report Layout window.

Clauses

<file>

You can modify existing labels by specifying the file name of the label definition table with <file>.  If the file you specify doesn't exist or can't be found, a new label file is created.

?

If you include the ? clause or omit a label file name, the Open dialog appears and displays a list of existing label files to choose from.  You can also choose New to create a new label file.

WINDOW <window name1>

If you include WINDOW <window name1>, the Label Design or Report Layout window takes on the characteristics of the window you specify with <window name1>.  For example, if the window is defined with the FLOAT clause of DEFINE WINDOW, the Label Design or Report Layout window can be moved.  The window you specify doesn't have to be active or visible, but it must be defined.

IN [WINDOW] <window name2>

If you include IN WINDOW <window name2>, the Label Design or Report Layout window is opened within a parent window without assuming the characteristics of the parent window.  A Label Design or Report Layout window activated inside a parent window can't be moved outside the parent window.  If the parent window is moved, the Label Design or Report Layout window moves with it.

To access the Label Design or Report Layout window, the parent window must first be defined with DEFINE WINDOW and must be visible.

IN SCREEN

By including IN SCREEN, you can explicitly place the Label Design window on the desktop in FoxPro for MS-DOS or the Report Layout window in the main window in FoxPro for Windows when a user-defined window is active.  The Label Design window is placed on the desktop and the Report Layout window is placed in main FoxPro window by default.

IN MACDESKTOP

MACDESKTOP is available in FoxPro for Macintosh only.

Include the MACDESKTOP clause to place a Label Design window on the Macintosh desktop. The Label Design window resides at the same level as the main FoxPro window. The Label Design window can be moved outside of the main FoxPro window and the main FoxPro window can be brought forward over the top of it. When you include the MACDESKTOP clause, the Label Design window behaves in the same manner as Label Design windows in FoxBASE+ for Macintosh.

Including the MACDESKTOP clause overrides the current SET MACDESKTOP setting. SET MACDESKTOP determines if Label Design windows are placed on the main FoxPro window or the Macintosh desktop when the SCREEN or MACDESKTOP clause is not included. For more information about placing Label Design windows on the main FoxPro window or the Macintosh desktop, see SET MACDESKTOP.

NOENVIRONMENT

When you close the Label Design or Report Layout window, you are prompted to save the current FoxPro environment with the label definition file.  Saving the FoxPro environment places an additional record in the label definition table.  This record contains the names of all open table and index files, the index order, and any relationships between the tables.

MODIFY LABEL automatically restores the environment saved with the label definition file if you saved the FoxPro environment.  If you include NOENVIRONMENT, the environment isn't restored.  Include  NOENVIRONMENT to prevent changes to the current environment.

NOWAIT

When you issue MODIFY LABEL from within a program, the Label Design or Report Layout window is opened and program execution pauses until the Label Design or Report Layout window is closed.  Include NOWAIT to continue program execution after the Label Design or Report Layout window is opened.  The program continues executing on the program line immediately following MODIFY LABEL NOWAIT.

NOWAIT is available only in a program.  Including NOWAIT has no effect on MODIFY LABEL when it is issued in the Command window.

SAVE

In FoxPro for MS-DOS, include SAVE to keep an image of the Label Design window on the desktop or in a user-defined window after the Label Design window is closed.

In FoxPro for Windows and FoxPro for Macintosh, include SAVE to keep an image of the Report Layout window in the main FoxPro window or in a user-defined window after the Report Layout window is closed.

The Label Design or Report Layout window is normally removed from the desktop, the main FoxPro window or a user-defined window after you close the editor window.  Use CLEAR to erase the Label Design or Report Layout window from the desktop, the main FoxPro window or a user-defined window.

SAVE is available only from within a program.  Including SAVE has no effect when it is issued in the Command window.


MODIFY LABEL SeeAlso
See Also

CREATE LABEL Command

LABEL Command


MODIFY MEMO Command

See Also	Example

Opens an editing window for a memo field in the current table.

Syntax

MODIFY MEMO <memo field1>
[, <memo field2> ...]
[NOEDIT]
[NOWAIT]
[RANGE <expN1>, <expN2>]
[[WINDOW <window name1>] [IN [WINDOW] <window name2> | IN SCREEN | IN MACDESKTOP]]
[SAME]
[SAVE]

Remarks

In the editing window, you can view or change the contents of the memo field.  You can open an editing window for each memo field if a record has more than one.

In FoxPro for MS-DOS, you can close a memo-editing window and save changes you made to the memo field by pressing Ctrl+W, clicking the close box or choosing Close from File menu. To exit the memo window without saving any changes, press Esc or Ctrl+Q.

In FoxPro for Windows, you can close a memo-editing window and save any changes made to the memo field by pressing Ctrl+W, choosing Close from the window's Control menu or Close from File menu. To exit the memo window without saving any changes, press Esc or Ctrl+Q.

In FoxPro for Macintosh, you can close a memo-editing window and save any changes made to the memo field by pressing Ctrl+W or choosing Close from File menu. To exit the memo window without saving any changes, press Esc.

You can also close the editing memo window and save your changes by issuing CLOSE MEMO.  Similarly, closing a table saves changes made to a memo field or fields.

In a table opened for shared access on a network, the current record is automatically locked when editing begins on a memo field.

Clauses

<memo field1>[, <memo field2> ...]

Specify the names of one or more memo fields to edit with <memo field1>, <memo field2>, and so on.  If you include the table alias, you can open editing windows for memo fields in the noncurrent work area.

NOEDIT

NOEDIT prevents modification to a memo field opened with MODIFY MEMO.  The memo field can't be changed but can be viewed and copied to the clipboard.

NOMENU

In FoxPro for Windows and FoxPro for Macintosh, you can include NOMENU to remove the Text menu pad from the FoxPro System menu bar, preventing changes to the font, font size, line spacing and indentation. The spell checker is also disabled.

NOWAIT

When you issue MODIFY MEMO from within a program, a memo editing window is opened and program execution pauses until the editing window is closed.  Include NOWAIT to continue program execution after the memo editing window is opened.  The program continues executing on the program line immediately following MODIFY MEMO NOWAIT.

RANGE <expN1>, <expN2>

RANGE lets you open a memo editing window with a range of characters selected.  Characters are selected starting at the position specified with <expN1> up to (but not including) the <expN2> character.  If <expN1> is equal to <expN2>, no characters are selected, and the cursor is placed at the position specified with <expN1>.

WINDOW <window name1>

If you include WINDOW <window name1>, the memo editing window takes on the characteristics of the window you specify with <window name1>.  For example, if the window is defined with the FLOAT clause of DEFINE WINDOW, the editing window can be moved.  The window you specify doesn't have to be active or visible, but it must be defined.

IN [WINDOW] <window name2>

If you include IN WINDOW <window name2>, the memo editing window is opened within a parent window without assuming the characteristics of the parent window.  An editing window activated inside a parent window can't be moved outside the parent window.  If the parent window is moved, the editing window moves with it.

To access the memo editing window, the parent window must first be defined with DEFINE WINDOW and must be visible.

IN SCREEN

By including IN SCREEN, you can explicitly place a memo-editing window in the main FoxPro window when a user-defined window is active.  A memo editing window is placed on the desktop or main FoxPro window by default.

IN MACDESKTOP

MACDESKTOP is available in FoxPro for Macintosh only.

Include the MACDESKTOP clause to place a memo-editing window on the Macintosh desktop. The memo-editing window resides at the same level as the main FoxPro window. The memo-editing window can be moved outside of the main FoxPro window and the main FoxPro window can be brought forward over the top of it. When you include the MACDESKTOP clause, the memo-editing window behaves in the same manner as memo-editing windows in FoxBASE+ for Macintosh.

Including the MACDESKTOP clause overrides the current SET MACDESKTOP setting. SET MACDESKTOP determines if memo-editing windows are placed on the main FoxPro window or the Macintosh desktop when the SCREEN or MACDESKTOP clause is not included. For more information about placing memo-editing windows on the main FoxPro window or the Macintosh desktop, see SET MACDESKTOP.

SAME

Include SAME to prevent a memo editing  window from coming forward as the active window.  If the memo editing window is hidden, it is displayed but doesn't become the active window.

SAVE

Include the SAVE option to keep an image of a memo editing window on the desktop, the main FoxPro window or a user-defined window after the editing window is closed.  After you close a memo editing window, it is normally removed from the desktop, the main FoxPro window, or a user-defined window.  Use CLEAR to erase a memo editing window from the desktop, the main FoxPro window or a user-defined window.

SAVE is available only from within a program.  Including SAVE has no effect when it is issued in the Command window.


MODIFY MEMO Example

The following example opens the NOTES memo field for the first record in SALESMAN.DBF in an editing window with a highlighted range.

CLOSE DATABASES
USE salesman
WAIT WINDOW "Note that Janet's name is highlighted" NOWAIT
MODIFY MEMO notes NOEDIT RANGE 1,6
USE


MODIFY MEMO SeeAlso
See Also

CLOSE MEMO Command


MODIFY MENU Command

See Also

Displays the Menu Design window and enables you to modify or create a menu system.

Syntax

MODIFY MENU
[<file> | ?]
[[WINDOW <window name1>] [IN [WINDOW] <window name2> | IN SCREEN | IN MACDESKTOP]]
[NOWAIT]
[SAVE]

Remarks

MODIFY MENU displays the Menu Design window in which you can modify existing menu files or create new ones.  For information about the Menu Builder, see the Menu Builder chapter in the FoxPro User's Guide.

Clauses

<file>

You can modify existing menus by specifying the file name of the menu definition table with <file>.  If the file you specify doesn't exist or can't be found, a new menu file is created.

?

If you include the ? clause or omit a menu file name, the Open dialog appears and displays a list of existing menu files to choose from.  You can also choose New to create a new menu file.

WINDOW <window name1>

If you include WINDOW <window name1>, the Menu Design window takes on the characteristics of the window you specify with <window name1>.  For example, if the window is defined with the FLOAT clause of DEFINE WINDOW, the Menu Design window can be moved.  The window you specify doesn't have to be active or visible, but it must be defined.

IN [WINDOW] <window name2>

If you include IN WINDOW <window name2>, the Menu Design window is opened within a parent window without assuming the characteristics of the parent window.  A Menu Design window activated inside a parent window can't be moved outside the parent window.  If the parent window is moved, the Menu Design window moves with it.

To access the Menu Design window, the parent window must first be defined with DEFINE WINDOW and must be visible.

IN SCREEN

By including IN SCREEN, you can explicitly place a Menu Design window in the main FoxPro window when a user-defined window is active.  The Menu Design window is placed on the desktop or main FoxPro window by default.

IN MACDESKTOP

MACDESKTOP is available in FoxPro for Macintosh only.

Include the MACDESKTOP clause to place a Menu Design window on the Macintosh desktop. The Menu Design window resides at the same level as the main FoxPro window. The Menu Design window can be moved outside of the main FoxPro window and the main FoxPro window can be brought forward over the top of it. When you include the MACDESKTOP clause the Menu Design window behaves in the same manner as windows in FoxBASE+ for Macintosh.

Including the MACDESKTOP clause overrides the current SET MACDESKTOP setting. SET MACDESKTOP determines if Menu Design windows are placed on the main FoxPro window or the Macintosh desktop when the SCREEN or MACDESKTOP clause is not included. For more information about placing Menu Design windows on the main FoxPro window or the Macintosh desktop, see SET MACDESKTOP.

NOWAIT

When you issue MODIFY MENU from within a program, the Menu Design window is displayed and program execution pauses until the Menu Design window is closed.  Include NOWAIT to continue program execution after the Menu Design window is opened.  The program continues executing on the program line immediately following MODIFY MENU NOWAIT.

NOWAIT is available only in a program.  Including NOWAIT has no effect on MODIFY MENU when it is issued in the Command window.

SAVE

Include SAVE to keep an image of the Menu Design window on the desktop, the main FoxPro window or a user-defined window after the Menu Design window is closed.  After you close the Menu Design window, it is normally removed from the desktop, the main FoxPro window, or a user-defined window.  Use CLEAR to erase the Menu Design window from the desktop, the main FoxPro window or a user-defined window.

SAVE is available only from within a program.  Including SAVE has no effect when it is issued in the Command window.


MODIFY MENU SeeAlso
See Also

DEFINE BAR Command

DEFINE MENU Command

DEFINE PAD Command

DEFINE POPUP Command

SET SYSMENU Command


MODIFY PROJECT Command

See Also

Opens the Project window and enables you to create or modify a project file.

Syntax

MODIFY PROJECT
[<file> | ?]
[[WINDOW <window name1>] [IN [WINDOW] <window name2> | IN SCREEN | IN MACDESKTOP]]
[SAVE]

Remarks

A project is a special table that keeps track of all programs, screens, menus, libraries, reports, labels, .DBFs, indexes, format files, and so on required to create an application, as well as all the dependencies, references and connections among the files.  A project file has a .PJX file name extension and an associated memo file with a .PJT extension.  In a project, you specify all the pieces that are required for the final application, and then FoxPro makes sure the generated application is based on the latest source files.  FLL libraries cannot be included in FoxPro for Windows and FoxPro for Macintosh projects.

For information on the Project Manager, refer to the Project Manager chapter in the FoxPro User's Guide.

Clauses

<file>

You can modify existing projects by specifying the file name of the project definition table with <file>.  If the file you specify doesn't exist or can't be found, a new project can be created.

Issuing MODIFY PROJECT without any additional arguments causes the Open dialog to appear.  The name Untitled is assigned to the project file.  When you close the Project window, you can save the project with a different name.

?

If you include the ? clause or omit the file name, the Open dialog appears, displaying a list of existing project definition files to choose from.  You can also choose the New push button to create a new project.

WINDOW <window name1>

If you include WINDOW <window name1>, the Project window takes on the characteristics of the window you specify with <window name1>.  For example, if the window is defined with the FLOAT clause of DEFINE WINDOW, the Project window can be moved.  The window you specify doesn't have to be active or visible, but it must be defined.

IN [WINDOW] <window name2>

If you include IN WINDOW <window name2>, the Project window is opened within a parent window without assuming the characteristics of the parent window.  A Project window activated inside a parent window can't be moved outside the parent window.  If the parent window is moved, the Project window moves with it.

To access the Project window, the parent window must first be defined with DEFINE WINDOW and must be visible.

IN SCREEN

By including IN SCREEN, you can explicitly place the Project window in the main FoxPro window when a user-defined window is active.  The Project window is placed on the desktop or main FoxPro window by default.

IN MACDESKTOP

MACDESKTOP is available in FoxPro for Macintosh only.

Include the MACDESKTOP clause to place a Project window on the Macintosh desktop. The Project window resides at the same level as the main FoxPro window. The Project window can be moved outside of the main FoxPro window and the main FoxPro window can be brought forward over the top of it. When you include the MACDESKTOP clause the Project window behaves in the same manner as windows in FoxBASE+ for Macintosh.

Including the MACDESKTOP clause overrides the current SET MACDESKTOP setting. SET MACDESKTOP determines if Project windows are placed on the main FoxPro window or the Macintosh desktop when the SCREEN or MACDESKTOP clause is not included. For more information about placing Project windows on the main FoxPro window or the Macintosh desktop, see SET MACDESKTOP.

NOWAIT

When you issue MODIFY MENU from within a program, the Project window is opened and program execution pauses until the Project window is closed.  Include NOWAIT to continue program execution after the Project window is opened.  The program continues executing on the program line immediately following MODIFY PROJECT NOWAIT.

NOWAIT is available only from within a program.  Including NOWAIT has no effect on MODIFY PROJECT when it is issued in the Command window.

SAVE

Include SAVE to keep an image of the Project window on the desktop, the main FoxPro window or a user-defined window after the Project window is closed.  After you close the Project window, it is normally removed from the desktop, the main FoxPro window or a user-defined window.  Use CLEAR to erase the Project window from the desktop, the main FoxPro window or a user-defined window.

SAVE is available only from within a program.  Including SAVE has no effect when it is issued in the Command window.


MODIFY PROJECT SeeAlso
See Also

BUILD APP Command

BUILD EXE Command

BUILD PROJECT Command

COMPILE Command

CREATE PROJECT Command


MODIFY QUERY Command

See Also

Opens the RQBE window, in which you can create or modify a query.

Syntax

MODIFY QUERY
[IN SCREEN | IN MACDESKTOP] [NOWAIT]

Remarks

For more information about creating queries, see the RQBE chapter in the FoxPro User's Guide or the Retrieving Your Data chapter in the FoxPro Getting Started manual.

Clauses

<file>

You can modify an existing query by specifying the name of the query file.  If the file you specify doesn't exist or can't be found, a new query can be created.

Issuing MODIFY QUERY without any additional arguments causes the Open dialog to appear.  The name Untitled is assigned to the query.  When you exit the RQBE window, you can save the query with a different name.  After you have created a query, the query is stored as a FoxPro program file with a .QPR extension.  You can execute a query program with DO, but you must include the .QPR extension with the query file name.

?

If you include the ? clause or omit the file name, the Open dialog appears, displaying a list of existing query files to choose from.  You can also choose the New push button to create a new query.

IN SCREEN

The SCREEN option is only available for MODIFY QUERY in FoxPro for Macintosh.

By including IN SCREEN, you can explicitly place the RQBE window in the main FoxPro window. The RQBE window cannot be moved outside of the main FoxPro window.

IN MACDESKTOP

MACDESKTOP is available in FoxPro for Macintosh only.

Include the MACDESKTOP clause to place an RQBE window on the Macintosh desktop. The RQBE window resides at the same level as the main FoxPro window. The RQBE window can be moved outside of the main FoxPro window and the main FoxPro window can be brought forward over the top of it. When you include the MACDESKTOP clause the RQBE window behaves in the same manner as windows in FoxBASE+ for Macintosh.

Including the MACDESKTOP clause overrides the current SET MACDESKTOP setting. SET MACDESKTOP determines if RQBE windows are placed on the main FoxPro window or the Macintosh desktop when the SCREEN or MACDESKTOP clause is not included. For more information about placing RQBE windows on the main FoxPro window or the Macintosh desktop, see SET MACDESKTOP.

NOWAIT

When you issue MODIFY QUERY from within a program, the RQBE window is opened and program execution is suspended until the RQBE window is closed.  Including NOWAIT continues program execution after the RQBE window has been opened.  The program doesn't wait for the RQBE window to be closed but continues executing from the program line immediately following MODIFY QUERY NOWAIT.

NOWAIT is available only from within a program.  Including NOWAIT has no effect on the MODIFY QUERY command when it is issued from the Command window.


MODIFY QUERY SeeAlso
See Also

CREATE QUERY Command

DO Command


MODIFY REPORT Command

See Also

Opens the Report Design window.

Syntax

MODIFY REPORT
[<file> | ?]
[[WINDOW <window name1>] [IN [WINDOW] <window name2> | IN SCREEN | IN MACDESKTOP]]
[NOENVIRONMENT]
[NOWAIT]
[SAVE]

Remarks

MODIFY REPORT lets you interactively modify an existing report or create a new report in the Report Design window.

For more information on creating and modifying reports, see the reports chapter in the FoxPro User's Guide or the Reporting on Your Data chapter in the FoxPro Getting Started manual.

Clauses

<file>

You can modify an existing report by specifying the name of the report definition file with <file>.  If the file you specify doesn't exist or can't be found, a new report is created.

To modify a report created in FoxBASE+, you must include the .FRM file name extension in the name you specify with <file>.  When you modify a report created in FoxBASE+, the report is saved in a FoxPro format, and the report can't be opened again in FoxBASE+.  A FoxPro table and memo file are created with the same name as the FoxBASE+ report.  The table name has an .FRM extension; the memo file name has an .FPT extension.  If you change the table name's .FRM extension to .FRX and the memo file name's .FPT extension to FRT, you can then open the report without specifying an extension.

?

If you include the ? clause or omit the report file name, the Open dialog appears and displays a list of existing report files to choose from.  You can also choose New to create a new report file.   If you choose New, the name Untitled is assigned to the Report Design window.  You can save the report file with a different name when you close the Report Design window.

WINDOW <window name1>

If you include WINDOW <window name1>, the Report Design window takes on the characteristics of the window you specify with <window name1>.  For example, if the window is defined with the FLOAT clause of DEFINE WINDOW, the Report Design window can be moved.  The window you specify doesn't have to be active or visible, but it must be defined.

IN [WINDOW] <window name2>

If you include IN WINDOW <window name2>, the Report Design window is opened within a parent window without assuming the characteristics of the parent window.  A Report Design window activated inside a parent window can't be moved outside the parent window.  If the parent window is moved, the Report Design window moves with it.

To access the Report Design window, the parent window must first be defined with DEFINE WINDOW and must be visible.

IN SCREEN

By including IN SCREEN, you can explicitly place a Report Design window in the main FoxPro window when a user-defined window is active.  The Report Design window is placed on the desktop or main FoxPro window by default.

IN MACDESKTOP

MACDESKTOP is available in FoxPro for Macintosh only.

Include the MACDESKTOP clause to place a Report Design window on the Macintosh desktop. The Report Design window resides at the same level as the main FoxPro window. The Report Design window can be moved outside of the main FoxPro window and the main FoxPro window can be brought forward over the top of it. When you include the MACDESKTOP clause the Report Design window behaves in the same manner as Report Design windows in FoxBASE+ for Macintosh.

Including the MACDESKTOP clause overrides the current SET MACDESKTOP setting. SET MACDESKTOP determines if Report Design windows are placed on the main FoxPro window or the Macintosh desktop when the SCREEN or MACDESKTOP clause is not included. For more information about placing Report Design windows on the main FoxPro window or the Macintosh desktop, see SET MACDESKTOP.

NOENVIRONMENT

When you close the Report Design window, you are prompted to save the current FoxPro environment with the report definition file.  Saving the FoxPro environment places an additional record in the report definition table.  This record contains the names of all open table and index files, the index order, and any relationships between the tables.

MODIFY REPORT automatically restores the environment saved with the report definition file if you saved the FoxPro environment.  If you include NOENVIRONMENT, the environment isn't restored.  Include  NOENVIRONMENT to prevent changes to the current environment.

NOWAIT

When you issue MODIFY REPORT from within a program, the Report Design window is opened and program execution pauses until the Report Design window is closed.  Include NOWAIT to continue program execution after the Report Design window is opened.  The program continues executing on the program line immediately following MODIFY REPORT NOWAIT.

NOWAIT is available only from within a program.  Including NOWAIT has no effect on MODIFY REPORT when it is issued in the Command window.

SAVE

Include SAVE to keep an image of the Report Design window on the desktop, the main FoxPro window or a user-defined window after the Report Design window closed.  When you close the Report Design window, it is normally removed from the desktop, the main FoxPro window or a user-defined window.  Use CLEAR to erase the Report Design window from the desktop, the main FoxPro window or a user-defined window.

SAVE is available only from within a program.  Including SAVE has no effect when it is issued in the Command window.


MODIFY REPORT SeeAlso
See Also

CREATE REPORT Command

REPORT Command


MODIFY SCREEN Command

See Also

Opens the Screen Design window and enables you to create or modify a screen.

Syntax

MODIFY SCREEN
[<file> | ?]
[[WINDOW <window name1>] [IN [WINDOW] <window name2> | IN SCREEN | IN MACDESKTOP]]
[NOENVIRONMENT]
[NOWAIT]
[SAVE]

Remarks

For more information on creating and modifying screens, see the Screen Builder chapter in the FoxPro User's Guide or the Designing a Custom Input Screen chapter in the FoxPro Getting Started manual.

<file>

You can modify an existing screen by specifying the name of the screen definition file.  If the file you specify doesn't exist or can't be found, a new screen is created.

?

If you include the ? clause or omit the screen file name, the Open dialog appears and displays a list of existing screen files to choose from.  You can also choose New to create a new screen file.  If you choose New, the name Untitled is assigned to the Screen Design window.  You can save the screen file with a different name when you close the Screen Design window.

WINDOW <window name1>

If you include WINDOW <window name1>, the Screen Design window takes on the characteristics of the window you specify.  For example, if the window is defined with the FLOAT clause of DEFINE WINDOW, the Screen Design window can be moved.  The window you specify doesn't have to be active or visible, but it must be defined.

IN [WINDOW] <window name2>

If you include IN WINDOW <window name2>, the Screen Design window is opened within a parent window without assuming the characteristics of the parent window.  A Screen Design window activated inside a parent window can't be moved outside the parent window.  If the parent window is moved, the Screen Design window moves with it.

To access the Screen Design window, the parent window must first be defined with DEFINE WINDOW and must be visible.

IN SCREEN

By including IN SCREEN, you can explicitly place a Screen Design window in the main FoxPro window when a user-defined window is active.  The Screen Design window is placed on the desktop or the main FoxPro window by default.

IN MACDESKTOP

MACDESKTOP is available in FoxPro for Macintosh only.

Include the MACDESKTOP clause to place a Screen Design window on the Macintosh desktop. The Screen Design window resides at the same level as the main FoxPro window. The Screen Design window can be moved outside of the main FoxPro window and the main FoxPro window can be brought forward over the top of it. When you include the MACDESKTOP clause, the Screen Design window behaves in the same manner as windows in FoxBASE+ for Macintosh.

Including the MACDESKTOP clause overrides the current SET MACDESKTOP setting. SET MACDESKTOP determines if Screen Design windows are placed on the main FoxPro window or the Macintosh desktop when the SCREEN or MACDESKTOP clause is not included. For more information about placing Screen Design windows on the main FoxPro window or the Macintosh desktop, see SET MACDESKTOP.

NOENVIRONMENT

When you close the Screen Design window, you are prompted to save the current FoxPro environment with the screen definition file.  Saving the FoxPro environment places an additional record in the screen definition table.  This record contains the names of all open table and index files, the index order, and any relationships between the tables.

MODIFY SCREEN automatically restores the environment saved with the screen definition file if you saved the FoxPro environment.  If you include NOENVIRONMENT, the environment isn't restored.  Include  NOENVIRONMENT to prevent changes to the current environment.

NOWAIT

When you issue MODIFY SCREEN from within a program, the Screen Design window is opened and program execution pauses until the Screen Design window is closed.  Include NOWAIT to continue program execution after the Screen Design window is opened.  The program continues executing on the program line immediately following MODIFY SCREEN NOWAIT.

NOWAIT is available only from within a program.  Including NOWAIT has no effect on MODIFY SCREEN when it is issued in the Command window.

SAVE

Include SAVE to keep an image of the Screen Design window on the desktop, the main FoxPro window or a user-defined window after the Screen Design window closed.  After you close the Screen Design window, it is normally removed from the desktop, the main FoxPro window, or a user-defined window.  Use CLEAR to erase the Screen Design window from the desktop, the main FoxPro window or a user-defined window.

SAVE is available only from within a program.  Including SAVE has no effect when it is issued in the Command window.


MODIFY SCREEN SeeAlso
See Also

CREATE SCREEN Command


MODIFY STRUCTURE Command

See Also

Allows you to modify the current table structure.

Syntax

MODIFY STRUCTURE

Remarks

If no file is open in the current work area, you are prompted to select a table to modify.

Changes you can make to a table's structure include the addition and deletion of fields and the modification of field names, sizes and types.  You can also add indexes and/or tags to a table.

You can also modify the structure of tables by choosing Setup ...  from the Database menu or by choosing the Setup push button in the View window.  For more information on modifying the structure of tables through the FoxPro interface, see the Database Menu chapter in the FoxPro User's Guide.

FoxPro automatically makes a backup copy of the current table before you change the table's structure.  When the modifications are complete, the data contained in the backup copy of the table is appended to the newly modified record structure.  A memo field backup file is also created.  The table backup file has a .BAK extension, and the memo file backup file has a .TBK extension.

When you modify the structure of a table that has a memo field, the blocksize of the memo file is set to the current blocksize setting.  You can specify the memo file blocksize with SET BLOCKSIZE.

Keep in mind when changing fields from one data type to another that the field contents will not always transfer or transfer cleanly.  For example, if you wish to convert a field of date type to numeric type, the field contents will not transfer.

Also, if you accept the structure changes and interrupt the data copying process, the new file will not contain all the records in the original table.

In either case, remember that FoxPro creates a .BAK copy of the original table file and a .TBK copy of the original memo field file, if the table has a memo field.  If you have any problems with MODIFY STRUCTURE, you can delete the new file(s) and rename the .BAK file and .TBK file, if any, to the original file extensions (.DBF and .FPT).


MODIFY STRUCTURE SeeAlso
See Also

CREATE Command


MODIFY WINDOW Command

See Also

Modifies a defined window.

Syntax

MODIFY WINDOW <window name> | SCREEN
[FROM <row1, column1> TO <row2, column2> |
AT <row3, column3> SIZE <row4, column4>]
[FONT <expC1>[, <expN1>]]
[STYLE <expC2>]
[TITLE <expC3>]
[HALFHEIGHT]
[DOUBLE | PANEL | NONE | SYSTEM]
[CLOSE | NOCLOSE]
[FLOAT | NOFLOAT]
[GROW | NOGROW]
[MINIMIZE | NOMINIMIZE]
[SHADOW | NOSHADOW]
[ZOOM | NOZOOM]
[ICON FILE <expC4>]
[FILL FILE <bmp file>]
[COLOR SCHEME <expN2> | COLOR <color pair list>]

Remarks

MODIFY WINDOW is supported in FoxPro for Windows and FoxPro for Macintosh.

MODIFY WINDOW changes the attributes of an existing user-defined window or the main FoxPro window.  User-defined windows are created with DEFINE WINDOW.  MODIFY WINDOW can't be used to change the attributes of FoxPro system windows (the Command window, Browse windows, the Filer, and so on).

Use MODIFY WINDOW to change the location, default font, title, border, controls, icon, wallpaper and color of a user-defined window or the main FoxPro window.  Any of these attributes can be changed by including the clauses listed above.  Note that if you change colors, you must issue CLEAR to apply the color changes.

For example, include the TO and FROM or AT and SIZE clauses to specify a new location or size for a user-defined window or the main FoxPro window.  To prevent a user-defined window or the main FoxPro window from being moved, include the NOFLOAT key word.

Clauses

<window name>

Specify the user-defined window to modify with <window name>.  The window you specify must first be created with DEFINE WINDOW.

SCREEN

You can modify the attributes of the main FoxPro window by including SCREEN instead of a window name.  Do not abbreviate the keyword SCREEN when using MODIFY WINDOW to change the attributes of the main FoxPro window [image] a "Window not defined" error message is generated.  To return the main FoxPro window to its startup configuration, issue the following command without any additional clauses:

MODIFY WINDOW SCREEN

Tip   Issuing MODIFY WINDOW SCREEN NOCLOSE is an excellent way to prevent yourself from accidentally terminating FoxPro for Windows prematurely.

Additional Clauses

For more information about the MODIFY WINDOW clauses, see DEFINE WINDOW Command.


MODIFY WINDOW SeeAlso
See Also

DEFINE WINDOW Command


MONTH( ) Function

See Also	Example

Returns the numeric month for a given date.

Syntax

MONTH(<expD>)

Returns

Numeric

Remarks

MONTH( ) returns a number from 1 through 12 indicating the month of the year.  January is month 1, and December is month 12.

Parameter

<expD>

<expD> is the date expression for which you want MONTH( ) to return the month number.


MONTH( ) Example

? DATE( )

? MONTH(DATE( ))

STORE {05/23/92} TO buy
STORE MONTH(buy + 30) TO month
? month


MONTH() SeeAlso
See Also

CMONTH( ) Function

DAY( ) Function

SYS( ) Functions Overview

YEAR( ) Function


MOVE POPUP Command

See Also	Example

Moves a popup defined with DEFINE POPUP or a FoxPro system menu popup to a new location.

Syntax

MOVE POPUP <popup name> TO <row, column> | BY <expN1>, <expN2>

Remarks

MOVE POPUP moves a popup to a different location on the desktop in FoxPro for MS-DOS, the main FoxPro window or a user-defined window.  The popup can be moved to a specific position or relative to its current position.  If a popup has been defined, it can be moved; it doesn't have to be active or visible.

Clauses

<popup name>

Specify the popup to move with <popup name>, which can be the name of a system menu popup (such as _MFILE, MEDIT, OR _MDATA) or a user-defined popup.

TO <row, column>

Include this clause to move the popup to a specific location on the desktop, main FoxPro window or a user-defined window.

BY <expN1>, <expN2>

Include this clause to move the popup to a location relative to its current position. <expN1> specifies the number of rows to move the popup (down if <expN1> is positive, up if negative).  <expN2> specifies the number of columns to move the popup (to the right if <expN2> is positive, to the left if negative).


MOVE POPUP Example

The following example defines and activates a popup, then moves and enlarges it to demonstrate popup versatility.

CLOSE DATABASE
CLEAR
DEFINE POPUP movinpop FROM 2,2 TO 7, 14 PROMPT FILES LIKE *.PRG ;
TITLE 'Programs'
ACTIVATE POPUP movinpop NOWAIT
=CHRSAW(2)
MOVE POPUP movinpop BY 5,5	&& Move popup down
=CHRSAW(2)
SIZE POPUP movinpop BY 5,5	&& Enlarge the popup
=CHRSAW(2)
SIZE POPUP movinpop BY -5,-5	&& Shrink the popup
=CHRSAW(2)
MOVE POPUP movinpop BY -5,-5	&& Move popup up
=CHRSAW(2)
DEACTIVATE POPUP movinpop
RELEASE POPUP movinpop


MOVE POPUP SeeAlso
See Also

ACTIVATE POPUP Command

DEFINE POPUP Command

SIZE POPUP Command


MOVE WINDOW Command

See Also	Example

Moves a window to a specified screen location.

Syntax

MOVE WINDOW <window name> TO <row, column> | BY <expN1>, <expN2>
[CENTER]

Remarks

Use MOVE WINDOW to move a user-defined or system window to a specified location on the desktop in FoxPro for MS-DOS, the main FoxPro window or a user-defined window.  The window can be moved to a specific position or relative to its current position.  If a window is defined, it can be moved; it doesn't have to be active or visible.

Clauses

<window name>

Specify the name of the window to move with <window name>.

TO <row, column>

Include this clause to specify the row and column coordinates to move a window to on the desktop, the main FoxPro window or a user-defined window.

BY <expN1>, <expN2>

Include this clause to move a window to a location relative to its current position.  The first numeric expression <expN1> specifies the number of rows to move the window (down if <expN1> is positive, up if negative).  The second numeric expression <expN2> specifies the number of columns to move the window (to the right if <expN2> is positive, to the left if negative).

CENTER

You can center a window on the desktop, the main FoxPro window, or in a parent window by including CENTER.


MOVE WINDOW Example

In this example, after the window menter is defined and activated, the window is moved.

DEFINE WINDOW menter FROM 10,4 TO 15,54 SYSTEM ;
TITLE "Nomadic Window"
ACTIVATE WINDOW menter
WAIT WINDOW 'Press any key to move window'
MOVE WINDOW menter TO 20,15
WAIT WINDOW 'Press any key to release window'
RELEASE WINDOW menter


MOVE WINDOWSeeAlso
See Also

ACTIVATE WINDOW Command


MRKBAR( ) Function

See Also

Determines whether or not a bar on a popup defined with DEFINE POPUP or on a FoxPro menu system popup is marked with SET MARK OF.

Syntax

MRKBAR(<expC>, <expN>)

Returns

Logical

Remarks

If the specified popup bar is marked, true (.T.) is returned.  If the popup bar isn't marked, false (.F.) is returned.

Parameters

<expC>

Specify the name of the popup containing the bar with <expC>.

<expN>

Specify the number of the bar with <expN>.

For an example using MRKBAR( ), see CNTBAR( ).


MRKBAR() SeeAlso
See Also

MRKPAD( ) Function

SET MARK OF Commands


MRKPAD( ) Function

See Also	Example

Determines whether or not a pad on a user-defined menu bar or on the FoxPro system menu bar is marked with SET MARK OF.

Syntax

MRKPAD(<expC1>, <expC2>)

Returns

Logical

Remarks

If the specified menu pad is marked, true (.T.) is returned.  If the menu pad isn't marked, false (.F.) is returned.

Parameters

<expC1>

Specify the name of the menu bar containing the menu pad with <expC1>.

<expC2>

Specify the menu pad name with <expC2>.


MRKPAD( ) Example

The following example uses MRKPAD( ) to toggle the mark character of a menu pad when you choose it.

The current system menu bar is first saved to memory with SET SYSMENU SAVE, and all the system menu pads are removed with SET SYSMENU TO.

Several system menu pads are created with DEFINE PAD.  When you choose a menu pad, the CHOICE procedure is executed.  CHOICE displays the name of the menu pad you choose and the name of the menu bar.  SET MARK OF is used with MRKPAD( ) to display or hide the menu pad's mark character.  If you choose Exit, the original FoxPro system menu is restored.

*** Name this program MARKPAD.PRG ***

CLEAR

SET SYSMENU SAVE
SET SYSMENU TO

SET MARK OF MENU _MSYSMENU TO CHR(4)
PUBLIC markpad
markpad = .T.

DEFINE PAD syspad    OF _MSYSMENU PROMPT '\<System'  COLOR SCHEME 3 ;
KEY ALT+S, ''
DEFINE PAD editpad   OF _MSYSMENU PROMPT '\<Edit'    COLOR SCHEME 3 ;
KEY ALT+E, ''
DEFINE PAD recordpad OF _MSYSMENU PROMPT '\<Record'  COLOR SCHEME 3 ;
KEY ALT+R, ''
DEFINE PAD windowpad OF _MSYSMENU PROMPT '\<Window'  COLOR SCHEME 3 KEY ALT+W, ''
DEFINE PAD reportpad OF _MSYSMENU PROMPT 'Re\<ports' COLOR SCHEME 3 ;
KEY ALT+P, ''
DEFINE PAD exitpad   OF _MSYSMENU PROMPT 'E\<xit'    COLOR SCHEME 3 ;
KEY ALT+X, ''

ON SELECTION MENU _MSYSMENU ;
DO choice IN markpad WITH PAD( ), MENU( )

PROCEDURE choice
PARAMETER mpad, mmenu

WAIT WINDOW 'You chose ' + mpad + ;
' from menu ' + mmenu NOWAIT
SET MARK OF PAD (mpad) OF _MSYSMENU TO ;
! MRKPAD('_MSYSMENU', mpad)
markpad = ! markpad

IF mpad = 'EXITPAD'
SET SYSMENU TO DEFAULT
ENDIF


MRKPAD() SeeAlso
See Also

MRKBAR( ) Function

SET MARK OF Commands


MROW( ) Function

See Also

Returns the screen or window row position of the mouse pointer.

Syntax

MROW([<expC>])

Returns

Numeric

Remarks

MROW( ) returns to row position of the mouse pointer on the desktop in FoxPro for MS-DOS, the main FoxPro window or user-defined window.

Parameter

<expC>

If <expC> is the name of a window, MROW( ) returns the mouse pointer row coordinate relative to the specified window.

MROW( ) returns the desktop or main FoxPro window row position of the mouse pointer if <expC> is omitted and there is no active user-defined window.

MROW( ) returns the mouse pointer row coordinate relative to the active user-defined window if there is an active user-defined window and <expC> is omitted.  MROW( ) returns a value of -1 if the mouse pointer is positioned outside the user-defined window.

In FoxPro for MS-DOS, MROW( ) returns 0 if <expC> is the name of a Browse window or the Debug window and the mouse pointer is positioned on the top window border.  MROW( ) returns -1 if the mouse pointer is positioned on the top border of any other windows.

MROW( ) returns -1 if no mouse driver is loaded and there is no output window.

For an example using MROW( ), see the second example for INKEY( ).


MROW() SeeAlso
See Also

COL( ) Function

MCOL( ) Function

ROW( ) Function

WCOLS( ) Function

WROWS( ) Function


MWINDOW( ) Function

See Also

Indicates over which window the mouse pointer is positioned.

Syntax

MWINDOW([<window name>])

Returns

Character or Logical

Remarks

If you don't specify a window name, MWINDOW( ) returns the name of the window over which the mouse pointer is positioned.  The null string is returned if the mouse pointer is positioned over the desktop in FoxPro for MS-DOS or the main FoxPro window.

Parameter

<window name>

If you specify a window name in MWINDOW( ) with <window name>, true (.T.) is returned if the mouse pointer is positioned over the specified window.  False (.F.) is returned if the mouse pointer isn't positioned over the window.


MWINDOW() SeeAlso
See Also

MCOL( ) Function

MDOWN( ) Function

MROW( ) Function

WONTOP( ) Function

WOUTPUT( ) Function


NDX( ) Function

See Also

Returns the name of an open .IDX index file for the current or specified table.

Syntax

NDX(<expN1>[, <expN2> | <expC>])

Returns

Character

Remarks

The CDX( ) and MDX( ) functions can be used to return the names of open .CDX compound index files.

In FoxPro for MS-DOS and FoxPro for Windows, when SET FULLPATH is ON, the path to the .IDX is returned with the .IDX name. When SET FULLPATH is OFF, the drive the .IDX resides on is returned with the .IDX name. In FoxPro for Macintosh, the FULLPATH setting is ignored and the path to the .IDX is always returned with the .IDX name.

Parameters

<expN1>

USE and SET INDEX both support an index file list that lets you open index files for a table.  The index file name returned by this function is determined by the order of the file names in this index file list.  For example, if <expN1> is 1, the name of the first index file in the index file list is returned; if <expN1> is 2, the second index name is returned; and so on.  Names of any compound index files in the index file list are ignored.

The null string is returned if <expN1> is greater than the number of .IDX index files in the index file list.

<expN2> | <expC>

If you don't specify a work area or table alias, NDX( ) returns the names of .IDX index files open with the table in the current work area.

You can return names of .IDX index files open in other work areas by specifying a work area number with <expN2> or a table alias with <expC>.

NDX( ) returns the null string if no table is open in the work area you specify.  If no table has the alias you include, the message "Alias not found" is displayed.


NDX() SeeAlso
See Also

CDX( ) Function

INDEX Command

MDX( ) Function

SET FULLPATH Command

SET INDEX Command

SYS(14) Function - Index Expression

TAG( ) Function

USE Command


NORMALIZE( ) Function

See Also

Converts a character expression into a form that can be compared with FoxPro function return values.

Syntax

NORMALIZE(<expC>)

Returns

Character

Remarks

Use NORMALIZE( ) to convert a character expression supplied by a user into a form that can be compared with return values from FoxPro functions.

NORMALIZE( ) returns a character string from the character expression <expC> with the following changes:

The character expression is converted to upper-case. However, embedded strings are not changed. An example of an embedded string is "Hello" in the character expression "LEFT('Hello',1)".

Any abbreviated FoxPro keywords in the character expression are expanded to their full length.

Any -> operators separating aliases from field names are converted to periods.

The syntax of any FoxPro commands or functions within the character expression is checked although the expression is not evaluated. If the syntax is incorrect, a syntax error is generated. NORMALIZE( ) does not check for the existence of any fields, tables, memory variables, user-defined functions or other references in the character expression.

For example, a user may enter an index expression like the following in the expression builder:

UPPE(cust->lname) + UPPE(cust->fname)

While this is a valid FoxPro index key expression, it's difficult to compare this to the return values from a FoxPro function like KEY( ). NORMALIZE( ) returns the following character string for the expression above:

UPPER(CUST.LNAME) + UPPER(CUST.FNAME)

This can be easily compared to the value returned by a function like KEY( ), allowing you, in this example, to determine if an index or index tag with the user supplied index expression already exists.

Parameter

<expC>

Specify the character expression to normalize with <expC>.


See Also

EVALUATE( ) Function

ISUPPER( ) Function

PROPER( ) Function

UPPER( ) Function


Note| * | && Commands

See Also	Example

Indicate the beginning of a non-executing comment line in a program file.

Syntax

Note

[<comments>]
or
*
[<comments>]
or
&&
[<comments>]

Remarks

Use the NOTE, * and && commands to place comments in program files.  To continue a comment on the following line, place a semicolon at the end of the comment.

Commands

Note[<comments>]

The word NOTE at the beginning of a program line indicates that the line is a comment.  For example:

NOTE	This is a comment

* [<comments>]

An asterisk (*) at the beginning of a program line indicates that the line is a comment.  For example:

*	This is a comment

&& [<comments>]

Two ampersands (&&) at the end of a program line indicate that in-line comments follow.  For example:

STORE (20*12) TO payments	&& 20 years of monthly payments

Inserting in-line comments to denote the end of IF ... ENDIF, DO and FOR ... ENDFOR constructs greatly improves the readability of programs.


Note| * | && Example

NOTE  Initialize the page number;
variable.
STORE 1 to MPGNMBR
* Set up the loop
DO WHILE MPGNMBR <= 25	&& loop 25 times
MPGNMBR = MPGNMBR + 1
ENDDO	&& DO WHILE MPGNMBR <= 25


NOTE | * | && SeeAlso
See Also

MODIFY COMMAND / MODIFY FILE Commands


NUMLOCK( ) Function

See Also	Example

Returns the current mode of the NumLock key or sets the mode of the NumLock key on or off.

Syntax

NUMLOCK([<expL>])

Returns

Logical

Remarks

NUMLOCK( ) returns a true (.T.) or false (.F.) value, depending on the current mode of the NumLock key.  True (.T.) is returned if NumLock is on (pressing a key on the numeric keypad returns a number).  False (.F.) is returned if NumLock is off (pressing a key on the numeric keypad moves the cursor).

In FoxPro for Macintosh, the Num Lock key setting can be changed by pressing Shift+Clear.

Parameter

<expL>

To turn the NumLock key on or off, include <expL>.  If <expL> is .T., the NumLock key is turned on; if <expL> is .F., the NumLock key is turned off.  NUMLOCK( ) returns a logical value corresponding to the NumLock key setting before NUMLOCK(.T.) or NUMLOCK(.F.) is issued.


NUMLOCK( ) Example

In these examples, the equal sign (=) is used to execute NUMLOCK( ) without returning a value.

oldlock = NUMLOCK( )	&& Save original setting
= NUMLOCK(.T.)	&& Turn numlock on
= NUMLOCK(!NUMLOCK( ))	&& Toggle NumLock to the opposite value
= NUMLOCK(oldlock)	&& Return to original setting


NUMLOCK() SeeAlso
See Also

CAPSLOCK( ) Function

INSMODE( ) Function


@ ... PROMPT Command

See Also	Example

Creates a menu bar.

Syntax

@ <row, column> PROMPT <expC1>
[MESSAGE <expC2>]

Remarks

@ ... PROMPT is included for backward compatibility.  Use the Menu Builder to create menus and menu popups.

Using a series of @ ...  PROMPTs you can create the menu bar pads and specify their positions on the desktop (FoxPro for MS-DOS), the main FoxPro window or in a user-defined window.

After the menu bar pads are created, issue MENU TO to activate the menu bar.

When you choose a menu bar pad, a number is returned to a memory variable or array element specified in MENU TO.  The number returned is determined by the order in which the pads are defined.  For example, if five pads are defined with five @ ...  PROMPTs and you choose the third pad, 3 is stored to the memory variable or array element.

To choose a menu bar pad, press Enter or the Spacebar when the desired pad is selected, or click the pad.

A menu pad is disabled by placing a backslash (\) before the pad prompt.  A disabled menu pad appears on the menu bar but cannot be selected.  You can also create a hot key for a menu pad by placing a backslash and a less-than sign (<) before the character in the prompt that you would like to be the hot key.

If a prompt contains more than one occurrence of a character, the first occurrence of that character is the hot key.  In the following example, the second D in ADD is specified as the hot key, but the first D is the hot key.

@ 1,20 PROMPT 'AD\<D' MESSAGE 'Add a record'

If CONFIRM is set on with SET CONFIRM, you can select a menu bar pad by pressing the key corresponding to the first character of the prompt.  Once a menu bar pad is selected, press Enter or the Spacebar to choose the pad.  If hot keys have been assigned to the pads, you can choose a pad by pressing its hot key.  Hot keys aren't affected by SET CONFIRM.

If CONFIRM is set off, pressing the key corresponding to the first character of the prompt of a menu bar pad chooses the pad.  If menu bar pads have been defined with hot keys other than the first character of the menu bar pads, the hot keys take precedence.

Clauses

<row, column> PROMPT

The <row, column> coordinates specify where the menu bar pads are placed. If <row> is the same for each @ ... PROMPT, a horizontal menu bar is created.  If <column> is the same for each @ ... PROMPT command, a vertical menu bar is created.

<expC1>

The character expression <expC1> is the prompt that appears in the menu bar pad.

MESSAGE <expC2>

The character expression <expC2> is displayed when the menu bar is activated with MENU TO.


@ ... PROMPT Example

SET TALK OFF
CLEAR
SET MESSAGE TO 24 CENTER
@ 1,20 PROMPT '\<ADD' MESSAGE 'Add a record to the table'
@ 1,30 PROMPT '\<DELETE' MESSAGE;
'Delete a record from the table'
@ 1,40 PROMPT '\<UPDATE' MESSAGE 'Update records in the table'
@ 1,50 PROMPT '\<QUIT' MESSAGE 'Exit this program'
STORE 1 TO mchoice
MENU TO mchoice

DO CASE
CASE mchoice= 1
@ 2,0 SAY 'Menu pad # ' + STR(mchoice,1) + ', ADD'
CASE mchoice= 2
@ 2,0 SAY 'Menu pad # ' + STR(mchoice,1) + ', DELETE'
CASE mchoice = 3
@ 2,0 SAY 'Menu pad # ' + STR(mchoice,1) + ', UPDATE'
CASE mchoice = 4
@ 2,0 SAY 'Menu pad # ' + STR(mchoice,1) + ', QUIT'
ENDCASE


@ ... PROMPT SeeAlso
See Also

CREATE MENU Command

MENU TO Command

SET CONFIRM Command

SET MESSAGE Command


@     SCROLL Command

See Also

Moves an area of the main FoxPro window or a user-defined window up, down, left, or right.

Syntax

@ <row1, column1> TO <row2, column2> SCROLL
[UP | DOWN | LEFT | RIGHT]
[BY <expN>

Remarks

Included for compatibility with dBASE.

<row1, column1> TO <row2, column2> SCROLL

The rectangular region of the desktop, the main FoxPro window or the active user-defined window specified with these coordinates is moved. The upper-left corner of the region is specified with <row1, column1>, and the lower-right corner is specified with <row2, column2>.

UP | DOWN | LEFT | RIGHT

Specifies the direction the rectangular region is moved. If a direction is omitted, the region is moved upward.

BY <expN>

Specifies how many rows or columns the rectangular region is moved. If a <expN> is omitted, the region is moved by one row or column.


@ ... SCROLL SeeAlso
See Also

SCROLL Command


@ ... TO Command

See Also

Draws a box, circle, or ellipse using specified coordinates.

Syntax

@ <row1, column1> TO <row2, column2>
[DOUBLE | PANEL | <border string>]
[PATTERN <expN1>]
[PEN <expN2>[, <expN3>]]
[STYLE <expC>]
[COLOR SCHEME <expN4> | COLOR <color pair list>]

Remarks

Use this command to draw a box.  If you omit the optional clauses, the box is drawn with a single line for the border and the current colors.

In FoxPro for Windows and FoxPro for Macintosh, you can draw rectangles, rounded rectangles, circles and ellipses by including the PATTERN, PEN and STYLE clauses.  These clauses are optional and can be included in any combination.  If a PATTERN, PEN or STYLE clause is included with a DOUBLE or PANEL clause, the DOUBLE or PANEL clause is ignored.

The PATTERN clause specifies a fill pattern for drawn objects.  The PEN clause specifies the width and type of an object's outline.  STYLE lets you create a transparent or opaque object and specify the curvature for rectangle edges, circles and ellipses.

Important   In FoxPro for Windows and FoxPro for Macintosh, if FoxFont is the current font and the PATTERN, PEN and STYLE clauses aren't included, rectangles are drawn with the FoxFont box drawing characters.  This provides compatibility with earlier versions of FoxPro.

If FoxFont isn't the current font, or if FoxFont is the current font and a PATTERN, PEN or STYLE clause is included, rectangles are drawn using graphics.  A rectangle drawn with the FoxFont box-drawing characters and the same rectangle drawn with graphics are drawn at slightly different positions.

Clauses

<row1, column1> TO <row2, column2>

<row1, column1> are the coordinates of the upper-left corner of the box.  <row2, column2> are the coordinates of the lower-right corner of the box. If <row1> and <row2> are the same, a horizontal line is drawn.  If <column1> and <column2> are the same, a vertical line is drawn.

DOUBLE | PANEL | <border string>

If DOUBLE is included, the box is drawn with a double-line border.  If PANEL is included, the box is drawn with a solid border.

<border string> is a set of characters that specify parts of the box in this order:  top, bottom, left side, right side, upper-left corner, upper-right corner, lower-left corner, lower-right corner.

Specify the characters in the border string using one of the following forms and separate them with commas:

Literal characters enclosed in string delimiters (single or double quotation marks or brackets).

@ 1,10 TO 22,45 '=', '=', '|', '|', '+', '+', '+', '+'

Character expressions or variables delimited with commas.

STORE '=' TO END
STORE '|' TO SIDE
STORE '+' TO CORNER
@ 1,10 TO 22,45 END,END,SIDE,SIDE,CORNER,CORNER,CORNER,CORNER

The ASCII value of the characters specified in CHR( ) functions.

STORE CHR(61) TO END
STORE CHR(124) TO SIDE
STORE CHR(43) TO CORNER
@ 1,10 TO 22,45 END,END,SIDE,SIDE,CORNER,CORNER,CORNER,CORNER

or

@ 1,10 TO 22,45 CHR(61),CHR(61),CHR(124),CHR(124),;
CHR(43),CHR(43),CHR(43),CHR(43)

You can draw the box with a single character by including the top character and omitting the remaining characters.  This example draws a box using asterisks:

STORE '*' TO BOX_CHAR
@ 1,10 TO 22,45 BOX_CHAR

PATTERN <expN1>

PATTERN accepts a numeric argument from 0 through 7 that specifies the pattern that fills the object.  This numeric argument corresponds to the fill patterns available for an object with the Screen Builder.

<expN1>	Pattern
0	None
1	Solid
2	Horizontal lines
3	Vertical lines
4	Forward diagonals
5	Backward diagonals
6	Crosshatch
7	Slanted crosshatch
The PATTERN clause is ignored in FoxPro for MS-DOS.

PEN <expN2>[, <expN3>]

Include the PEN clause to specify an object's outline.  The width of the pen used to draw the outline is specified with <expN2>, and the pen type is specified with <expN3>.

The following table lists values for <expN2> and <expN3> and the corresponding pen widths and types.

<expN2>	Pen Width
0	Hairline*
1	1 point*
2	2 point
3	3 point
4	4 point
5	5 point
6	6 point
* Lines drawn with the hairline and 1-point pens may display as 1 point wide with some display drivers and hardware.

<expN3>	Pen Type
0	None
1	Dotted
2	Dashed
3	Dash-dot
4	Dash-dot-dot
The PEN clause is ignored in FoxPro for MS-DOS.

In FoxPro for Macintosh, only solid and dotted lines are supported; including 1, 2, 3 or 4 creates a dotted line.The 100 pen type is only supported in FoxPro for Macintosh, and creates 3-dimensional rectangles. When you include 100 for the pen type, any additional clauses you include  (PATTERN, STYLE, COLOR, etc.) are ignored.

STYLE <expC>

The type of object created (rectangle, rounded rectangle, circle or ellipse) is specified by <expC>.  Objects created with @ ... TO are opaque by default; include T in <expC> to create a transparent object.

Include a number from 0 to 99 in <expC> to specify the curvature of the object's corner:  0 specifies no curvature, and creates square corners; 99 specifies the maximum curvature, and creates circles and ellipses.

The STYLE clause is ignored in FoxPro for MS-DOS.

COLOR SCHEME <expN4> | COLOR <color pair list>

The color of the object you create with @ ... FILL can be specified by including the number of an existing color scheme in the COLOR SCHEME clause or a set of color pairs in the COLOR clause.

A color scheme is a set of 10 predefined color pairs.  The color pairs in a color scheme can be changed with SET COLOR OF SCHEME.  In FoxPro for MS-DOS the color pairs in a color scheme can also be changed in the Color Picker.

A color pair is a set of two letters separated by a forward slash.  The first color letter specifies the foreground color and the second letter specifies the background color.

For example, this color pair specifies a red foreground on a white background:

R/W

For a list of colors and their corresponding color letters, see SET COLOR Commands Overview or Color Table by Color Pair.

A color pair can also be specified with a set of 6 RGB (Red Green Blue) color values separated by commas.  The first 3 color values specify the foreground color and the second 3 color values specify the background color.  The color values can range from 0 through 255.

The R/W color pair in the example above can also be specified with this RGB color pair:

RGB(255,0,0,255,255,255)

Only the first color pair in the specified color scheme or color pair list determines the color of the object.

In FoxPro for Windows, the first color in the color pair is the pen color, the second color is the fill color.  For example, the following creates an ellipse with a solid red interior and a blue outline:

@ 2,2 TO 12,22 STYLE '99' ;
PATTERN 1 PEN 2 COLOR 'B/R'

If you omit the color clause, the rectangular portion is cleared.  An area can also be cleared with @ ... CLEAR.


@ ... TO SeeAlso
See Also

@ ... BOX Command

SET COLOR Commands Overview


ABS( ) Function

See Also	Example

Returns the absolute value of the specified numeric expression.

Syntax

ABS(<expN>)

Returns

Numeric

Parameters

<expN>

<expN> is the numeric expression whose absolute value is returned by ABS( ).


ABS Example
ABS( ) Example

? ABS(-45)

? ABS(10-30)

? ABS(30-10)

STORE 40 TO num1
STORE 2 TO num2
? ABS(num2-num1)


ABS SeeAlso
See Also

INT( ) Function

ROUND( ) Function

SIGN( ) Function


ACCEPT Command

See Also	Example

Accepts character string data from the screen.

Syntax

ACCEPT
[<expC>]
TO <memvar>

Remarks

ACCEPT is included for backward compatibility.  Use @ ... GET instead.

This command allows you to enter character data directly into a memory variable or array element without delimiting the characters with quotation marks.

If you need to perform data validation or trap errors, @ ... GET is a better choice.

ACCEPT differs from INPUT in two ways.  With ACCEPT:

The data you enter is always treated as character type.

You don't have to enclose the entered data in quotation marks.

Clauses

<expC>

The character expression <expC> is the prompt text that is displayed next to the area in which data is entered. In FoxPro for Windows and FoxPro for Macintosh, the prompt text appears in the same font as the font of the main FoxPro window. However, the character data you enter appears in 9 point FoxFont.

<memvar>

The memory variable or array element in which the character data is stored is specified with <memvar>.  If the memory variable or array element isn't defined, it is automatically created by ACCEPT.

If you press Enter without entering data, the memory variable or array element contains the null string.  If you press Esc when SET ESCAPE is OFF, the memory variable contains the null string.  If you press Esc when SET ESCAPE is ON, program execution is suspended.


ACCEPT Example

This example prompts you for a customer name and displays the memory variable containing the name you entered.

ACCEPT 'ENTER THE CUSTOMER NAME: ' TO mcustname
?
? mcustname


ACCEPT SeeAlso
See Also

@ ... GET Command

READ Command

WAIT Command


OBJNUM( ) Function

See Also	Example

Returns the object number of an @ ... GET control.

Syntax

OBJNUM(<var> [, <expN>])

Returns

Numeric

Remarks

You can use @ ... GET and @ ... EDIT to create controls which are also called objects. Controls that are considered objects are fields, check boxes, lists, popups, invisible, push, and radio buttons, spinners and text editing regions.  OBJNUM( ) returns a number that corresponds to a control's creation order in a set of controls.

Parameters

<var>

<var> is the name of the memory variable, array element or field specified when you create the control.

<expN>

Nested READs are created by issuing @ ... GETs and a READ in a routine called during a READ.  READs can be nested to five levels.  To return a control number for a control at a read level other than the current read level, include the optional read level number <expN>.  If <expN> is omitted, OBJNUM( ) returns the @ ...  GET control number for the current read level.


OBJNUM( ) Example

The following example creates a window and places radio buttons in the window that let you move the record pointer through an open table.  If a table isn't open, the Open dialog is displayed so you can select a table to open.

SET TALK OFF
DEFINE WINDOW gotodialog FROM 9, 17 TO 19,61 ;
FLOAT NOCLOSE SHADOW DOUBLE COLOR SCHEME 5
PRIVATE file,lastobj,enter,tab,shifttab,up,down,left,right

*** Assign lastkey values ***

enter	= 13
tab	= 9
shifttab	= 15
up	= 5
down	= 24
right	= 4
left	= 19
lastobj	= 1

*** Open a table ***

IF EMPTY(DBF( ))
file = GETFILE('DBF','Pick a table')
IF EMPTY(FILE)
WAIT WINDOW 'Cancelled' NOWAIT
RETURN
ENDIF
USE (file)
ENDIF

*** Draw the fields ***

ACTIVATE WINDOW gotodialog
@ 0,1 TO 8,25
@ 1,3 GET radio PICTURE '@*RVN \<Top;\<Bottom;\<Record;\<Skip' SIZE 1,10,1 DEFAULT 1 WHEN radwhen( ) VALID radvalid( )
@ 5,15 GET recordnum SIZE 1,8 DEFAULT 0 ;
FUNCTION 'Z' WHEN recwhen( ) VALID recvalid( ) DISABLE
@ 7,15 GET skipnum SIZE 1,8 DEFAULT 0 ;
FUNCTION 'Z' WHEN skipwhen( ) DISABLE
@ 3,29 GET okcancel PICTURE '@*VT \!\<Goto;\?\<Cancel' ;
SIZE 1,10,2 DEFAULT 0 WHEN okwhen( ) VALID okvalid( )
READ CYCLE
RELEASE WINDOW gotodialog

*** Place cursor in recordnum field if it is enabled ***
*** and the last object selected was the radio button ***
*** record.  Do this only if Enter, Tab, Down Arrow or ***
*** Right Arrow is pressed to exit the record radio button. ***

FUNCTION radwhen
IF _CUROBJ = OBJNUM(radio)+3 AND radio = OBJNUM(radio)+2 ;
AND lastobj = OBJNUM(radio)+2 ;
AND (LASTKEY( ) = enter OR LASTKEY( ) = tab ;
OR LASTKEY( ) = down OR LASTKEY( ) = right)
_CUROBJ = OBJNUM(recordnum)
lastobj = OBJNUM(recordnum)
RETURN
ENDIF

*** Place cursor in recordnum field if it is enabled ***
*** and the last object selected was the radio button ***
*** skip.  Do this only if Shift+Tab, Up Arrow or ***
*** Left Arrow is pressed to exit the skip radio button. ***

IF _CUROBJ = OBJNUM(radio)+2 AND radio = OBJNUM(radio)+2 ;
AND lastobj = OBJNUM(radio)+3 AND (LASTKEY( ) = shifttab ;
OR LASTKEY( ) = left OR LASTKEY( ) = up)
lastobj = _CUROBJ
_CUROBJ = OBJNUM(recordnum)
RETURN
ENDIF
lastobj = _CUROBJ

*** Enable and disable appropriate get fields when ***
*** a radio button is selected. ***

FUNCTION radvalid
DO CASE
CASE radio = 1 or radio = 2
STORE 0 TO recordnum,skipnum
SHOW GET recordnum DISABLED
SHOW GET skipnum DISABLED
CASE radio = 3
STORE 0 TO skipnum
SHOW GET recordnum ENABLED
SHOW GET skipnum DISABLED
_CUROBJ = OBJNUM(recordnum)
CASE radio = 4
STORE 0 TO recordnum
SHOW GET recordnum DISABLED
SHOW GET skipnum ENABLED
_CUROBJ = OBJNUM(skipnum)
ENDCASE

*** Routine to bypass the recno field and move to the goto button. ***
*** Put cursor on goto push button if the last object selected ***
*** was the radio button skip.  Do this only if Tab, Down Arrow ***
*** or Right Arrow is pressed to exit the skip radio button. ***

FUNCTION recwhen
IF lastobj = OBJNUM(radio)+3 AND (LASTKEY( ) = tab OR LASTKEY( ) = down OR LASTKEY( ) = right)
_CUROBJ = OBJNUM(okcancel)
RETURN
ENDIF
*** Routine to bypass the recno field and move to the skip button. ***
*** Place cursor on skip radio button if the last object selected ***
*** was the goto push button.  Do this only if Shift+Tab, Up Arrow ***
*** or Left Arrow is pressed to exit the goto push button. ***

IF lastobj = OBJNUM(okcancel) AND (LASTKEY( ) = shifttab ;
OR LASTKEY( ) = up OR LASTKEY( ) = left)
_CUROBJ = OBJNUM(radio)+3
RETURN
ENDIF
lastobj = _CUROBJ

FUNCTION recvalid
IF !MDOWN( ) AND (LASTKEY( ) = enter OR LASTKEY( ) = tab ;
OR LASTKEY( ) = down OR LASTKEY( ) = right)
_CUROBJ = OBJNUM(radio)+3
RETURN
ENDIF

IF !MDOWN( ) AND (LASTKEY( )= shifttab ;
OR LASTKEY( ) = up OR LASTKEY( ) = left)
_CUROBJ = OBJNUM(radio)+2
ENDIF

FUNCTION skipwhen
lastobj = _CUROBJ

FUNCTION okwhen
lastobj = _CUROBJ

*** Routine to process the button choice ***

FUNCTION okvalid
IF okcancel = 1
DO CASE
CASE radio = 1
GO TOP
CASE radio = 2
GO BOTTOM
CASE radio = 3
IF recordnum > RECCOUNT( )
WAIT WINDOW 'Record out of range' NOWAIT
ELSE
GO recordnum
ENDIF
CASE radio = 4
IF skipnum+RECNO( ) > RECCOUNT( ) OR skipnum + RECNO( ) < 0
WAIT WINDOW 'Record out of range' NOWAIT
ELSE
SKIP skipnum
ENDIF
ENDCASE
ENDIF


OBJNUMSeeAlso
See Also

@ ... GET Command

CLEAR READ Command

_CUROBJ System Memory Variable

OBJVAR( ) Function

RDLEVEL( ) Function

READ Command

SHOW GET Command

SHOW OBJECT Command


OBJVAR( ) Function

See Also

Returns the name of the memory variable, array element or field associated with an object.

Syntax

OBJVAR([<expN1> [, <expN2>]])

Returns

Character

Remarks

You can use @ ... GET and @ ... EDIT to create controls which are also called objects. Controls that are considered objects are fields, check boxes, lists, popups, invisible, push, and radio buttons, spinners and text editing regions. OBJVAR( ) returns the name of the memory variable, array element or field in which one of these stores a value.

Memory variable and array element names returned by OBJVAR( ) are prefaced with M and a period (M.). Field names returned by OBJVAR( ) are prefaced by the table alias and a period.

Parameters

<expN1>

If <expN1> is omitted, OBJVAR( ) returns the memory variable, array element or field for the currently active object. _CUROBJ can be used to determine the currently active object.

Include <expN1> to return the memory variable, array element or field for a specific object. <expN1> corresponds to the order in which the objects are created. For example, specify 1 for <expN1> to return the memory variable, array element or field for the first object, 2 for the second object and so on.

OBJVAR( ) returns the null string if <expN1> is greater than the number of objects.

<expN2>

Nested READs are created by issuing @ ... GETs and a READ in a routine called during a READ.  READs can be nested to five levels. To return memory variable and array element names for objects at a read level other than the current read level, include the optional read level number <expN2>.  If <expN2> is omitted, OBJVAR( ) returns memory variable and array element names for objects at the current read level.


OBJVAR() SeeAlso
See Also

@ ... GET Command

_CUROBJ System Memory Variable

OBJNUM( ) Function

READ Command


OCCURS( ) Function

See Also	Example

Returns the number of times the value of a character expression occurs within another character expression.

Syntax

OCCURS(<expC1>, <expC2>)

Returns

Numeric

Remarks

OCCURS( ) returns zero if the value of an expression isn't found in the value of another expression.

Parameters

<expC1>

Include a character expression <expC1> for which to search.

<expC2>

The second character expression <expC2> is searched for occurrences of the first character expression <expC1>.


OCCURS( ) Example

STORE 'abracadabra' TO m_string
? OCCURS('a',m_string)

? OCCURS('b',m_string)

? OCCURS('c',m_string)

? OCCURS('e',m_string)


OCCURS() SeeAlso
See Also

$ Function

INLIST( ) Function


OEMTOANSI( ) Function

See Also

Converts each character in a character expression to the corresponding character in the ANSI character set.

Syntax

OEMTOANSI(<expC>)

Remarks

OEMTOANSI( ) is supported in FoxPro for Windows and FoxPro for Macintosh.

Use OEMTOANSI( ) to move data from FoxPro for MS-DOS to FoxPro for Windows and FoxPro for Macintosh.

Parameter

<expC>

OEMTOANSI( ) converts each character in <expC> to the corresponding character in the ANSI character set.  The character expression <expC> should contain characters from the MS-DOS (OEM) character set.

If a character in <expC> doesn't have an ANSI equivalent, the character is converted to a similar ANSI character.  For example, MS-DOS line drawing characters may not be found in the ANSI character set.


OEMTOANSI() SeeAlso
See Also

ANSITOOEM( ) Function

CHRTRAN( ) Function

SYS(15) Function - Character Translation


ON APLABOUT Command

See Also	Example

Specifies a command to execute when the About... menu option is chosen from the Apple menu.

Syntax

ON APLABOUT [<command>]

Remarks

Use ON APLABOUT with SET APLABOUT to display a custom dialog for your application.

Parameter

<command>

<command> is executed when you choose the About... menu option from the Apple menu. Issue ON APLABOUT without <command> to display the default About Microsoft FoxPro... dialog when the About... menu option is chosen.


ON APLABOUT Example

This example replaces the About Microsoft FoxPro... menu option on the Apple menu with an option for a sample application. When you choose this option, the WAIT command in ON APLABOUT is executed and a window appears.

SET APLABOUT PROMPT 'About My Application...'
ON APLABOUT WAIT WINDOW 'This is My Application'


ON APLABOUT SeeAlso
See Also

ON MACHELP

SET APLABOUT

SET MACHELP


ON BAR

See Also	Example

Activates a popup or menu bar when a specific popup option is chosen.

Syntax

ON BAR <expN> OF <popup name1>
[ACTIVATE POPUP <popup name2> | ACTIVATE MENU <menu name>]

Remarks

ON BAR specifies a popup or menu bar that is activated when you choose an option from a popup.  A popup that displays and activates another popup is called a hierarchical popup.  Use ON SELECTION BAR or ON SELECTION POPUP to execute a command when an option is chosen from a popup.>

The popups and the menu bar are defined with DEFINE POPUP and DEFINE MENU, or are part of the FoxPro menu system.

Clauses

<expN> OF <popup name1>

Each option in a popup can have another popup or a menu bar assigned to it.  Specify the option's bar number <expN> and the name of the popup <popup name1> containing the option.

A popup option that has a popup or menu bar assigned to it has an arrow placed to the right of the option text.  The arrow indicates that choosing that option activates an additional popup or menu bar.  An additional space for the hierarchical arrow is placed to the right of each option if you define the popup with DEFINE POPUP ...  MARGIN.  If the popup is created without the MARGIN clause, the hierarchical arrow may overwrite the last character of the option.

ACTIVATE POPUP <popup name2> | ACTIVATE MENU <menu name>

Specify the name of the popup <popup name2> or menu bar <menu name> to activate when the popup option is chosen.  Use ON BAR without the ACTIVATE POPUP or ACTIVATE MENU to release a popup or menu bar from a popup option.


ON BAR Example

The following example demonstrates a system of hierarchical popups.  A menu bar named DINNER is created with two menu bar pads.  Each pad uses ON PAD to activate the popup named MAINCOURSE or DESSERT.  The popups named MAINCOURSE and DESSERT each have additional popups named BURGER, PIZZA and PIE assigned to their options with three ON BAR commands.  The OLIVE and PIE options have additional popups assigned with two more ON BAR commands.

When a selection is made, ON SELECTION POPUP ALL executes a procedure named YOUR CHOICE that activates a window and displays the choice.  The choice is determined with POPUP( ) and PROMPT( ), which return the name of the popup and the contents of the option's prompt.

DEFINE WINDOW order FROM 10,0 TO 13,39

DEFINE MENU dinner
DEFINE PAD one OF dinner PROMPT '\<Main Course' KEY ALT+M, ''
DEFINE PAD two OF dinner PROMPT '\<Dessert'     KEY ALT+D, ''
ON PAD one OF dinner ACTIVATE POPUP maincourse
ON PAD two OF dinner ACTIVATE POPUP dessert

DEFINE POPUP maincourse MARGIN MESSAGE ;
'We have burgers and pizza today'
DEFINE BAR 1 OF maincourse PROMPT '\<Hamburgers'
DEFINE BAR 2 OF maincourse PROMPT '\<Pizza'
ON BAR 1 OF maincourse ACTIVATE POPUP burger
ON BAR 2 OF maincourse ACTIVATE POPUP pizza

DEFINE POPUP burger MARGIN MESSAGE ;
'What would you like on your burger?'
DEFINE BAR 1 OF burger PROMPT '\<Ketchup'
DEFINE BAR 2 OF burger PROMPT '\<Mustard'
DEFINE BAR 3 OF burger PROMPT '\<Onions'
DEFINE BAR 4 OF burger PROMPT '\<Pickles'

DEFINE POPUP pizza MARGIN MESSAGE ;
'Here are the available toppings'
DEFINE BAR 1 OF pizza PROMPT '\<Anchovies'
DEFINE BAR 2 OF pizza PROMPT '\<Green Peppers'
DEFINE BAR 3 OF pizza PROMPT '\<Olives'
DEFINE BAR 4 OF pizza PROMPT '\<Pepperoni'
ON BAR 3 OF pizza ACTIVATE POPUP olives

DEFINE POPUP olives MARGIN
DEFINE BAR 1 OF olives PROMPT '\<Black' MESSAGE 'Black olives?'
DEFINE BAR 2 OF olives PROMPT '\<Green' MESSAGE 'Green olives?'

DEFINE POPUP dessert MARGIN MESSAGE 'Our dessert offerings'
DEFINE BAR 1 OF dessert PROMPT '\<Brownies'
DEFINE BAR 2 OF dessert PROMPT '\<Cookies'
DEFINE BAR 3 OF dessert PROMPT '\<Ice Cream'
DEFINE BAR 4 OF dessert PROMPT '\<Pie'
ON BAR 4 OF dessert ACTIVATE POPUP pie

DEFINE POPUP pie MARGIN MESSAGE 'What kind of pie?'
DEFINE BAR 1 OF pie PROMPT '\<Blueberry'
DEFINE BAR 2 OF pie PROMPT '\<Cherry'
DEFINE BAR 3 OF pie PROMPT '\<Peach'
DEFINE BAR 4 OF pie PROMPT '\<Rhubarb'

ON SELECTION POPUP ALL DO yourchoice

ACTIVATE MENU dinner

PROCEDURE yourchoice
ACTIVATE WINDOW order
CLEAR
DO CASE
CASE POPUP( ) = 'BURGER'
@ 0,0 SAY 'A ' + LOWER(POPUP( )) + ' order:'
@ 1,0 SAY 'You ordered a burger with ' + LOWER(PROMPT( ))
CASE POPUP( ) = 'PIZZA'
@ 0,0 SAY 'A ' + LOWER(POPUP( )) + ' order:'
@ 1,0 SAY 'You ordered a pizza with ' + LOWER(PROMPT( ))
CASE POPUP( ) = 'OLIVES'
@ 0,0 SAY 'A pizza order:'
@ 1,0 SAY 'You ordered a pizza with ' ;
+ LOWER(PROMPT( )) + ' olives'
CASE POPUP( ) = 'DESSERT'
@ 0,0 SAY 'A ' + LOWER(POPUP( )) + ' order:'
@ 1,0 SAY 'You ordered ' + LOWER(PROMPT( )) + ' for dessert'
CASE POPUP( ) = 'PIE'
@ 0,0 SAY 'A pie order:'
@ 1,0 SAY 'You ordered ' + LOWER(PROMPT( )) + ' pie'
ENDCASE
WAIT WINDOW
DEACTIVATE WINDOW order
RETURN


ON BAR SeeAlso
See Also

ACTIVATE MENU Command

DEFINE BAR Command

DEFINE MENU Command

DEFINE POPUP Command

ON EXIT BAR Command

ON SELECTION BAR Command

ON SELECTION POPUP Command


ON ERROR Command

See Also	Example

Specifies a command that executes when an error occurs.

Syntax

ON ERROR
[<command>]

Remarks

When an error occurs during program execution, FoxPro executes the command you specify with ON ERROR.  Typically, ON ERROR uses DO to execute an error-handling procedure.

After the command specified with ON ERROR executes, program execution resumes on the line immediately following the line that caused the error.  However, if the error-handling procedure includes RETRY, the program line that caused the error is executed again.

Clauses

<command>

If you specify with <command> a procedure to execute when an error occurs, you can use ERROR( ), MESSAGE( ), LINENO( ) and PROGRAM( ) to pass the error number, the error message, the program line number and program name to the procedure.  This information can be used to correct the cause of the error.

Use ON ERROR without <command> to cause no command to execute when an error occurs (the default).


ON ERROR Example

ON ERROR DO errhand WITH ;
ERROR( ), MESSAGE( ), MESSAGE(1), PROGRAM( ), LINENO( )

*** The next line should cause an error ***

USE nodatabase
ON ERROR 	&& restore system error handler

PROCEDURE errhand
PARAMETER merror, mess, mess1, mprog, mlineno
? 'Error number: ' + LTRIM(STR(merror))
? 'Error message: ' + mess
? 'Line of code with error: ' + mess1
? 'Line number of error: ' + LTRIM(STR(mlineno))
? 'Program with error: ' + mprog


ON ERROR SeeAlso
See Also

DO Command

ERROR( ) Function

FUNCTION Command

LINENO( ) Function

MESSAGE( ) Function

PROGRAM( ) Function

PROCEDURE Command

RETRY Command


ON ESCAPE Command

See Also	Example

Specifies a command that executes when you press the Esc key during program or command execution.

Syntax

ON ESCAPE
 [<command>]

Remarks

Typically, ON ESCAPE uses DO to execute a procedure.

After the command specified with ON ESCAPE executes, program execution resumes on the line immediately following the program line that was executing when Esc was pressed.  However, if a procedure specified with ON ESCAPE includes RETRY, the program line that was executing when Esc was pressed executes again.

Use ON ESCAPE without a command to cause no command to execute when Esc is pressed (the default).

If both ON ESCAPE and ON KEY are in effect and Esc is pressed, the command specified with ON ESCAPE is executed.

Note   An ON ESCAPE routine isn't executed if SET ESCAPE is OFF.


ON ESCAPE Example

This example sets up an infinite loop but defines an ON ESCAPE routine to exit it.

SET ESCAPE ON
ON ESCAPE DO stopit
WAIT WINDOW 'Press Esc to stop loop' NOWAIT
moreloop = .T.
DO WHILE moreloop
ENDDO
RETURN

PROCEDURE stopit
moreloop = .F.
RETURN


ON ESCAPE SeeAlso
See Also

INKEY( ) Function


ON EXIT BAR Command

See Also

Executes a command when you move from the specified popup option.

Syntax

ON EXIT BAR <expN> OF <popup name> [<command>]

Remarks

Included for compatibility with dBASE.

Clauses

<expN>

Specifies the number of the popup option to which the command is assigned.

<popup name>

Specifies the name of the popup containing the popup option.

<command>

Specifies the command to execute when you move from the popup option. If you omit <command>, a command previously assigned to the popup option with ON EXIT BAR is released.


ON BAR EXIT SeeAlso
See Also

ACTIVATE MENU Command

DEFINE BAR Command

DEFINE MENU Command

DEFINE POPUP Command

ON EXIT POPUP Command

ON SELECTION BAR Command

ON SELECTION POPUP Command


ON EXIT MENU Command

See Also

Executes a command when you move from any pad in the specified menu.

Syntax

ON EXIT MENU <menu name> [<command>]

Remarks

Included for compatibility with dBASE.

The command you specify is executed for any menu pad that does not have a command assigned to it with ON EXIT PAD.

Clauses

<menu name>

Specifies the name of the menu to which the command is assigned.

<command>

Specifies the command to execute when you move from any pad in the menu. If you omit <command>, a command previously assigned to the menu with ON EXIT MENU is released.


ON EXIT MENU  SeeAlso
See Also

ACTIVATE MENU Command

DEFINE MENU Command

ON EXIT PAD Command

ON PAD Command

ON SELECTION MENU Command

ON SELECTION PAD Command


ON EXIT PAD Command

See Also

Executes a command when you move from the specified menu pad.

Syntax

ON EXIT PAD <pad name> OF <menu name> [<command>]

Remarks

Included for compatibility with dBASE.

Clauses

<pad name>

Specifies the name of the menu pad to which the command is assigned.

<menu name>

Specifies the name of the menu containing the menu pad.

<command>

Specifies the command to execute when you move from the menu pad. If you omit <command>, a command previously assigned to the menu pad with ON EXIT PAD is released.


ON EXIT PAD SeeAlso
See Also

ACTIVATE MENU Command

DEFINE MENU Command

ON EXIT MENU Command

ON PAD Command

ON SELECTION MENU Command

ON SELECTION PAD Command


ON EXIT POPUP Command

See Also

Executes a command when you move from any menu option in the specified popup.

Syntax

ON EXIT POPUP <popup name> [<command>]

Remarks

Included for compatibility with dBASE.

The command you specify is executed for any menu option that does not have a command assigned to it with ON EXIT BAR.

Clauses

<popup name>

Specifies the name of the popup to which the command is assigned.

<command>

Specifies the command to execute when you move from any menu option in the popup. If you omit <command>, a command previously assigned to the popup with ON EXIT POPUP is released.


ON EXIT POPUP  SeeAlso
See Also

ACTIVATE POPUP Command

DEFINE BAR Command

DEFINE POPUP Command

ON BAR Command

ON EXIT BAR Command

ON SELECTION POPUP Command


ON KEY Command

See Also	Example

Specifies a command that executes when you press any key during program execution.

Syntax

ON KEY
[<command>]

Remarks

When you press any key during program execution, FoxPro executes the command you specify with ON KEY.  Typically, ON KEY uses DO to execute a procedure.

After the command you specify with ON KEY executes, program execution resumes on the line immediately following the program line that was executing when a key was pressed.  However, if a procedure specified with ON KEY includes RETRY, the program line that was executing when a key was pressed executes again.

Use ON KEY without a command to cause no command to execute when a key is pressed (the default).

If both ON KEY and ON ESCAPE are in effect and Esc is pressed, the command specified with ON ESCAPE is executed.


ON KEY Example

In this example, records from the CUSTOMER table are displayed.  If a key is pressed while the records are being displayed, the procedure named PAUSE is called.  PAUSE uses WAIT to suspend display.

SET TALK OFF
USE customer
CLEAR
ON KEY DO pause
DO WHILE NOT EOF( )
? 'Company: ' + company
? 'Address: ' + address
?
SKIP
ENDDO

PROCEDURE pause
STORE INKEY( ) TO HOLD
WAIT
RETURN


ON KEY SeeAlso
See Also

INKEY( ) Function


ON KEY = Command

See Also	Example

Executes a command when a specific key or key combination is pressed during a READ.

Syntax

ON KEY
[ = <expN>]
[<command>]

Remarks

ON KEY = is included for backward compatibility.  Use ON KEY LABEL instead.

Pressing the specified key or key combination when a READ isn't in effect doesn't execute the ON KEY = command.  ON KEY = typically uses DO to execute a procedure.

Only one ON KEY = command can be active at a time.  Use ON KEY LABEL to execute commands for multiple keys or key combinations.

Clauses

= <expN>

If the key you specify is a printable character, specify the ASCII value for the key with <expN>.  If the key cannot be printed, or if you use a key combination, include a value from the following table in <expN>.

<command>

The command to be executed when the key is pressed is specified with <command>.

Keycodes	Corresponding Keystrokes
272 - 281 286 - 294 300 - 306	Alt+Q, W, E, R, T, Y, U, I, O ,P Alt+A, S, D, F, G, H, J, K, L Alt+Z, X, C, V, B, N, M
315 - 324 327 328	F1 to F10 Function keys Home Up Arrow
329 331 333	P age Up Left Arrow Right Arrow
335 336 337	End Down Arrow P age Down
338 339 340 - 349	Ins  (On the Macintosh, Help) Del Shift+F1 to Shift+F10
350 - 359 360 - 369 370	Ctrl+F1 to Ctrl+F10 Alt+F1 to Alt+F10 Ctrl+Print+Scrn
371 372 373	Ctrl+Left Arrow Ctrl+Right Arrow Ctrl+End
374 375 376 - 387 388	Ctrl+Page Down Ctrl+Home Alt+1, 2, 3, 4, 5, 6, 7, 8, 9, 0, -, =* Ctrl+Page Up
* In FoxPro for Macintosh, keystrokes Alt + ... are replaced with Ctrl + Option + ...


ON KEY = Example

In this example, records from CUSTOMER.DBF are displayed for editing.  If you press F1, the name of the current field is passed to the procedure named SCRNHELP and a message is displayed in a window.

ON KEY = 315 DO scrnhelp WITH VARREAD( )
SET TALK OFF
USE customer
SCATTER TO temp
DEFINE WINDOW input FROM 6,10 TO 18,70 PANEL
ACTIVATE WINDOW input
@ 1,3	SAY 'Customer: '	GET company
@ 3,3	SAY 'Address: '	GET address
@ 5,3	SAY 'City: '	GET city
@ 7,3	SAY 'State: '	GET state
@ 7,18	SAY 'Zip: ' 	GET zip
@ 9,8	SAY 'Press Esc to cancel or F1 for help'
READ

IF LASTKEY( ) = 27
GATHER FROM temp
ENDIF

DEACTIVATE WINDOW input
RELEASE WINDOW input

PROCEDURE scrnhelp
PARAMETERS fieldname
DEFINE WINDOW help_me FROM 1,0 TO 4,79
ACTIVATE WINDOW help_me
@ 0,20 SAY 'Sorry, no help available for ' +  fieldname
WAIT
RELEASE WINDOW help_me
RETURN


ON KEY = SeeAlso
See Also

INKEY( ) Function

ON KEY LABEL Command


ON KEY LABEL Command

See Also	Example

Specifies a command that executes when you press a specific key or key combination or click the mouse.

Syntax

ON KEY
[LABEL <key label>]
[<command>]

Remarks

ON KEY LABEL typically uses DO to execute a procedure. >

ON KEY LABEL executes the command immediately during the execution of READ, BROWSE, EDIT, CHANGE and user-defined menus and popups.  If a program is executing when the key is pressed or the mouse is clicked, the current program line is executed and then the ON KEY LABEL command is executed.  Any ON KEY LABEL key assignments created in a program remain in effect after the program is run.  ON KEY LABEL key assignments can also be created in the Command window.

Tip   To prevent recursive calls during the execution of an ON KEY LABEL procedure,  include PUSH KEY CLEAR early in the procedure to disable all active ON KEY LABELs.  Issue POP KEY at the end of the procedure to enable the ON KEY LABELs.

The ON KEY LABEL key assignments aren't in effect in the FoxPro system menu bar, dialogs, alerts, system popups and so on.  ON KEY LABEL key assignments are effective in the FoxPro system windows - the FoxPro text editor, the Command window, the Trace window, and so on.

FoxPro for Windows cannot trap certain events because they are under Windows control.  In particular, the ON KEY LABEL MOUSE, ON KEY LABEL LEFTMOUSE and ON KEY LABEL RIGHTMOUSE commands are executed when you click on a Windows control like a Control menu, scroll bars, and so on.

Unlike ON KEY, you can have multiple active ON KEY LABEL commands.  For example, you can assign a command to each of the arrow keys and both mouse buttons.

Note that executing an ON KEY LABEL resets PARAMETERS( ) to 0.  For more information, see PARAMETERS( ).

Clauses

LABEL <key label>

The key label is specified as the letter or digit label on the keyboard key, or as a special name assigned to the key.  See the following table for the special key label assignments.

Keycap Identification	<key  label>
Left Arrow
Right Arrow
Up Arrow
Down Arrow
Home	HOME
End	END
Page Up	PGUP
Page Down	PGDN
Del*	DEL
Backspace*	BACKSPACE
Spacebar	SPACEBAR
Ins	INS
Tab	TAB
Shift Tab	BACKTAB
Enter *	ENTER
F1 to F12	F1, F2, F3 ...
Ctrl+F1 to Ctrl+F12	Ctrl+F1, Ctrl+F2 ...
Shift+F1 to Shift+F12	Shift+F1, Shift+F2 ...
Alt+F1 to Alt+F12	Alt+F1, Alt+F2, Alt+F3 ...
Alt+0 to Alt-9	Alt+0, Alt+1, Alt+2 ...
Alt+A to Alt+Z	Alt+A, Alt+B, Alt+C ...
Ctrl+Left Arrow*	Ctrl+LEFTARROW
Ctrl+Right Arrow*	Ctrl+RIGHTARROW
Ctrl+Home*	Ctrl+HOME
Ctrl+End*	Ctrl+END
Ctrl+Page Up*	Ctrl+PGUP
Ctrl+Page Down*	Ctrl+PGDN
Ctrl+A to Ctrl+Z*	Ctrl+A, Ctrl+B, Ctrl+C ...
Right Mouse Button*	RIGHTMOUSE
Left Mouse Button*	LEFTMOUSE
Mouse Button	MOUSE
Esc	ESC
* In FoxPro for Macintosh, the [image] command key is also supported in ON KEY LABEL. Use CMD to specify the  [image] command key. The Control (Ctrl) and  [image] command keys are equivalent in FoxPro for Macintosh and can be used interchangeably. However, if your application will be run on other FoxPro platforms, use Ctrl for maximum compatiblity. For additional information about the keyboard and keystrokes in FoxPro for Macintosh, see the Keyboard Differences section in the Installation and Macintosh Features Guide.

In FoxPro for Macintosh, the mouse has one button. Use ON KEY LABEL LEFTMOUSE or ON KEY LABEL MOUSE to execute a command when the mouse is clicked. Use ON KEY LABEL RIGHTMOUSE to execute a command when the mouse is clicked while the [image] +Option keys are pressed.

FoxPro for Macintosh also supports RETURN as a key assignment. ON KEY LABEL RETURN is equivalent to ON KEY LABEL ENTER in FoxPro for Macintosh. Also, ON KEY LABEL DEL is equivalent to ON KEY LABEL BACKSPACE.

The Alt key in FoxPro for MS-DOS and FoxPro for Windows is emulated in FoxPro for Macintosh with Ctrl+Option.

<command>

<command> is the command that executes when the specified key is pressed or the mouse is clicked.


ON KEY LABEL Example

The following example displays a message when an arrow key is pressed.

SET TALK OFF
CLEAR
ON KEY LABEL RIGHTARROW	? 'Right Arrow'
ON KEY LABEL LEFTARROW	? 'Left Arrow'
ON KEY LABEL UPARROW	? 'Up Arrow'
ON KEY LABEL DNARROW	? 'Down Arrow'
SET ESCAPE ON
STORE .F. TO mexit
ON ESCAPE STORE .T. TO mexit
STORE 0 TO TEMP
@ 2,0 SAY 'Press an arrow key to test ON KEY LABEL, <Esc> to exit'
DEFINE WINDOW menter FROM 10,20 TO 14,60 DOUBLE
ACTIVATE WINDOW menter
DO WHILE NOT mexit
ENDDO
DEACTIVATE WINDOW menter
ON KEY


ON KEY LABEL SeeAlso
See Also

INKEY( )


ON MACHELP

See Also	Example

Specifies a command to execute when the Help menu option is chosen from the Help menu.

Syntax

ON MACHELP [<command>]

Remarks

Use ON MACHELP with SET MACHELP to invoke a custom Help system for your application.

Parameter

<command>

<command> is executed when you choose the Help menu option from the Help menu. Issue ON MACHELP without <command> to invoke the default FoxPro for Macintosh Help when the Help menu option is chosen.


ON MACHELP Example

This example replaces the Microsoft FoxPro Help... menu option in the Help menu with an option that provides customized Help. When you choose this option, the WAIT command in ON MACHELP is executed and a window appears.

SET MACHELP PROMPT 'My Application Help...'
ON MACHELP WAIT WINDOW "This is My Application's Help"


ON MACHELP SeeAlso
See Also

ON APLABOUT

SET APLABOUT

SET MACHELP

 Function

ON( ) Function

POP KEY Command

PUSH KEY Command


ON PAD Command

See Also	Example

Specifies the menu popup or menu bar that is activated when you choose a specific menu pad.

Syntax

ON PAD <pad name> OF <menu name1>
[ACTIVATE POPUP <popup name> | ACTIVATE MENU <menu name2>]

Remarks

Use ON SELECTION PAD or ON SELECTION MENU to execute a command when a menu pad is chosen.>

Clauses

<pad name> OF <menu name1>

The menu popup or menu bar is assigned to the menu pad specified with <pad name> and <menu name1>.

ACTIVATE POPUP <popup name> | ACTIVATE MENU <menu name2>

Specify the name of the menu popup <popup name> or menu bar <menu name2> to activate when the menu pad is chosen.  Use ON PAD <pad name> OF <menu name1> without an ACTIVATE POPUP or ACTIVATE MENU clause to release a menu popup or menu bar from a menu pad.


ON PAD Example

ON PAD is used in this program example to activate a menu popup when you choose a menu pad in the menu bar.

The current FoxPro system menu bar is saved to memory with SET SYSMENU SAVE and all system menu pads are removed with SET SYSMENU TO.

Two new system menu pads are created with DEFINE PAD, and DEFINE POPUP creates menu popups for each menu pad.  DEFINE BAR creates the options in each of the menu popups.  When a menu pad is chosen, ON PAD uses ACTIVATE POPUP to activate the corresponding menu popup.

When an option is chosen from a menu popup, ON SELECTION POPUP uses PROMPT( ) and POPUP( ) to pass the option number and menu popup name to the procedure named CHOICE.  CHOICE displays the prompt of the option you choose and the name of the menu popup containing the option.  The original FoxPro system menu is restored when you choose Exit from the menu popup named CARDINFO.

*** Name this program ONPAD.PRG ***

CLEAR

SET SYSMENU SAVE
SET SYSMENU TO

DEFINE PAD convpad OF _MSYSMENU PROMPT '\<Conversions' COLOR SCHEME 3 ;
KEY ALT+C, ''
DEFINE PAD cardpad OF _MSYSMENU PROMPT 'Card \<Info' COLOR SCHEME 3 ;
KEY ALT+I, ''

ON PAD convpad OF _MSYSMENU ACTIVATE POPUP conversion
ON PAD cardpad OF _MSYSMENU ACTIVATE POPUP cardinfo

DEFINE POPUP conversion MARGIN RELATIVE SHADOW COLOR SCHEME 4
DEFINE BAR 1 OF conversion PROMPT 'Ar\<ea' KEY CTRL+E, '^E'
DEFINE BAR 2 OF conversion PROMPT '\<Length' ;
KEY CTRL+L, '^L'
DEFINE BAR 3 OF conversion PROMPT 'Ma\<ss' ;
KEY CTRL+S, '^S'
DEFINE BAR 4 OF conversion PROMPT 'Spee\<d' ;
KEY CTRL+D, '^D'
DEFINE BAR 5 OF conversion PROMPT '\<Temperature' ;
KEY CTRL+T, '^T'
DEFINE BAR 6 OF conversion PROMPT 'T\<ime' ;
KEY CTRL+I, '^I'
DEFINE BAR 7 OF conversion PROMPT 'Volu\<me' ;
KEY CTRL+M, '^M'

ON SELECTION POPUP conversion;
DO choice IN onpad WITH PROMPT( ), POPUP( )

DEFINE POPUP cardinfo MARGIN RELATIVE SHADOW COLOR SCHEME 4
DEFINE BAR 1 OF cardinfo PROMPT '\<View Charges' ;
KEY ALT+V, ''
DEFINE BAR 2 OF cardinfo PROMPT 'View \<Payments' ;
KEY ALT+P, ''
DEFINE BAR 3 OF cardinfo PROMPT 'Vie\<w Users' ;
KEY ALT+W, ''
DEFINE BAR 4 OF cardinfo PROMPT '\-'
DEFINE BAR 5 OF cardinfo PROMPT '\<Charges '
DEFINE BAR 6 OF cardinfo PROMPT '\-'
DEFINE BAR 7 OF cardinfo PROMPT 'E\<xit '

ON SELECTION POPUP cardinfo;
DO choice IN onpad WITH PROMPT( ), POPUP( )

PROCEDURE choice
PARAMETERS mprompt, mpopup

WAIT WINDOW 'You chose ' + mprompt + ;
' from popup ' + mpopup NOWAIT

IF mprompt = 'Exit'
SET SYSMENU TO DEFAULT
ENDIF


ON PAD SeeAlso
See Also

ACTIVATE MENU Command

DEFINE MENU Command

ON SELECTION MENU Command

ON SELECTION PAD Command


ON PAGE Command

See Also

Executes a command when printed output reaches a specified line number in a report, or when EJECT PAGE is issued.

Syntax

ON PAGE
[AT LINE <expN> <command>]

Clauses

AT LINE <expN> <command>

The system variable _PLINENO keeps track of the current line number in a report.  The specified command executes when _PLINENO becomes greater than the line number <expN> specified in ON PAGE.  ON PAGE typically uses DO to execute a procedure for handling page breaks, headers and footers.

The command specified with ON PAGE also executes when EJECT PAGE is issued.  For more information, see EJECT PAGE.

Executing ON PAGE without the AT LINE <expN> clause clears the previous ON PAGE.


ON PAGE SeeAlso
See Also

EJECT PAGE Command


ON READERROR Command

See Also	Example

Specifies a command that executes in response to a data input error.

Syntax

ON READERROR
[<command>]

Remarks

Input errors that ON READERROR traps for include:

Invalid dates

Input that falls outside of a range defined with @ ...  GET ...  RANGE

Input that doesn't meet a condition defined with @ ...  GET ...  VALID

Clause

<command>

The command specified with ON READERROR executes when one of the above input errors occur.  ON READERROR typically uses DO to execute a procedure that prompts the user for correct data.

Use ON READERROR without <command> to clear the previous ON READERROR.


ON READERROR Example

In this example, a message is displayed if a price is entered that is lower than cost or greater than three times the cost.

CLOSE DATABASES
SET STATUS OFF
SET TALK OFF
USE parts
ON READERROR DO errhand
@ 10,13 SAY 'Part Number: ' GET pno
@ 12,13 SAY 'Cost: ' GET cost
@ 14,13 SAY 'Selling Price: '
@ 14,28 GET price PICTURE '999.99' RANGE cost,(cost + (cost * 3))
READ

PROCEDURE errhand
IF price < cost
WAIT WINDOW "Price can't be lower than cost"
ELSE
WAIT WINDOW "Markup is too high"
ENDIF
RETURN


ON READERROR SeeAlso
See Also

@ ... GET Command

READ Command


ON SELECTION BAR Command

See Also

Specifies a command that executes when you choose a specific popup option.

Syntax

ON SELECTION BAR <expN> OF <popup name>
[<command>]

Remarks

When a specific popup option is chosen, FoxPro executes the command you specify with ON SELECTION BAR.  Typically, ON SELECTION BAR uses DO to execute a procedure or program.  Place ON SELECTION BAR between the DEFINE POPUP and the ACTIVATE POPUP commands when you create and activate the popup.

You can also use ON SELECTION BAR with a FoxPro menu system popup.  Use ON SELECTION POPUP to execute a command when you choose any option in a popup.  Use ON BAR to activate a menu bar or a popup when you chose a specific option in a popup.

Clauses

<expN> OF <popup name> [<command>]

Include the option's bar number <expN>, the popup name <popup name>, and  the command to execute for the specified popup option.

Use ON SELECTION BAR <expN> OF <popup name> without a command to release a command assigned to a popup option.


ON SELECTION BAR SeeAlso
See Also

DEFINE BAR Command

DEFINE POPUP Command

ON BAR Command

ON EXIT BAR Command

ON SELECTION POPUP Command


ON SELECTION MENU Command

See Also	Example

Specifies a command that executes when you choose any pad on a menu bar.

Syntax

ON SELECTION MENU <menu name> | ALL
[<command>]

Remarks

When you choose any pad on a menu bar, FoxPro executes the command you specify with ON SELECTION MENU.  Place ON SELECTION MENU between the DEFINE MENU and the ACTIVATE MENU commands when you create the menu.

Use ON SELECTION PAD to execute a command when a specific menu pad is chosen.  An ON SELECTION PAD takes precedence over an ON SELECTION MENU.  Use ON PAD to activate a menu bar or a popup when a specific menu pad is chosen.

Clauses

<menu name> | ALL

The command executes when you choose a menu pad from the menu bar whose name you specify with <menu name>.  If you include ALL instead of a menu name, the command executes when you choose any menu pad from any menu bar.

<menu name> is the name of a menu  defined with DEFINE MENU or the FoxPro system menu.

<command>

Specify with <command> a command to execute when you choose a menu pad.  Use ON SELECTION MENU without a command to release a command assigned to a menu bar.


ON SELECTION MENU Example

ON SELECTION MENU is used in this program example to execute a procedure when a menu pad is chosen from the FoxPro system menu.

The current system menu bar is saved to memory with SET SYSMENU SAVE and all system menu pads are removed with SET SYSMENU TO.

DEFINE PAD creates several system menu pads.  When you choose a menu pad the CHOICE procedure assigned to the menu bar with ON SELECTION MENU executes.  CHOICE displays the name of the menu pad you choose and the name of the menu bar.  If you choose the Exit menu pad, the original FoxPro system menu is restored.

*** Name this program ONMENU.PRG ***

CLEAR

SET SYSMENU SAVE
SET SYSMENU TO

DEFINE PAD syspad    OF _MSYSMENU PROMPT '\<System'  COLOR SCHEME 3 ;
KEY ALT+S, ''
DEFINE PAD editpad   OF _MSYSMENU PROMPT '\<Edit'    COLOR SCHEME 3 ;
KEY ALT+E, ''
DEFINE PAD recordpad OF _MSYSMENU PROMPT '\<Record'  COLOR SCHEME 3 ;
KEY ALT+R, ''
DEFINE PAD windowpad OF _MSYSMENU PROMPT '\<Window'  COLOR SCHEME 3 ;
KEY ALT+W, ''
DEFINE PAD reportpad OF _MSYSMENU PROMPT 'Re\<ports' COLOR SCHEME 3 KEY ALT+P, ''
DEFINE PAD exitpad   OF _MSYSMENU PROMPT 'E\<xit'    COLOR SCHEME 3 ;
KEY ALT+X, ''

ON SELECTION MENU _MSYSMENU ;
DO choice IN onmenu WITH PAD( ), MENU( )

PROCEDURE choice
PARAMETER mpad, mmenu

WAIT WINDOW 'You chose ' + mpad + ;
' from menu ' + mmenu NOWAIT

IF mpad = 'EXITPAD'
SET SYSMENU TO DEFAULT
ENDIF


ON SELECTION MENU SeeAlso
See Also

ACTIVATE MENU Command

DEFINE MENU Command

ON EXIT MENU Command

ON PAD Command

ON SELECTION PAD Command


ON SELECTION PAD Command

See Also

Specifies a command that executes when you choose a specific menu bar pad.

Syntax

ON SELECTION PAD <pad name> OF <menu name>
[<command>]

Remarks

When the specified menu bar pad is chosen, FoxPro executes the command you specify with ON SELECTION PAD.  Typically, ON SELECTION PAD uses DO to execute a procedure or program when a specific menu pad is chosen from the menu bar.  Place ON SELECTION PAD between the DEFINE MENU and the ACTIVATE MENU commands when you create and activate the menu bar.

Use ON SELECTION MENU to execute a command when you choose any menu pad in a menu bar.  Use ON PAD to activate a menu bar or a popup when you chose a menu pad in a menu bar.

Clauses

<pad name> OF <menu name> [<command>]

Include the pad name and menu bar name to execute the command for the specified menu pad.

Use ON SELECTION PAD without a command to release a command assigned to the menu pad.


ON SELECTION PAD SeeAlso
See Also

ACTIVATE MENU Command

DEFINE MENU Command

DEFINE PAD Command

ON EXIT PAD Command

ON PAD Command

ON SELECTION MENU Command


ON SELECTION POPUP Command

See Also	Example

Specifies a command that executes when you choose any option from a specified popup or from all popups.

Syntax

ON SELECTION POPUP <popup name> | ALL
[<command>]

Remarks

When you choose any option from a popup, FoxPro executes the command you specify with ON SELECTION POPUP.  Place ON SELECTION POPUP between the DEFINE POPUP and the ACTIVATE POPUP commands when you create the popup.

Use ON SELECTION BAR to execute a command when a specific popup option is chosen.  An ON SELECTION BAR takes precedence over an ON SELECTION POPUP.  Use ON BAR to activate a menu bar or a popup when a specific popup option is chosen.

Clauses

<popup name> | ALL

The command is executed when you choose an option from the popup you specify with <popup name>.  If you include ALL instead of a popup name, the command is executed when you choose an option from any popup.

<command>

Specify a command to execute when you choose a popup option.  Use ON SELECTION POPUP without a command to release a command assigned to a popup option with a previous ON SELECTION POPUP.


ON SELECTION POPUP Example

The following program example, named SYSTIME.PRG, places a time and date pad in the system menu in FoxPro for MS-DOS. In FoxPro for Windows, the pads are placed in the Help menu. In FoxPro for Macintosh, they are placed in File menu. The display of clock, date and day of the week can be toggled on and off from within the popup named TIMEPOP.

ON SELECTION POPUP is used in this example to execute the procedure named TOGGLE.  When an option is chosen from the TIMEPOP popup, the TOGGLE routine executes and BAR( ) passes a bar number to the routine.

SET MARK OF and MRKBAR( ) display or clear a mark character for each option as its associated display is toggled on or off.

In FoxPro for Windows, the options are placed on the Help menu.

*** Name the program systime.prg ***

SET TALK OFF
SET CLOCK OFF

IF _WINDOWS
ZOOM WINDOW SCREEN MAX
ENDIF
IF _MAC
DEFINE BAR 1 BEFORE _MFI_SAVE OF _MSM_FILE ;
PROMPT '\<Time & Date' KEY SHIFT+F2, 'F2 '
ELSE
DEFINE BAR 1 BEFORE _MST_FILER OF _MSYSTEM ;
PROMPT '\<Time & Date' KEY SHIFT+F2, 'F2 '

DEFINE POPUP timepop MARGIN	&& Menu popup for System menu pad
DEFINE BAR 1 OF timepop PROMPT '\<Clock '
DEFINE BAR 2 OF timepop PROMPT '\<Date '
DEFINE BAR 3 OF timepop PROMPT 'Da\<y '
DEFINE BAR 4 OF timepop PROMPT '\-'	 	&& Draw a separator
DEFINE BAR 5 OF timepop PROMPT '\<Show All '
DEFINE BAR 6 OF timepop PROMPT 'Clear \<All '
IF _MAC
ON BAR 1 OF _MSM_FILE ACTIVATE POPUP timepop
ELSE
ON BAR 1 OF _MSYSTEM ACTIVATE POPUP timepop
ON SELECTION POPUP timepop DO toggle IN systime WITH BAR( )

PROCEDURE toggle
PARAMETER barnumber
clockcolor = SCHEME(1,7)
DO CASE	&& CASE for each option
CASE barnumber = 1	&& Clock option
*** Set clock on or off, toggle mark character ***
SET MARK OF BAR 1 OF timepop TO NOT MRKBAR('timepop', 1)
IF MRKBAR('timepop', 1) = .T.
SET CLOCK ON
ELSE
SET CLOCK OFF
ENDIF
CASE barnumber = 2	&& Date option
*** Show or clear date, toggle mark character ***
SET MARK OF BAR 2 OF timepop TO NOT MRKBAR('timepop', 2)
IF MRKBAR('timepop', 2) = .T.
@ 1,70 SAY DATE( ) COLOR (clockcolor)
ELSE
@ 1,68 CLEAR TO 1,79
ENDIF
CASE barnumber = 3	&& Day option
*** Show or clear day, toggle mark character ***
SET MARK OF BAR 3 OF timepop TO NOT MRKBAR('timepop', 3)
IF MRKBAR('timepop', 3) = .T.
@ 2,70 SAY CDOW(DATE( )) COLOR (clockcolor)
ELSE
@ 2,70 CLEAR TO 2,79
ENDIF
CASE barnumber = 5	&& Show all option
*** Set all marks to .T., turn on clock, show date and day ***
SET MARK OF BAR 1 OF timepop TO .T.
SET MARK OF BAR 2 OF timepop TO .T.
SET MARK OF BAR 3 OF timepop TO .T.
SET CLOCK ON
@ 1,70 SAY DATE( ) COLOR (clockcolor)
@ 2,70 SAY CDOW(DATE( )) COLOR (clockcolor)
CASE barnumber = 6	&& Clear all option
*** Set all marks to .F., turn off clock, clear date and day ***
SET MARK OF BAR 1 OF timepop TO .F.
SET MARK OF BAR 2 OF timepop TO .F.
SET MARK OF BAR 3 OF timepop TO .F.
SET CLOCK OFF
@ 1,70 CLEAR TO 2,79
ENDCASE
RETURN


ON SELECTION POPUP SeeAlso
See Also

ACTIVATE POPUP Command

DEFINE BAR Command

DEFINE POPUP Command

ON BAR Command

ON EXIT POPUP Command


ON( ) Function

See Also	Example

Returns the command assigned to ON ERROR, ON ESCAPE, ON KEY, ON KEY LABEL, ON MACHELP, ON PAGE or ON READERROR.

Syntax

ON(<expC1>[, <expC2>])

Returns

Character

Remarks

A command can be assigned to each of these event handling commands:

ON APLABOUT

ON ERROR

ON ESCAPE

ON KEY

ON KEY LABEL

ON MACHELP

ON PAGE

ON READERROR

When an event occurs that is trapped by one of the above event-handling commands, the command assigned by the event-handling command executes.  ON( ) returns the command you assigned to an event-handling command.  The null string is returned if a command isn't currently assigned to the event-handling command you specify.

Parameters

<expC1>

The character expression <expC1> specifies one of the above event-handling commands.

Here are the commands and the corresponding character expressions to use with ON( ):

Command	<expC1>
ON APLABOUT	APLABOUT
ON ERROR	ERROR
ON ESCAPE	ESCAPE
ON KEY	KEY
ON KEY LABEL	KEY
ON MACHELP	MACHELP
ON PAGE	PAGE
ON READERROR	READERROR
For example, to return the command currently assigned to ON ERROR, use

? ON('ERROR')

<expC2>

The second character expression <expC2> is included to return the command assigned to a specific key or key combination in ON KEY LABEL.  Specify "KEY" in <expC1> and the key label name of the key or key combination in <expC2>.  For a complete listing of key label names, see ON KEY LABEL.

For example, to return the command currently assigned to the F7 function key with ON KEY LABEL, use

? ON('KEY', 'F7')


ON( ) Example

The following example uses ON( ) to display ON ERROR and ON KEY LABEL settings.

ON ERROR DO errorhand
ON KEY LABEL CTRL+F2 WAIT WINDOW 'You pressed ^F2'
ON KEY LABEL ALT+Z DISPLAY MEMORY

? ON('ERROR')
? ON('KEY', 'CTRL+F2')
? ON('KEY', 'ALT+Z')

ON ERROR
ON KEY LABEL CTRL+F2
ON KEY LABEL ALT+Z


ON() SeeAlso
See Also

INKEY( ) Function

LASTKEY( ) Function

ON ERROR Command

ON ESCAPE Command

ON KEY Command

ON KEY LABEL Command

ON PAGE Command

ON READERROR Command

READKEY( ) Function


ORDER( ) Function

See Also	Example

Returns the name of the controlling index file or tag for the current or specified table.

Syntax

ORDER([<expN1> | <expC>[, <expN2>]])

Returns

Character

Remarks

A table can have several index files open simultaneously.  However, only one single-entry index file (the controlling index file) or tag from a compound index file (the controlling tag) controls the order in which the table is displayed or accessed.  Certain commands, such as SEEK, use the controlling index file or controlling tag to search for records.  This function returns the name of the controlling index file or controlling tag.

USE and SET INDEX both support opening more than one index, with an index file list.  A controlling index file or controlling tag can be designated in this index file list.  SET ORDER can also be used to designate a controlling index or controlling tag.

Parameters

<expN1> | <expC>

ORDER( ) by default returns the controlling index file name or controlling tag name for the current work area.

You can return the controlling index file name or controlling tag name from unselected work areas by specifying the work area number <expN1> or the table or work area alias <expC>.

<expN2>

If a table has a controlling index file or tag, and you include <expN2>, the drive and directory is returned along with the single-entry or compound index file name.  The numeric expression <expN2> can have any value.


ORDER( ) Example

The following examples display index tags and files.

CLOSE DATABASES
SELECT 0
USE customer ORDER ono
? ORDER( )

? ORDER('customer', 1)


ORDER() SeeAlso
See Also

INDEX Command

SET INDEX Command

SET ORDER Command

USE Command


OS( ) Function

See Also	Example

Returns the name and version number of the operating system under which FoxPro is running.

Syntax

OS( )

Returns

Character

Remarks

OS( ) returns the name and version number of the host operating system.

In FoxPro for Windows, you can include 1 in OS( ) (OS(1)) to return the Windows version (for example, Windows 3.10).

In FoxPro for Macintosh, include 1 in OS( ) to return the system software version (for example, System 7.1.0).


OS( ) Example

? OS( )

? OS(1)


OS() SeeAlso
See Also

DISKSPACE( )

GETENV( )

VERSION( )


PACK Command

See Also

PACK permanently removes all records marked for deletion in the current table.  PACK also reduces the size of a memo file associated with a table.

Syntax

PACK
[MEMO]
[DBF]

Remarks

Records can be marked for deletion with DELETE, by choosing the Delete ...  option on the Record menu, or from within a Browse window.  When PACK is issued without the MEMO and DBF clauses, the table and the memo file are both packed.

PACK requires exclusive use of the table.  For more information about opening a table exclusively on a network, see SET EXCLUSIVE .

Caution   Exercise caution when using PACK.  There is no way to retrieve deleted records after the pack is finished.

When PACK is issued, FoxPro copies all records not marked for deletion to a temporary table.  When the PACK is completed, FoxPro deletes the original table from disk and renames the temporary table with the original table name.  PACK can be interrupted by pressing Esc. Pressing Esc stops the PACK, the temporary table is deleted and the original table remains unchanged.  The original table is also recovered if you run out of disk space during a PACK.

If the current table has one or more indexes open, PACK rebuilds the index files.

Clauses

MEMO

Information in memo fields is stored in an associated memo file.  A memo file has the same name as the table and an .FPT extension.

Include the MEMO clause to pack the memo file without packing the table file.  PACK MEMO removes unused space from the memo file, but doesn't remove records marked for deletion from the table.

DBF

If you include the DBF clause but not the MEMO clause, the table is packed without packing the memo file.


PACK see also
See Also

DELETE Command

DELETED( ) Function

RECALL Command

SET EXCLUSIVE Command


PAD( ) Function

See Also	Example

Returns the name of the menu pad that was most recently chosen from a menu bar.

Syntax

PAD( )

Returns

Character

Remarks

PAD( ) returns the pad name as an upper-case character string.

A menu bar must be defined and active for PAD( ) to return a pad name.  Menu bars are defined and activated with DEFINE MENU and ACTIVATE MENU.  You can also use PAD( ) with the FoxPro system menu bar.  PAD( ) returns the null string if a menu isn't active or PAD( ) is issued from the Command window.


PAD( ) Example

PAD( ) is used in this program example to pass the name of a menu pad to a procedure.

The current system menu bar is saved to memory with SET SYSMENU SAVE, and all system menu pads are removed with SET SYSMENU TO.

Several system menu pads are created with DEFINE PAD.  When a menu pad is chosen, PAD( ) is used to pass the name of the menu pad to the procedure named CHOICE.  CHOICE displays the name of the menu pad you choose and the name of the menu bar.  If you choose the Exit menu pad, the original FoxPro system menu is restored.

*** Name this program PADEXAM.PRG ***

CLEAR

SET SYSMENU SAVE
SET SYSMENU TO

DEFINE PAD syspad    OF _MSYSMENU PROMPT '\<System'  COLOR SCHEME 3 ;
KEY ALT+S, ''
DEFINE PAD editpad   OF _MSYSMENU PROMPT '\<Edit'    COLOR SCHEME 3 ;
KEY ALT+E, ''
DEFINE PAD recordpad OF _MSYSMENU PROMPT '\<Record'  COLOR SCHEME 3 ;
KEY ALT+R, ''
DEFINE PAD windowpad OF _MSYSMENU PROMPT '\<Window'  COLOR SCHEME 3 ;
KEY ALT+W, ''
DEFINE PAD reportpad OF _MSYSMENU PROMPT 'Re\<ports' COLOR SCHEME 3 KEY ALT+P, ''
DEFINE PAD exitpad   OF _MSYSMENU PROMPT 'E\<xit'    COLOR SCHEME 3 ;
KEY ALT+X, ''

ON SELECTION MENU _MSYSMENU ;
DO choice IN padexam WITH PAD( ), MENU( )

PROCEDURE choice
PARAMETERS mpad, mmenu

WAIT WINDOW 'You chose ' + mpad + ;
' from menu ' + mmenu NOWAIT

IF mpad = 'EXITPAD'
SET SYSMENU TO DEFAULT
ENDIF


PAD() SeeAlso
See Also

ACTIVATE MENU Command

BAR( ) Function

DEFINE PAD Command

DEFINE MENU Command

MENU( ) Function

ON PAD Command

ON SELECTION PAD Command

PROMPT( ) Function


PADC( ) | PADL( ) | PADR( ) Functions

See Also	Example

Returns the specified expression padded on the left, right, or both left and right sides.

Syntax

PADL(<expr>, <expN>[, <expC>])
or
PADR(<expr>, <expN>[, <expC>])
or
PADC(<expr>, <expN>[, <expC>])

Returns

Character

Remarks

These functions return a character string from a character expression, padded to a specified length.

PADL( ) inserts padding on the left, PADR( ) inserts padding on the right and PADC( ) inserts padding on both sides.

Parameters

<expr>

Include the expression <expr> to be padded.  This expression can be a character, numeric or date expression.

<expN>

<expN> specifies the total number of characters in the expression after it is padded.

<expC>

The value of <expC> is used for padding.  If <expC> is omitted, spaces (ASC(32)) are used for padding.  If <expC> is included, the value of <expC> is repeated as necessary to pad the expression <expr> to a length of <expN> characters.


PADC( ), PADL( ), PADR( ) Example

STORE 'TITLE' TO string
? PADL(string, 40, '=')

? PADR(string, 40, '=')

? PADC(string, 40, '=')


PADC(), PADL(), PADR() SeeAlso
See Also

ALLTRIM( ) Function

LEFT( ) Function

LTRIM( ) Function

RIGHT( ) Function

STUFF( ) Function

TRIM( ) Function


PARAMETERS Command

See Also	Example

Assigns data passed from a calling program to local memory variables or arrays.

Syntax

PARAMETERS <parameter list>

Remarks

PARAMETERS using DO ...  WITH must be the first executable statement in the called program, procedure, or user-defined function (UDF).

By default, DO ...  WITH passes variables and arrays to programs by reference.  When a value is changed in the called program, the new value is passed back to the associated variable in the calling program.  If you want to pass a variable or array by value, enclose the variable or array in parentheses in the DO ...  WITH parameter list.  Any changes made to the parameter in the called program will not be passed back to the calling program.

Variables and arrays are by default passed by value to a UDF.  Use SET UDFPARMS REFERENCE to pass variables and arrays to a UDF by reference.

Clause

<parameter list>

The parameter names listed in <parameter list> are memory variable or array names.

Parameters within <parameter list> are separated by commas.  There must be at least as many parameters in the PARAMETERS statement as in the DO ...  WITH statement.  If more variables or arrays are listed in the PARAMETERS statement than are passed by DO ...  WITH, the remaining variables or arrays are initialized to false (.F.).  A maximum of 24 parameters can be passed.

PARAMETERS( ) returns the number of parameters that were passed to the most recently executed routine.


PARAMETERS Example

The following example passes parameters to an error-handling routine.

ON ERROR DO errhand WITH ERROR( ), MESSAGE( ), ;
MESSAGE(1),PROGRAM( ),LINENO( )

USE nodatabase
ON ERROR	&& restores system error handling routine

PROCEDURE errhand
PARAMETERS merror, mess, mess1, mprog, mlineno
? 'Error number: ' + LTRIM(STR(merror))
? 'Error message: ' + mess
? 'Line of code with error: ' + mess1
? 'Line number of error: '+ LTRIM(STR(mlineno))
? 'Program with error: ' + mprog


PARAMETERS SeeAlso
See Also

DO Command

PARAMETERS( ) Function

SET UDFPARMS Command


PARAMETERS( ) Function

See Also	Example

Returns the number of parameters that were passed to the most recently called program, procedure, or user-defined function (UDF).

Syntax

PARAMETERS( )

Returns

Numeric

Remarks

PARAMETERS( ) is useful in situations where a variable number of parameters are passed to a procedure or UDF.

Note   The value returned by PARAMETERS( ) is reset every time a procedure or function is called or ON KEY LABEL is executed.


PARAMETERS( ) Example
PARAMETERS( ) Examples

The following example calls a procedure and displays in a wait window the number of parameters passed.

DO testpar WITH 1,2,3
PROCEDURE testpar
PARAMETERS s1,s2,s3
msg = 'PARAMETERS( ) ='+ALLTRIM(STR(PARAMETERS( )))
WAIT WINDOW (msg)
RETURN

The following example uses a procedure to display the average of 4 values.  Executing this program returns:

Average value is  18.75

SET TALK OFF
val1 = 10
val2 = 20
val3 = 30
val4 = 15
m_min = getavg(val1, val2, val3, val4)
? 'Average value is '
?? m_min

* This UDF permits up to 9 parameters to be passed.
* It uses the PARAMETERS( ) function to determine how many
* were passed and returns the average value.

FUNCTION getavg
PARAMETERS para1,para2,para3,para4,para5,para6,para7,para8,para9
IF PARAMETERS( ) = 0
   RETURN 0
ENDIF
mresult = 0
FOR mcount = 1 to PARAMETERS( )
mcompare = 'para' +(STR(mcount,1))
mresult = mresult + EVAL(mcompare)
ENDFOR
mresult = mresult / (mcount - 1)
RETURN mresult


PARAMETERS() SeeAlso
See Also

DO Command

FUNCTION Command

PARAMETERS Command

PROCEDURE Command

SET UDFPARMS Command

User-Defined Functions (UDFs)


PAYMENT( ) Function

See Also	Example

Returns the amount of each periodic payment on a fixed-interest loan.

Syntax

PAYMENT(<expN1>, <expN2>, <expN3>)

Returns

Numeric

Remarks

PAYMENT( ) assumes a constant periodic interest rate and that payments are made at the end of each period.

Parameters

<expN1>

<expN1> is the beginning principal of the loan.

<expN2>

The fixed interest rate per period is <expN2>.  If monthly payments are made on the loan but the interest rate is annual, divide the annual interest rate by 12.

<expN3>

The total number of payments to be made on the loan is <expN3>.


PAYMENT( ) Example

STORE 100000 to principal	&& $100,000 beginning principal
STORE .105/12 TO interest	&& 10.5% annual interest rate
STORE (20*12) TO payments	&& 20 years of monthly payments
? PAYMENT(principal, interest, payments)

Executing this program returns:

998.38


PAYMENT() SeeAlso
See Also

CALCULATE Command

FV( ) Function

PV( ) Function


PCOL( ) Function

See Also	 Example

Returns the current column position of the printer's print head.

Syntax

PCOL( )

Returns

Numeric

Remarks

The value returned by PCOL( ) is relative to the current setting of the left printer margin.  The left margin may be set with SET MARGIN or by storing a value to the system memory variable _PLOFFSET.

PCOL( ) is especially useful for relative addressing of printed text.

You can use the $ operator in place of PCOL( ).


PCOL( ) Example

@ PROW( ), PCOL( )+12 SAY 'Contact person'
@ PROW( ), $+12 SAY 'Contact person'


PCOL() SeeAlso
See Also

COL( ) Function

ROW( ) Function

PROW( ) Function


PI( ) Function

See Also	Example

Returns the numeric constant pi.

Syntax

PI( )

Returns

Numeric

Remarks

This mathematical function returns the numeric constant pi (3.141592), the ratio of the circumference of a circle to its diameter.

The number of decimal places displayed in the value returned by PI( ) is determined by SET DECIMALS.


PI( ) Example

? PI( )

STORE 2.30 TO radius
STORE PI( ) * radius^2 TO area
? area


PI() SeeAlso
See Also

SET DECIMALS Command


PLAY MACRO Command

See Also

Executes a keyboard macro.

Syntax

PLAY MACRO <macro name>
[TIME <expN>]

Remarks

With FoxPro you can save a series of keystrokes as a keyboard macro by pressing Shift-F10.  PLAY MACRO plays this series of keystrokes.  Playing keyboard macros within programs lets you create self-running demonstration programs.

Once a keyboard macro has been stored in memory with RESTORE MACRO, or by creating the macro with Shift-F10, it can also be played back by pressing the key or keys you specified when you created the macro.  For more information on creating macros, see the FoxPro User's Guide.

If PLAY MACRO is issued from the Command window, it executes immediately.  If PLAY MACRO is issued in a program, execution is delayed until the program executes a command that allows keyboard input.  Examples of commands that wait for input are @ ...  GET, BROWSE, and EDIT.

If a series of PLAY MACROs are pending, FoxPro doesn't execute them in the order in which they are issued.  Macros are played within a program in reverse order [image] the first PLAY MACRO executes last, the last PLAY MACRO executes first.  The PLAY MACROs execute from bottom to top order as they appear within the program.

Clauses

<macro name>

The name of the keyboard macro to play is specified with <macro name>.

TIME <expN>

The TIME clause specifies the time interval between the delivery of each keystroke in a keyboard macro.  Specify a time delay between 0 and 10 seconds in <expN>.  <expN> can evaluate to a number with a decimal fraction.  For example, if you specify <expN> equal to 1, keystrokes from the macro will be played with a one-second delay between each keystroke.


PLAY MACRO SeeAlso
See Also

CLEAR MACROS Command

ON KEY LABEL Command

RESTORE MACROS Command

SAVE MACROS Command


POP KEY Command

See Also

Restores ON KEY LABEL assignments that were placed on the stack with PUSH KEY.

Syntax

POP KEY
[ALL]

Remarks

POP KEY, when used with PUSH KEY, lets you save a set of key assignments defined with ON KEY LABEL commands, make changes to the key assignments with more ON KEY LABEL commands, and then restore the original key assignments.

For more information on placing ON KEY LABEL commands on the stack, see PUSH KEY.

Clause

ALL

Including the ALL clause with POP KEY clears all current key assignments defined with ON KEY LABELs, and clears all key assignments defined with ON KEY LABEL commands from the stack.


POP KEY SeeAlso
See Also

ON KEY LABEL Command

ON( ) Function

PUSH KEY Command


POP MENU Command

See Also	Example

Restores the specified menu bar definition that was placed on the stack with PUSH MENU.

Syntax

POP MENU <menu name>
[TO MASTER]

Remarks

POP MENU, when used with PUSH MENU, lets you save a menu definition, make changes to the menu definition and then restore the menu definition to its original state.

Menus are placed on and removed from the stack in last in, first out order.

Clauses

<menu name>

<menu name> specifies the name of the menu whose definition is pulled off the stack. The specified menu can be a user-defined menu or the FoxPro system menu.

TO MASTER

Including the TO MASTER clause restores the first menu definition pushed onto the menu stack, and then clears the stack.


POP MENU Example

Type the following commands in the command window.  In this example, the system menu bar definition is pushed to the stack and then modified.  The original system menu definition is then restored by popping it off the stack.

PUSH MENU _MSYSMENU
SET SYSMENU TO _MFILE, _MEDIT
POP MENU _MSYSMENU


POP MENU SeeAlso
See Also

ACTIVATE MENU Command

DEFINE MENU Command

POP POPUP Command

PUSH MENU Command

PUSH POPUP Command


POP POPUP Command

See Also	Example

Restores the specified popup definition that was placed on the stack with PUSH POPUP.

Syntax

POP POPUP <popup name>

Remarks

POP POPUP, when used with PUSH POPUP, lets you save a popup definition, make changes to the popup definition, and then restore the popup definition to its original state.

Popup definitions are placed on and removed from the stack in a last in, first out order.

Clause

<popup name>

<popup name> specifies the name of the popup whose definition is pulled off the stack. The specified popup can be a popup defined with DEFINE POPUP or a FoxPro system popup.


POP POPUP Example

In the following example, a popup named POPEXAM is created.  The popup definition is pushed to the stack and then one of the popup options is modified.  The original popup definition is then restored by popping it off the stack.

DEFINE POPUP popexam FROM 5,5

DEFINE BAR 1 OF popexam PROMPT 'One'
DEFINE BAR 2 OF popexam PROMPT 'Two'
DEFINE BAR 3 OF popexam PROMPT 'Three'
DEFINE BAR 4 OF popexam PROMPT 'Four'

ACTIVATE POPUP popexam NOWAIT
PUSH POPUP popexam
WAIT 'Popup pushed' WINDOW

RELEASE BAR 2 OF popexam
WAIT 'This is the modified Popup' WINDOW

POP POPUP popexam
WAIT 'Popup popped, original popup restored' WINDOW

DEACTIVATE POPUP popexam
RELEASE POPUP popexam


POP POPUP SeeAlso
See Also

ACTIVATE POPUP Command

DEFINE POPUP Command

POP MENU Command

PUSH MENU Command

PUSH POPUP Command


POPUP( ) Function

See Also	Example

Returns as a character string the name of the active popup.

Syntax

POPUP( )

Returns

Character

Remarks

A popup must be defined and active for POPUP( ) to return its name.  Popups are defined and activated with DEFINE POPUP and ACTIVATE POPUP.  The popup can also be a FoxPro system popup.  If a popup isn't active or POPUP( ) is issued from the Command window, POPUP( ) returns the null string.


POPUP( ) Example

POPUP( ) is used in this program example to pass the name of the popup you choose to a procedure.

The current system menu bar is first saved to memory with SET SYSMENU SAVE and then all system menu pads are removed with SET SYSMENU TO.

Two new system menu pads are created with DEFINE PAD, and DEFINE POPUP is used to create a popup for each menu pad.  DEFINE BAR is used to create options in each of the popups.  When a menu pad is chosen, ON PAD uses ACTIVATE POPUP to activate the corresponding popup.

When an option is chosen from a popup, ON SELECTION POPUP uses PROMPT( ) and POPUP( ) to pass the option number and popup name to the procedure named CHOICE.  CHOICE displays the prompt of the option you choose and the name of the popup containing the option.  If you choose the Exit option in the popup named CARDINFO, the original FoxPro system menu is restored.

*** Name this program POPEXAMP.PRG ***

CLEAR

SET SYSMENU SAVE
SET SYSMENU TO

DEFINE PAD convpad OF _MSYSMENU PROMPT '\<Conversions' COLOR SCHEME 3 ;
KEY ALT+C, ''
DEFINE PAD cardpad OF _MSYSMENU PROMPT 'Card \<Info' COLOR SCHEME 3 ;
KEY ALT+I, ''

ON PAD convpad OF _MSYSMENU ACTIVATE POPUP conversion
ON PAD cardpad OF _MSYSMENU ACTIVATE POPUP cardinfo

DEFINE POPUP conversion MARGIN RELATIVE SHADOW COLOR SCHEME 4
DEFINE BAR 1 OF conversion PROMPT 'Ar\<ea' KEY CTRL+E, '^E'
DEFINE BAR 2 OF conversion PROMPT '\<Length' ;
KEY CTRL+L, '^L'
DEFINE BAR 3 OF conversion PROMPT 'Ma\<ss' ;
KEY CTRL+S, '^S'
DEFINE BAR 4 OF conversion PROMPT 'Spee\<d' ;
KEY CTRL+D, '^D'
DEFINE BAR 5 OF conversion PROMPT '\<Temperature' ;
KEY CTRL+T, '^T'
DEFINE BAR 6 OF conversion PROMPT 'T\<ime' ;
KEY CTRL+I, '^I'
DEFINE BAR 7 OF conversion PROMPT 'Volu\<me' ;
KEY CTRL+M, '^M'

ON SELECTION POPUP conversion;
DO choice IN popexamp WITH PROMPT( ), POPUP( )

DEFINE POPUP cardinfo MARGIN RELATIVE SHADOW COLOR SCHEME 4
DEFINE BAR 1 OF cardinfo PROMPT '\<View Charges' ;
KEY ALT+V, ''
DEFINE BAR 2 OF cardinfo PROMPT 'View \<Payments' ;
KEY ALT+P, ''
DEFINE BAR 3 OF cardinfo PROMPT 'Vie\<w Users' ;
KEY ALT+W, ''
DEFINE BAR 4 OF cardinfo PROMPT '\-'
DEFINE BAR 5 OF cardinfo PROMPT '\<Charges '
DEFINE BAR 6 OF cardinfo PROMPT '\-'
DEFINE BAR 7 OF cardinfo PROMPT 'E\<xit '

ON SELECTION POPUP cardinfo;
DO choice IN popexamp WITH PROMPT( ), POPUP( )

PROCEDURE choice
PARAMETERS mprompt, mpopup

WAIT WINDOW 'You chose ' + mprompt + ;
' from popup ' + mpopup NOWAIT

IF mprompt = 'Exit'
SET SYSMENU TO DEFAULT
ENDIF


POPUP() SeeAlso
See Also

ACTIVATE POPUP Command

BAR( ) Function

DEFINE BAR Command

DEFINE POPUP Command

ON SELECTION POPUP Command


PRINTJOB ... ENDPRINTJOB Command

See Also

Activates print job system memory variable settings.

Syntax

PRINTJOB
<statements>
ENDPRINTJOB

Remarks

PRINTJOB initializes the printer and certain system memory variables that affect printed output.  PRINTJOB can send control codes to the printer, eject a page from the printer before and/or after a print job,  initialize the printer column number and control the number of copies printed.

Issuing PRINTJOB performs these tasks:

Sends starting printer control codes that are stored in the system memory variable _PSCODE to the printer.  For more information on printer control codes, see the System Memory Variables topics and check your printer manual.

Ejects a page if the system memory variable _PEJECT is set to BEFORE or to BOTH.

Sets the system memory variable _PCOLNO to 0.  _PCOLNO stores the printer column number.

Issuing ENDPRINTJOB performs these tasks:

Sends ending printer control codes to the printer.  You can reset the printer to the configuration it had before PRINTJOB was issued.  The ending printer control codes are stored in the system memory variable _PECODE.

Ejects a page if the system memory variable _PEJECT is set to AFTER or to BOTH.

Loops back to PRINTJOB to print another copy of the report, if the _PCOPIES system memory variable is set to a value higher than 1 (the default).  The number of copies is determined by the value of the system memory variable _PCOPIES.  When the number of copies printed equals the value of _PCOPIES, FoxPro exits the loop.  Program control then begins with the command immediately following ENDPRINTJOB.

PRINTJOB and ENDPRINTJOB may be executed only from within a program.  You may not nest PRINTJOBs.


PRINTJOB ... ENDPRINTJOB SeeAlso
See Also

ON PAGE Command

System Memory Variables


PRINTSTATUS( ) Function

See Also	Example

Returns true (.T.) if the printer or print device is on line, or false (.F.) if it isn't.

Syntax

PRINTSTATUS( )

Returns

Logical

Remarks

PRINTSTATUS( ) is similar to SYS(13), except  SYS(13) returns READY or OFFLINE instead of true or false.

In FoxPro for Windows and FoxPro for Macintosh, PRINTSTATUS( ) always returns .T. if the printer is connected through the Control Panel or Chooser.


PRINTSTATUS( ) Example

? PRINTSTATUS( )

*** Program Example ***

STORE PRINTSTATUS( ) TO ready
IF NOT ready
WAIT 'Make sure printer is attached and turned on!' WINDOW
ELSE
WAIT 'Printer is ready!' WINDOW
ENDIF


PRINTSTATUS() SeeAlso
See Also

SET DEVICE Command

SET PRINTER Commands

SYS(13) Function - Printer Status


PRIVATE Command

See Also	Example

Hides specified memory variables or arrays that were defined in a calling program from the current program.

Syntax

PRIVATE <memvar list>
or
PRIVATE ALL
[LIKE <skel> | EXCEPT <skel>]

Remarks

The hiding of variables created in higher-level programs enables variables of the same name as the private variables to be manipulated in the current program without affecting the values of the hidden variables.  Once the program containing PRIVATE has completed execution, all memory variables and arrays that were declared private are again available.

PRIVATE doesn't create variables; it simply hides variables declared in higher-level programs from the current program.

Clauses

<memvar list>

<memvar list> specifies the memory variables or arrays to be declared private.

ALL LIKE <skel>

The ALL LIKE clause causes PRIVATE to hide all memory variables and arrays whose names match the skeleton <skel>.  The skeleton can contain the wildcard characters ? and *.

ALL EXCEPT <skel>

The ALL EXCEPT clause causes PRIVATE to hide all memory variables or arrays unless their names match the skeleton <skel>.  The skeleton can contain the wildcard characters ? and *.


PRIVATE Example

*** Program example demonstrating PRIVATE ***
SET TALK OFF
val1 = 10
val2 = 15
DO down
? val1, val2

PROCEDURE down
PRIVATE val1
val1 = 50
val2 = 100
? '       Val1       Val2'
? val1, val2
RETURN


PRIVATE SeeAlso
See Also

DIMENSION Command

PUBLIC Command


PRMBAR( ) Function

See Also	Example

Returns the prompt text from a bar on a popup.

Syntax

PRMBAR(<expC>, <expN>)

Returns

Character

Remarks

Popups are created with DEFINE POPUP and DEFINE BARs.  DEFINE POPUP creates the popup, while DEFINE BARs create the popup bars. PRMBAR( ) also works with a FoxPro system popup.  PRMBAR( ) returns the text that appears on the bar.

A popup doesn't have to be active for PRMBAR( ) to return a bar's prompt text.

If a popup bar was created with the hot key (\<) or disabled option (\) special characters aren't included, only the prompt is returned.  The special characters aren't included.  PRMBAR( ) returns the null string when a popup bar is a separator created with the \- special characters.  The null string is also returned if a bar is created without a prompt.

Parameters

<expC>

Specify the popup name with <expC>.

<expN>

Include the bar number <expN>.  The prompt text of the bar with that number is returned.  For example, if <expN> is 1 the first bar's prompt text is returned, if <expN> is 2 the second bar's prompt text is returned and so on.  <expN> must be at least 1 and no greater than the number of bars in the popup.


PRMBAR() SeeAlso
See Also

CNTBAR( ) Function

GETBAR( ) Function

DEFINE BAR Command

DEFINE POPUP Command

MRKBAR( ) Function

PRMPAD( ) Function


PRMPAD( ) Function

See Also	Example

Returns the text from a menu pad.

Syntax

PRMPAD(<expC1>, <expC2>)

Returns

Character

Remarks

Menu pads are created with DEFINE MENU and DEFINE PAD.  DEFINE MENU creates the menu bar, and DEFINE PAD creates the menu pads.  PRMPAD( ) also works with the FoxPro menu system.  PRMPAD( ) returns the text that appears on the pad.

A menu bar doesn't have to be active for PRMPAD( ) to return a pad's prompt.

If a menu pad is created with the hot key (\<) or disabled (\) special characters, only the prompt is returned.  The special characters aren't included.  The null string is returned if a pad is created without a prompt.

Parameters

<expC1>

Specify the menu bar name with <expC1>.

<expC2>

Specify the menu pad name in <expC2>.


PRMPAD( ) Example

In the following example a menu bar named PRMEXAMPLE is created with three menu pads.  The hot key and disabled option designators aren't returned from the pads named TWO and THREE.  The menu is activated to show the pads and is cleared from the screen and from memory when a pad is chosen.

CLEAR
SET TALK OFF
STORE 'prmexample' TO mpopname

DEFINE MENU prmexample BAR AT LINE 1
DEFINE PAD one OF prmexample PROMPT 'This will be returned'
DEFINE PAD two OF prmexample PROMPT '\<As will this'
DEFINE PAD three OF prmexample PROMPT '\And this too'

@  8,1 SAY PRMPAD('prmexample', 'one')
@  9,1 SAY PRMPAD('prmexample', 'two')
@ 10,1 SAY PRMPAD(mpopname, 'three')

ACTIVATE MENU prmexample
DEACTIVATE MENU prmexample
RELEASE MENU prmexample


PRMPAD() SeeAlso
See Also

CNTBAR( ) Function

GETBAR( ) Function

DEFINE BAR Command

DEFINE POPUP Command

MRKPAD( ) Function

PRMBAR( ) Function


PROCEDURE Command

See Also	Example

Identifies the beginning of a procedure in a program file.

Syntax

PROCEDURE <procedure name>

Remarks

In many programs, certain routines are frequently repeated.  Define these commonly-used routines as separate procedures to reduce program size and complexity and to ease program maintenance.

PROCEDURE <procedure name> is a statement within a program file.  It specifies the beginning of each procedure in a program file and defines the procedure name.  Procedure names must begin with a letter or underscore and may contain any combination of letters, numbers and underscores.

In FoxPro for MS-DOS and FoxPro for Windows, procedure names can be up to 10 characters long. In FoxPro for Macintosh, procedure names can be up to 31 characters long. To distinguish a program filename with more than 10 characters from a procedure beginning with the same 10 characters in FoxPro for Macintosh, surround the program filename with quotation marks or include an extension after the program filename.

In all FoxPro versions, procedure names are significant to a limit of 10 characters. FoxPro cannot distinguish between two procedures when the first 10 characters of their names match. This limit does not apply to program names.

The PROCEDURE <procedure name> command line is followed by a series of commands that make up the procedure.  You may optionally include RETURN as the last line of a procedure, although an implicit RETURN is automatically executed following the last statement of a procedure.

When you execute a procedure with DO <procedure name>, FoxPro searches for the procedure in a specific order.

First, the file containing DO <procedure name> is searched.

Second, the file opened with SET PROCEDURE (if one is set) is searched.

Third, FoxPro looks through the programs in the execution chain.  Program files are searched beginning with the most recently executed program and continuing back to the first executed program.

Fourth, FoxPro searches for a stand-alone program file.  If a program file with the same name as the file name specified with DO is found, the program is executed.  If a matching program file name isn't found, an error message "File doesn't exist" is returned.


PROCEDURE Example

SET CENTURY ON
? longdate({08/19/92})

PROCEDURE longdate
PARAMETER mdate
RETURN CDOW(mdate) + ', ' + MDY(mdate)


PROCEDURE SeeAlso
See Also

FUNCTION Command

PARAMETERS Command

PARAMETERS( ) Function

RETURN Command

SET LIBRARY Command

SET PROCEDURE Command

SET UDFPARMS Command

User-Defined Functions (UDFs)


PROGRAM( ) Function

See Also	Example

Returns the name of the program currently being executed, or the name of the program that was executing when an error occurred.

Syntax

PROGRAM([<expN>])

Returns

Character

Remarks

PROGRAM( ) is useful when recovering from errors.  It is similar to SYS(16).

Parameter

<expN>

<expN> specifies how many program levels back the program name is to be fetched.  This parameter can range from 0 to the program nesting depth.  A program can execute another program which can execute another program and so on. Programs may be nested to 32 levels.

Specifying 0 or 1 with <expN> returns the name of the master program (the highest level program).  If <expN> is omitted, the name of the currently executing program is returned.  If <expN> exceeds the program nesting depth, the null string is returned.


PROGRAM( ) Example

ON ERROR DO errhand WITH PROGRAM( )

*** The next line should generate an error

USE nodatabase
ON ERROR	&&returns to system default error handling routine
PROCEDURE errhand
PARAMETERS mprogram

WAIT 'An error occurred in the program ' + mprogram WINDOW


PROGRAM() SeeAlso
See Also

DO Command

LINENO( ) Function

MESSAGE( ) Function

SYS(16) Function - Executing Program File Name


PROMPT( ) Function

See Also	Example

Returns the prompt text of a pad chosen from a menu bar or an option chosen from a popup.

Syntax

PROMPT( )

Returns

Character

Remarks

PROMPT( ) returns the prompt text of the pad last chosen from a menu bar or the option last chosen from a popup.  If a menu bar or popup isn't active or Esc is pressed to exit a menu bar or popup, PROMPT( ) returns the null string.

A menu bar is created with DEFINE MENU, and each menu pad in the menu bar is created with DEFINE PAD.

A popup is created with DEFINE POPUP, and the options (bars) in the popup are created with the PROMPT clause of DEFINE POPUP or DEFINE BAR.

The menu bar or popup can also be the menu bar or a popup in the FoxPro menu system. MENU( ) and POPUP( ) may be used to return the name of the menu bar or popup from which the pad or option is chosen.


PROMPT( ) Example

PROMPT( ) is used in this program example to pass the prompt of the popup option you choose to a procedure.

The current system menu bar is first saved to memory with SET SYSMENU SAVE and then all system menu pads are removed with SET SYSMENU TO.

Two new system menu pads are created with DEFINE PAD, and DEFINE POPUP is used to create a popup for each menu pad.  DEFINE BAR is used to create options in each of the popups.  When a menu pad is chosen, ON PAD uses ACTIVATE POPUP to activate the corresponding popup.

When an option is chosen from a popup, ON SELECTION POPUP uses PROMPT( ) and POPUP( ) to pass the option number and popup name to the procedure named CHOICE.  CHOICE displays the prompt of the option you choose and the name of the popup containing the option.  If you choose the Exit option in the popup named CARDINFO, the original FoxPro system menu is restored.

*** Name this program PROMPTEX.PRG ***

CLEAR

SET SYSMENU SAVE
SET SYSMENU TO

DEFINE PAD convpad OF _MSYSMENU PROMPT '\<Conversions' COLOR SCHEME 3 ;
KEY ALT+C, ''
DEFINE PAD cardpad OF _MSYSMENU PROMPT 'Card \<Info' COLOR SCHEME 3 ;
KEY ALT+I, ''

ON PAD convpad OF _MSYSMENU ACTIVATE POPUP conversion
ON PAD cardpad OF _MSYSMENU ACTIVATE POPUP cardinfo

DEFINE POPUP conversion MARGIN RELATIVE SHADOW COLOR SCHEME 4
DEFINE BAR 1 OF conversion PROMPT 'Ar\<ea' KEY CTRL+E, '^E'
DEFINE BAR 2 OF conversion PROMPT '\<Length' ;
KEY CTRL+L, '^L'
DEFINE BAR 3 OF conversion PROMPT 'Ma\<ss' ;
KEY CTRL+S, '^S'
DEFINE BAR 4 OF conversion PROMPT 'Spee\<d' ;
KEY CTRL+D, '^D'
DEFINE BAR 5 OF conversion PROMPT '\<Temperature' ;
KEY CTRL+T, '^T'
DEFINE BAR 6 OF conversion PROMPT 'T\<ime' ;
KEY CTRL+I, '^I'
DEFINE BAR 7 OF conversion PROMPT 'Volu\<me' ;
KEY CTRL+M, '^M'

ON SELECTION POPUP conversion;
DO choice IN promptex WITH PROMPT( ), POPUP( )

DEFINE POPUP cardinfo MARGIN RELATIVE SHADOW COLOR SCHEME 4
DEFINE BAR 1 OF cardinfo PROMPT '\<View Charges' ;
KEY ALT+V, ''
DEFINE BAR 2 OF cardinfo PROMPT 'View \<Payments' ;
KEY ALT+P, ''
DEFINE BAR 3 OF cardinfo PROMPT 'Vie\<w Users' ;
KEY ALT+W, ''
DEFINE BAR 4 OF cardinfo PROMPT '\-'
DEFINE BAR 5 OF cardinfo PROMPT '\<Charges '
DEFINE BAR 6 OF cardinfo PROMPT '\-'
DEFINE BAR 7 OF cardinfo PROMPT 'E\<xit '

ON SELECTION POPUP cardinfo;
DO choice IN promptex WITH PROMPT( ), POPUP( )

PROCEDURE choice
PARAMETERS mprompt, mpopup

WAIT WINDOW 'You chose ' + mprompt + ;
' from popup ' + mpopup NOWAIT

IF mprompt = 'Exit'
SET SYSMENU TO DEFAULT
ENDIF


PROMPT() SeeAlso
See Also

BAR( ) Function

DEFINE BAR Command

DEFINE MENU Command

DEFINE PAD Command

DEFINE POPUP Command

POPUP( ) Function

PRMBAR( ) Function


PROPER( ) Function

See Also	Example

Returns the specified character expression with each word having the initial letter capitalized and the remaining characters lowercase.

Syntax

PROPER(<expC>)

Returns

Character

Remarks

PROPER( ) returns from a character expression a character string capitalized as appropriate for proper names.

Parameter

<expC>

A properly capitalized character string is returned from the character expression <expC> you specify.


PROPER( ) Example
PROPER( ) Examples

STORE 'foxpro' TO expr1
? PROPER(expr1)

STORE 'FOXPRO' TO expr2
? PROPER(expr2)

To make sure that the names of all contacts in CUSTOMER.DBF have proper capitalization:

CLOSE DATABASES
USE customer
REPLACE ALL contact WITH PROPER(contact)


PROPER() SeeAlso
See Also

LOWER( ) Function

UPPER( ) Function


PROW( ) Function

See Also	Example

Returns the current row position of the printer's printhead.

Syntax

PROW( )

Returns

Numeric

Remarks

Issuing EJECT resets PROW( ) to 0.

PROW( ) is especially useful for relative addressing of printed text.


PROW( ) Example

@ PROW( ), PCOL( ) + 12 SAY 'Contact person'
@ PROW( ), $+12 SAY 'Contact person'

The two commands above return the same result.  You can use the $ operator in place of PCOL( ).  Both $ and PCOL( ) return the current column position of the printer.


PROW() SeeAlso
See Also

@ ... SAY Command

COL( ) Function

PCOL( ) Function

ROW( ) Function


PRTINFO( ) Function

See Also

Returns the current FoxPro for Windows printer settings.

Syntax

PRTINFO(<expN>)

Returns

Numeric

Remarks

PRTINFO( ) is supported in FoxPro for Windows only.

Use PRTINFO( ) to return current FoxPro for Windows printer settings. FoxPro for Windows printer settings are set in the FoxPro Print Setup dialog. Choose the Print Setup... option from the File menu or issue SYS(1037) to display the FoxPro Print Setup dialog.

Parameters

<expN>

The numeric expression <expN> specifies which FoxPro for Windows printer setting is returned.

The following table lists the values for <expN> and the corresponding printer setting return values. If PRTINFO(2) returns 256, use PRTINFO(3) and PRTINFO(4) to return the paper size.

<expN>	Return Values
1 (Page Orientation)	-1   Information not available    0   Portrait    1   Landscape
2 (Paper Size)	1   Letter           8 1/2 x 11 in   2   Letter Small  8 1/2 x 11 in   3   Tabloid             11 x 17 in   4   Ledger             17 x 11 in   5   Legal           8 1/2 x 14 in   6   Statement    5 1/2 x 8 1/2 in   7   Executive     7 1/4 x 10 1/2 in   8   A3            297 x 420 mm   9   A4            210 x 297 mm   10  A4 Small  210 x 297 mm   11  A5           148 x 210 mm   12  B4           250 x 354 mm   13  B5           182 x 257 mm   14  Folio      8 1/2 x 13 in   15  Quarto     215 x 275 mm   16  10 x 14 in   17  11 x 17 in   18  Note  8 1/2 x 11 in   19  Envelope #9    3 7/8 x 8 7/8 in   20  Envelope #10  4 1/8 x 9 1/2 in   21  Envelope #11  4 1/2 x 10 3/8 in   22  Envelope #12  4 1/2 x 11 in   23  Envelope #14  5 x 11 1/2 in   24  C size sheet   25  D size sheet   26  E size sheet   27  Envelope DL    110 x 220 mm   28  Envelope C5    162 x 229 mm   29  Envelope C3    324 x 458 mm   30  Envelope C4    229 x 324 mm   31  Envelope C6    114 x 162 mm   32  Envelope C65  114 x 229 mm   33  Envelope B4    250 x 353 mm   34  Envelope B5    176 x 250 mm   35  Envelope B6    176 x 125 mm   36  Envelope         110 x 230 mm   37  Envelope Monarch  3 7/8 x 7.5 in   38  6 3/4 Envelope       3 5/8 x 6 1/2 in   39  US Std Fanfold     14 7/8 x 11 in   40  German Std Fanfold     8 1/2 x 12 in   41  German Legal Fanfold  8 1/2 x 13 in    256  Information not available  use <expN> = 3 and <expN> = 4          to determine the paper size.
3 (Paper Length)	Paper Length (in tenths of millimeters)
4 (Paper Width)	Paper Width  (in tenths of millimeters)


See Also

PRINTSTATUS( ) Function

SET DEVICE Command

SET PRINTER Commands

SYS(13) Function - Printer Status

SYS(1037) Function - Print Setup Dialog


PUBLIC Command

See Also	Example

Defines global memory variables or arrays.

Syntax

PUBLIC <memvar list>
or
PUBLIC [ARRAY] <array1>(<expN1>[, <expN2>])
[, <array2>(<expN3>[, <expN4>])] ...

Remarks

Global variables and arrays can be used and modified from any program that you execute during the current FoxPro session.

Memory variables and arrays that are created with PUBLIC are initialized false (.F.) except for the public variables FOX and FOXPRO, which are initialized true (.T.).  The public variables FOX and FOXPRO can be used to conditionally execute code based on the product you are running.

Any memory variable or array you create in the Command window is automatically public.

Any memory variables or arrays you wish to declare as public must be declared public prior to assigning them a value.

If within a program you assign a value to a memory variable or array and later declare it public with PUBLIC, a syntax error will be generated.

Clauses

<memvar list>

<memvar list> specifies the names of one or more memory variables to be initialized and designated as global.

[ARRAY] <array1>(<expN1>[, <expN2>)

[, <array2>(<expN3>[, <expN4>]) ...

The array clause specifies one or more arrays to be initialized and designated as global.


PUBLIC Example

SET TALK OFF
PUBLIC val1,val2
val1 = 10
val2 = 15

DO down

? val1
? val2

RELEASE ALL 	&& Releases private variables only
DISPLAY MEMORY LIKE val?
RELEASE val1,val2 	&& Public variables must be released explicitly
DISPLAY MEMORY LIKE val?

PROCEDURE down
PRIVATE val1
val1 = 50
val2 = 100
? val1
? val2
RETURN


PUSH KEY SeeAlso
See Also

DIMENSION Command

PARAMETERS Command

PARAMETERS( ) Function

PRIVATE Command

RELEASE Command


PUSH KEY Command

See Also

Places all current ON KEY LABEL command settings on a stack in memory.

Syntax

PUSH KEY
[CLEAR]

Remarks

PUSH KEY, when used with POP KEY, lets you save key assignments defined with ON KEY LABEL commands, change these assignments and then restore the previous assignments.

For example, you could use a new set of ON KEY LABEL commands when a Browse window is open.  Before you open the Browse window, use PUSH KEY to save the current ON KEY LABEL key assignments in memory.  You can then add or change ON KEY LABEL assignments specifically for the Browse window.  After you close the Browse window, your previous ON KEY LABEL key assignments can be restored from memory with POP KEY.

ON KEY LABEL settings are placed on and removed from the stack in a "last in, first out" order.

DISPLAY STATUS and LIST STATUS show the current key assignments defined with ON KEY LABEL commands.

Clause

CLEAR

If the CLEAR clause is included, all current ON KEY LABEL key assignments are saved on the stack, and the key assignments are then cleared.


PUSH KEY SeeAlso
See Also

ON KEY LABEL Command

ON( ) Function

POP KEY Command


PUSH MENU Command

See Also	Example

Places a menu bar definition in a stack of menu definitions in memory.

Syntax

PUSH MENU <menu name>

Remarks

PUSH MENU, when used with POP MENU, lets you save a menu bar definition, make changes to the menu bar definition and then restore the menu bar definition to its original state.

Menu bar definitions are placed on and removed from the stack in last in, first out order.

Clause

<menu name>

<menu name> specifies the name of the menu bar whose definition is placed on the stack.  The menu bar can be a user-defined menu or the FoxPro system menu bar.


PUSH MENU Example

In the following example, the FoxPro system menu bar is pushed to the stack and then modified.  The modified system menu bar is then restored by popping it off the stack.

PUSH MENU _MSYSMENU
SET SYSMENU TO _MFILE, _MEDIT
POP MENU _MSYSMENU


PUSH MENU SeeAlso
See Also

ACTIVATE MENU Command

DEFINE MENU Command


PUSH POPUP Command

See Also	Example

Places a popup definition on a stack of popup definitions in memory.

Syntax

PUSH POPUP <popup name>

Remarks

PUSH POPUP, when used with POP POPUP, lets you save a popup definition, make changes to the popup definition and then restore the popup definition to its original state.

Popup definitions are placed on and removed from the stack in last in, first out order.

Clauses

<popup name>

<popup name> specifies the name of the popup whose definition is placed on the stack. The popup can be a popup defined with DEFINE POPUP or a FoxPro system menu popup.


PUSH POPUP Example

In the following example, a popup named POPEXAM is created.  The popup definition is pushed to the stack and then modified.  The original popup is then restored by popping it off the stack.

DEFINE POPUP popexam FROM 5,5

DEFINE BAR 1  OF popexam PROMPT 'One'
DEFINE BAR 2  OF popexam PROMPT 'Two'
DEFINE BAR 3  OF popexam PROMPT 'Three'
DEFINE BAR 4  OF popexam PROMPT 'Four'

ACTIVATE POPUP popexam NOWAIT
PUSH POPUP popexam

RELEASE BAR 2 OF popexam

POP POPUP popexam

DEACTIVATE POPUP popexam
RELEASE POPUP popexam


PUSH POPUP SeeAlso
See Also

ACTIVATE POPUP Command

DEFINE POPUP Command


PUTFILE( ) Function

See Also	Example

Invokes the Save As dialog and returns the file name you specify.

Syntax

PUTFILE([<expC1>] [, <expC2>] [, <expC3>])

Returns

Character

Remarks

Use PUTFILE( ) to choose an existing file name or specify a new file name.  PUTFILE( ) returns the file name with its path.  If a file name isn't entered, the default file name (specified by <expC2>) and extension (specified by <expC3>) are returned.  If the Cancel push button is chosen or Escape pressed, PUTFILE( ) returns the null string. You can use the file name PUTFILE( ) returns to name a file and save it to disk.

Parameters

<expC1>

<expC1> is the prompt text displayed at the top of the Save As dialog.

<expC2>

<expC2> is the default file name displayed in the text box.

<expC3>

<expC3> specifies file name extensions. Only file names with the specified extension are displayed in the Save As dialog's scrollable list when the All Files check box isn't checked.  For a complete list of the file extensions used by FoxPro, see the file extension table in Appendix A in the FoxPro Developer's Guide. The first extension in <expC3> is automatically appended to the file name entered if an extension isn't included with the filename.

In FoxPro for Macintosh, <expC3> is ignored. All files are displayed in the scrollable list but they cannot be chosen. However, you can chose folders from within the scrollable list to specify a folder where the file name.

The character expression <expC3> can take one of the following forms:

<expC3> can contain a single extension, for example ".PRG", and only file names with that extension are displayed.

<expC3> can contain a list of file name extensions separated by semicolons.  For example, including "PRG;FXP" displays all file names with the extensions .PRG and .FXP.

If file names have the same root name but different extensions (for example, CUSTOMER.PRG and CUSTOMER.FXP), only the file name with the first extension in <expC3> is displayed.

<expC3> can contain a list of file name extensions separated by vertical bars (for example, "PRG|FXP").  In this case, all file names with listed extensions are displayed, even if the files have the same name root.

If <expC3> contains just a semicolon (";"), all file names without an extension are displayed.

If <expC3> is the null string, the names of all files in the current directory are displayed.

If <expC3> contains MS-DOS wildcard characters (? and *), all file names with extensions that meet the wildcard criteria are displayed.  For example, if <expC3> is "?X?", all file names with the extensions .FXP, .EXE, .TXT and so on are displayed.


PUTFILE( ) Example

This example creates a delimited data file from any existing table the user chooses.  GETFILE( ) is used to find and open a table and PUTFILE( ) is used to return the name of the target file.

dbf_file = GETFILE('DBF', 'Open Table:')
USE (dbf_file)

file_name = ALIAS( ) + '.DLM'
out_file = PUTFILE('Delimited file:', file_name, 'DLM')

IF EMPTY(out_file)	&& Esc pressed
CANCEL
ENDIF

COPY TO (out_file) DELIMITED	&& Create delimited file
MODIFY FILE (out_file) NOEDIT


PUTFILE() SeeAlso
See Also

FILE( ) Function

GETEXPR Command

GETFILE( ) Function

LOCFILE( ) Function


PV( ) Function

See Also	Example

Returns the present value of an investment.

Syntax

PV(<expN1>, <expN2>, <expN3>)

Returns

Numeric

Remarks

The present value of an investment is computed as the value of the investment based on a series of equal periodic payments at a constant periodic interest rate.

Parameters

<expN1>

The periodic payment is specified by <expN1>.  It can evaluate to a positive or negative number.  PV( ) assumes that the payments are made at the end of each period.

<expN2>

The periodic interest rate is specified by <expN2>.  If the interest rate of an investment is annual and the payments are made monthly, divide the annual interest rate by 12.

<expN3>

The total number of payments is specified by <expN3>.


PV( ) Example

STORE 500 to payment	&& Periodic payments made monthly
STORE .075/12 TO interest	&& 7.5% annual interest rate
STORE 48 TO periodss	&& Four years (48 months)
? PV(payment, interest, periods)


PV() SeeAlso
See Also

CALCULATE Command

FV( ) Function


QUIT Command

See Also

Exits FoxPro.

Syntax

QUIT

Remarks

Use QUIT to terminate the current FoxPro session and return control to the operating system.  In FoxPro for MS-DOS you are returned to the DOS prompt; in FoxPro for Windows, you are returned to Windows. In FoxPro for Macintosh, you are returned to the Finder.

You can also exit FoxPro by choosing Quit from the File menu.

Caution   QUIT should always be used to terminate a FoxPro session.  Turning the computer off without issuing QUIT may result in damage to open files and the loss of data.  Exiting FoxPro without issuing QUIT may also leave temporary work files on disk that would normally be deleted.


QUIT SeeAlso
See Also

CANCEL Command

RESUME Command

RUN | ! Commands

SUSPEND Command


RAND( ) Function

Examples

Returns a random number between 0 and 1.

Syntax

RAND([<expN>])

Returns

Numeric

Parameters

<expN>

<expN> lets you to specify the seed value to use with the function.  Using the same positive value for <expN> in the first RAND( ) function you issue, and no <expN> in subsequent RAND( ) functions, always returns the same sequence of random numbers.

If <expN> is negative in the first RAND( ) function you issue, a seed value is created from the system clock.  To achieve the most random series of numbers, use RAND( ) initially with a negative argument and subsequent RAND( ) functions without an argument.

A seed value of 100001 is automatically used if <expN> is omitted in the first RAND( ) function you issue.  You can restore the default at any time with RAND(100001).


RAND( ) Examples

*** Seed random number generator (do this only once per program)

= RAND(-1)

*** Print uniformly distributed random number between 0 and 1

? RAND( )

*** Returns a uniformly distributed real number between a and b

FUNCTION urand
PARAMETER a, b
RETURN (b-a)*rand( )+a

*** Returns a uniformly distributed integer between i and j

FUNCTION irand
PARAMETER i, j
RETURN int((j-i+1)*rand( )+i)

*** Returns a value which simulates throwing a pair of dice.
*** (Uses 'FUNCTION irand' above.)
*** Note:  This is NOT the same as 'irand(12)' which has a quite
*** different probability distribution.

FUNCTION dice
RETURN irand(1,6)+irand(1,6)

*** Returns a random n-digit number (Uses 'FUNCTION irand' above)

FUNCTION digits
PARAMETER n
x = 10^n
y = irand(0, x-1) + x
RETURN substr(str(y,n+1),2)

*** Function to return exponentially distributed values of mean 'a'

FUNCTION edist
PARAMETER a
RETURN -a*log(rand( ))

*** Function to return a normally distributed value with mean 'm'
*** and standard deviation 'std'.
*** This function requires that the subroutine 'x_p' also be present.
*** The algorithm was taken from the "Handbook of Mathematical
*** Functions,"National Bureau of Standards, June 1964.
*** Equation 26.2.23, page 933. Its error is < (4.5E-4 * std).

FUNCTION ndist
PARAMETER m, std
x = x_p(RAND( ))
RETURN x * std + m

FUNCTION x_p
PARAMETER p
IF p < 0  or p > 1
RETURN 0
ENDIF
IF p < .5
adjust = .T.
ELSE
p = 1 - p
adjust = .F.
ENDIF
t = SQRT(LOG(1/(p*p)))
x = t -((t * 0.010328 + 0.802853) ;
* t + 2.515517) ;
/ (((t * 0.001308 + 0.189269) ;
* t + 1.432788) * t + 1)
RETURN IIF(adjust, -x, x)

*** Returns area under normal curve with mean 'm' and standard
*** deviation 'std' from -infinity to x
*** The algorithm was taken from the "Handbook of Mathematical
*** Functions,"National Bureau of Standards, June 1964.
*** Equation 26.2.17, page 932. Its error is < (7.5E-8 * std)
*** This doesn't use the RAND( ) function; it's just included
*** here for your convenience. It requires the function 'p'
*** to also be present

FUNCTION normal
PARAMETERS x, m, std
RETURN p((x-m)/std)

FUNCTION p
PARAMETER x
IF x < 0
adjust = .T.
x = -x
ELSE
adjust = .F.
ENDIF
t = 1 / (1 + 0.2316419 * x)
poly = ((((1.330274429 ;
* t - 1.821255978) ;
* t + 1.781477937) ;
* t - 0.356563782) ;
* t + 0.319381530) * t
res =  1 - 0.398942280401432678 ;
* EXP(-x*x/2) * poly
RETURN IIF(adjust, 1-res, res)


RAT( ) Function

See Also	Example

Returns the beginning numeric position of the first occurrence of one character expression or memo field within another character expression or memo field, counting from the rightmost character.

Syntax

RAT(<expC1>, <expC2>[, <expN>])

Returns

Numeric

Remarks

RAT( ), the reverse AT( ) function, searches a character expression, starting with the last character in the expression, for the occurrence of another character expression.  It then returns an integer corresponding to the position where the first character in the character expression is found.  0 is returned if the character expression isn't found.

The search performed by RAT( ) is case sensitive; upper-case and lower-case are respected.

Parameters

<expC1>, <expC2>

RAT( ) looks for <expC1> in <expC2>.  <expC1> and <expC2> can be memo fields.

<expN>

Include <expN> to specify which occurrence of <expC1> in <expC2> to look for.  By default, RAT( ) searches for the first occurrence of <expC1> (<expN> = 1).  If <expN> is included, RAT( ) searches for the <expN>th occurrence of <expC1> in <expC2>.  0 is returned if <expN> is higher than the number of times <expC1> occurs in <expC2>.


RAT( ) Example

STORE 'abracadabra' TO string
STORE 'a' TO find_str
? RAT(find_str,string)

? RAT(find_str,string,3)


RAT() SeeAlso
See Also

AT( ) Function

LEFT( ) Function

OCCURS( ) Function

RATLINE( ) Function

RIGHT( ) Function

SUBSTR( ) Function


RATLINE( ) Function

See Also	Example

Returns the line number of the last occurrence of a character expression within another character expression or memo field, counting from the last line.

Syntax

RATLINE(<expC1>, <expC2>)

Returns

Numeric

Remarks

RATLINE( ), the reverse ATLINE( ) function, searches a character expression, starting with the last character in the expression, for the occurrence of another character expression.  If the search is successful, the line number where the match occurs is returned.  0 is returned if the search is unsuccessful.

The search performed by RATLINE( ) is case sensitive.

Important   The line number returned by RATLINE( ) is affected by the value assigned to the memo field width by SET MEMOWIDTH. The memo field width determines the value returned by RATLINE( ) for character expressions (character string literals, memory variables or array elements and fields) as well as memo fields.

Parameters

<expC1>, <expC2>

RATLINE( ) searches <expC2> for <expC1>.  The search begins at the last character of <expC2>.  RATLINE( ) Return value [image] as an integer, the line number where <expC1> is found.  <expC1> and <expC2> can be memo fields.  The memo field line containing the matching character expression can be returned as a character string with MLINE( ).


RATLINE( ) Example

In this example,  RATLINE( ) returns the line number for the last line in the NOTES memo field containing the word "salesperson".  MLINE( ) uses this value to return the contents of the line.

CLOSE ALL
USE salesman
STORE 'salesperson' TO string
STORE MLINE(notes, RATLINE(string, notes)) TO mfileline
? mfileline


RATLINE() SeeAlso
See Also

AT( ) Function

ATLINE( ) Function

LEFT( ) Function

MLINE( ) Function

OCCURS( ) Function

RAT( ) Function

RIGHT( ) Function

SUBSTR( ) Function


RDLEVEL( ) Function

See Also	Example

Returns the current READ level.

Syntax

RDLEVEL( )

Returns

Numeric

Remarks

Nested READs are created by issuing @ ...  GETs and a READ in a routine that's executed during an active READ.  READs can be nested to five levels.

Use RDLEVEL( ) to return the level of the current READ command.  RDLEVEL( ) returns a value of 0, 1, 2, 3, 4 or 5 depending how deep the current READ is nested.  RDLEVEL( ) returns 0 if no READ is executing.


RDLEVEL( ) Example

In the following example, pressing F10 at any time displays the current READ level using RDLEVEL( ).  You can advance to the next READ level by pressing Enter or you can move back a READ level by pressing Esc. Note the use of the VALID clause with @ ... GET and a UDF to create nested READs.

ON KEY LABEL F10 DO saylevel
CLEAR
DO saylevel
@ 4,2 GET level1 VALID(proc1( )) DEFAULT 1
READ	&& READ Level 1
ON KEY LABEL F10
RETURN

PROCEDURE proc1
@ 6,2 GET level2 VALID(proc2( )) DEFAULT 2
READ	&& READ Level 2
RETURN ''

PROCEDURE proc2
@ 8,2 GET level3 VALID(proc3( )) DEFAULT 3
READ	&& READ Level 3
RETURN ''

PROCEDURE proc3
@ 10,2 GET level4 DEFAULT 4
READ	&& READ Level 4
RETURN ''

PROCEDURE saylevel
@ 2,2 SAY 'Read level: ' + STR(RDLEVEL( ))
RETURN ''


RDLEVEL() SeeAlso
See Also

@ ... GET Command

CLEAR READ Command

_CUROBJ System Memory Variable

OBJNUM( ) Function


READ Command

See Also

Activates objects created with @ ... GET and @ ... EDIT commands.

Syntax

READ
[CYCLE]
[ACTIVATE <expL1>]
[DEACTIVATE <expL2>]
[MODAL]
[WITH <window title list>]
[SHOW <expL3>]
[VALID <expL4 | expN1>]
[WHEN <expL5>]
[OBJECT <expN2>]
[TIMEOUT <expN3>]
[SAVE]
[NOMOUSE]
[LOCK | NOLOCK]
[COLOR <color pair list> | COLOR SCHEME <expN4>]

Remarks

READ activates objects.  Objects are GET fields, check boxes, lists, popups, push buttons, radio buttons, spinners and text editing regions defined with @ ... GETs.  READ activates all objects created after the last READ or CLEAR GETS was issued.

Exiting the READ

A user can exit a READ in several ways.  Moving forward past the last object or backward past the first object exits READ (if the CYCLE clause isn't included with READ).  Pressing Esc, or Ctrl+W or choosing a control that was defined to terminate the READ also exits the READ.

Multi-Window READ

A READ can span multiple windows.  You can place objects can be placed in different windows and activate all of them with a single READ.  When you move the cursor from object to object, the objects are traversed in the order they are created, regardless of the window they are placed in.

When you move the cursor to an object, the window that contains the object is activated and becomes the current output window when the current object is in the window.  When you press Tab, Enter or Down Arrow when the cursor is positioned on the last object in a window, the cursor is positioned on the first object in the next window.  When you press Shift+Tab or Up Arrow when the cursor is positioned on the first object in a window, the cursor is positioned on the last object in the previous window.  SHOW GETS contains an example of multi-window reads.

Nested READs

Nested READs are created by defining objects and issuing READ in a routine called while a READ is active.  READ commands can be nested to a depth of five levels.  RDLEVEL( ) returns the level of the current READ.  See RDLEVEL( ) for an example with nested READ commands.

Event Execution Order

The following list shows the order in which READ events and clauses are executed when the READ is first issued:

1	READ level WHEN clause is executed

2	First GET window is activated

3	READ level ACTIVATE clause is executed

4	READ level SHOW clause is executed

5	GET level WHEN clause is executed for first GET

The following list shows the order in which READ clauses are called when a new window is activated:

1	VALID clause for the field being exited is executed

2	Window of field being exited is deactivated

3	Window of new GET field is activated

4	READ level DEACTIVATE clause is executed

5	READ level ACTIVATE clause is executed

6	WHEN clause for the new field is executed

Clauses

CYCLE

If the CYCLE clause is included, the READ isn't terminated when you move forward past the last object or backward past the first object.  If the cursor is positioned on the last object and you press Tab, Enter or the Down Arrow, the cursor is repositioned on the first object.  If you are positioned on the first object and press Shift+Tab or the Up Arrow, you will be repositioned on the last object.   If CYCLE is included, pressing a terminating button, Esc, or Ctrl+W, or issuing CLEAR READ or a TIMEOUT clause is required to terminate the READ.

ACTIVATE <expL1>

The ACTIVATE clause is executed when READ is issued and whenever the current READ window changes.  ACTIVATE can be viewed as a window level WHEN clause.

The logical expression <expL1> is typically a user-defined function.  WOUTPUT( ) can be used in the user-defined function to determine which window is activated.  The user-defined function can disable @ ...  GET objects in other windows, hide windows, display a message and so on.

DEACTIVATE <expL2>

The DEACTIVATE clause is executed whenever you attempt to bring any other window forward (that is, whenever WONTOP( ) changes).  DEACTIVATE can be viewed as a window level VALID clause.

The logical expression <expL2> is typically a user-defined function.  The user-defined function can be used to validate the contents of fields in a window before allowing you to bring forward another window.  The READ isn't terminated if the user-defined function returns false (.F.).  The READ is terminated if the user-defined function returns true (.T.).

MODAL

Including the MODAL key word in READ prevents all windows from being activated with the exception of windows that are involved in the READ.  If windows that are not involved in the READ are defined when a MODAL READ is issued, they cannot be activated or accessed.

WITH <window title list>

By default, all interactive windows (Browse windows, desk accessories and windows opened with MODIFY FILE, MODIFY REPORT, and so on) can participate in a READ.  Include the WITH clause to restrict the windows that participate in the READ.  The windows included in the WITH clause can include FoxPro system windows (Browse windows, desk accessories and text and memo editing windows).

Including the WITH clause automatically creates a MODAL READ.

Include the Browse window title (by default, the table alias) in the window list to make a Browse window accessible.

Include the table alias in the window list to make a memo window accessible.

If a window title contains a character that isn't alphabetic, numeric or an underscore, include the part of the title up to the first character that isn't alphabetic, numeric or an underscore in the window list.  For example, if the window title is Client List, include Client in the window list (the space between Client and List isn't alphabetic, numeric or an underscore).

If a window title contains a character that isn't alphabetic, numeric or an underscore, you can place the title in quotation marks in the window list.  For example, if the window title is Client List, you can include "Client List" in the window list.

SHOW <expL3>

The SHOW clause is executed whenever SHOW GETS is issued.  The value returned by a SHOW routine is ignored.  A SHOW routine can be used to refresh @ ... SAYs or to enable or disable objects.

VALID <expL4> | <expN1>

The VALID clause is evaluated when you attempt to exit the current READ or when a READ issued without a previous @ ... GET clause times out.  The VALID clause can specify a logical or numeric expression or a user-defined function (UDF) that returns a logical or numeric value.

The READ is terminated if <expL4> evaluates to true (.T.).  If VALID <expL4> evaluates to a logical false (.F.), the current object remains active if possible.

If the object cannot remain active (perhaps the VALID routine deactivated the object), you are moved to the first object.

If the VALID clause returns a number, you are moved to the corresponding object.  The READ is terminated if an object corresponding to the number doesn't exist.  A VALID clause returning a value that isn't of logical or numeric type has the same effect as one returning true (.T.).

WHEN <expL5>

The WHEN clause determines if the READ is executed.  <expL5> must evaluate to true (.T.) when the READ is issued for the READ to be executed.  The READ is ignored and program execution continues with the command immediately following the READ if <expL5> evaluates to false (.F.).

OBJECT <expN2>

Include the OBJECT clause to specify which object is initially selected when READ is issued.   <expN2> determines which object is initially selected.  Object numbers are determined by the order in which the objects are created.

Each individual push, radio and invisible button is considered one object.  In the following program example, a field and three radio buttons are created.  The middle radio button is initially selected by including the OBJECT 3 clause with the READ.  The NAME field is object number 1, the first radio button is object number 2, the second radio button is object number 3 and the last radio button is object number 4.

STORE 1 TO radio
STORE SPACE(10) TO name
CLEAR
@ 2,2 SAY 'Enter a name: ' GET name
@ 4,2 GET radio PICTURE '@*R Apples;Oranges;Lemons'
READ CYCLE OBJECT 3

TIMEOUT <expN3>

A TIMEOUT clause determines how long the READ is in effect.  <expN3> specifies the number of seconds that can elapse without user input before the READ is terminated.  If the READ is terminated by a TIMEOUT clause, READKEY( ) returns 20 if changes have not been made to any object.  If changes have been made, READKEY( ) returns 276.

When READ is terminated by a TIMEOUT clause, any changes made to the field being edited when the READ ends are discarded.  However, changes made to other fields are saved.

SAVE

All objects definitions are automatically cleared when the READ ends unless the SAVE key word is included.  You can reissue READ without recreating the objects if you include SAVE with the previous READ.

NOMOUSE

Include the NOMOUSE key word to prevent objects from being selected with the mouse.  You must use the keyboard to move from object to object.  You can still use the mouse within fields to cut, copy, paste and position the cursor.

LOCK | NOLOCK

The LOCK and NOLOCK key words let you specify if a record containing fields specified in objects is automatically locked during a READ when the table is opened for shared use on a network.

If LOCK is included, record locks are attempted for every record used by the objects.  If the locks are successfully placed, you can edit the records.  SET REPROCESS determines how many times or for how long locking attempts are made.  READ defaults to READ LOCK if LOCK or NOLOCK isn't included.

If NOLOCK is included, the records used by objects are not locked.  Instead, all objects that use fields in the records are made read-only and the control cannot be selected and is displayed in the disabled colors.

If you issue READ NOLOCK and modify a memo field, the record is automatically locked.

COLOR <color pair list> | COLOR SCHEME <expN4>

The color of the current @ ... GET editing region can be specified by including the number of an existing color scheme in the COLOR SCHEME clause or a set of color pairs in the COLOR clause.

When an object is selected, it assumes the colors of the second color pair in the color pair list.  All other colors in the color pair list are ignored.  If you omit the first color pair you must include a comma for the color pair.

If you include a COLOR SCHEME clause, color pair 2 of the specified color scheme determines the color of the current @ ... GET editing region.  By default, the color of the current @ ... GET editing region is determined by color pair 2 of color scheme 1, color pair 2 of the window the @ ... GET editing region is placed in or color pair 2 of the color clause specified in @ ... GET.  The color of other objects (check boxes, popups, push buttons, etc.) isn't affected by this color clause.

A color scheme is a set of 10 predefined color pairs.  The color pairs in a color scheme can be changed with SET COLOR OF SCHEME.  In FoxPro for MS-DOS the color pairs in a color scheme can also be changed in the Color Picker.

A color pair is a set of two letters separated by a forward slash.  The first color letter specifies the foreground color and the second letter specifies the background color.

For example, this color pair specifies a red foreground on a white background:

R/W

For a list of colors and their corresponding color letters, see SET COLOR Commands Overview or Color Table by Color Pair.

A color pair can also be specified with a set of 6 RGB (Red Green Blue) color values separated by commas.  The first 3 color values specify the foreground color and the second 3 color values specify the background color.  The color values can range from 0 through 255.

The R/W color pair in the example above can also be specified with this RGB color pair:

RGB(255,0,0,255,255,255)

Foundation READ

FoxPro lets you easily create event-driven interfaces (like the FoxPro interface) for your applications.  This section suggests a method for creating an event-driven interface in FoxPro.

In previous versions of FoxPro, some sophisticated users utilized an event loop to handle menu choices and window selections when creating an event-driven interface.  The event loop would constantly poll the system status and then take action based on which window was on top or which menu option the user chose.

DO WHILE is used to create the event loop (often a large loop).  Event loops should be avoided for the following reasons:

Event loops are constantly being executed, making them intensive CPU users.

Event loops are complex and difficult to program.

Event loops are unfriendly in multi-program environments like DESQview, Windows and the Macintosh MultiFinder.

A Single READ with Multiple Windows

Event loop programming is rarely required in FoxPro.  A single READ supporting multiple windows can be used to eliminate most event loops.  A single READ with multiple windows provides versatility and flexibility without complex programming.

We suggest that you encompass all the windows that you intend to interact with.  FoxPro can coordinate windows containing objects (@ ...  GETs, check boxes, radio buttons, popups, and so on) with other windows not usually associated with a READ.  By default, all interactive windows (Browse windows, desk accessories, memo editing windows and windows opened with MODIFY FILE, MODIFY REPORT) can participate in a READ.

Coordinating Windows with a Single READ

To programmatically coordinate windows containing @ ... GET objects with a single READ:

1	Create the windows that will contain the @ ... GET objects.

2	Activate one of the windows and issue the @ ... GETs that create the objects for the window.

3	Activate another window and issue the @ ... GETs that create the objects for that window.

4	Continue in this fashion for the remaining windows.

5	Issue READ.

Screen set program code generated by GENSCRN provides a good example of this sequence.

The windows created and activated are now coordinated with a single READ.  Each of the GET objects appears in its respective window, and the user can move between the @ ... GET objects in each of the windows.  When the user moves from object to object with the keyboard, the objects are traversed in the order the @ ... GETs have been issued, regardless of which window they are in.  A window is activated and becomes the current output window when the current object is in the window.

When the user presses Tab, Enter or Down Arrow when the cursor is positioned on the last object in a window, the cursor is positioned on the first @ ... GET object in the next window.  When the user presses Shift+Tab or Up Arrow on the first object in a window, the cursor is positioned on the last @ ... GET object in the previous window.  The user can also move between different @ ... GET objects in different windows by clicking on the objects.

Access to other windows during a single READ can be controlled with the READ MODAL clause.  Including MODAL in READ prevents interaction with windows that are not encompassed in the READ's coordinated set of windows.  When MODAL is included with READ, the user cannot close, zoom, minimize, or move windows not involved in the READ.  Clicking on a window not involved in the READ sounds a beep if BELL is SET ON.

By default, all interactive windows (Browse windows, desk accessories and windows opened with MODIFY FILE, MODIFY REPORT, and so on) can participate in a READ.

You can explicitly indicate the windows that participate in the READ by specifying their names in the WITH clause.  The READ command is automatically made MODAL if you include the WITH clause to specify other windows involved in the READ.  The windows included in the WITH clause can include FoxPro system windows (Browse windows, desk accessories and text and memo editing windows).

ACTIVATE and DEACTIVATE

When a window involved in the READ is brought forward, the action taken can be controlled by the ACTIVATE and DEACTIVATE clauses.  The user can bring a window forward by clicking on the window, by cycling to the window with Ctrl+F1 or by choosing a control or menu option that activates the window.

When a window containing objects is foremost and you attempt to bring another window forward, the DEACTIVATE clause is executed after the new window is brought forward.

The value returned by the DEACTIVATE clause determines whether the READ is terminated  If the DEACTIVATE clause returns true (.T.), the READ is terminated.  If the clause returns false (.F.), the READ isn't terminated.

When the DEACTIVATE clause is executed, WONTOP( ) returns the name of the new window brought forward and WLAST( ) returns the name of the window that was formerly frontmost.  The window functions (WONTOP( ), WOUTPUT( ) ...) return false (.F.) when you include the name of a window that doesn't exist.

If your DEACTIVATE clause lets the new window remain forward and the new window contains objects, the ACTIVATE clause is executed.

Tip   When a window is brought forward, you can return the window to its former position by issuing the following command in the DEACTIVATE clause:

ACTIVATE WINDOW (WLAST( ))

The function WREAD( ) facilitates manipulation of windows participating in a READ.  WREAD( ) lets you determine if a specific window is participating in the current READ.

Coordinating Multiple READs / Foundation READs

The single READ with multiple windows section above recommends an approach to handling multiple windows with a single READ command.  The single READ approach works for most applications.

However, a foundation READ may be necessary in some applications.  A foundation READ is a READ without objects.  A foundation READ is used to coordinate multiple READs into a single interactive session.

A foundation READ typically incorporates code in its VALID clause routine that activates and controls the child READs.  Child READs are sometimes called nested READs.

A foundation READ normally has a VALID clause.  The VALID clause is executed when an event occurs that would otherwise terminate the READ.  Here are the events that terminate a foundation READ:

Any mouse click or keystroke that isn't a menu selection or doesn't execute an ON KEY LABEL.  During a foundation READ, the FoxPro system menu is accessible.

Selecting an item from a menu or executing an ON KEY LABEL command doesn't terminate a foundation READ.  If a menu is activated but a selection isn't made from the menu, the foundation READ isn't terminated.

A child READ is terminated.  However, the foundation READ isn't terminated if a grandchild READ is terminated.

The value returned by the READ VALID clause determines whether or not the foundation READ is terminated.  If the READ VALID clause returns true (.T.), the foundation READ is terminated; if it returns false (.F.), the foundation READ command remains active.

READKEY( ) facilitates the management of child READ commands.  By specifying a numeric argument in READKEY( ), you can determine how the last READ was terminated.  For example, the value can indicate that the last READ was terminated by closing a window, by a CLEAR READ, by a READ VALID or DEACTIVATE clause returning a logical true (.T.).

Here are the values returned by READKEY(<expN>) with the corresponding reason the READ was terminated:

Value	Reason

1	None of the following

2	CLEAR READ issued

3	Terminating control chosen

4	READ window closed

5	DEACTIVATE clause returned .T.

6	READ timed out

Sample Applications

Included with FoxPro are three sample applications, INV.APP, EX1.APP and EX2.APP.  These sample applications illustrate the features available with READs and how these features can be used to create an event-driven interface.

The applications are built from three projects, INV.PJX, EX1.PJX and EX2.PJX.  The projects contain all the files (programs, screen sets, menus, tables, and so on) used by the applications.  To examine the files included in a project, open the project with MODIFY PROJECT, or through the Open dialog.

INV: A Single READ with Multiple Windows

The sample application INV.APP demonstrates the use of a single READ with multiple windows.  A user-defined window containing @ ...  GET objects, two Browse windows and the CONTROL2 screen set control panel are coordinated with a single READ command.

EX1: A Foundation Read with Multiple Applications

EX1.APP, a more complex application than INV.APP, demonstrates coordination of four READs, each of which use the control panel built from the CONTROL3.SCX screen set.  A foundation READ coordinates the four READs. EX1.APP has been designed so you can use any FoxPro desk accessory or window (Help, Filer, Calculator, Calendar/Diary, editing windows, and so on) in conjunction with the application windows.

Applications are launched from the Application menu.  You can switch from one application to another by clicking in the respective application window.  Execution of the entire system can be terminated by choosing the Quit option in the File menu.

EX1 Quiz

Before you attempt to write your own multi-READ event driven code, we recommend you carefully study EX1.APP and be certain you can answer the following questions about its operation.  The answers are provided at the end of this section.

1	What would happen if the menu handling routine always immediately launched the requested application, regardless of the current READ level (returned by RDLEVEL( ))?

2	Why is it necessary to specify the IN EX1.MPR clause in the menu command on the Application menu?

3	Where is the code that handles the situation when an application window is closed manually, either through the window's Control menu (FoxPro for Windows) or by clicking on its close box (FoxPro for MS-DOS and FoxPro for Macintosh), or by choosing Close from the File menu?

4	What is the largest number of READs that are active at any one time while EX1.APP is executing?

5	What insures that the control panel vanishes when the last remaining application window is closed?

6	If you bring, say, the Calculator on top of an application window, is the application READ still active?  The foundation READ?

7	When you are executing EX1.APP and neither an application window nor the control panel is visible, and you're using, say, the Filer, is any READ active?

8	When you're running in one application window and you click in another application window, how is control transferred from the first application to the new one?  What event triggers the transfer?

If you can answer all these questions, you're ready to proceed to the next example.

EX2: A Foundation Read with Multiple Applications

This application is similar to EX1.APP, but replaces the single invoice editing screen with the INV.APP application that, besides editing the invoice file, includes the CONTROL2 control panel and two Browse windows coordinated as part of the READ.

Study EX2.APP carefully and you'll see that the changes required to handle this more complex situation are rather simple.  If you can answer the eight questions about EX1.APP, you should have no difficulty with EX2.APP.  And by now, you should have a general idea how to proceed in your own applications.

EX1 Quiz Answers

1	You would add one READ level each time you selected an application from the menu and, therefore, would get "Too many READs in effect" in short order.  FoxPro supports a maximum of five READ levels.

2	Because the procedure MENUHIT is contained within EX1.MPR.  EX1.MPR isn't a part of EX1.PRG; the IN EX1.MPR clause must be included to tell EX1.PRG where to look for the MENUHIT procedure.

3	It's found in the STOPREAD procedure which is evaluated each time an application window is deactivated.  The window name is passed to STOPREAD.  If the window isn't visible, (because it was closed either manually or by clicking on its close box) the control panel is displayed.  STOPREAD returns .T. if the window is involved in the READ, otherwise .F. is returned (a FoxPro system window was closed).

4	There are at most three READs active:  the foundation READ, one of the application READs, and a READ MODAL associated with either BROWSER.SPR or FINDER.SPR.

5	The procedure named EFFACE, which is called in the cleanup code for each application screen, ensures that when the last application window is closed the control panel is released.

EFFACE is called when either the Quit button is pressed or a READ window has been manually closed.

EFFACE looks through all the windows that are open, from back to front.  If it finds any of the user application windows (which require the control panel) it simply exits.  Otherwise, it concludes you're finished with the control panel and releases it.

6	The application READ is terminated because its DEACTIVATE clause returned .T., but the foundation READ remains active.

7	The first application's DEACTIVATE clause returns .T., thereby terminating that application's READ.  Termination of the application's READ triggers the foundation READ's VALID clause routine.

8	This routine, called MYHANDLER, uses WONTOP( ) to return the name of the application window where the mouse was clicked, and the screen program (.SPR) for that window is executed.

For examples using READ, see @ ... GET, CLEAR READ and SHOW GETS.


READ SeeAlso
See Also

@ ... GET Command

CLEAR READ Command

CLEAR GETS Command

RDLEVEL( ) Function

READKEY( ) Function

SET CONFIRM Command

VARREAD( ) Function

User-Defined Functions (UDFs)

SYS(2016) Function - SHOW GETS WINDOW Name


READ MENU Command

See Also

Activates a popup.

Syntax

READ MENU TO <memvar>
[SAVE]

Remarks

READ MENU is included for backward compatibility.  Use the FoxPro Menu Builder to create menus

This command activates the menu popup created with @ ... MENU.

The value initially contained in the memory variable or array element <memvar> specifies which popup option is selected when the popup is activated.  When you choose a popup option, a value is stored to <memvar> corresponding to option you choose.  If you press Esc to exit the popup, <memvar> contains 0.

Clause

SAVE

The SAVE clause keeps an image of the menu popup on the desktop (FoxPro for MS-DOS), the main FoxPro window or in a user-defined window after a choice is made from the menu or Esc is pressed.  Normally, the menu is cleared from the desktop, main FoxPro window or a user-defined window after you make a choice.


READ MENU SeeAlso
See Also

@ ... MENU Command

CREATE MENU Command


READKEY( ) Function

See Also	Example

Returns a value corresponding to the key pressed to exit certain editing commands, or a value indicating how the last READ was terminated.

Syntax

READKEY([<expN>])

Returns

Numeric

Remarks

If READKEY( ) is issued without the optional numeric expression <expN>, the value returned represents the key pressed to exit from these editing commands: APPEND, BROWSE, CHANGE, CREATE, EDIT, INSERT, MODIFY and READ.

An integer between 0 and 36, or between 256 and 292 is returned.  The value returned is between 0 and 36 if the data was not modified.  The value returned is between 256 and 292 if the data is modified.

The following table lists the values returned by READKEY:

Key(s)	No Update Code	Update Code
Backspace Left Arrow Ctrl+H Ctrl+S	0	256
Right Arrow Ctrl+D* Ctrl+L	1	257
Home Ctrl+A*	2	258
End Ctrl+F	3	259
Up Arrow Ctrl+E* Shift+Tab Ctrl+K*	4	260
Down Arrow Ctrl+X* Tab Ctrl+Enter Ctrl+I Ctrl+J	5	261
P age Up Ctrl+R*	6	262
P age Down Ctrl+C	7	263
Ctrl+ Left Arrow	8	264
Ctrl+Q Esc	12	268
Ctrl+End Ctrl+W	-	270
Enter Ctrl+Right Arrow Ctrl+M	15	271
Timeout	20	276
Ctrl+Home Ctrl+]	33	289
Ctrl+Page Up Ctrl+_	34	290
Ctrl+Page Down Ctrl+^	35	291
F1	36	292
*If SET SYSMENU is OFF or FOXPLUS.FKY has been loaded, these values are returned.  FOXPLUS.FKY can be found in the GOODIES directory.

In FoxPro for Macintosh, the [image] command key is also supported in ON KEY LABEL. Use Cmd to specify the [image] command key. The Control (Ctrl) and [image] command keys are equivalent in FoxPro for Macintosh and can be used interchangeably. However, if your application will be run on other FoxPro platforms, use Ctrl for maximum compatiblity. For additional information about the keyboard and keystrokes in FoxPro for Macintosh, see the Keyboard Differences section in the Installation and Macintosh Features Guide.

In FoxPro for Macintosh, the mouse has one button. Use ON KEY LABEL LEFTMOUSE or ON KEY LABEL MOUSE to execute a command when the mouse is clicked. Use ON KEY LABEL RIGHTMOUSE to execute a command when the mouse is clicked while the Ctrl or Cmd+Option keys are pressed.

FoxPro for Macintosh also supports RETURN as a key assignment. ON KEY LABEL RETURN is equivalent to ON KEY LABEL ENTER in FoxPro for Macintosh. Also, ON KEY LABEL DEL is equivalent to ON KEY LABEL BACKSPACE.

The Alt key in FoxPro for MS-DOS and FoxPro for Windows is emulated in FoxPro for Macintosh with Ctrl+Option.

Parameter

<expN>

READKEY( ) returns a value that indicates how the last READ was terminated if the optional numeric expression <expN> is included.  The numeric expression <expN> can be any value.

The following table lists the values returned by READKEY( ) with the reason the READ was terminated.

Value	Reason

1	None of the following

2	CLEAR READ issued

3	Terminating control chosen

4	READ window closed

5	DEACTIVATE clause returned .T.

6	READ timed out


READKEY( ) Example

In the following example, the data from the current record in CUSTOMER.DBF is placed in an array with SCATTER.  The field data for the current record is displayed for editing.  Press Esc to cancel your changes.  READKEY( ) tests to see if the READ was exited by pressing Esc. If Esc is pressed, the original values are restored to the fields with GATHER.

SET TALK OFF
CLOSE ALL
CLEAR
USE customer
COPY TO temp.dbf
USE temp
SCATTER TO temp
DEFINE WINDOW menter FROM 6,10 to 18,70 PANEL
ACTIVATE WINDOW menter
@ 1,3 SAY 'Customer: ' GET company
@ 3,3 SAY 'Address: ' GET address
@ 5,3 SAY 'City: '  GET city
@ 9,18 SAY 'Press Esc to cancel'
READ
IF READKEY( ) = 268	&& Esc was pressed
GATHER FROM temp
ENDIF
DEACTIVATE WINDOW menter
RELEASE WINDOW menter
DISPLAY NEXT 5 FIELDS company, city
USE
ERASE temp.dbf


READKEY() SeeAlso
See Also

INKEY( ) Function

ON KEY Command

READ Command

VARREAD( ) Function


RECALL Command

See Also

Unmarks records marked for deletion in the selected table.

Syntax

RECALL
[<scope>]
[FOR <expL1>]
[WHILE <expL2>]
[NOOPTIMIZE]

Remarks

RECALL can be used to recover records, provided that a PACK or ZAP has not been performed on the table.

Caution   Once a file has been packed, all records marked for deletion are gone forever.

Records can be marked for deletion by issuing DELETE, from within a Browse, Change or Edit window or by choosing Delete ...  from the Record menu.

Records can be recalled by issuing RECALL, from within a Browse, Change or Edit window or by choosing Recall ...  from the Record menu.

Clauses

<scope>

The scope clauses are:  ALL, NEXT <expN>, RECORD <expN>, and REST.  These are explained in the Overview of the FoxPro Language chapter in the FoxPro Language Reference.  Commands which include <scope> operate only on the table in the active work area.

You can specify a scope of records to recall.  Only the records that fall within the range of records specified by the scope are recalled.

The default scope for RECALL is the current record (NEXT 1).

FOR <expL1>

If the FOR clause is included, only the records for which <expL1> evaluates to true (.T.) are recalled.  Including a FOR clause lets you conditionally recall records, filtering out undesired records.

Rushmore optimizes a RECALL FOR if <expL1> is an optimizable expression.  For best performance, use an optimizable expression in the FOR clause.  A discussion of Rushmore optimizable expressions appears in the Optimizing Your Application chapter in the FoxPro Developer's Guide.

WHILE <expL2>

If the WHILE clause is included, records are recalled for as long as <expL2> evaluates to true (.T.).

NOOPTIMIZE

To prevent Rushmore optimization of RECALL, include NOOPTIMIZE.  For more information on NOOPTIMIZE, see SET OPTIMIZE.


RECALL SeeAlso
See Also

DELETE Command

PACK Command

SET DELETED Command

ZAP Command


RECCOUNT( ) Function

See Also	Example

Returns the number of records in the current or specified table.

Syntax

RECCOUNT([<expN> | <expC>])

Returns

Numeric

Remarks

All records in the table are counted.  The value returned by RECCOUNT( ) isn't affected by SET DELETED and SET FILTER.

Parameters

<expN> | <expC>

RECCOUNT( ) with no parameter returns the number of records in the table in the selected work area.  To return the number of records in a table open in another work area, include the work area number <expN> or the table alias <expC>.

RECCOUNT( ) returns zero if a table isn't open in the work area you specify.


RECCOUNT( ) Example

In this example, FoxPro compares the available disk space with the amount needed to sort CUSTOMER.DBF.

*** Check DISKSPACE before a SORT ***

USE customer

*** Get size of table header ***

dbf_top = HEADER( )

*** Calculate size of table ***

file_size = dbf_top + (RECSIZE( ) * RECCOUNT( ) + 1)
IF DISKSPACE( ) > (file_size * 3)
@ 5,0 SAY 'Sufficient diskspace to Sort.'
ELSE
@ 5,0 SAY 'Insufficient diskspace. Sort cannot be done.'
ENDIF


RECCOUNT() SeeAlso
See Also

RECNO( ) Function

RECSIZE( ) Function


RECNO( ) Function

See Also	Example

Returns the current record number in the current or specified table.

Syntax

RECNO([<expN> | <expC>])

Returns

Numeric

Remarks

The record pointer is positioned on the current record.

RECNO( ) returns a value that is one greater than the number of records in the file if the record pointer is positioned beyond the last record in the file.  RECNO( ) returns 1 if the record pointer is positioned before the first record in the file.

If the table has no records, RECNO( ) returns 1 and EOF( ) returns true (.T.).

Parameters

<expN> | <expC>

RECNO( ) returns the current record number for the table in the selected work area.

To return the current record number for a table open in another work area, include the work area number <expN> or the table alias <expC>.

If a table isn't open in the work area you specify, RECNO( ) returns zero.

RECNO(0) Soft Seek

After an unsuccessful SEEK in an indexed table, RECNO(0) uses "soft seek" logic to determine the record number to return.  RECNO(0) returns the record number of the closest match if the SEEK is unsuccessful and no matching record is found.  RECNO(0) returns 0 if a close match cannot be found.  The message "Record out of range" is generated if you issue GO RECNO(0) and a close match hasn't been found.


RECNO( ) Example

The following example searches CUSTOMER.DBF for a name, and, if the name isn't found, uses RECNO(0) to return the closest matching company.

CLOSE DATABASES
USE customer
SET ORDER TO company
SEEK 'John Doe'
IF FOUND( )
DISPLAY
ELSE
GOTO RECNO(0)
? 'Closest matching company is ' + company
ENDIF


RECNO() SeeAlso
See Also

GO/GOTO Commands

RECCOUNT( ) Function

RECSIZE( ) Function

SEEK Command

SKIP Command


RECSIZE( ) Function

See Also

Returns the size (width) of a table record.

Syntax

RECSIZE([<expN> | <expC>])

Returns

Numeric

Parameters

<expN> | <expC>

RECSIZE( ) with no parameter returns the record size for the table in the selected work area.

To return the record size for a table open in another work area, include the work area number <expN> or the table alias <expC>.

RECSIZE( ) returns zero if a table isn't open in the work area you specify.

For an example using RECSIZE( ), see RECCOUNT( ).


RECSIZE() SeeAlso
See Also

RECCOUNT( ) Function

FSIZE( ) Function


REGIONAL Preprocessor Directive

See Also	Example

Creates regional memory variables and arrays.

Syntax

#REGION <number>
REGIONAL <memvar list>

Remarks

Memory variables or arrays with identical names can be created without interfering with each other when their values are protected within a "region".  Regional variables are similar to private variables.

Declaring screen variables as regional in the screen setup code ensures that a variable from one screen isn't affected by a variable with the same name used in another screen.  If the variables in each of the screens in the screen set are declared as regional variables in their setup code, FoxPro automatically resolves the conflicts.

The GENSCRN screen generating program used by the Screen Builder automatically inserts the necessary #REGION compiler directives needed to resolve memory variable name conflicts.

Creating Regional Variables

#REGION <number>

Regional variables should be declared before they are used in a program.  A region is created with the #REGION compiler directive (#REGION isn't a command).  Include a region number 0 through 31.

REGIONAL <memvar list>

After a region is created with the #REGION directive, declare the variables for that region with REGIONAL.  <memvar list> is a list of memory variables and arrays separated by commas.

During program compilation, if another identically-named regional variable has already been compiled when a regional declaration is encountered, the second occurrence of the variable name is made unique to ensure there is no conflict with the previously-declared regional variable.

A variable's name is made unique by padding the regional variable's name out to 10 characters with underscores and the current region number.  This substitution takes place entirely during program compilation and has no effect on execution speed.

When a variable name is modified, the modified variable name can be displayed with DISPLAY MEMORY.  To monitor the variable in the Debug window, use its modified variable name.  Since the Trace window uses the original program source code, the original variable name (not the modified name created by the compiler) appears in the Trace window.


REGIONAL Example

Two sets of regional variables are created.  In region 1, the variables A, B, C and D are created, and the character string "One" is stored to each.  In region 2, the variables C, D, E and F are created, and the character string "Two" is stored to each.  The variables C and D are common to both regions.

The screen output from DISPLAY MEMORY is then shown.  The names of memory variables C and D are modified in the second region.  C becomes C________2, and D becomes D________2.  All the variables are private and can be accessed by lower-level programs.

#REGION 1
REGIONAL A,B,C,D
STORE 'One' to A,B,C,D

#REGION 2
REGIONAL C,D,E,F	&& C and D are common to both regions
STORE 'Two' to C,D,E,F
DO showmemory

PROCEDURE showmemory
DISPLAY MEMORY LIKE *


REGIONAL SeeAlso
See Also

PRIVATE

PUBLIC

STORE


REINDEX Command

See Also

Rebuilds open index files.

Syntax

REINDEX
[COMPACT]

Remarks

REINDEX updates index files.  Index files become outdated when a table is opened without opening its corresponding index files and changes are made to the index files' key fields.  When index files become outdated, they can be updated by reindexing.

All index files open in the selected work area are updated by REINDEX.  All tags in .CDX compound index files are also updated.  Structural .CDX compound indexes automatically opened with the table are also updated.

Any index files created with the UNIQUE key word of the INDEX command or with UNIQUE SET ON retain their UNIQUE status when they are reindexed.

To REINDEX outdated index files, issue these commands:

USE <table> INDEX <outdated index or indexes>
REINDEX

Clause

COMPACT

FoxPro recognizes each index file type (.CDX, .IDX and structural) and reindexes accordingly.  You can convert regular .IDX index files to compact .IDX index files by including COMPACT.


REINDEX SeeAlso
See Also

INDEX Command

SET INDEX Command

SET UNIQUE Command

SYS( ) Functions Overview

USE Command


RELATION( ) Function

See Also	Example

Returns a specified relational expressions for a table open in a specific work area.

Syntax

RELATION(<expN1>[, <expN2> | <expC>])

Returns

Character

Remarks

The null string is returned if no relations exist.  For additional information about creating relations between tables, see SET RELATION.

DISPLAY STATUS and LIST STATUS also display relational expressions.

Parameters

<expN1>

<expN1> specifies which relation is returned.  For example, if <expN1> is 3, RELATION the relational expression for the third relation created.

<expN2> | <expC>

RELATION( ) by default returns relational expressions for the table in the selected work area.  To return relational expressions for a table open in another work area, include the work area number <expN> or the table alias <expC>.

If a table isn't open in the work area you specify, RELATION( ) returns the null string.


RELATION( ) Example

In the following example, tables are opened and orders set, then the relations are displayed using RELATION( ).

CLOSE DATABASES
USE salesman IN 0 ORDER ono
USE customer IN 0 ORDER ono
USE offices IN  0 ORDER ono
SELECT salesman
SET RELATION TO ono INTO customer
SET RELATION TO ono INTO offices ADDITIVE
? RELATION(1)	&& ONO
? RELATION(2)	&& ONO
? RELATION(3)	&& null string


RELATION SeeAlso
See Also

DISPLAY STATUS Command

LIST STATUS Command

SET RELATION Command

SET RELATION OFF Command

TARGET( ) Function


RELEASE Commands

See Also	Example

Releases memory variables and arrays, libraries, menus, menu pads, popups, popup options, user-defined or system windows from memory.

Syntax

RELEASE <memvar list>
or
RELEASE ALL
[LIKE <skel> | EXCEPT <skel>]
or
RELEASE LIBRARY <library name>
or
RELEASE MENUS
[<menu list> [EXTENDED]]
or
RELEASE PAD <pad name> OF <menu name> | ALL OF <menu name>
or
RELEASE POPUPS
[<popup list> [EXTENDED]]
or
RELEASE BAR <expN> OF <popup name>| ALL OF <popup name>
or
RELEASE WINDOWS
[<window list>]

Remarks

This makes the previously allocated memory available.  System memory variables cannot be released from memory.

You can also use RELEASE to remove menu pads from the FoxPro system menu bar and options from the FoxPro system menus.

Commands

RELEASE <memvar list>

RELEASE <memvar list> releases memory variables and arrays whose names are contained in the <memvar list> from memory.  Separate the memory variables and arrays with commas.

RELEASE ALL

[LIKE <skel> | EXCEPT <skel>]

Use RELEASE ALL to release all private memory variables and arrays, release all private memory variables and arrays that match the specified skeleton or release all private memory variables and arrays EXCEPT those that match the specified skeleton.  The skeleton <skel> can include the wildcard characters ? and *.

Only private memory variables and arrays at the current and lower program execution levels are released.

Tip   RELEASE ALL, RELEASE ALL LIKE or RELEASE ALL EXCEPT do not release public variables when issued in a program.  Use RELEASE <memvar list> to release public variables.

RELEASE LIBRARY <library name>

In FoxPro for MS-DOS and FoxPro for Windows,RELEASE LIBRARY removes a single external API routine library (written in C or assembly language) from memory.  Issue SET LIBRARY TO to remove all API libraries from memory.  An external API routine library is loaded into memory with SET LIBRARY.  For more information on API routine libraries, see SET LIBRARY.

RELEASE MENUS

[<menu list> [EXTENDED]]

RELEASE MENUS releases specified user-defined menu bars from memory.  An active menu must first be deactivated with DEACTIVATE MENU before it can be released from memory.  The menus removed from memory are specified in the <menu list>.  If RELEASE MENUS is issued without a menu list, all user-defined menus are removed from memory.

Include the EXTENDED key word to release a menu bar and all its subordinate pads, popups, bars and all associated ON SELECTION BAR, ON SELECTION MENU, ON SELECTION PAD, and ON SELECTION POPUPs.

RELEASE PAD <pad name> OF <menu name> | ALL OF <menu name>

RELEASE PAD removes a specified pad or all pads from a menu bar.  You can selectively remove a pad from a user-defined menu bar or the FoxPro system menu bar by specifying its name in <pad name>.  For example, the command RELEASE PAD _MEDIT OF _MSYSMENU removes the Edit pad and its menu from the system menu bar.

Every pad in a user-defined menu bar is removed if you specify ALL.  ALL cannot be used to remove pads from the system menu bar.

RELEASE POPUPS

[<popup list> [EXTENDED]]

RELEASE POPUPS releases specified or all user-defined popups from memory.  An active popup must be deactivated with DEACTIVATE POPUP before it can be released from memory.

Include the names of popups in <popup list> to specify the popups to release.  If RELEASE POPUPS is issued without a <popup list>, all user-defined popups are removed from memory.

System menu popups that appear under the system menu bar can also be released.  To release a system menu popup, include the name of the system menu popup (_MFILE, _MEDIT, _MDATA, and so on).  Use SET SYSMENU TO DEFAULT to restore the default system menu bar and system menu popups.

Include EXTENDED to release a popup and its subordinate popups, bars and all associated ON SELECTION POPUP and ON SELECTION BAR commands.

RELEASE BAR <expN> OF <popup name> | ALL OF <popup name>

RELEASE BAR removes a specified option or all options from a popup.  You can selectively remove an option from a user-defined popup by specifying its option number <expN>.  To remove an option from a system menu (Edit, File, Database, and so on), include the system option name in <expN>.

Every option in a user-defined popup is removed if you include ALL.  ALL cannot be used to remove options from a FoxPro system menu popup.

RELEASE WINDOWS [<window list>] | SCREENRELEASE WINDOWS removes the windows whose names are contained in the <window list> from memory.  <window list> can include both user-defined windows and FoxPro system windows.

The active user-defined window is released if a window list isn't included.

FoxPro desk accessories and system windows can be removed from the desktop, main FoxPro window or a user-defined window with RELEASE WINDOW.

The following two tables list desk accessories and system windows that can be released from the screen or a parent window with RELEASE WINDOW:

Desk Accessories

Filer

Calculator

CALENDAR/Diary

SPECIAL Characters [image] supported in FoxPro for MS-DOS only

ASCII Chart [image] supported in FoxPro for MS-DOS only

Puzzle

System Windows

Command

Debug

Trace

View

When releasing desk accessories that have two parts to their name (CALENDAR/Diary, SPECIAL Characters and the ASCII Chart), use just the first part of the name (shown here in upper case).  For example, use RELEASE WINDOW CALENDAR to release the CALENDAR/Diary.  Use ACTIVATE WINDOW to place a desk accessory or a system window on the desktop, main FoxPro window or in a user-defined window.

The SCREEN option is available in FoxPro for Macintosh only.

Include SCREEN to hide the main FoxPro window. You can also click the main FoxPro window close box to hide it.

To display the main FoxPro again, choose the Screen menu option from the Window menu or issue ACTIVATE WINDOW SCREEN or SHOW WINDOW SCREEN.


RELEASE Example

These commands remove the Window pad from the system menu bar and the Sum option of the Database menu.

PUSH MENU _MSYSMENU

*** Remove a pad from the system menu bar ***

RELEASE PAD _MSM_WINDO OF _MSYSMENU

*** Remove an option from System menus ***

RELEASE BAR _MDA_SUM OF _MDATA
POP MENU _MSYSMENU


RELEASE SeeAlso
See Also

CLEAR MEMORY Command

DEACTIVATE POPUP Command

DEFINE BAR Command

DEFINE MENU Command

DEFINE PAD Command

DEFINE POPUP Command

DEFINE WINDOW Command

SET LIBRARY Command

SYS(2013) Function - System Menu Name String


RELEASE MODULE Command

See Also

Removes a binary file from memory.

Syntax

RELEASE MODULE <file>

Remarks

In FoxPro for MS-DOS and FoxPro for Windows, binary files are placed in memory with LOAD and are executed with CALL.  Up to 16 binary files can be placed in memory at one time.

In FoxPro for Macintosh, external commands and external functions are placed in memory with SET XCMDFILE and LOAD.

Use RELEASE MODULE to remove a single binary file, external command or external function from memory.

Clause

<file>

<file> specifies the name of the binary file to clear.


RELEASE MODULE SeeAlso
See Also

CALL Command

LOAD Command


RENAME Command

See Also

Renames a file.

Syntax

RENAME <file1> TO <file2>

Remarks

Use RENAME to change the name of a file, <file1>, to a new name, <file2>.

Include the file extensions for both files.  If the file extensions are not included, the default extension .DBF is assumed.  Include a period (.) after the file name to rename a file that doesn't have an extension.

Include paths with the file names if the files are not on the default drive and directory. If <file1> and <file2> are in different directories, <file1> is moved into the directory of <file2>.

RENAME requires that <file2> doesn't already exist and <file1> must exist but cannot be open.


RENAME SeeAlso
See Also

COPY FILE Command

COPY TO Command

FILER Command


REPLACE Command

See Also	Example

Updates table records.

Syntax

REPLACE <field1> WITH <expr1>
[ADDITIVE]
[, <field2> WITH <expr2>
[ADDITIVE]] ...
[<scope>]
[FOR <expL1>]
[WHILE <expL2>]
[NOOPTIMIZE]

Remarks

REPLACE replaces data in a field with the value in an expression.  Fields in unselected work areas must be prefaced with their alias.

Important   No replacement occurs if the record pointer is at the end of the file in the current work area and you specify a field in another work area.

Clauses

<field1> WITH <expr1>

[, <field2> WITH <expr2> ...

The data in <field1> is replaced with the value of the expression <expr1>, the data in <field2> is replaced with the value of the expression <expr2> and so on.

When the  expression value is longer than the width of a numeric field, REPLACE forces the value to fit:

1	First, decimal places are truncated and the remaining decimal portion of the field is rounded.

2	If the value still doesn't fit, the field contents are stored in scientific notation.

3	If the value still doesn't fit, asterisks replace the field contents.

ADDITIVE

The ADDITIVE clause applies to replacements in memo fields only.  If ADDITIVE is included, replacements to memo fields are appended to the end of the memo fields.  If ADDITIVE is not included, the memo field is overwritten with the value of the expression.

<scope>

The scope clauses are:  ALL, NEXT <expN>, RECORD <expN>, and REST.  These are explained in the Overview of the FoxPro Language chapter in the FoxPro Language Reference.  Commands which include <scope> operate only on the table in the active work area.

You can specify a scope of records to replace.  Only the records that fall within the range of records specified by the scope are replaced.

The default scope for REPLACE is the current record (NEXT 1).

FOR <expL1>

If the FOR clause is included, the specified fields are replaced only in records for which <expL1> evaluates to true.  Including FOR lets you conditionally replace records, filtering out undesired records.

Rushmore optimizes REPLACE FOR if <expL1> is an optimizable expression.  For best performance, use an optimizable expression in the FOR clause.  A discussion of Rushmore optimization appears in the Optimizing Your Application chapter in the FoxPro Developer's Guide.

WHILE <expL2>

If the WHILE clause is included, fields in records are replaced for as long as the logical expression <expL2> evaluates to true (.T.).

NOOPTIMIZE

To prevent Rushmore optimization of REPLACE, include NOOPTIMIZE.  For more information, see SET OPTIMIZE or the discussion of Rushmore optimization in the Optimizing Your Application chapter in the FoxPro Developer's Guide.


REPLACE Example

The following example creates a temporary table, defines and activates a data input window, and replaces the fields of a blank record in the temporary table with information entered in the input window.

CLOSE DATABASES
USE customer
COPY NEXT 1 TO temp
USE TEMP
SET TALK OFF
SCATTER MEMVAR BLANK
DEFINE WINDOW menter FROM 7,10 to 17,70 PANEL
ACTIVATE WINDOW menter
@ 1,3  SAY 'Company: ' GET m.company
@ 3,3  SAY 'Address: ' GET m.address
@ 5,3  SAY 'City: ' GET m.city
@ 7,3  SAY 'State: ' GET m.state
@ 7,18 SAY 'Zip: ' GET m.zip
READ
DEACTIVATE WINDOW menter
RELEASE WINDOW menter
IF UPDATED( )
APPEND BLANK
REPLACE company 	WITH m.company
REPLACE address	WITH m.address
REPLACE city	WITH m.city
REPLACE state	WITH m.state
REPLACE zip	WITH m.zip
BROWSE
ENDIF
CLOSE DATABASES
ERASE temp.dbf


REPLACE SeeAlso
See Also

GATHER Command

INSERT Command - SQL

REPLACE FROM ARRAY Command

SCATTER Command


REPLACE FROM ARRAY Command

See Also

Updates table records from a memory variable array.

Syntax

REPLACE FROM ARRAY <array>
[FIELDS <field list> | FIELDS LIKE <skel> | FIELDS EXCEPT <skel>]
[<scope>]
[FOR <expL1>]
[WHILE <expL2>]
[NOOPTIMIZE]

Remarks

REPLACE FROM ARRAY replaces data in fields with values from a memory variable array. Memo and general fields are ignored in REPLACE FROM ARRAY; use GATHER and APPEND GENERAL to import data into these fields.

Starting with the first element, the elements of the array replace the corresponding fields of the record.  The contents of the first array element replaces the first field of the record, the contents of the second array element replaces the second field and so on.

If the array has fewer elements than the table has fields, the additional fields are ignored.  If the array has more elements than the table has fields, the additional array elements are ignored.

Note   If the record pointer is at the end of the file in the current work area and you specify a field in another work area, no replacement occurs.

Clauses

FIELDS <field list>

If you include the FIELDS clause, only the fields specified in <field list> are replaced by the contents of the array. Fields in unselected work areas must be prefaced with their aliases.

FIELDS LIKE <skel> | FIELDS EXCEPT <skel>

You can selectively replace the contents of fields from an array by including the LIKE or EXCEPT clause or both. If you include LIKE <skel>, FoxPro replaces the contents of the fields that match <skel>. If you include EXCEPT <skel>, FoxPro replaces the contents of all fields except those that match <skel>.

The skeleton <skel> supports wildcard characters.  For example, to replace the contents of fields that begin with the letters A and P, use:

REPLACE FROM ARRAY myarray FIELDS LIKE A*,P*

The LIKE clause can be combined with the EXCEPT clause:

REPLACE FROM ARRAY myarray FIELDS LIKE A*,P* EXCEPT PARTNO*

<scope>

The scope clauses are:  ALL, NEXT <expN>, RECORD <expN>, and REST.  These are explained in the Overview of the FoxPro Language chapter in the FoxPro Language Reference.  Commands which include <scope> operate only on the table in the active work area.

You can specify a scope of records to replace with the contents of the array.  Only the records that fall within the range of records specified by the scope are replaced. Replacement occurs until the end of the scope or the array is reached.

The default scope for REPLACE FROM ARRAY is the current record (NEXT 1).

FOR <expL1>

If the FOR clause is included, the fields are replaced only in records for which <expL1> evaluates to true.  Including FOR lets you conditionally replace records, filtering out records you don't want. Replacement occurs in each record for which <expL1> is true or until the end of the array is reached.

Rushmore optimizes REPLACE FROM ARRAY FOR if <expL1> is an optimizable expression.  For best performance, use an optimizable expression in the FOR clause.  A discussion of Rushmore optimization appears in the Optimizing Your Application chapter in the FoxPro Developer's Guide and in the Rushmore Technology help topic.

WHILE <expL2>

If the WHILE clause is included, fields in records are replaced by the contents of the array for as long as the logical expression <expL2> evaluates to true (.T.).

NOOPTIMIZE

To prevent Rushmore optimization of REPLACE FROM ARRAY, include NOOPTIMIZE.  For more information, see SET OPTIMIZE or the discussion of Rushmore optimization in the Optimizing Your Application chapter in the FoxPro Developer's Guide.


REPLACE FROM ARRAY SeeAlso
See Also

APPEND FROM ARRAY Command

APPEND GENERAL

COPY TO ARRAY Command

GATHER Command

REPLACE Command

SCATTER Command

SET OPTIMIZE

Rushmore Technology


REPLICATE( ) Function

See Also	Example

Returns a character string that contains a specified character expression repeated a specified number of times.

Syntax

REPLICATE(<expC>, <expN>)

Returns

Character

Remarks

The maximum length of the resulting character string cannot exceed 64,000 characters in the Standard version of FoxPro for MS-DOS.  In the 32-bit Extended version of FoxPro for MS-DOS and in FoxPro for Windows and FoxPro for Macintosh, the maximum length of the resulting character string is restricted by the amount of available memory.

Parameters

<expC>

The character expression that is replicated is specified in <expC>.

<expN>

The character expression is replicated <expN> times.


REPLICATE( ) Example

? REPLICATE('HELLO ',5)

@ 2,05,12,59 BOX REPLICATE(CHR(177),9)


REPLICATE() SeeAlso
See Also

SPACE( ) Function


REPORT Command

See Also

Produces a report.

Syntax

REPORT
[FORM <file> | ?]
[ENVIRONMENT]
[<scope>]
[FOR <expL1>]
[WHILE <expL2>]
[HEADING <expC>]
[NOEJECT]
[NOCONSOLE]
[NOOPTIMIZE]
[PDSETUP]
[PLAIN]
[PREVIEW]
[TO PRINTER [PROMPT] | TO FILE <file>]
[SUMMARY]

Remarks

REPORT displays or prints reports under the control of a report definition file created with MODIFY REPORT or CREATE REPORT.

The default extension for a report definition file is .FRX.  If the report definition file is on a drive other than the default drive or directory, the path must also be included with the file name.

If REPORT is issued without any additional arguments, the Open dialog appears, displaying a list of existing report files to choose from.

Clauses

FORM <file1>

You can specify which report to print by including the name of a report definition file in <file>.

?

If you include ? the Open dialog appears, displaying a list of existing report files to choose from.

ENVIRONMENT

When you create or modify reports, you can save the current FoxPro environment with the report definition file.  Saving the FoxPro environment places an additional record in the report definition table.  This record contains the names of all open tables and index files, the index order and any relationships between the tables.

Include ENVIRONMENT to restore the environment saved in the report definition file.

<scope>

The scope clauses are:  ALL, NEXT <expN>, RECORD <expN>, and REST.  These are explained in the Overview of the FoxPro Language chapter in the FoxPro Language Reference.  Commands which include <scope> operate only on the table in the active work area.

You can specify a scope of records included in the report.  Only the records that fall within the range of records specified by the scope are included in the report.

The default scope for REPORT is ALL records.

FOR <expL1>

If the FOR clause is included, data in only those records for which  <expL1> evaluates to true (.T.) are printed.  Including FOR lets you conditionally print data in records, filtering out undesired records.

Rushmore optimizes REPORT FOR if <expL1> is an optimizable expression.  For best performance, use an optimizable expression in the FOR clause.  A discussion of Rushmore optimization appears in the Optimizing Your Application chapter in the FoxPro Developer's Guide.

WHILE <expL2>

If the WHILE clause is included, record data is printed for as long as the logical expression <expL2> evaluates to true (.T.).

HEADING <expC>

Include HEADING to specify text for an additional heading to be placed on each page of the report.  <expC> is the text.  The PLAIN option takes precedence if both HEADING and PLAIN are included.

NOEJECT

NOEJECT suppresses a form feed to the printer prior to printing the report.

NOEJECT is ignored in FoxPro for Windows and FoxPro for Macintosh.

NOCONSOLE

Include NOCONSOLE to suppress the echoing of a report to the desktop in FoxPro for MS-DOS, the main FoxPro window or a user-defined window when a report is being printed or sent to a file.

NOOPTIMIZE

To prevent Rushmore optimization, include NOOPTIMIZE.  For more information, see SET OPTIMIZE or the discussion of Rushmore optimization in the Optimizing Your Application chapter in the FoxPro Developer's Guide.

PDSETUP [image] FoxPro for MS-DOS only

In FoxPro for MS-DOS, when you create a report definition with the FoxPro Report Writer, you can specify a printer driver setup that determines the printed appearance of your report.  If you save the environment with the report definition, the printer driver setup is also saved.  If you include the PDSETUP key word when printing reports, the printer driver setup is loaded and used when the reports are printed.

PLAIN

If PLAIN is included, a page heading appears only at the beginning of the report.

PREVIEW

Include PREVIEW to display the report in page preview mode.  If PREVIEW is included, the report is displayed in a page preview window and isn't sent to the printer.  To print a report you must issue REPORT without the PREVIEW option.

Note that system memory variables are ignored when PREVIEW is included.

TO PRINTER [PROMPT] | TO FILE <file>

Include TO PRINTER to send a report to the printer.

In FoxPro for Windows and FoxPro for Macintosh, you can include the optional PROMPT clause to display a dialog before printing starts. In this dialog you can adjust printer settings, including the number of copies and page numbers to print. The printer settings that you can adjust depend on the currently installed printer driver. Place the PROMPT key word immediately after TO PRINTER.  PROMPT is ignored in FoxPro for MS-DOS.

Include TO FILE to send character-based reports created in FoxPro for MS-DOS to the text file specified with <file2>.  The file created when you include TO FILE has the default extension .TXT.

SUMMARY

SUMMARY suppresses detail line printing.  Only totals and subtotals are printed.


REPORT SeeAlso
See Also

CREATE REPORT Command

MODIFY REPORT Command


RESTORE FROM Command

See Also	Example

Restores memory variables and arrays from a file or a memo field.

Syntax

RESTORE FROM <file> | FROM MEMO <memo field>
[ADDITIVE]

Remarks

RESTORE FROM retrieves memory variables and memory variable arrays saved in a memory variable file or a memo field and places them into memory.

All the memory variables and arrays are restored as PRIVATE when RESTORE FROM is issued in a program.  Memory variables and arrays are restored as PUBLIC if RESTORE is issued in the Command window.

When RESTORE FROM is issued, any memory variables or arrays currently in memory are erased unless the ADDITIVE key word is included.  System memory variables are not affected by RESTORE FROM.

Clauses

<file>

Restores memory variables and arrays from the specified memory variable <file>.  Memory variable files are assigned a .MEM extension.

MEMO <memo field>

Restores memory variables and arrays from the memo field specified in <memo field>.

ADDITIVE

Include the ADDITIVE key word to prevent any memory variables or arrays currently in memory from being erased.  If the number of memory variables or arrays being added with the ADDITIVE key word plus the number of existing memory variables exceeds the memory variable limit, as many memory variables and arrays as possible are brought into memory from the memory variable file or memo field.

If you restore a memory variable that has the same name as an existing memory variable, the value in the existing memory variable is changed to the value of the restored memory variable.


RESTORE FROM Example

In the following example, two memory variables are created.  They are saved to a memory variable file and restored without clearing the existing memory variables.

val1 = 50
val2 = 'Hello'
SAVE TO temp
CLEAR MEMORY
val3 = DATE( )
RESTORE FROM temp ADDITIVE
DISPLAY MEMORY LIKE val?


RESTORE FROM SeeAlso
See Also

DIMENSION Command

PUBLIC Command

PRIVATE Command

RELEASE Commands

SAVE TO Command

STORE Command


RESTORE MACROS Command

See Also

Restores keyboard macros to memory from a file or a memo field.

Syntax

RESTORE MACROS
[FROM <file> | FROM MEMO <memo field>]

Remarks

Use RESTORE MACRO to retrieve a set of keyboard macros that were saved in a keyboard macro file or a memo field.

You can define and save a series of keystrokes in memory as a keyboard macro.  When you quit FoxPro, the macros you create are lost unless you use SAVE MACROS to store them to a macro file or a memo field.  In FoxPro for MS-DOS you can also interactively save macros to a file by choosing Macros ...  from the System menu and then choosing Save.  In FoxPro for Windows and FoxPro for Macintosh, choose Macros... from the Program menu and then choose Save.

In FoxPro for MS-DOS, macros can be restored from a file by choosing Macros ...  from the System menu and then choosing Restore.  In FoxPro for Windows and FoxPro for Macintosh, choose Macros ...  from the Program menu and then choose Restore to restore macros from a file.

By default, restoring macros from a file or memo field is additive [image] the restored macros are appended to the existing set of macros in memory.  If a macro name in the file or memo field is the same as an existing macro name, the macro in the file or memo field overwrites the existing macro.

Issuing RESTORE MACROS without a file name or memo field name clears all macros from memory and restores the default macros.  The default macros are restored from the keyboard macro file named DEFAULT.FKY.  The F2 through F9 keys are restored to the standard FoxPro startup settings if DEFAULT.FKY cannot be found.

Refer to the FoxPro User's Guide for more information on keyboard macros.

Clauses

FROM <file>

Specifies the macro file that macros are to be restored from.  Macro files have an .FKY extension.

FROM MEMO <memo field>

Specifies the memo field that macros are restored from.


RESTORE MACROS SeeAlso
See Also

CLEAR Commands

PLAY MACRO Command

SAVE MACROS Command


RESTORE SCREEN Command

See Also

Restores a desktop or screen.

Syntax

RESTORE SCREEN
[FROM <memvar>]

Remarks

RESTORE SCREEN restores a previously saved desktop (FoxPro for MS-DOS), main FoxPro window or user-defined window from the screen buffer, a memory variable or an array element.  Use SAVE SCREEN to place the current main FoxPro window or active user-defined window in the screen buffer, a memory variable or an array element.

Memory variables or array elements that have screen or window images as their values appear with a data type of S when you issue DISPLAY or LIST MEMORY.  The main FoxPro window or user-defined windows saved to memory variables or array elements can also be saved to and restored from memory variable files with SAVE TO and RESTORE FROM.

Clause

FROM <memvar>

Specifies the name of a memory variable or memory variable array element from which a screen is restored.  The main FoxPro window or user-defined window is restored from the screen buffer if you omit the FROM clause.


RESTORE SCREEN SeeAlso
See Also

RESTORE FROM Command

SAVE SCREEN Command

SAVE TO Command


RESTORE WINDOW Command

See Also	Example

Restores window definitions to memory from a window file or a memo field.

Syntax

RESTORE WINDOW <window list> | ALL
FROM <file> | FROM MEMO <memo field>

Remarks

Use SAVE WINDOW to store window definitions in a window file or a memo field.

Any windows in memory with the same names as those restored are overwritten.  A window's status (hidden, active, and so on) when it is saved is preserved when it is restored.

Clauses

<window list>

Comma-delimited list of windows to be restored.

ALL

Restores all window definitions in the window file or memo field.

FROM <file>

<file> is the window file to restore the windows from.  A window file has a .WIN extension.

FROM MEMO <memo field>

<memo field> is the memo field to restore the windows from.


RESTORE WINDOW Example

In the following example, a window named OUTPUT is defined and saved to a memory variable.  All windows are cleared and the window named OUTPUT is restored and activated.

CLEAR
DEFINE WINDOW output FROM 2,1 TO 13,75 TITLE 'Output' ;
CLOSE FLOAT GROW SHADOW ZOOM
SAVE WINDOW output TO temp
CLEAR WINDOWS
RESTORE WINDOW output FROM temp
ACTIVATE WINDOW output
WAIT "The window Output has been restored" WINDOW
RELEASE WINDOW output


RESTORE WINDOW SeeAlso
See Also

ACTIVATE WINDOW Command

DEFINE WINDOW Command

SAVE WINDOWS Command


RESUME Command

See Also

Continues execution of a suspended program.

Syntax

RESUME

Remarks

Use SUSPEND to suspend program execution.  The suspended program restarts at the line where execution was suspended.

SUSPEND and RESUMEs are valuable debugging tools.  The current status of the FoxPro environment, including memory variables, window, menu bar or popup definitions, can be examined when a program is suspended.

Important   To prevent commands executed when a program is suspended from interfering with subsequent program output, issue CLEAR to clear the desktop (FoxPro for MS-DOS), the main FoxPro window or the active user-defined window before you resume program execution.


RESUME SeeAlso
See Also

CANCEL Command

CLEAR Commands

RETURN Command

SUSPEND Command


RETRY Command

See Also	Example

Re-executes the previous command.

Syntax

RETRY

Remarks

RETRY returns control to the calling program and re-executes the last line executed in the program.  RETRY is similar to RETURN except RETURN executes the next line in the calling program.

RETRY is useful in error-handling routines.  RETRY is frequently used to re-execute a command until a record- or file-locking function succeeds in locking the record or file.  SET REPROCESS can also be used to control retries of a record- or file-locking function.  SET REPROCESS is preferable in most network situations.


RETRY Example

In the following example, records from the CUSTOMER table are printed.  If an error occurs, the PROCEDURE named STOP is executed.  STOP displays a message to check the printer and the program retries the command that caused the error.

CLOSE DATABASES
SET ESCAPE ON
SET TALK OFF
USE customer
CLEAR
ON ERROR DO stop
SET DEVICE TO PRINTER
SCAN
@ PROW( )+1,10 SAY 'Company: ' + company
ENDSCAN
SET DEVICE TO SCREEN
ON ERROR

PROCEDURE stop
IF ERROR( ) = 125
WAIT WINDOW 'Please check your printer'
SET DEVICE TO PRINTER
RETRY
ENDIF
RETURN


RETRY SeeAlso
See Also

ON ERROR Command

RETURN Command

SET REPROCESS Command


RETURN Command

See Also	Example

Returns program control to a calling program.

Syntax

RETURN
[<expr> | TO MASTER | TO <program name>]

Remarks

RETURN terminates execution of a program, procedure or function.  Control is returned to the calling program, the highest level calling program, another program or the Command window.

PRIVATE memory variables are released when RETURN is executed.

RETURN is usually placed at the end of a program, procedure or function to return control to a higher-level program.  However, an implicit RETURN is executed if RETURN is omitted.

Clauses

<expr>

RETURN can be followed by an expression <expr> that is returned to the calling program.  True (.T.) is automatically returned to the calling program if RETURN or the return expression is omitted.

TO MASTER

TO MASTER returns control to the highest level calling program.  If the Run menu pad is present on the FoxPro system menu bar because FOXSTART.APP was executed on startup, RETURN TO MASTER returns control to FOXSTART.APP.

TO <program name>

Include the  TO <program name> clause to return control to the program specified with <program name>.


RETURN Example

In the following example, the function LONGDATE returns a character string that is suitable for printing from a date.

SET CENTURY ON
? longdate({08/19/92})

FUNCTION longdate
PARAMETER mdate
RETURN CDOW(mdate) + ', ' + MDY(mdate)


RETURN SeeAlso
See Also

DO Command

FUNCTION Command

PARAMETERS Command

PARAMETERS( ) Function

PRIVATE Command

PROCEDURE Command

PUBLIC Command

User-Defined Functions (UDFs)


RIGHT( ) Function

See Also	Example

Returns the specified number of rightmost characters from a character string.

Syntax

RIGHT(<expC>, <expN>)

Returns

Character

Remarks

Characters are returned beginning with the last character on the right and continuing for a specified number of characters.

Parameters

<expC>

Rightmost characters are returned from the character expression specified in <expC>.

<expN>

The number of characters returned from the character expression is specified by <expN>.  All of the character expression is returned if <expN> is greater than the length of <expC>.  The null string is returned if <expN> is negative or 0.


RIGHT( ) Example

? RIGHT('Redmond, WA', 2)


RIGHT() SeeAlso
See Also

AT( ) Function

LEFT( ) Function

LTRIM( ) Function

RAT( ) Function

RTRIM( ) Function

SUBSTR( ) Function

TRIM( ) Function


RLOCK( ) Function

See Also	Example

Attempts to lock a table record or records.

Syntax

RLOCK([<expN> | <expC1>] | [<expC2>, <expN> | <expC1>])

Returns

Logical

Remarks

RLOCK( ) is identical to LOCK( ).

If the lock or locks are successfully placed, RLOCK( ) returns true (.T.).  Locked records are available for both read and write access by the user who placed the locks and are available for read-only access to all other users on the network.

Executing RLOCK( ) doesn't guarantee that the attempted record lock or locks are successfully placed.  A record lock cannot be placed on a record already locked by another user or in a table locked by another user.  If the record lock or locks cannot be placed for any reason, RLOCK( ) returns false (.F.).

By default, RLOCK( ) makes one attempt to lock a record.  Use SET REPROCESS to automatically retry a record lock when the first attempt fails.  SET REPROCESS controls the number of lock attempts or the length of time lock attempts are made when the initial lock attempt is unsuccessful.  For more information about SET REPROCESS and table locking, see SET REPROCESS.

SET MULTILOCKS determines if you can lock multiple records in a table.  If MULTILOCKS is OFF (the default), you can only lock a single record in a table.  Multiple records in a table can be locked when MULTILOCKS is ON.  For more information, see SET MULTILOCKS.

Parameters

<expN> | <expC1>

If you don't specify a work area or alias, RLOCK( ) attempts to lock the current record in the table in the currently selected work area.

To attempt a record lock on the current record in a table open in another work area, include the work area number <expN> or the table alias <expC1>.

<expC2>

You must include <expC2> to attempt to lock multiple records.  MULTILOCKS must be ON and you must include the work area or alias of the table in which you attempt multiple record locks.

<expC2> is a list of one or more record numbers.  RLOCK( ) attempts to lock all of these records.  The record numbers in <expC2> are separated by commas.  For example, to attempt record locks on the first 4 records in a table, <expC2> will contain 1,2,3,4.

You can also lock multiple records by moving the record pointer to the record you would like to lock, issuing RLOCK( ) or LOCK( ) and then repeating this process for additional records.

If all the records specified in <expC2> are successfully locked, RLOCK( ) returns true (.T.).  If one or more of the records specified in <expC2> cannot be locked, RLOCK( ) returns false (.F.) and none of the records are locked.  In either case, existing record locks remain in place.  Multiple record locking is an additive process [image] placing additional record locks doesn't release existing record locks.

From a performance perspective, it is always faster to lock the entire table rather than to lock even a small number of records.

Unlocking Records

A table record can only be unlocked by the user who placed the lock.  Record locks can be released by issuing UNLOCK, closing the table or exiting FoxPro.

UNLOCK can be used to release record locks in the current work area, a specific work area or in all work areas.  For more information, see UNLOCK.

Toggling MULTILOCKS from ON to OFF or from OFF to ON implicitly performs UNLOCK ALL.  All record locks in all work areas are released.

Tables can be closed with USE, CLEAR ALL or CLOSE DATABASES.

For more information about record and file locking and sharing tables on a network, see the FoxPro in a Multi-User Environment chapter in the FoxPro Developer's Guide.


RLOCK( ) Example

The following example locks and unlocks the first four records of CUSTOMER.DBF and OFFICES.DBF.

SET MULTILOCKS ON
SET REPROCESS TO AUTOMATIC
STORE '1,2,3,4' TO mreclist
CLOSE DATA
SELECT 0
USE customer
SELECT 0
USE offices

? LOCK('1,2,3,4', 'customer')	&& Lock the 1st 4 records in customer
? RLOCK(mreclist, 'offices')	&& Lock the 1st 4 records in offices

UNLOCK IN customer
UNLOCK IN offices
SET MULTILOCKS OFF
SET REPROCESS TO 0


RLOCK() SeeAlso
See Also

CLEAR Commands

CLOSE Commands

FLOCK( ) Function

LOCK( ) Function

SET MULTILOCKS Command

SET RELATION Command

SET REPROCESS Command

UNLOCK Command

USE Command


ROUND( ) Function

See Also	Example

Return a numeric expression rounded to a specified number of decimal places.

Syntax

ROUND(<expN1>, <expN2>)

Returns

Numeric

Remarks

The value returned by ROUND( ) has the same number of decimal places as <expN2>.  The number of decimal places specified by SET DECIMALS is ignored.

Parameters

<expN1>

<expN1> is the numeric expression whose value is to be rounded.

<expN2>

<expN2> is the number of decimal places to round <expN1> to.

If <expN2> is negative, ROUND( ) returns a whole number containing <expN2> zeros to the left of the decimal point.  For example, if <expN2> is -2 the first and second digits to the left of the decimal point in the value are zero.


ROUND( ) Example

SET DECIMALS TO 4
SET FIXED ON	&& fix decimal display
? ROUND(1234.1962, 3)
? ROUND(1234.1962, 2)
? ROUND(1234.1962, 0)
? ROUND(1234.1962, -1)
? ROUND(1234.1962, -2)
? ROUND(1234.1962, -3)
SET FIXED OFF	&& restore defaults
SET DECIMALS TO 2


ROUND() SeeAlso
See Also

INT( ) Function

SET DECIMALS Command


ROW( ) Function

See Also	Example

Returns the current row position of the cursor.

Syntax

ROW( )

Returns

Numeric

Remarks

ROW( ) is especially useful for directing screen output to a position relative to the current row position of the cursor.

The special operator $ can be used in place of the ROW( ) function.


ROW( ) Example

@ 5,5 SAY ' '
@ ROW( ) + 6, COL( ) SAY 'Contact person'
@ $ + 6, COL( ) SAY 'Contact person'


ROW() SeeAlso
See Also

COL( ) Function

PCOL( ) Function

PROW( ) Function

WCOLS( ) Function

WROWS( ) Function


RTOD( ) Function

See Also	Example

Converts a numeric expression that represents radians to an equivalent value in degrees.

Syntax

RTOD(<expN>)

Returns

Numeric

Remarks

RTOD( ) is useful when working with FoxPro trigonometric functions such as COS( ), SIN( ), TAN( ) and so on.  Use DTOR( ) to convert degrees to radians.

Parameter

<expN>

<expN> is the numeric expression representing radians to be converted to degrees.


RTOD( ) Example

? RTOD(ACOS(0))

STORE -1 to arcangle
? RTOD(ACOS(arcangle))

? RTOD(ACOS(SQRT(2)/2))


RTOD() SeeAlso
See Also

COS( ) Function

DTOR( ) Function

SIN( ) Function

TAN( ) Function


RTRIM( ) Function

See Also	Example

Returns the specified character expression with all trailing blanks removed.

Syntax

RTRIM(<expC>)

Returns

Character

Remarks

RTRIM( ) returns a character string that results from removing the trailing blanks from a character expression.  RTRIM( ) is identical to TRIM( ).

Parameter

<expC>

Include the character expression <expC> to trim the trailing blanks from.


RTRIM( ) Example

CLOSE DATABASES
SELECT 0
USE customer
GOTO 3
? 'The contact for '+ RTRIM(company) + ' is ' + contact


RTRIM() SeeAlso
See Also

ALLTRIM( ) Function

LTRIM( ) Function

TRIM( ) Function


RUN | ! Commands

See Also	Example

Executes external operating commands or programs.

Syntax

RUN [/N [K]] <MS-DOS command | program name>
or
! [/N [K]] <MS-DOS command | program name>

Remarks

RUN is available in FoxPro for MS-DOS and FoxPro for Windows. It is ignored in FoxPro for Macintosh.

RUN can be issued from within the Command window or from a program.

Important   To use RUN under MS-DOS, the operating system file COMMAND.COM must be in the current directory or otherwise locatable by the MS-DOS COMSPEC parameter.  See your MS-DOS manual for more information on SET COMSPEC.

Do not RUN disk reorganization programs like CHKDSK from within FoxPro.  They modify the contents of your disk in a manner that can confuse FoxPro.

RUN and FoxPro for MS-DOS

FoxPro includes FoxSwap, a memory manager utility.  FoxSwap is used to make more memory available for RUN.

The RUN command options /N or /NK specify the amount of memory FoxPro makes available for running external programs.  N is a numeric value that specifies the amount of memory in kilobytes (K) that is made available to the RUN command.  Do not include the letter N when specifying how much memory to make available.

Specifying N = 0 uses FoxSwap to its fullest extent.  As much memory as possible is made available to the RUN command.

If a value greater than 0 is specified for N, FoxPro does the following:

Buffers are flushed to disk.

If N kilobytes of memory are available to RUN, RUN is invoked.  If N kilobytes of memory are not available, FoxSwap is invoked.

For example, you can issue the following commands to make 120 kilobytes of memory available to run an external text editor called MYEDITOR:

RUN /120 MYEDITOR
! /120K MYEDITOR.

Although you can run larger external programs with FoxSwap, it takes additional time to executed FoxSwap.

Tip   Determine the amount of memory required to run an external program.  Do not specify more than is needed.  If enough memory is available, FoxSwap isn't used and the RUN command executes faster.

RUN and FoxPro for Windows

When RUN is used to run programs outside of FoxPro for Windows, it searches for programs in a slightly different manner than FoxPro for MS-DOS.

If the program you specify in RUN doesn't have an extension, FoxPro for Windows first looks along the MS-DOS path for a PIF (Program Information File) with the name you specify.  If the PIF is found, the program specified in the PIF is executed with the PIF parameters.  If a PIF isn't found, the DOS path is then searched for an executable file with the name you specify.

When a PIF isn't found, FoxPro for Windows uses FOXRUN.PIF, a PIF installed in the FoxPro for Windows directory.  FOXRUN.PIF is configured to run the program in a window.  You can modify FOXRUN.PIF to run programs in another configuration.

A PIF lets you run a non-Windows program under Windows.  You can specify parameters for the program, whether the program is run in a window or full screen, the amount of memory allocated for the program and so on.

FOXRUN.PIF

FOXRUN.PIF allows you to execute MS-DOS and Windows programs and commands from within FoxPro for Windows by including one of the following commands in the Command window or in a program:

! [/N [<expN>]] <program name or command>
RUN [/N [<expN>]] <program name or command>

FOXRUN.PIF must be in the same directory as FOXPROW.EXE.

In FoxPro for MS-DOS /N and /NK specifies a numeric value for the amount of memory reserved for running external program.  In FoxPro for Windows /N means NOWAIT.  In FoxPro for Windows include the letter N (do not replace N with a numeric value and do not include K) to execute another Windows-based application.  For example, the following opens the Windows character map accessory:

! /N CHARMAP.EXE

This example opens the Windows color picker from the Windows Control Panel:

! /N CONTROL COLOR

A Windows-based application executed with RUN /N or ! /N behaves the same way the application does when you open it through the Program Manager or the File Manager.  You can switch between the application and FoxPro for Windows with the standard Windows operations.

You can include an optional numeric value immediately after /N to specify how the window application is opened.  Do not include any spaces between /N and the numeric value.  The following table lists the values for <expN> and how the Windows-based application is opened:

<expN1>	Application Attributes
1	Active and normal size
2	Active and minimized
3	Active and maximized
4	Inactivate and normal size
7	Inactivate and minimized
Running MS-DOS Programs in FoxPro for Windows

By default, FOXRUN.PIF runs the specified external MS-DOS program in a window.  While the MS-DOS program or command is running, the title of the window is FoxPro Run Command.  After the external program or command is finished executing, the window title changes to Inactive FoxPro Run Command.  The FoxPro menu system is disabled until this window is closed.

You can use the Windows PIF editor to customize FOXRUN.PIF.  You can edit the PIF to close the window automatically by checking Close Window on Exit, open external programs in a full screen by checking Full Screen, allocate memory for the program and so on.

Memory Considerations

By default, FOXRUN.PIF allocates a minimum of 256K of memory for running an external command or program.  If you do not have 256K of free conventional memory, FoxPro displays an error message.  To correct this:

Close applications and files to free up additional memory.

Edit FOXRUN.PIF to reduce the amount of memory required in the KB Required text box.

If the external command requires more than 256K, MS-DOS displays an "Insufficient memory" error in the FoxPro Run Command window.  To correct this, edit your FOXRUN.PIF to increase the amount of memory required in the KB Required text box.


RUN | ! Example

In FoxPro for MS-DOS and FoxPro for Windows, this example saves the current today to a memory variable.  Then the operating system date is changed by running the MS-DOS DATE command. The current date is then restored to the operating system by running the MS-DOS DATE command again with the contents of the memory variable.

STORE DTOC(DATE( )) TO today	&& save today's date
! DATE 01/01/90
? DATE( )
RUN DATE &today	&& restore today's date
? DATE( )


RUN | ! SeeAlso
See Also

GETENV( )

RUNSCRIPT


RUNSCRIPT Command

See Also

Executes an AppleScript® in FoxPro for Macintosh.

Syntax

RUNSCRIPT <script name> [TO <memvar>]

Remarks

RUNSCRIPT is used in FoxPro for Macintosh to execute an AppleScript. An AppleScript is a compiled series of Apple events that executes through the Apple Event Manager. Other Macintosh applications can use AppleScripts to access FoxPro for Macintosh if they generate the Apple events that FoxPro for Macintosh supports. Apple events and AppleScripts require System 7 or greater.

To execute an AppleScript with RUNSCRIPT, include the name of the AppleScript in <script name>.

If the AppleScript you execute with RUNSCRIPT contains an error, the error message "Script error" is returned along with additional information about where the error occurred in the AppleScript. If AppleScript support has not been installed on your Macintosh, the error message "RUNSCRIPT command failed" is returned.

For additional information about executing AppleScripts, see the FoxPro Installation and Macintosh Features Guide.

Clause

TO <memvar>

An AppleScript can return a value to a memory variable or an array element when you include the TO <memvar> clause. If you specify a memory variable that does not exist, FoxPro automatically creates it. If you specify an array element that does not exist, an "Invalid subscript reference" error message is generated.


RUNSCRIPT SeeAlso
See Also

RUN


SAVE MACROS Command

See Also	Example

Saves a set of keyboard macros to a keyboard macro file or to a memo field.

Syntax

SAVE MACROS TO <file name> | TO MEMO <memo field>

Remarks

You can save a series of keystrokes in memory as a keyboard macro.  When you quit FoxPro, the macros you create are lost unless you use SAVE MACROS to store them to a keyboard macro file or a memo field.

In FoxPro for MS-DOS, you can also save a macro to a file by choosing Macros ...  from the System menu and then choosing Save.  In FoxPro for Windows and FoxPro for Macintosh, choose Macros... from the Program menu, and then choose Save to save a macro to a file.

For more information about creating, saving and restoring keyboard macros, see the "Macros" section in the FoxPro User's Guide.

Clauses

TO <file name>

Specify the file you want to save the macros to with <file name>.  Keyboard macro file names must begin with a letter or an underscore and can contain any combination of a maximum of eight letters, numbers and underscores.  A macro file cannot begin with a number.  The keyboard macro file is assigned an .FKY extension.  If you assign an extension other than .FKY, you must include that extension in RESTORE MACROS.

TO MEMO <memo field>

Saves the macros to the memo field specified in <memo field>.  The table containing the memo field must be open.  However, it does not have to be in the selected work area.  To save macros to a table in another work area, include the table's alias when referencing the memo field.  If you use a table with multiple records, be sure the record pointer is positioned on the correct record before saving the macros.


SAVE MACROS Example

The following example saves the current set of macros to a file called MYMACROS.FKY.

SAVE MACROS TO mymacros


SAVE MACROS SeeAlso
See Also

CLEAR Commands

PLAY MACRO Command

RESTORE MACROS Command


SAVE SCREEN Command

See Also

Saves an image of the main FoxPro window or the active window to the screen buffer, a memory variable or an array element.

Syntax

SAVE SCREEN
[TO <memvar>]

Remarks

An image stored to the screen buffer with SAVE SCREEN can be redisplayed with RESTORE SCREEN.

Use RESTORE SCREEN to redisplay images saved to a memory variable or an array element.  Memory variables or array elements containing stored screen or window images have an S data type when you view the variables or array elements with DISPLAY or LIST MEMORY.

Clause

TO <memvar>

<memvar> is the memory variable or array element you want to store the screen or window image to.  If you omit this clause, the image is saved to the screen buffer.


SAVE SCREEN SeeAlso
See Also

RESTORE FROM Command

RESTORE SCREEN Command

SAVE TO Command


SAVE TO Command

See Also	Example

Stores current memory variables and memory variable arrays to a memory variable file or a memo field.

Syntax

SAVE TO <file> | TO MEMO <memo field>
[ALL LIKE <skel> | ALL EXCEPT <skel>]

Remarks

Use RESTORE FROM to load memory variables and memory variable arrays back into memory from a file or a memo field.

Clauses

TO <file>

Specify the memory variable file to save memory variables to with <file>.  The default extension for a memory variable file is .MEM.

TO MEMO <memo field>

Specify the memo field to save memory variables to with <memo field>.

ALL LIKE <skel>

Include the ALL LIKE clause to save all memory variables and arrays that match the skeleton <skel>.  The skeleton can contain the wildcard characters ? and *.

ALL EXCEPT <skel>

Include the ALL EXCEPT clause to save all memory variables and arrays except those that match the skeleton <skel>.  The skeleton can contain the wildcard characters ? and *.


SAVE TO Example

val1 = 50
val2 = 'Hello'
SAVE TO temp
CLEAR MEMORY
val3 = DATE( )
RESTORE FROM temp ADDITIVE
DISPLAY MEMORY LIKE val?


SAVE TO SeeAlso
See Also

PRIVATE Command

PUBLIC Command

RELEASE Command

RESTORE FROM Command


SAVE WINDOWS Command

See Also	Example

Saves all or specified window definitions and window statuses to a window file or a memo field.

Syntax

SAVE WINDOWS <window list> | ALL
TO <file> | TO MEMO <memo field>

Remarks

Window definitions can later be restored from a window file or memo field with RESTORE WINDOW.  For example, if a window is hidden when it is saved to a file or memo field, it remains hidden when it is restored.

Clauses

<window list>

Specify one or more windows to be saved with <window list>.  Separate the window names with commas.

ALL

Include ALL to save all window definitions.

TO <file>

Specify the window file to save the window definitions to with <file>.

If you don't specify an extension when naming the file, the default extension of .WIN is assigned.  If you specify another extension when you save the window definitions to a file, you must include the extension when you restore the window definitions from the file.

TO MEMO <memo field>

Saves the window definitions to the memo field specified in <memo field>.  The table containing the memo field must be open.  However, it does not have to be in the selected work area.  To save window definitions to a table in another work area, include the table's alias when referencing the memo field.  If you use a table with multiple records, be sure the record pointer is positioned on the correct record before saving the window definitions.


SAVE WINDOWS Example

In this example, a window named Output is created, and the window definition is saved to the file TEMP.WIN.  All windows are cleared and the Output window is restored from the file and activated.

CLEAR
DEFINE WINDOW output FROM 2,1 TO 13,75 TITLE 'Output' ;
CLOSE FLOAT GROW SHADOW ZOOM
ACTIVATE WINDOW output

@ 1,1 SAY 'This is the contents of the window'

SAVE WINDOWS output TO temp
CLEAR WINDOWS

WAIT WINDOW 'The window has been saved - Press a key'

RESTORE WINDOW output FROM temp
ACTIVATE WINDOW output
WAIT WINDOW 'The window has been restored - Press a key'
DEACTIVATE WINDOW output
RELEASE WINDOW output

DELETE FILE temp.win


SAVE WINDOWS SeeAlso
See Also

DEFINE WINDOW Command

RESTORE SCREEN Command

RESTORE WINDOW Command

SAVE SCREEN Command


SCAN ... ENDSCAN Command

See Also

Moves the record pointer through the current table and executes a block of commands for each record that meets the specified conditions.

Syntax

SCAN
[NOOPTIMIZE]
[<scope>]
[FOR <expL1>]
[WHILE <expL2>]
[<statements>]
[LOOP]
[EXIT]
ENDSCAN

Remarks

SCAN automatically advances the record pointer to the next record that meets the specified conditions and executes the block of commands.

You can place comments after ENDSCAN on the same line.  The comments are ignored during program compilation and execution.

Clauses

NOOPTIMIZE

To disable Rushmore optimization of SCAN, include NOOPTIMIZE.  For more information, see SET OPTIMIZE or the discussion of Rushmore optimization in the Optimizing Your Application chapter in the FoxPro Developer's Guide.

<scope>

The scope clauses are: ALL, NEXT <expN>, RECORD <expN>, and REST.  These are explained in the Overview of the FoxPro Language chapter in the FoxPro Language Reference.  Commands which include <scope> operate only on the table in the selected work area.

You can specify a scope of records that are scanned.  Only the records that fall within the range of records specified by the scope are scanned.

The default scope for SCAN is ALL records.

FOR <expL1>

Including the FOR clause lets you filter out undesired records.  If the FOR clause is included, the commands are executed for all records within the scope for which <expL1> is true.

Rushmore optimizes a query created with SCAN ... FOR if <expL1> is an optimizable expression.  For best performance, use an optimizable expression in the FOR clause.  A discussion of Rushmore optimizable expressions appears in the Optimizing Your Application chapter in the FoxPro Developer's Guide.

WHILE <expL2>

If the WHILE clause is included, the commands are executed as long as <expL2> remains true.

<statements>

Specify the FoxPro commands to be executed with <statements>.

LOOP

LOOP returns control directly back to SCAN and can be placed anywhere between SCAN and ENDSCAN.

EXIT

EXIT transfers control outside the SCAN ... ENDSCAN loop to the first command immediately following ENDSCAN.


SCAN ... ENDSCAN SeeAlso
See Also

DO CASE ... ENDCASE Command

DO WHILE ... ENDDO Command

FOR ... ENDFOR Command


SCATTER Command

See Also	Example

Copies data from the current record to an array or a set of memory variables.

Syntax

SCATTER
[FIELDS <field list> | FIELDS LIKE <skel> | FIELDS EXCEPT <skel>]
[MEMO]
TO <array> | TO <array> BLANK | MEMVAR | MEMVAR BLANK

Remarks

SCATTER automatically creates the memory variables or arrays if they don't already exist.

Use GATHER to copy memory variables or array elements to table records.

Clauses

FIELDS <field list>

Only the fields contained in the field list you specify with <field list> are transferred to the memory variables or the array.  All fields are transferred if you omit FIELDS <field list>.  The field list can contain memo fields if you include the MEMO key word.  General and picture fields are always ignored in SCATTER, even if the MEMO keyword is included.

FIELDS LIKE <skel> | FIELDS EXCEPT <skel>

You can selectively transfer fields to memory variables or an array by including the LIKE or EXCEPT clause or both. If you include LIKE <skel>, fields that match <skel> are transferred to the memory variables or the array. If you include EXCEPT <skel>, all fields except those that match <skel> are transferred to the memory variables or the array.

The skeleton <skel> supports wildcard characters.  For example, to transfer all fields that begin with the letters A and P to the memory variables or the array, use:

SCATTER FIELDS LIKE A*,P* TO myarray

The LIKE clause can be combined with the EXCEPT clause:

SCATTER FIELDS LIKE A*,P* EXCEPT PARTNO* TO myarray

MEMO

By default, memo fields are ignored in SCATTER.  Include the MEMO key word if you include a memo field or fields in the field list.

You must have sufficient memory to scatter large memo fields to memory variables or an array.  The message "Insufficient memory" is displayed if you lack sufficient memory.  If a memo field is too large to fit in memory, neither it nor any additional memo fields in the field list are scattered.  If a memo field isn't scattered, its memory variable or array element is set to false (.F.).

TO <array>

The contents of the fields in the record are copied into each element of the array specified with <array> in sequential order starting with the first field.

Extra array elements are left unchanged if the array has more elements than the number of fields.  A new array is automatically created if the array doesn't already exist or if it has fewer elements than the number of fields.  The array elements have the same data types as the corresponding fields.

TO <array> BLANK

An array is created with empty elements if BLANK is included.  The elements are the same size and type as the fields in the table.

MEMVAR

MEMVAR scatters the data to a set of memory variables instead of to an array.  One memory variable is created for each field in the table.  Each memory variable is filled with data from the corresponding field in the current record and is assigned the same name, type and size as its field.

A memory variable is created for each field in the field list if a field list is included.

Preface the memory variable name with the M. qualifier to reference a memory variable that has the same name as a field in the current table.

Important   Don't include TO with MEMVAR.  An array named MEMVAR is created if TO is included.

MEMVAR BLANK

A set of empty memory variables is created if MEMVAR BLANK is included.  Each memory variable is assigned the same name, data type and size as its field.  If a field list is included, a memory variable is created for each field in the field list.


SCATTER Example

This program uses SCATTER to copy the data in the current record to a set of memory variables.  The data is displayed in a window for editing and then copied back to the current record using GATHER (unless Esc is pressed).

SET TALK OFF
USE salesman
COPY TO temp
USE temp
SCATTER MEMVAR MEMO	&& save old values
DEFINE WINDOW menter FROM 5,10 to 20,70 PANEL
ACTIVATE WINDOW menter
@ 1,3   SAY 'Name: ' 	 GET m.name
@ 3,3   SAY 'Address: '  GET m.address
@ 5,3   SAY 'City: '     GET m.city
@ 7,3   SAY 'State: '    GET m.state
@ 7,18  SAY 'Zip: '      GET m.zip
@ 9,13  SAY 'Notes:'
@ 9,23 EDIT m.notes SIZE 3,26
@ 13,13 SAY 'Press Esc to discard changes'
READ

IF LASTKEY( ) != 27
GATHER MEMVAR	&& save changes
WAIT WINDOW 'Changes saved' NOWAIT
ELSE	&& no GATHER
WAIT WINDOW 'Changes not saved' NOWAIT
ENDIF
DEACTIVATE WINDOW menter
BROWSE
USE


SCATTER SeeAlso
See Also

APPEND FROM ARRAY Command

COPY TO ARRAY Command

DECLARE Command

DIMENSION Command

GATHER Command

REPLACE FROM ARRAY Command


SCHEME( ) Function

See Also	Example

Returns a color pair or a color pair list from a specified color scheme.

Syntax

SCHEME(<expN1>[, <expN2>])

Returns

Character

Parameters

<expN1>

<expN1> is the number of the color scheme for which you want a complete color listing.  10 color pairs are returned.

<expN2>

Include <expN2> to return a single color pair from a color scheme.  The position of the color pair in the color scheme is specified with <expN2>.  For example, if <expN2> is 4, the fourth color pair is returned.


SCHEME( ) Example

The following command returns the third color pair from color scheme number 4:

? SCHEME(4,3)


SCHEME() SeeAlso
See Also

SET COLOR Commands Overview


SCOLS( ) Function

See Also

Returns the number of columns available in the main FoxPro window.

Syntax

SCOLS( )

Returns

Numeric

Remarks

In FoxPro for MS-DOS and FoxPro for Windows, the value returned by SCOLS( ) depends on the current display mode.  Display modes can be changed with SET DISPLAY.

In FoxPro for Macintosh, the value returned by SCOLS( ) depends on the MACDESKTOP setting and the current screen font. If MACDESKTOP is set to ON, SCOLS( ) returns the number of columns for the Macintosh desktop. If MACDESKTOP is set to OFF, SCOLS( ) returns the number of columns for the FoxPro for Macintosh desktop. The screen font can be changed with the MODIFY WINDOW command, or in the Font dialog. To change the screen font from the Font dialog, hold down the Shift key and choose the Text menu, then choose the Screen Font option.


SCOLS() SeeAlso
See Also

COL( )

ROW( )

SET DISPLAY

SET MACDESKTOP

SROWS( )

WCOLS( )

WROWS( )


SCROLL Command
SCROLL

See Also	Example

Scrolls an area of the main FoxPro window or a user-defined window up, down, left, or right.

Syntax

SCROLL <row1, column1>, <row2, column2>, <expN1>
[, <expN2>]

Clauses

<row1, column1>, <row2, column2>

Scrolling occurs in a rectangular region of the desktop, the main FoxPro window or the active user-defined window.  The upper-left corner of the region is specified with <row1, column1>, and the lower-right corner is specified with <row2, column2>.

<expN1>

The numeric expression <expN1> specifies how many rows the area inside the rectangular region is scrolled up or down.  The area is scrolled upward <expN1> rows if <expN1> is positive.  The area is scrolled downward <expN1> rows if <expN1> is negative.  The area is cleared if <expN1> is 0 and <expN2> is omitted.

<expN2>

The numeric expression <expN2> specifies how many columns left or right the area inside the rectangular region is scrolled. The area is scrolled to the right <expN2> columns if <expN2> is positive.  The area is scrolled to the left <expN2> columns if <expN2> is negative.  The area can be scrolled diagonally if both <expN1> and <expN2> are included.


Scroll Example

The following command scrolls a small rectangular region.

CLEAR
@ 4, 1 FILL TO 10, 8 COLOR GR+/B
WAIT WINDOW 'Press key to scroll off left top corner'
SCROLL 0, 0, 5, 5, -2, 1


SCROLL SeeAlso
See Also

MOVE WINDOW Command


SECONDS( ) Function

See Also	Example

Returns the number of seconds that have elapsed since midnight.

Syntax

SECONDS( )

Returns

Numeric

Remarks

The numeric value is returned with a resolution of 1 millisecond, in the format seconds.thousandths of a second.


SECONDS( ) Example

? SECONDS( )

? SECONDS( )/(60 * 60)


SECONDS SeeAlso
See Also

SYS(2) Function - Seconds Since Midnight

TIME( ) Function


SEEK Command

See Also	Example

SEEK searches the current indexed table for the first occurrence of a record whose index key expression matches a general expression.

Syntax

SEEK <expr>

Remarks

You can use SEEK only with indexed tables, and you can search only on the index key expression.  The match must be exact unless SET EXACT is OFF.

If SEEK finds a matching record, RECNO( ) returns the record number of the matching record, FOUND( ) returns true (.T.) and EOF( ) returns false (.F.).

If no match is found, RECNO( ) returns the number of records in the table plus 1, FOUND( ) returns false (.F.) and EOF( ) returns true (.T.).

The record pointer is positioned immediately after the closest matching record if SET NEAR is ON.  The record pointer is positioned at the end of the file if SET NEAR is OFF.  In either case, RECNO(0) returns the record number of the closest record.

Clause

<expr>

Specify the index key expression you want SEEK to search for with <expr>.


SEEK Example

In this example, CUSTOMER.DBF is opened and indexed on the COMPANY field.  SEEK is used to find the index key expression that matches the value contained in the memory variable MVAL.

CLOSE DATABASES
USE customer
INDEX ON UPPER(company) TAG Company
SET EXACT OFF
STORE 'AZ INC' TO mseekval
SEEK mseekval
IF FOUND( )
DISPLAY FIELDS company, contact
ENDIF


SEEK SeeAlso
See Also

EOF( ) Function

FOUND( ) Function

INDEX Command

LOCATE Command

RECNO( ) Function

SEEK( ) Function

SET EXACT Command

SET NEAR Command


SEEK( ) Function

See Also	Example

Searches the current indexed table and returns a value that indicates whether the search is successful.

Syntax

SEEK(<expr>[, <expN> | <expC>])

Returns

Logical

Remarks

SEEK( ) searches the current indexed table for the first occurrence of a record whose index key expression matches a specified expression.  If a match is found, true (.T.) is returned and the record pointer is moved to the matching record.  If a match isn't found, false (.F.) is returned and the record pointer is positioned at the end of the file.  Issuing SEEK( ) is equivalent to issuing both SEEK and FOUND( ).

Note   The table you search must be indexed.

Parameters

<expr>

The index key expression to search for is specified with <expr>.

<expN> | <expC>

SEEK( ) searches for a matching record in the table in the current work area.  To search for a matching record in a table open in another work area, specify the work area number with <expN> or the table or work area alias with <expC>.


SEEK( ) Example

USE customer ORDER ono
? SEEK('2')


SEEK() SeeAlso
See Also

EOF( ) Function

FOUND( ) Function

LOCATE Command

SEEK Command


SELECT Command

See Also	Example

Activates the specified work area.

Syntax

SELECT <expN> | <expC>

Clauses

<expN> | <expC>

By default, work area number 1 is active when FoxPro is started.  You can specify a different work area with <expN>.  The lowest-numbered unused work area is selected if <expN> is 0.

When a table is opened in a work area, you can select the table's work area by specifying the table's alias with <expC>.

Table/DBF Fields

Fields in tables in any work area can be included in FoxPro commands and functions.  Use the following formats to access fields in a table open in a work area other than the current work area:

<alias>.<field>

or

<alias> -> <field>


SELECT Example

The following example demonstrates ways of selecting work areas.

CLOSE DATABASES
SELECT 1	&& Work area 1
USE customer
SELECT 2	&& Work area 2
USE invoices
SELECT customer	&& Work area 1
BROWSE
SELECT B	&& Work area 2
BROWSE


SELECT SeeAlso
See Also

ALIAS( ) Function

SELECT( ) Function

USE Command


SELECT( ) Function

See Also

Returns the number of the current work area or the unused work area with the highest number.

Syntax

SELECT([0 | 1 | <expC>])

Returns

Numeric

Remarks

SELECT( ) returns the number of the current work area if SET COMPATIBLE is OFF.  If SET COMPATIBLE is ON, SELECT( ) returns the number of the unused work area with the highest number.

A work area can be selected (activated) with SELECT.

Parameters

0 | 1

The number of the current work area is returned if you include 0 in SELECT( ).  The number of the unused work area with the highest number is returned if you include 1.

<expC>

SELECT( ) returns the work area number of the table whose alias you specify with <expC>. If a table doesn't have the alias you specify, 0 is returned.


SELECT() SeeAlso
See Also

ALIAS( ) Function

SELECT Command

SET COMPATIBLE Command


SELECT Command - SQL
SELECT Command [image] SQL

See Also	Example

Retrieves data from one or more tables.

Syntax

SELECT
[ALL | DISTINCT]
[<alias>.]<select_item>
[AS <column_name>]
[, [<alias>.]<select_item>
[AS <column_name>] ...]
FROM <table>
[<local_alias>]
[, <table> [<local_alias>] ...]
[[INTO <destination>] |
[TO FILE <file> [ADDITIVE] | TO PRINTER [PROMPT] | TO SCREEN]]
[PREFERENCE <name>]
[NOCONSOLE]
[PLAIN]
[NOWAIT]
[WHERE <joincondition> [AND <joincondition> ...]
[AND | OR <filtercondition> [AND | OR <filtercondition> ...]]]
[GROUP BY <groupcolumn>[, <groupcolumn> ...]]
[HAVING <filtercondition>]
[UNION [ALL] <SELECT command>]
[ORDER BY <order_item> [ASC | DESC] [, <order_item> [ASC | DESC] ...]]

Remarks

When you use SELECT to pose a query, FoxPro interprets the query and retrieves the specified data from the tables.  The SQL command SELECT is built into FoxPro like any other FoxPro command.  You can create a SELECT query:

In the Command window

In a FoxPro program (like any other FoxPro command)

In the RQBE window

When you issue SET TALK ON and execute SELECT, FoxPro displays the query time and the number of records in the results.  _TALLY stores the number of records in the query results.

Clauses

[ALL | DISTINCT]

The SELECT clause specifies the fields, constants and expressions that will be displayed in the query results.

By default, all of the rows (ALL) in the query results are displayed.  Include DISTINCT to exclude duplicates of any rows from the query results.

Note   You can use DISTINCT only once per SELECT clause.

[<alias>.]<select_item>

[AS <column_name>]
[, [<alias>.]<select_item>
[AS <column_name>] ...]

<select_item> can be one of the following:

The name of a field from a table in the FROM clause

A constant specifying that the same constant value is to appear in every row of the query results

An expression that can be the name of a user-defined function (UDF)

Each item you specify with <select_item> generates one column of the query results.  If more than one item has the same name, be sure to qualify the matching names by including the table alias and a period before the item name.

Important   Although using  UDFs in the SELECT clause has obvious benefits, you should also consider the following restrictions:

The speed of operations performed with SELECT may be limited by the speed at which such UDFs are executed.  High-volume manipulations involving UDFs may better be accomplished by using API and UDFs written in C or assembly language.

You can assume nothing about the FoxPro input/output (I/O) or table environment in UDFs invoked from SELECT.  In general, you don't know which work area is selected, the name of the current table or even the names of the fields being processed.  The value of these variables depend on precisely where in the optimization process the UDF is invoked.

It isn't safe to change the FoxPro I/O or table environment in UDFs invoked from SELECT.  In general, the results are unpredictable.

The only reliable way to pass values to UDFs invoked from SELECT is by the argument list passed to the function when it is invoked.

If you experiment and discover a supposedly forbidden manipulation that works correctly in a certain version of FoxPro, there is no guarantee that it will continue to work in later versions.

Apart from these restrictions, feel free to use UDFs.  However, don't forget the effect of using SELECT on performance.

The following field functions are available for use with a select item that is a field or an expression involving a field:

AVG(<select_item>) [image] Averages a column of numeric data.

COUNT(<select_item>) [image] Counts the number of select items in a column.  COUNT(*) counts the number of rows in the query output.

MIN(<select_item>) [image] Determines the smallest value of <select_item> in a column.

MAX(<select_item>) [image] Determines the largest value of <select_item> in a column.

SUM(<select_item>) [image] Totals a column of numeric data.

You cannot nest field functions.

The optional AS <column_name> clause specifies the heading for a column in the query output.  This is useful when <select_item> is an expression or contains a field function and you want to give the column a meaningful name.  <column_name> can be an expression but cannot contain characters (for example, spaces) that aren't permitted in table field names.

FROM <table>
[<local_alias>]
[, <table> [<local_alias>] ...  ]

The FROM clause lists the tables that contain the data to be retrieved by the query.  If no table is open in a work area in the current directory or the FoxPro path, the Open dialog appears so you can specify the file location.

If a table in the query isn't open in a work area, it is opened and remains open in a work area once the query is complete.

<local_alias> is a temporary name for a table specified with <table>.  If you specify a local alias, you must use the local alias in place of the table name throughout SELECT.  The local alias doesn't affect the FoxPro environment.

Tip   If several tables have fields with the same name, which must be qualified, you may want to use a short local alias.

INTO <destination>

The INTO clause determines where the query results are stored.  If you include the INTO clause, no output display is produced.  This means that if you include an INTO clause and a TO clause in the same query, the TO clause is ignored.  If you don't include the INTO clause, query results are displayed in a Browse window.  Query results can also be directed to the printer or a file with the TO clause.

<destination> can be one of the following:

ARRAY <array> [image] Stores query results in a memory variable array named <array>.  The array isn't created if the query selects 0 records.

CURSOR <cursor> [image] Stores query results in a cursor named <cursor>.  If you specify the name of an open table, FoxPro closes the table and creates a cursor by that name without warning if SET SAFETY is OFF.  After SELECT is executed, the temporary cursor remains open and is active but is read-only.  Once you close this temporary cursor, it is deleted.  Cursors can exist as a temporary file on the SORTWORK drive.

DBF <table> | TABLE <table> [image] Stores query results in a table named <table>.  If you specify a table that is already open, FoxPro closes the table and reopens it without warning if SET SAFETY is OFF.  If you don't specify an extension, the table is given a .DBF extension.  The table remains open and active after SELECT is executed.

TO FILE <file> [ADDITIVE] | TO PRINTER [PROMPT] | TO SCREEN

If you include a TO clause but not an INTO clause, you can direct query results to an ASCII text file named <file> or to the printer in addition to the desktop or main FoxPro window.

If query results are directed to a text file, including ADDITIVE appends output to any existing contents of the file.

Include TO PRINTER to direct output from a query to a printer.

In FoxPro for Windows and FoxPro for Macintosh, you can include the optional PROMPT clause to display a dialog before printing starts. In this dialog you can adjust printer settings, including the number of copies and page numbers to print. The printer settings that you can adjust depend on the currently installed printer driver. Place the PROMPT key word immediately after TO PRINTER.  PROMPT is ignored in FoxPro for MS-DOS.

By default, query results are sent to a Browse window.  Include TO SCREEN to direct query results to the desktop (FoxPro for MS-DOS), the main FoxPro window or an active user-defined window.

When query results are output, columns are named according to the following rules:

If a select item is a field with a unique name, the output column name is the field's name.

If more than one select item has the same name (for example, CUST.ZIP and STATE.ZIP) output columns are named <extension>_A and <extension>_B (ZIP_A and ZIP_B).  For a select item with a 10-character name, the name is truncated to add the underscore and letter.

If a select item is an expression, its output column is named EXP_A.  Any other expressions are named EXP_B, EXP_C, and so on.

If a select item contains a field function such as COUNT( ), the output column is named CNT_A.  If another select item contains SUM( ), its output column is named SUM_B.

PREFERENCE <name>

If query results are sent to a Browse window, you can include PREFERENCE to save the Browse window's attributes and options for later use.  PREFERENCE saves the Browse window's attributes indefinitely in the FOXUSER resource file.  Preferences can be retrieved at any time.

Issuing SELECT with a PREFERENCE <name> for the first time creates the preference.  Issuing SELECT later with the same preference name restores the Browse window to that preference state.  When the Browse window is closed, the preference is updated.

If you exit a Browse window by pressing Ctrl+Q, any Browse window changes are not saved to the resource file.

NOCONSOLE

Including NOCONSOLE prevents the query results from being displayed on the desktop or main FoxPro window.  NOCONSOLE can be used whether or not a TO clause is present.  If an INTO clause is included, NOCONSOLE is ignored.

PLAIN

Including PLAIN prevents column headings from appearing in the query output displayed.  PLAIN can be used whether or not a TO clause is present.  If an INTO clause is included, PLAIN is ignored.

NOWAIT

When query results are directed to a Browse window in a program, including NOWAIT continues program execution after the Browse window is opened.  The program doesn't wait for the Browse window to be closed, but continues execution on the program line immediately following the SELECT statement.

When TO SCREEN is included to direct output to the main FoxPro window or a user-defined window, output pauses when the main FoxPro window is full of query results.  Press a key to see the next set of query results.  If NOWAIT is included, the query results are scrolled off the main FoxPro window or the user-defined window without pausing for a key press.  NOWAIT is ignored if included with the INTO clause.

WHERE <joincondition> [AND <joincondition> ...]
[AND | OR <filtercondition> [AND | OR <filtercondition> ...  ]]

WHERE is required to retrieve data from multiple tables.  It tells FoxPro to include only certain records in the query results.

<joincondition> specifies fields that link the tables in the FROM clause.  If you include more than one table in a query, you should specify a join condition for every table after the first.

Important

If you include two table in a query and don't specify a join condition, every record in the first table is joined with every record in the second table as long as the filter conditions are met.  Such a query can produce lengthy results.

Be careful when using functions (DELETED( ), RECNO( ), EOF( ), FOUND( ), RECCOUNT( ), and so on) that support an optional alias or work area in join conditions.  Including an alias or work area in these functions may yield unexpected results.  SELECT doesn't use your work areas; it performs the equivalent of USE ... AGAIN.  Single-table queries that use these functions without an optional alias or work area will return proper results.  However, multiple-table queries that use these functions [image] even without an optional alias or work area [image] may return unexpected results.

Use caution when joining tables with empty fields because FoxPro matches empty fields.  For example, if you join on CUSTOMER.ZIP and INVOICE.ZIP, and CUSTOMER contains 100 empty zip codes and INVOICE contains 400 empty zip codes, the query output contains 40,000 extra records resulting from the empty fields.  Use the EMPTY( ) function to eliminate empty records from the query output.

Multiple join conditions must be connected with the AND operator.  Each join condition has the following form:

<field1> <comparison> <field2>

<field1> is the name of a field from one table, <field2> is the name of a field from another table, and <comparison> is one of the following operators:

<comparison>

 =

< >, !=, #

= =

>

> =

<

< =

When you use the = operator with strings, it acts differently depending on the setting of SET ANSI.  When SET ANSI is OFF, FoxPro treats string comparisons in the manner with which Xbase users are familiar.  When SET ANSI is ON, string comparisons follow ANSI standards.

<filtercondition> specifies the criteria that records must meet to be included in the query results.  A query can include as many filter conditions as desired, connected with the AND or OR operator.  You can also use the NOT operator to reverse the value of a logical expression or use EMPTY( ) to check for an empty field.  <filtercondition> can take one of these forms:

Form: <field1> <comparison> <field2>

Example: customer.cust_id = payments.cust_id

Form: <field> <comparison> <expression>

Example: <payments.amount >= 1000

Form: <field> <comparison> ALL (<subquery>)

Example: taxrate < ALL ;
(SELECT taxrate FROM customer WHERE state = "WA")

When the filter condition includes ALL, the field must meet the comparison condition for all values generated by the subquery before its record is included in the query results.

Form: <field> <comparison> ANY | SOME (<subquery>)

Example: taxrate < ANY ;
(SELECT taxrate FROM customer WHERE state = "WA")

When the filter condition includes ANY or SOME, the field must meet the comparison condition for at least one of the values generated by the subquery.

Form: <field> [NOT] BETWEEN <start_range> AND <end_range>

Example: customer.taxrate BETWEEN 5.50 AND 6.00

This example checks to see if the values in the field are within a specified range of values.

Form: [NOT] EXISTS (<subquery>)

Example: EXISTS ;
(SELECT * FROM invoices WHERE customer.zip = invoices.zip)

This example checks to see if at least one row meets the criteria in the subquery.  When the filter condition includes EXISTS, the filter condition evaluates to true unless the subquery evaluates to the empty set.

Form: <field> [NOT] IN <value_set>

Example: customer.zip NOT IN ("98052","98072","98034")

When the filter condition includes IN, the field must contain one of the values before its record is included in the query results.

Form: <field> [NOT] IN (<subquery>)

Example: customer.cust_id IN ;
(SELECT tranfile.cust_id FROM tranfile WHERE tranfile.item="FoxPro")

Here, the field must contain one of the values returned by the subquery before its record is included in the query results.

Form: <field> [NOT] LIKE <expC>

Example: customer.state NOT LIKE "WA"

This filter condition searches for each field that matches <expC>.  You can use the wildcard characters % (percent sign) and _ (underscore) as part of <expC>.  The underscore represents a single unknown character in the string.

A subquery is SELECT within a SELECT and must be enclosed in parentheses.  You can have multiple subqueries at the same level (not nested) in the WHERE clause.  Subqueries can contain multiple join conditions.

GROUP BY <groupcolumn>[, <groupcolumn> ...]

Including the GROUP BY clause groups rows in the query based on values in one or more columns. <groupcolumn> can be the name of a regular table field, or a field that includes an SQL field function, or a numeric expression indicating the location of the column in the result table (the leftmost column number is 1).

HAVING <filtercondition>

If you include the HAVING clause, FoxPro will include groups in the query results as long as they meet the filter condition specified with <filtercondition>.  <filtercondition> cannot contain a subquery.

HAVING <filtercondition> should be used with GROUP BY to specify the criteria that groups must meet to be included in the query results.  HAVING can include as many filter conditions as desired, connected with the AND or OR operator.  You can also use NOT to reverse the value of a logical expression.

A HAVING clause without a GROUP BY clause acts like a WHERE clause.  You can use local aliases and field functions in the HAVING clause.  Use a WHERE clause for faster performance if your HAVING clause contains no field functions.

[UNION [ALL] <SELECT command>]

Include the UNION clause to combine the final results of one SELECT with the final results of another SELECT.  By default, UNION checks the combined results and eliminates duplicate rows.  Use the optional ALL key word to prevent UNION from eliminating duplicate rows from the combined results.

You can use parentheses to combine multiple UNION clauses.

UNION clauses follow these rules:

You cannot use UNION to combine subqueries.

Both SELECTs must output the same number of columns.

Each column in the query results of one SELECT must have the same data type and width as the corresponding column in the other SELECT.

Only the final SELECT can have an ORDER BY clause, which must refer to output columns by number.  If an ORDER BY clause is included, it affects the entire result.

You can also use the UNION clause to simulate an outer join.

When you join two tables in a query, only records with matching values in the joining fields are included in the output. If a record in the parent table doesn't have a corresponding record in the child table, the record in the parent table isn't included in the output. An outer join allows you to include all of the records in the parent table in the output, along with the matching records in the child table. To create an outer join in FoxPro, you need to use a nested SELECT command as in the following example:

SELECT customer.company, invoices.ino, invoices.itotal ;
FROM customer, invoices ;
WHERE customer.cno = invoices.cno ;
UNION ;

SELECT customer.company, 0, 0.00 ; && 0 and 0.00 are place holders
FROM customer ;
WHERE customer.cno NOT IN ;
(SELECT invoices.cno FROM invoices)

Note   Be sure to include the space immediately preceding each semicolon. Otherwise, you'll receive an error.

The section of the command before the UNION clause selects records from both tables that have matching values. The customer companies that do not have associated invoices are not included. The section of the command after the UNION clause selects records in the CUSTOMER table that do not have matching records in the INVOICES table.

In the second section of the command:

SELECT customer.company, 0, 0.00 ; && 0 and 0.00 are place holders
FROM customer ;
WHERE customer.cno NOT IN ;
(SELECT invoices.cno FROM invoices)

The SELECT statement within the parentheses is processed first. This statement results in a selection of all customer numbers in the INVOICES table.

The WHERE clause finds all customer numbers in the CUSTOMER table that are not in the INVOICES table. Since the first section of the command provided all companies that had a customer number in the INVOICES table, all companies in the customer table are now included in the query results.

Because the structures of tables included in a UNION must be identical, there are two place holders in the second SELECT statement to represent INVOICES.INO and INVOICES.ITOTAL from the first SELECT statement.

Note   The place holders must be the same type as the fields they represent. If the field is a date type, the place holder should be { / / }. If the field is a character field, the place holder should be " ".

ORDER BY <order_item> [ASC | DESC] [, <order_item> [ASC | DESC] ...]

ORDER BY sorts the query results based on the data in one or more columns.  Each order item must correspond to a column in the query results and can be one of the following:

A field in a FROM table that is also a select item in the main SELECT clause (not in a subquery).

A numeric expression indicating the location of the column in the result table. (The leftmost column is number 1.)

You can specify the optional DESC key word if you want your query results to appear in descending order according to the order item or items.  ASC specifies an ascending order for query results and is the default for ORDER BY.

Query results appear unordered if you don't specify an order with ORDER BY.


SELECT - SQL Examples
SELECT [image] SQL Examples

This example displays the names of all companies in the CUSTOMER.DBF (one field from one table).

SELECT customer.company ;
FROM customer

This example displays the contents of three fields from two tables and joins the two tables based on the CUST_ID field.  It uses local aliases for both tables.

SELECT a.company, b.idate, b.itotal ;
FROM customer a, invoices b ;
WHERE a.cno = b.cno

This example displays only records with unique data in the specified fields.

SELECT DISTINCT a.company, b.idate, b.itotal ;
FROM customer a, invoices b ;
WHERE a.cno = b.cno

This example displays STATE, ZIP and COMPANY fields in ascending order.

SELECT state, zip, company, cno;
FROM customer ;
ORDER BY state, zip, company

This example stores the contents of fields from two tables in a third table.

SELECT a.company, b.idate, b.itotal ;
FROM customer a, invoices b ;
WHERE a.cno = b.cno ;
INTO TABLE custinv.dbf
BROWSE
CLOSE DATA

This example displays only records with an invoice date earlier than 05/08/90.

SELECT a.company, b.idate, b.itotal ;
FROM customer a, invoices b ;
WHERE a.cno = b.cno ;
AND b.idate < {05/08/90}

This example displays the names of all companies from CUSTOMER.DBF with a zip code that matches a zip code in the INVOICES table.

SELECT company FROM customer a WHERE ;
EXISTS (SELECT * FROM offices b WHERE a.zip = b.zip)

This example displays all records from CUSTOMER.DBF having a company name that begins with an upper-case C and is an unknown length.

SELECT * FROM customer a WHERE a.company LIKE "C%"

This example displays all records from CUSTOMER.DBF having a state name that begins with an upper-case N and is followed by one unknown character.

SELECT * FROM customer a WHERE a.state LIKE "N_"

This example displays the names of all cities in CUSTOMER.DBF in upper-case and names the output column CityList.

SELECT UPPER(city) AS CityList FROM customer


SELECT - SQL SeeAlso
See Also

CREATE QUERY Command

CREATE TABLE Command- SQL

INSERT Command - SQL

MODIFY QUERY Command

SET ANSI Command

SET PATH Command

_TALLY System Memory Variable


SET Command

See Also

Opens the View window.

Syntax

SET

Remarks

The View window is one of the most useful FoxPro tools:  It provides an easy way to open tables, establish relations or set or change many FoxPro options.

For more information about the View window, see the FoxPro User's Guide.


SET SeeAlso
See Also

SET VIEW Command


SET ALTERNATE Commands

See Also

Directs screen or printer output created with ?, ??, DISPLAY or LIST to a text file.

Syntax

SET ALTERNATE ON | OFF
or
SET ALTERNATE TO
[<file> [ADDITIVE]]

Clauses

ON

Include ON to direct output to the text file.

OFF

Include OFF to disable output to the text file.  This is the default setting.

TO

[<file> [ADDITIVE]]

SET ALTERNATE TO <file> creates the text file, which is assigned the default extension .TXT unless you include a different extension with the file name.

The last file you created using SET ALTERNATE is closed if <file> is omitted.

Include ADDITIVE to append output to the end of the file specified with <file>.  If ADDITIVE is omitted, the contents of the file are overwritten.


SET ALTERNATE SeeAlso
See Also

CLOSE Command

SET PRINTER Commands


SET ANSI Command

See Also

SET ANSI determines how comparisons between strings of different lengths are made with the = operator in FoxPro SQL commands.

Syntax

SET ANSI ON | OFF

Remarks

SET ANSI determines whether the shorter of two strings is padded with blanks when a SQL string comparison is made.  SET ANSI has no effect on the == operator; the shorter string is always padded with blanks for the comparison when you use the == operator.

Clauses

ON

When SET ANSI is ON, the shorter string is padded with the number of blanks needed to equal the length of the longer string.  The two strings are then compared character for character for the entire length of the strings.  Consider this comparison:

'Tommy' = 'Tom'

The result is false (.F.) if SET ANSI is ON because when padded, 'Tom' becomes 'Tom  ' and the strings 'Tom  ' and  'Tommy' don't match character for character.

The == operator uses this method for comparisons in FoxPro SQL commands.

OFF

When SET ANSI is OFF, the shorter string isn't padded with blanks.  The two strings are compared character for character until the end of the shorter string is reached.  Consider this comparison:

'Tommy' = 'Tom'

The result is true (.T.) when SET ANSI is OFF because the comparison stops after 'Tom'.

SET ANSI and RQBE

FoxPro builds an SQL SELECT command in the RQBE window when you create a query.  When creating join and filter conditions, if you choose the Like or Exactly Like options, the = or == operator is included in the generated SELECT.  The ANSI setting can affect the results of queries you create and perform in the RQBE window.

String Order

In SQL commands, the left-to-right order of the two strings in a comparison is irrelevant [image] switching a string from one side of the = or == operator to the other doesn't affect the result of the comparison.


SET ANSI SeeAlso
See Also

CREATE QUERY

MODIFY QUERY

SELECT - SQL

SET EXACT


SET APLABOUT Command

See Also	Example

Manipulates the About... menu option in the Apple menu.

Syntax

SET APLABOUT DISABLE | ENABLE | PROMPT [<expC>]

Remarks

Use SET APLABOUT to manipulate the About... menu option in the Apple menu. SET APLABOUT, when used with ON APLABOUT, can be used to display a custom dialog for your application.

Clauses

DISABLE

Issue SET APLABOUT DISABLE to disable the About... menu option. The About... menu option remains in the Apple menu, but it cannot be chosen and appears in disabled colors.

ENABLE

Issue SET APLABOUT ENABLE to enable the About... menu option when it has been disabled with SET APLABOUT DISABLE.

PROMPT [<expC>]

Use the PROMPT option with <expC> to specify the text that appears in the About... menu option. Issue SET APLABOUT PROMPT without <expC> to restore the default "About Microsoft FoxPro..." text to the About... menu option.


SET APLABOUT Example

This example replaces the About Microsoft FoxPro... menu option in the Apple menu with an option for a sample application. When you choose this option, the WAIT command in ON APLABOUT is executed and a window appears.

SET APLABOUT PROMPT 'About My Application...'
ON APLABOUT WAIT WINDOW 'This is My Application'


SET APLABOUT SeeAlso
See Also

ON APLABOUT

ON MACHELP

SET MACHELP


SET AUTOSAVE Command
SET AUTOSAVE

See Also

SET AUTOSAVE determines whether or not FoxPro flushes data buffers to disk when you exit a READ or return to the Command window.

Syntax

SET AUTOSAVE ON | OFF

Remarks

Flushing buffers may reduce the chance of data loss if your computer loses power.

Clauses

ON

Buffers are flushed to disk whenever you exit a READ or return to the Command window when SET AUTOSAVE is ON.

OFF

When SET AUTOSAVE is OFF, buffers are flushed only if five minutes have elapsed since the last flush occurred, and only when a READ is exited or you return to the Command window.

The default for SET AUTOSAVE is OFF.


SET AUTOSAVE SeeAlso
See Also

FFLUSH( ) Function

FLUSH Command


ACOPY( ) Function

See Also	Example

Copies elements from one array to another array.

Syntax

ACOPY(<array1>, <array2> [, <expN1> [, <expN2> [, <expN3>]]])

Returns

Numeric

Remarks

ACOPY( ) returns the number of elements copied to the destination array.

Parameters

<array1>, <array2>

Elements from the source array <array1> are copied one-to-one to elements of the destination array <array2>.  The elements in the destination array are replaced by those copied from the source array.

The arrays can be one- or two-dimensional.  If the destination array doesn't exist, FoxPro automatically creates it.  In such a case, the size of the destination array will be the same as that of the source array.

Note   You can refer to an element in a two-dimensional memory variable array in two ways:  The first uses two subscripts to specify the row and column position of the element in the array; the other uses a single-element number.  This function and others that manipulate two-dimensional arrays require single-element numbers (here, <expN1> and <expN3>).

Use AELEMENT( ) to return the proper element number for a two-dimensional array from its row and column subscripts.

<expN1>

The optional numeric expression <expN1> specifies the first element number in the source array to be copied and is inclusive (element number <expN1> is included in the copying).  If <expN1> isn't included, copying begins with the first element in the source array.

<expN2>

You can specify the number of elements copied from the source array by including the optional numeric expression <expN2>.  If <expN2> is -1, all elements of the source array beginning with element <expN1> are copied.

<expN3>

You can specify the first element in the destination array to be replaced with <expN3>.


ACOPY( ) Example

The following example creates an array from selected records in the CUSTOMER table and then uses ACOPY( ) to copy the array.

CLOSE DATABASES
SELECT DISTINCT company ;
FROM customer ;
ORDER BY company ;
WHERE state = 'WA';
INTO ARRAY companies
= ACOPY(companies, temp_comp)	&& Make a copy of the companies array

DISPLAY MEMORY LIKE *


ACOPY() SeeAlso
See Also

ADEL( ) Function

AELEMENT( ) Function

AINS( ) Function

ASCAN( ) Function

ASORT( ) Function

DIMENSION Command


ACOS( ) Function

See Also	Example

Returns the arc cosine of a specified numeric expression.

Syntax

ACOS(<expN>)

Returns

Numeric

Remarks

This trigonometric function returns the arc cosine in radians.

Parameters

<expN>

The arc cosine of <expN> is returned by ACOS( ).  The value of <expN> can range from +1 through -1.  The value returned by ACOS( ) ranges from 0 through pi ( 3.141592).  The number of decimal places ACOS( ) returns is determined by SET DECIMALS.

Use RTOD( ) to convert radians to degrees.


ACOS( ) Example

? RTOD(ACOS(0))

STORE -1 to arcangle
? RTOD(ACOS(arcangle))

? RTOD(ACOS(SQRT(2)/2))


ACOS() SeeAlso
See Also

ASIN( ) Function

ATAN( ) Function

ATN2( ) Function

COS( ) Function

DTOR( ) Function

RTOD( ) Function

SET DECIMALS Command

SIN( ) Function

TAN( ) Function


ACTIVATE MENU Command

See Also	Example

Displays and activates a menu bar.

Syntax

ACTIVATE MENU <menu name>
[NOWAIT]
[PAD <pad name>]

Remarks

This command works in conjunction with DEFINE MENU and DEFINE PAD.  ACTIVATE MENU displays and activates the menu bar specified with <menu name>.

Navigating in a Menu Bar

When the menu bar is activated, you can move from menu pad to menu pad by pressing the Right and Left Arrow keys.  If SET CONFIRM is ON, you can also move across the menu bar by pressing the key corresponding to the first character of a menu bar pad.

Choosing an Option

You can choose a pad on a menu bar by selecting it and pressing Enter or the Spacebar, or by clicking the pad.  If hot keys are assigned to the menu bar pads, you can choose a pad by pressing the corresponding hot key.  If no hot keys are defined and SET CONFIRM is OFF, you can choose a menu bar pad by pressing the key corresponding to the first character of the menu bar pad.

Press Esc to deactivate the menu bar without making a choice.  The menu bar can also be deactivated by issuing DEACTIVATE MENU or by activating another menu bar.

Tip   When you include the FoxPro system menu bar (_MSYSMENU) in an application, there is no need to activate the menu.  Instead, issue SET SYSMEMU AUTOMATIC.  For more information on using the FoxPro system menu bar, see the Menu Builder chapter in the FoxPro User's Guide.

Clauses

<menu name>

Specify the name of the menu to activate with <menu name>.

NOWAIT

When a menu bar is displayed and activated, program execution pauses until you choose a menu pad or press Esc. Including NOWAIT continues program execution after the menu bar is displayed and activated.  The program doesn't wait for a choice to be made but continues executing.  You can choose a pad from the menu bar whenever the program is waiting for input from the keyboard.

Tips

If you want a menu bar to be active during a READ command, include NOWAIT when you activate the menu.  Activate the menu before you issue READ.

A menu activated with the NOWAIT option doesn't return program execution to the line following the ACTIVATE MENU command when DEACTIVATE MENU is issued.

PAD <pad name>

When a menu bar is activated, the first menu pad is selected by default.  If you include PAD <pad name> in ACTIVATE MENU, the menu pad specified with <pad name> is automatically selected when the menu bar is activated.


ACTIVATE MENU Example

This example uses ACTIVATE MENU to display and activate a user-defined menu system.  The current system menu bar is first saved to memory with SET SYSMENU SAVE, and then all system menu pads are removed with SET SYSMENU TO.

Two menu pads are created with DEFINE PAD, and DEFINE POPUP is used to create a menu popup for each menu pad.  DEFINE BAR is used to create options on each of the menu popups.  When a menu pad is chosen, ON PAD uses ACTIVATE POPUP to activate the corresponding menu popup.  ACTIVATE MENU displays and activates the menu bar.

When an option is chosen from a menu popup, the CHOICE procedure is executed.  CHOICE displays the name of the chosen option and the name of the menu popup containing the option.

*** Name this program ACTIMENU.PRG ***
CLEAR
SET SYSMENU SAVE
SET SYSMENU TO
ON KEY LABEL ESC KEYBOARD CHR(13)
DEFINE MENU example BAR AT LINE 1

DEFINE PAD convpad OF example PROMPT '\<Conversions' COLOR SCHEME 3 ;
KEY ALT+C, ''
DEFINE PAD cardpad OF example PROMPT 'Card \<Info' COLOR SCHEME 3 ;
KEY ALT+I, ''
ON PAD convpad OF example ACTIVATE POPUP conversion
ON PAD cardpad OF example ACTIVATE POPUP cardinfo

DEFINE POPUP conversion MARGIN RELATIVE SHADOW COLOR SCHEME 4
DEFINE BAR 1 OF conversion PROMPT 'Ar\<ea' ;
KEY CTRL+E, '^E'
DEFINE BAR 2 OF conversion PROMPT '\<Length' ;
KEY CTRL+L, '^L'
DEFINE BAR 3 OF conversion PROMPT 'Ma\<ss' ;
KEY CTRL+S, '^S'
DEFINE BAR 4 OF conversion PROMPT 'Spee\<d' ;
KEY CTRL+D, '^D'
DEFINE BAR 5 OF conversion PROMPT '\<Temperature' ;
KEY CTRL+T, '^T'
DEFINE BAR 6 OF conversion PROMPT 'T\<ime' ;
KEY CTRL+I, '^I'
DEFINE BAR 7 OF conversion PROMPT 'Volu\<me' ;
KEY CTRL+M, '^M'

ON SELECTION POPUP conversion DO choice IN actimenu WITH PROMPT( ), POPUP( )

DEFINE POPUP cardinfo MARGIN RELATIVE SHADOW COLOR SCHEME 4
DEFINE BAR 1 OF cardinfo PROMPT '\<View Charges' ;
KEY ALT+V, ''
DEFINE BAR 2 OF cardinfo PROMPT 'View \<Payments' ;
KEY ALT+P, ''
DEFINE BAR 3 OF cardinfo PROMPT 'Vie\<w Users' ;
KEY ALT+W, ''
DEFINE BAR 4 OF cardinfo PROMPT '\-'
DEFINE BAR 5 OF cardinfo PROMPT '\<Charges '
ON SELECTION POPUP cardinfo;
DO choice IN actimenu WITH PROMPT( ), POPUP( )

ACTIVATE MENU example
DEACTIVATE MENU example
RELEASE MENU example EXTENDED
SET SYSMENU TO DEFAULT
ON KEY LABEL ESC

PROCEDURE choice
PARAMETERS mprompt, mpopup
WAIT WINDOW 'You chose ' + mprompt + ' from popup ' + mpopup NOWAIT


ACTIVATE MENU SeeAlso
See Also

CLEAR MENUS Command

CREATE MENU Command

DEACTIVATE MENU Command

DEFINE MENU Command

DEFINE PAD Command

HIDE MENU Command

SET SYSMENU Command

SHOW MENU Command


ACTIVATE POPUP Command

See Also	Example

Displays and activates a popup created with DEFINE POPUP, or a FoxPro menu system popup.

Syntax

ACTIVATE POPUP <popup name>
[AT <row, column>]
[BAR <expN>]
[NOWAIT]
[REST]

Remarks

ACTIVATE POPUP works in conjunction with the commands DEFINE POPUP and DEFINE BAR.  DEFINE POPUP creates a popup, and DEFINE BAR creates the individual options on the popup.  ACTIVATE POPUP displays and activates the popup.

Navigating in a Popup

When the popup is activated, you can move between the popup options by pressing the Up and down arrow keys.  If SET CONFIRM is ON, you can select a popup option by pressing the key corresponding to the first character in the name of the option.

Choosing an Option

You can choose an option on a popup by selecting it and pressing Enter or the Spacebar, or by clicking the option.  If hot keys are assigned to the menu options, you can choose a popup option by pressing the corresponding hot key.  If SET CONFIRM is OFF, you can choose a popup option by pressing the key corresponding to the first character in the name of the popup option.

Press Esc to deactivate the popup without making a choice.  The popup can also be deactivated by issuing DEACTIVATE POPUP or by activating another popup.

Clauses

<popup name>

Specify the name of the popup to activate with <popup name>.

AT <row, column>

You can specify where the popup is activated by including AT <row, column>.  The upper-left corner of the popup is positioned at the coordinate specified by <row, column>.  The position specified by this clause takes precedence over a position specified by the FROM clause in DEFINE POPUP.

BAR <expN>

If BAR <expN> is included, popup option number <expN> is automatically selected when the popup is displayed.  For example, if <expN> is 2, the second option is selected.  The first option is selected if BAR <expN> is omitted or if <expN> is greater than the number of options in the popup.

NOWAIT

When ACTIVATE POPUP is issued from within a program, the popup is displayed and activated.  Program execution pauses until an option is chosen or Esc is pressed.  Including NOWAIT causes program execution to continue after the popup is displayed and activated.  The program doesn't wait for a choice to be made.  You can choose an option from the popup whenever the program is waiting for input from the keyboard.

REST

A popup created with the PROMPT FIELD clause of DEFINE POPUP places records from a field into the popup.  When the popup is activated, the first option in the popup is initially selected, even if the record pointer in the table is positioned on a record other than the first record.

To change this default behavior and to initially select the popup option corresponding to the current record pointer position in the table, include the REST keyword.


ACTIVATE POPUP Example

This example uses ACTIVATE POPUP with ON PAD to activate a popup when a menu pad is chosen.  The current system menu bar is first saved to memory with SET SYSMENU SAVE, and then all system menu pads are removed with SET SYSMENU TO.

Two new system menu pads are created with DEFINE PAD, and DEFINE POPUP is used to create a popup for each menu pad.  DEFINE BAR is used to create options on each of the popups.  When a menu pad is chosen, ON PAD uses ACTIVATE POPUP to activate the corresponding popup.

When an option is chosen from a popup, the CHOICE procedure is executed.  CHOICE displays the name of the chosen option and the name of the popup containing the option.  If the Exit option in the Card Info popup is chosen, the original FoxPro system menu is restored.

*** Name this program ACTIPOP.PRG ***

CLEAR

SET SYSMENU SAVE
SET SYSMENU TO

DEFINE PAD convpad OF _MSYSMENU PROMPT '\<Conversions' COLOR SCHEME 3 ;
KEY ALT+C, ''
DEFINE PAD cardpad OF _MSYSMENU PROMPT 'Card \<Info' COLOR SCHEME 3 ;
KEY ALT+I, ''

ON PAD convpad OF _MSYSMENU ACTIVATE POPUP conversion
ON PAD cardpad OF _MSYSMENU ACTIVATE POPUP cardinfo

DEFINE POPUP conversion MARGIN RELATIVE SHADOW COLOR SCHEME 4
DEFINE BAR 1 OF conversion PROMPT 'Ar\<ea' KEY CTRL+E, '^E'
DEFINE BAR 2 OF conversion PROMPT '\<Length' ;
KEY CTRL+L, '^L'
DEFINE BAR 3 OF conversion PROMPT 'Ma\<ss' ;
KEY CTRL+S, '^S'
DEFINE BAR 4 OF conversion PROMPT 'Spee\<d' ;
KEY CTRL+D, '^D'
DEFINE BAR 5 OF conversion PROMPT '\<Temperature' ;
KEY CTRL+T, '^T'
DEFINE BAR 6 OF conversion PROMPT 'T\<ime' ;
KEY CTRL+I, '^I'
DEFINE BAR 7 OF conversion PROMPT 'Volu\<me' ;
KEY CTRL+M, '^M'

ON SELECTION POPUP conversion;
DO choice IN actipop WITH PROMPT( ), POPUP( )

DEFINE POPUP cardinfo MARGIN RELATIVE SHADOW COLOR SCHEME 4
DEFINE BAR 1 OF cardinfo PROMPT '\<View Charges' ;
KEY ALT+V, ''
DEFINE BAR 2 OF cardinfo PROMPT 'View \<Payments' ;
KEY ALT+P, ''
DEFINE BAR 3 OF cardinfo PROMPT 'Vie\<w Users' ;
KEY ALT+W, ''
DEFINE BAR 4 OF cardinfo PROMPT '\-'
DEFINE BAR 5 OF cardinfo PROMPT '\<Charges '
DEFINE BAR 6 OF cardinfo PROMPT '\-'
DEFINE BAR 7 OF cardinfo PROMPT 'E\<xit '
ON SELECTION POPUP cardinfo;
DO choice IN actipop WITH PROMPT( ), POPUP( )

PROCEDURE choice
PARAMETERS mprompt, mpopup

WAIT WINDOW 'You chose ' + mprompt + ;
' from popup ' + mpopup NOWAIT

IF mprompt = 'Exit'
SET SYSMENU TO DEFAULT
ENDIF


ACTIVATE POPUP SeeAlso
See Also

CLEAR POPUPS Command

CREATE MENU Command

DEACTIVATE POPUP Command

DEFINE BAR Command

DEFINE POPUP Command

HIDE POPUP Command

MOVE POPUP Command

ON PAD Command

ON SELECTION PAD Command

ON SELECTION POPUP Command

POP POPUP Command

POPUP( ) Function

PROMPT( ) Function

PUSH POPUP Command

SHOW POPUP Command


ACTIVATE SCREEN Command

See Also

Sends all subsequent output to the screen instead of the current window.

Syntax

ACTIVATE SCREEN

Remarks

ACTIVATE SCREEN directs output to the desktop in FoxPro for MS-DOS or to the main FoxPro window instead of to the active user-defined window.

To direct output to a user-defined window, use ACTIVATE WINDOW to activate the window.

Tip   In FoxPro for MS-DOS and FoxPro for Windows, to view output in the main FoxPro window or a window that is obscured by a window, press Alt+Ctrl+Shift. In FoxPro for Macintosh, press Shift + Ctrl+Option+ [image]. Any windows on top of the main FoxPro window or an active user-defined window are hidden until the keys are released.


ACTIVATE SCREEN SeeAlso
See Also

ACTIVATE WINDOW Command

DEACTIVATE WINDOW Command

DEFINE WINDOW Command

HIDE WINDOW Command

SHOW WINDOW Command


SET BELL Command

Example

Turns the computer bell on or off and sets the bell attributes.

Syntax

SET BELL ON | OFF
or
SET BELL TO
[<frequency>, <duration>]

Remarks

SET BELL enables or disables the sounding of the bell during editing when the end of a field is reached or invalid data is entered.

Clauses

ON

SET BELL ON turns the bell on.  This is the default setting.

OFF

SET BELL OFF turns the bell off.

TO [<frequency>, <duration>]

You can adjust the pitch of the bell and the length of time the bell is sounded with SET BELL TO.  Specify the pitch with <frequency>, which can be 19 through 10,000 hertz.  The default frequency is 512 hertz.  Specify the length of time with <duration>, which can be 1 through 19 seconds.  The default duration is 2 seconds.

In FoxPro for Windows, you can specify a waveform sound to play when the bell is rung.  Specify in <frequency> the waveform sound to play by including a waveform sound file name or an entry in the sounds section of your WIN.INI file.  If the sound cannot be found, the default sound specified by the SystemDefault entry in the sounds section of your WIN.INI file is played.  No sound is played if there isn't a SystemDefault entry or the default sound cannot be located.

In FoxPro for Macintosh, you can specify a system alert sound to play when the bell is rung. The system alert sound you specify must be installed on your Macintosh.

If you specify a waveform or system alert sound, you must also include a value in <duration>.  A syntax error occurs if the duration value is omitted.  The duration value you specify is ignored and the entire waveform or system alert sound is played.


Set Bell Example

In this FoxPro for Windows example, the waveform sound file DING.WAV is played.

SET BELL TO 'C:\WINDOWS\DING.WAV', 0
?? CHR(7)


SET BLINK Command

See Also

Determines whether or not you can specify a blinking attribute or a high-density attribute.

Syntax

SET BLINK ON | OFF

Remarks

SET BLINK is supported in FoxPro for MS-DOS only and only affects users with EGA or VGA monitors.

If you specify a BLINK setting in your configuration file, it is overridden by the BLINK setting of the color set that loads when you start FoxPro.

SET BLINK is ignored in FoxPro for Windows and FoxPro for Macintosh and on other display hardware.

Clauses

ON

Screen elements (borders, shadows, text, and so on) can be made to blink if SET BLINK is ON.

The default setting is ON.

OFF

The background colors can be brightened if SET BLINK is OFF, doubling the number of available colors.


SET BLINK SeeAlso
See Also

SET COLOR Commands Overview


SET BLOCKSIZE Command

See Also

Specifies how FoxPro allocates disk space for the storage of memo fields.

Syntax

SET BLOCKSIZE TO <expN>

Remarks

The default value for SET BLOCKSIZE is 64.  To reset BLOCKSIZE to a different value after the file has been created, set BLOCKSIZE to a new value, and then use COPY to create a new table.  The new table will have the specified blocksize.

Parameter

<expN>

If <expN> is an integer between 1 and 32, disk space for the storage of memo fields is allocated in blocks of <expN> 512 bytes.  If <expN> is greater than 32, disk space is allocated in blocks of <expN> bytes.  Specifying a value for BLOCKSIZE greater than 32 can result in a substantial savings in disk space.


SET BLOCKSIZE SeeAlso
See Also

COPY FILE Command

MODIFY STRUCTURE Command

PACK Command


SET BORDER Command

See Also

Defines a border for popups created with DEFINE POPUP and for windows created with DEFINE WINDOW.

Syntax

SET BORDER TO
[SINGLE | DOUBLE | PANEL | NONE | <border string1>[, <border string2>]]

Remarks

Use SET BORDER to specify the borders of boxes, popups and windows.  Boxes are created with @ ... TO, popups are created with DEFINE POPUP and windows are created with DEFINE WINDOW.  SET BORDER does not affect boxes created with @ ... BOX.

SET BORDER provides compatibility with FoxBASE+ style popups.  When you start FoxPro, the default border for FoxBASE+ style popups is a double line.  All other objects (windows, popups created with DEFINE POPUP and so on) default to a single-line border.  If you issue SET BORDER TO SINGLE or SET BORDER TO DOUBLE, all objects including FoxBASE+ style popups are drawn with a single- or double-line border, respectively.

In FoxPro for Windows and FoxPro for Macintosh, the DOUBLE option creates a PANEL border for popups and windows, and the <border string> option is ignored.

If you issue SET BORDER TO without any additional arguments, the default borders are restored.

Clauses

SINGLE

Including SINGLE creates a single-line border.  This the default setting.

DOUBLE

Including DOUBLE creates a double-line border.

PANEL

Including PANEL creates a wide border.

NONE

Including NONE suppresses the border entirely.

<border string1>[, <border string2>]

Use the border definition strings <border string1> and <border string2> to create your own borders.  <border string1> is used for menus, popups and boxes and for the current output window.  <border string2> specifies the border that appears when output isn't being directed to the window.  <border string2> doesn't affect boxes or popups.

A border definition string is a set of ASCII character values defined [<1>] [, [<2>] [, [<3>] [, [<4>] [, [<5>] [, [<6>][, [<7>] [, [<8>]]]]]]]].  The border string entries 1 through 8 designate the top, bottom, left side, right side, upper-left corner, upper-right corner, lower-left corner and lower-right corner of the border, respectively.  If you include just one ASCII value in the border string definition, the entire border is drawn using that one character.

If a border string definition is changed after a popup or window has been defined, the original border string is retained.  To use the new border string, you must recreate the popup or window.


SET BORDER SeeAlso
See Also

@ ... TO Command

DEFINE POPUP Command

DEFINE WINDOW Command


SET BRSTATUS Command

See Also

Enables or disables the display of the status bar in a Browse window.

Syntax

SET BRSTATUS ON | OFF

Remarks

SET BRSTATUS is included for backward compatibility.

SET BRSTATUS controls the display of the status bar when a Browse window is opened.  The status bar displays the current drive, the active table, the record pointer position, the number of records in the table and the state of the Insert, NumLock, and CapsLock keys.

If the status bar is already displayed when you open a Browse window, it remains displayed.

Clauses

ON

The status bar is displayed at the bottom of the screen when a Browse window is opened if SET BRSTATUS is ON.  If more than one Browse window has been opened, the status bar displays information for the active Browse window.

In FoxPro for Windows and FoxPro for Macintosh, opening a Browse window displays the character status bar if the status bar is turned off.

OFF

If SET BRSTATUS is OFF, the status bar isn't displayed when a Browse window is opened.  This is the default setting.


SET BRSTATUS SeeAlso
See Also

SET STATUS Command


SET CARRY Command

See Also

Determines whether or not FoxPro carries data forward from the current record to the new record created with APPEND or INSERT.

Syntax

SET CARRY ON | OFF
or
SET CARRY TO
[<field list> [ADDITIVE]]

Remarks

Use SET CARRY to enable data to be carried forward from the current record to a new record or to prevent data from being carried forward.  Fields that generally remain unchanged during an editing session can be brought forward for each new record.  For example, a field containing the current date can be brought forward for each new record so a new date doesn't have to be entered again.

Clauses

ON

SET CARRY ON brings data from all fields in all work areas forward from the current record to a new record.

OFF

SET CARRY OFF prevents data from all fields from being passed to a new record.  This is the default setting.

TO
[<field list> [ADDITIVE]]

By default, data from all fields is carried forward to a new record.  Use SET CARRY TO <field list> to specify from which field data is carried forward.  Data from only the fields specified in the field list are brought forward.  If ADDITIVE is included, the fields in the field list are added to the current set of fields being carried forward.

SET CARRY TO affects the current work area.  Issuing SET CARRY TO implicitly performs SET CARRY ON.

Use SET CARRY TO without <field list> to restore the default setting (all fields are carried forward).


SET CARRY SeeAlso
See Also

APPEND Command


SET CENTURY Command

See Also

Determines whether or not FoxPro displays the century portion of date expressions.

Syntax

SET CENTURY ON | OFF

Remarks

Use SET CENTURY to specify how date variables and functions are displayed.

Clauses

ON

SET CENTURY ON specifies a four-digit year format that includes 10 characters (including date delimiters).

OFF

SET CENTURY OFF specifies a two-digit year format that includes eight characters and assumes the twentieth century for date calculations.  This is the default setting.


SET CENTURY SeeAlso
See Also

DATE( ) Function

YEAR( ) Function


SET CLEAR Command

See Also

Determines whether or not issuing SET FORMAT and QUIT clears the screen.

Syntax

SET CLEAR ON | OFF

Remarks

SET CLEAR determines whether the desktop in FoxPro for MS-DOS or the main FoxPro window is cleared when SET FORMAT is issued.

Clauses

ON

If SET CLEAR is ON, the main FoxPro window isn't cleared when you open a format file with SET FORMAT.  This is the default setting.

OFF

The main FoxPro window is cleared if SET CLEAR is OFF.

In FoxPro for MS-DOS, if SET CLEAR is OFF, the main FoxPro window isn't cleared when you exit FoxPro.  You can display a sign-off screen when you quit FoxPro.


SET CLEAR SeeAlso
See Also

CLEAR Commands


SET CLOCK Command

See Also

Determines whether or not FoxPro displays the system clock and specifies the clock location on the screen.

Syntax

SET CLOCK ON | OFF | STATUS
or
SET CLOCK TO
[<row, column>]

Clauses

ON

SET CLOCK ON displays the clock in the upper-right corner of the desktop in FoxPro for MS-DOS or the main FoxPro window.

OFF

SET CLOCK OFF removes the clock from the status bar of the main FoxPro window. This is the default setting.

STATUS

In FoxPro for Windows and FoxPro for Macintosh, issue SET CLOCK STATUS to display the clock in the graphical status bar.  Issue SET STATUS BAR ON to display the graphical status bar.  The STATUS clause is ignored in FoxPro for MS-DOS.

TO

[<row, column>]

You can designate where the clock is displayed in the main FoxPro window by including the coordinates <row, column>.  Use SET CLOCK TO without the coordinates to display the clock in its default position in the upper-right corner of the main FoxPro window.

In FoxPro for Windows and FoxPro for Macintosh, if the clock is placed in the graphical status bar with SET CLOCK STATUS and you specify a location in the main FoxPro window with TO <row, column>, the clock is removed from the graphical status bar and is placed at the location you specify.


SET CLOCK SEE ALSO
See Also

SET BRSTATUS Command

SET HOURS Command

SET STATUS Command


SET COLOR OF Command

See Also

Specifies the colors of user-defined menu systems and windows.

Syntax

SET COLOR OF NORMAL | MESSAGES | TITLES | BOX | HIGHLIGHT |
INFORMATION | FIELDS TO
[<standard>]

Remarks

Included for backward compatibility [image] use SET COLOR OF SCHEME instead.

SET COLOR OF affects the color settings of color schemes 1 and 2.  With this command, you can set selected color attributes of user-defined windows and selected color attributes of user-defined menus.


SET COLOR OF SeeAlso
See Also

SET COLOR OF SCHEME Command

SET COLOR Commands Overview


SET COLOR OF SCHEME Command

See Also

Specifies the colors of a color scheme or copies one color scheme to another color scheme.

Syntax

SET COLOR OF SCHEME <expN1> TO
[SCHEME <expN2> | <color pair list>]

Remarks

In FoxPro for MS-DOS, if you issue SET COLOR OF SCHEME <expN1> TO without including an optional clause, color scheme <expN1> derives its colors from the last named color set in this order:  the last color set loaded or saved, the last color set defined with SET COLOR SET TO, the last color set loaded from CONFIG.FP or the FoxPro default color set.  If there is no last named color set, the hardware default is restored.

In FoxPro for Windows, not all interface elements can be controlled by color schemes [image] FoxPro for Windows system windows (View and Command Windows, the system menu bar, etc.) are always controlled by the Windows Control Panel color settings.  Issuing SET COLOR OF SCHEME <expN1> TO without including another color scheme or a color pair list restores the colors from the current Windows color scheme.

Clauses

<expN1>

<expN1> is the number of the color scheme you want to change. This can be a value from 1 through 24.  In FoxPro for Windows, color schemes 13 and 14 are reserved. In FoxPro for Macintosh, color schemes 13 through 16 are reserved.

TO [<color pair list>]

If you include a color pair list, you can specify up to 10 color pairs you would like to change.  You can selectively change colors in a color scheme by including a comma for each color pair that you don't want to change.  For example, to change the third color pair in color scheme 1 to bright white and blue and leave the rest of the color settings unchanged, use this command:

SET COLOR OF SCHEME 1 TO , , W+/B*

A color pair can also be specified with a set of 6 RGB (Red Green Blue) color values separated by commas.   To change the third color pair in color scheme 1 to white and blue and leave the rest of the color settings unchanged as in the example above, you can use this command:

SET COLOR OF SCHEME 1 TO , , RGB(255,255,255,0,0,255)

TO [SCHEME <expN2>]

Set the colors of a color scheme to those of another color scheme with TO SCHEME <expN2>.  <expN2> is the number of the color scheme you want to copy.


SET COLOR OF SCHEME SeeAlso
See Also

CREATE COLOR SET Command

SET COLOR Commands Overview

SET COLOR SET Command


SET COLOR SET Command

See Also

Loads a previously defined color set.

Syntax

SET COLOR SET TO
[<color set name>]

Remarks

Color sets can be created with SET COLOR OF SCHEME and saved with CREATE COLOR SET.

In FoxPro for MS-DOS, you can also create a color set with the Color Picker dialog by choosing Color ...  from the Window menu.  After you create a color set, be sure to save it in the Color Picker or with CREATE COLOR SET.

Clause

<color set name>

In FoxPro for MS-DOS, if <color set name> isn't included, FoxPro loads the last named color set.  The last named color set is the last color set loaded or saved, the last color set defined with SET COLOR SET TO, the last color set loaded from your configuration file on startup, or the FoxPro default color set.  If there is no last named color set, the hardware default is restored.

In FoxPro for Windows and FoxPro for Macintosh, if <color set name> isn't included, the current color set remains loaded.


SET COLOR SET SeeAlso
See Also

CREATE COLOR SET Command

SET COLOR Commands Overview

SET COLOR OF SCHEME Command


SET COLOR TO Command

See Also

Specifies the colors of user-defined menus and windows.

Syntax

SET COLOR TO
[[<standard>] [, [<enhanced>] [, [<border>]]]]

Remarks

SET COLOR TO is included for backward compatibility.  Use SET COLOR OF SCHEME instead.

SET COLOR TO affects multiple color pairs of color scheme number 1 and color scheme number 2.  Use SET COLOR OF SCHEME for maximum control over the color environment.


SET COLOR TO SeeAlso
See Also

CREATE COLOR SET Command

SET COLOR Commands Overview

SET COLOR OF SCHEME Command

SET COLOR SET Command


SET COMPATIBLE Command

Controls compatibility with FoxBASE+ and other Xbase languages.

Syntax

SET COMPATIBLE FOXPLUS | OFF | DB4 | ON
[PROMPT | NOPROMPT]

Remarks

Commands and functions affected by SET COMPATIBLE include LIKE( ), PLAY MACRO, SELECT( ) and STORE (when STORE is used with arrays).

SET COMPATIBLE doesn't create compatibility with other Xbase commands, functions or features that are not supported in FoxPro.  For example, it doesn't allow you to open a report form created in other Xbase products with the FoxPro Report Writer.

A complete listing of commands that are affected by SET COMPATIBLE is included in the SET COMPATIBLE topic in the FoxPro Language Reference or the Commands and Functions Affected by SET COMPATIBLE help topic.

Clauses

FOXPLUS | OFF

FOXPLUS and OFF can be used interchangeably. Include either key word to allow programs created in FoxBASE+ to run in FoxPro for MS-DOS or FoxPro for Windows without changes.  This is the default setting.

DB4 | ON

Including DB4 or ON affects the behavior of some commands and functions.

[PROMPT | NOPROMPT]

The PROMPT and NOPROMPT options determine if a dialog is displayed when you open a dBASE table with a memo field.

By default, if you open a dBASE table with a memo field, the Convert Memos dialog is displayed, asking if you'd like to convert the dBASE memo file to a FoxPro format. You must convert the memo field to a FoxPro format to open the table in FoxPro. You can later convert the memo file to a dBASE format by including the TYPE FOXPLUS option in the COPY command. Include the PROMPT option to display the Convert memos dialog.

If you include NOPROMPT, the Convert Memos dialog is not displayed when you open a dBASE table with a memo field. The dBASE memo file is automatically converted to a FoxPro format.


SET CONFIRM Command

See Also

Specifies whether or not Enter or Tab must be pressed to exit an input field.

Syntax

SET CONFIRM ON | OFF

Remarks

When SET CONFIRM is OFF (the default value) and the cursor reaches the last character in an @ ... GET input field, the cursor moves to the next field and the bell sounds (if SET BELL is ON).

If SET CONFIRM is ON, you must press Enter or Tab to move to the next object.

SET CONFIRM also affects menu bars and popups created with DEFINE MENU and DEFINE POPUP.  If SET CONFIRM is OFF, you can choose an option from a popup or a pad from a menu bar by pressing the key corresponding to the first letter of the option.

If SET CONFIRM is ON, typing the first letter of the option or choosing a pad selects that option or pad.  To choose the option or pad, you must press Enter or the Spacebar.

If a popup option or menu bar pad is defined with a hot key, the option or pad can be chosen by pressing the corresponding hot key.  SET CONFIRM has no effect on hot keys.

The default value of SET CONFIRM is OFF.


SET CONFIRM SeeAlso
See Also

@ ... GET Command


SET CONSOLE Command

See Also

Enables or disables output to the main FoxPro window or a user-defined window.

Syntax

SET CONSOLE ON | OFF

Remarks

SET CONSOLE enables or disables output to the desktop in FoxPro for MS-DOS, the main FoxPro window or the active user-defined window from within programs.  All output is sent to the main FoxPro window or the active user-defined window if SET CONSOLE is ON.

Output to the main FoxPro window or the active user-defined window is suppressed if SET CONSOLE is OFF.

SET CONSOLE is ON when you are using FoxPro interactively and cannot be changed to OFF in the Command window.  You can change SET CONSOLE to OFF only from within a program.

The CONSOLE setting affects some interactive FoxPro dialogs.  For example, if SET CONSOLE is OFF and you issue BROWSE when no table is open, an error message is displayed.  The Open dialog is displayed if SET CONSOLE is ON.

SET CONSOLE doesn't affect output from @ ... SAY.  Output from @ ...  SAY is controlled by the DEVICE setting.

Important   An error always sets CONSOLE to ON.  Use SYS(100) to check the CONSOLE setting before the error occurred.  For more information, see SYS(100) Function - Console Setting.

The default value of SET CONSOLE is ON.


SET CONSOLE SeeAlso
See Also

SYS(100) Function - Console Setting


SET CPCOMPILE Command

See Also

Specifies the code page for compiled programs.

Syntax

SET CPCOMPILE TO [<expN>]

Remarks

AS <expN>

Use SET CPCOMPILE to compile programs for a specific code page. The code page you specify with SET CPCOMPILE is used for programs compiled automatically by FoxPro, programs compiled from the Compile dialog and programs compiled with the COMPILE command. However, you can include the AS clause in the COMPILE command to override the code page you specify with SET CPCOMPILE.

Clause

<expN>

Specify the compilation code page with <expN>. See the International and Cross-Platform Features topic for a listing of code pages and other international considerations.

Issue SET CPCOMPILE TO without <expN> to reset the compilation code page to the current code page. Use CPCURRENT( ) to determine the current code page.


SET CPCOMPILE SeeAlso
See Also

COMPILE Command

CPCURRENT( ) Function


SET CPDIALOG Command

See Also

Specifies if the Code Page dialog is displayed when a table is opened within a program.

Syntax

SET CPDIALOG ON | OFF

Remarks

Use SET CPDIALOG to suppress the Code Page dialog when a table is opened from within a program.

Clauses

ON | OFF

The Code Page dialog is displayed when you open a table and the following conditions are true:

The table is opened exclusively.

The table is not marked with a code page.

CODEPAGE = AUTO is included in your FoxPro configuration file.

If a table is opened from within a program, the Code Page dialog is only displayed when  SET CPDIALOG is ON. If SET CPDIALOG is OFF, the Code Page dialog is not displayed when the table is opened from within a program.

Regardless of the SET CPDIALOG setting, the Code Page dialog is always displayed if you open a table interactively (from within the Command window or from the File menu) and the conditions above are true.

The default for SET CPDIALOG is OFF.

See the International and Cross-Platform Features topic for more information about code pages and international considerations.


SET CPDIALOG SeeAlso
See Also

CPCURRENT( ) Function

CPDBF( ) Function

CPCONVERT( ) Function

SET NOCPTRANS Command

USE Command


SET CURRENCY Command

See Also	Example

Defines the currency symbol and specifies its position in the display of numeric expressions using the $ PICTURE or FUNCTION code.

Syntax

SET CURRENCY TO
[<expC>]
or
SET CURRENCY LEFT | RIGHT

Clauses

<expC>

<expC> is a character string representing the currency symbol and can be one to nine characters long.  Issue SET CURRENCY TO without <expC> to reset the currency symbol to the default dollar sign ($).

LEFT | RIGHT

Use LEFT or RIGHT to position the currency symbol to the left or right of the currency value.  SET CURRENCY LEFT places the currency symbol to the left of the currency value, and SET CURRENCY RIGHT places the symbol to the right of the currency value.  The default is LEFT.


SET CURRENCY Example

The following example demonstrates how you can display two currency symbols (DM and $), one on either side of the currency value.  If you use PICTURE to display the currency symbol, be sure to include @ before the dollar sign.

STORE SET('CURRENCY') TO currposit
STORE 1234.56 TO dollaramnt
CLEAR

SET CURRENCY TO 'DM'
@ 2,2 SAY dollaramnt PICTURE '@$99,999.99'

IF currposit = 'LEFT'
SET CURRENCY RIGHT
ELSE
SET CURRENCY LEFT
ENDIF
@ 4,2 SAY dollaramnt FUNCTION '$99,999.99'


SET CURRENCY SeeAlso
See Also

SET DECIMALS Command

SET SEPARATOR Command


SET CURSOR Command

See Also

Determines whether the cursor is displayed during a pending @ ...  GET.

Syntax

SET CURSOR ON | OFF

Remarks

You can turn the cursor on or off with SET CURSOR.  SET CURSOR is similar to SYS(2002).

Clauses

ON

SET CURSOR ON causes the cursor to be displayed during a pending @ ... GET, @ ... EDIT, WAIT, or INKEY( ) function.  This is the default setting.

OFF

SET CURSOR OFF prevents the cursor from being displayed during a pending @ ... GET, @ ... EDIT, WAIT or INKEY( ).


SET CURSOR SeeAlso
See Also

@ ... GET Command

INKEY( ) Function

SET( ) Function

SYS(2002) Function - Turn Cursor On or Off

WAIT Command


SET DATE Command

See Also

Specifies the format for the display of date expressions.

Syntax

SET DATE
[TO]
AMERICAN | ANSI | BRITISH | FRENCH | GERMAN | ITALIAN |
JAPAN | USA | MDY | DMY | YMD

Remarks

Use this command to set the format used to display date expressions.  Here are the settings and the resulting date formats:

Setting	Format
AMERICAN	mm/dd/yy
ANSI	yy.mm.dd
BRITISH/FRENCH	dd/mm/yy
GERMAN	dd.mm.yy
ITALIAN	dd-mm-yy
JAPAN	yy/mm/dd
USA	mm-dd-yy
MDY	mm/dd/yy
DMY	dd/mm/yy
YMD	yy/mm/dd
The default date setting is AMERICAN.


SET DATE SeeAlso
See Also

DATE( ) Function

SET CENTURY Command

SET MARK OF Commands


SET DEBUG Command

See Also

Enables or disables access to the Debug and Trace windows.

Syntax

SET DEBUG ON | OFF

Remarks

For more information on the Trace and Debug windows, see the Debugging Your Application chapter in the FoxPro Developer's Guide.

Clauses

ON

If SET DEBUG is ON, you can open both the Debug and Trace windows using the FoxPro system menu.  ON is the default setting.

OFF

If SET DEBUG is OFF, neither window can be opened from the FoxPro system menu.  However, when SET DEBUG is OFF, the Debug window can be opened with SET ECHO ON or ACTIVATE WINDOW DEBUG, and the Trace window can be opened with SET STEP ON or ACTIVATE WINDOW TRACE.


SET DEBUG SeeAlso
See Also

SET ECHO Command


SET DECIMALS Command

See Also

Specifies the number of decimal places displayed in numeric expressions.

Syntax

SET DECIMALS TO
[<expN>]

Remarks

SET DECIMALS specifies the minimum number of decimal places used to display the results of division, multiplication and trigonometric and financial functions.

Clause

<expN>

Specify the minimum number of decimal places to display with <expN>.  The default is two decimal places.  The maximum number of decimals places is 18, and the minimum is 0.


SET DECIMALS SeeAlso
See Also

SET FIXED Command


SET DEFAULT Command

See Also	Examples

Specifies the drive and directory.

Syntax

SET DEFAULT TO
[<expC>]

Remarks

In FoxPro for MS-DOS and FoxPro for Windows, SET DEFAULT instructs FoxPro to change the default FoxPro directory to the directory you specify.

In FoxPro for Macintosh, SET DEFAULT instructs FoxPro to change the default FoxPro folder to the folder you specify.

FoxPro searches for a file in the default FoxPro directory or folder. If you create a file and don't specify where to place the file, the file is placed in the default FoxPro directory or folder.

When you start FoxPro, the default directory or folder is the directory or folder from which you start FoxPro.  However, you can specify a different default directory or folder in your FoxPro configuration file or a startup program. If a file cannot be found in the default directory or folder, the FoxPro path (if one has been specified) is then searched. Use SET PATH to specify the FoxPro path.

If you create a file and don't specify where to place the file, the file is placed in the default FoxProWhen you quit FoxPro for MS-DOS, you are placed on the drive from which you started FoxPro and in the last directory specified in <expC> if the directory is on the startup drive.  The default drive is the drive from which FoxPro is started.

When you quit FoxPro for Windows, you are returned to Windows.  When you exit Windows, you are returned to the drive and directory that you started Windows from.

When you quit FoxPro for Macintosh, you are returned to the Finder.

Tip   SYS(5) returns the default drive.  SYS(2003) returns the default directory or folder with no drive designator.  SYS(5) + SYS(2003) returns the default drive and directory or folder.

Clause

<expC>

<expC> can be one of the following: a drive designator, a drive designator with a directory or folder name. In FoxPro for Macintosh, any of the above using Macintosh shorthand notation (: or ::) or MS-DOS shorthand notation (\ or ..).

Note   FoxPro for Macintosh does not recognize folder names that contain embedded back slashes (\). If a folder name contains an embedded back slash, an "Invalid path or filename" error message is generated.

MS-DOS shorthand notation is supported in FoxPro for Macintosh to provide compatibility with applications created on other FoxPro platforms. See SET PATH for more information about MS-DOS and Macintosh shorthand notation. Use SYS(2027) to convert a folder or path containing MS-DOS shorthand notation to one using Macintosh shorthand notation.


SET DEFAULT Example
SET DEFAULT Examples

FoxPro for MS-DOS and FoxPro for Windows

You can change the default drive to drive A using either of the following commands:

SET DEFAULT TO A
SET DEFAULT TO A:

You can also specify a directory:

SET DEFAULT TO A:\sales
SET DEFAULT TO C:\sales\data

You can specify a child directory.  If the root directory on the C drive is the default FoxPro directory, issue this command to change the default directory to C:\SALES:

SET DEFAULT TO sales

You can use MS-DOS shorthand notation.  If the current directory is C:\SALES\DATA, issue the following command to make the root directory the default directory:

SET DEFAULT TO \

You can also move the default directory one directory toward the root directory with this command:

SET DEFAULT TO ..

To restore the FoxPro startup directory, issue SET DEFAULT without any arguments:

SET DEFAULT TO

FoxPro for Macintosh

You can change the default drive to the drive named MacHD with the following command. Be sure to include a colon after a drive name.

SET DEFAULT TO MacHD:

If a volume or folder name contains a space, enclose the expression in quotation marks.

SET DEFAULT TO 'Volume:sales figures'

You can specify a specific folder:

SET DEFAULT TO MacHD:foxpro:sales:data

You can specify a nested folder. If the current default folder is FOXPRO, issue this command to change the default folder to MacHD:FOXPRO:SALES:

SET DEFAULT TO sales

You can move the default folder one folder toward the top-level folder with this command:

SET DEFAULT TO ::

To restore the FoxPro for Macintosh startup folder, issue SET DEFAULT without any arguments:

SET DEFAULT TO


SET DEFAULT SeeAlso
See Also

SYS(5) Function - Default Drive

SYS(2003) Function - Current Directory


SET DELETED Command

See Also

Specifies whether or not FoxPro processes records marked for deletion and determines whether records marked for deletion are available for use in other commands.

Syntax

SET DELETED ON | OFF

Remarks

Important   SET DELETED is ignored if the default scope for the command is the current record or you include a scope of a single record.  INDEX and REINDEX always ignore SET DELETED and index all records in the table.

Queries that use DELETED( ) to test the status of records can be optimized using Rushmore technology if the table is indexed on DELETED( ).  See the Optimizing Your Application chapter in the FoxPro Developer's Guide for more information on optimizing queries.

You can mark records for deletion by issuing DELETE from within a Browse, Change or Edit window or by choosing Delete ...  from the Record menu.

You can recall records by issuing RECALL or by choosing Recall ...  from the Record menu.

Clauses

ON

All commands that select records (including records in related tables) using a scope ignore records marked for deletion if SET DELETED is ON.

OFF

When SET DELETED is OFF, records marked for deletion can be accessed by other commands.

The default for SET DELETED is OFF.


SET DELETED SeeAlso
See Also

DELETE Command

DELETED( ) Function

PACK Command

RECALL Command


SET DELIMITERS Command

See Also

Specifies whether or not @ ... GET input fields are delimited.

Syntax

SET DELIMITERS ON | OFF
or
SET DELIMITERS TO <expC> | TO DEFAULT

Remarks

SET DELIMITERS is included for backward compatibility.

Clauses

ON

Issuing SET DELIMITERS ON displays delimiters in @ ... GET fields.  The default delimiting characters are colons (:).  A colon is placed on the left and right side of the field to indicate where to enter data.

OFF

If SET DELIMITERS is OFF, no delimiters are displayed in fields created with @ ... GET.  This is the default setting.

TO <expC>

Specify one or two delimiting characters with <expC>.   Fields are delimited on both sides by the same character if <expC> includes one character.  If <expC> includes two characters, the first character is the left delimiter and the second character is the right delimiter.

TO DEFAULT

Use SET DELIMITERS TO DEFAULT to reset the delimiters to the default colons.


SET DELIMITERS SeeAlso
See Also

@ ... GET Command


SET DEVELOPMENT Command

See Also

Causes FoxPro to compare the creation date and time of a program with those of its compiled object file when the program is run.

Syntax

SET DEVELOPMENT ON | OFF

Remarks

FoxPro recompiles the source program before it executes if SET DEVELOPMENT is ON and the source program is more current than its compiled object program.  This ensures that the most current version of a program is executed.

The source and compiled versions of the program aren't compared if SET DEVELOPMENT is OFF.  You may not always be executing the most current version of a program if SET DEVELOPMENT is OFF.

The most current version of a program modified with the FoxPro editor invoked with MODIFY COMMAND is always executed, regardless of the DEVELOPMENT setting.

SET DEVELOPMENT needs to be ON only when programs are modified outside of FoxPro.  Using an external editor (for example, a TSR editor) may require you to issue CLEAR PROGRAM before you execute the modified program.  For more information, see CLEAR PROGRAM.  Use SET DEVELOPMENT OFF for optimum performance.

When SET DEVELOPMENT is ON, program execution can be canceled during a READ.  The Cancel option on the Program menu is enabled when SET DEVELOPMENT is ON and a READ is active.  Choosing Cancel during the READ cancels program execution.  If SET DEVELOPMENT is OFF, the Cancel option on the Program menu is disabled during a READ.

The default value of SET DEVELOPMENT is ON.


SET DEVELOPMENT SeeAlso
See Also

COMPILE Command

MODIFY COMMAND / MODIFY FILE Commands


SET DEVICE Command

See Also

Directs output of @ ... SAY commands to the screen, a printer, or a file.

Syntax

SET DEVICE TO SCREEN | TO PRINTER [PROMPT] | TO FILE <file>

Remarks

SET DEVICE specifies where output from an @ ... SAY is directed. @ ... SAY output can be sent to the main FoxPro window, the active user-defined window, the printer or a file.

Clauses

TO SCREEN

Including TO SCREEN directs @ ... SAY output to the desktop, the main FoxPro window or the active user-defined window.

TO PRINTER [PROMPT]

Including TO PRINTER directs @ ... SAY output to the printer.  A page eject is issued when the coordinates in @ ... SAY specify a location on the page higher than the location specified by the coordinates in the previous @ ... SAY.

In FoxPro for Windows and FoxPro for Macintosh, you can include the optional PROMPT clause to display a dialog before printing starts. In this dialog you can adjust printer settings, including the number of copies and page numbers to print. The printer settings that you can adjust depend on the currently installed printer driver. Place the PROMPT key word immediately after TO PRINTER.  PROMPT is ignored in FoxPro for MS-DOS.

TO FILE <file>

Including TO FILE <file> sends @ ... SAY output to the file specified with <file>.


SET DEVICE SeeAlso
See Also

SYS(101) Function - Device Setting


SET DISPLAY Command

See Also

Enables you to change the current display mode on monitors that support different modes.

Syntax

SET DISPLAY TO CGA | COLOR | EGA25 | EGA43 | MONO | VGA25 | VGA50

Remarks

In FoxPro for MS-DOS, SET DISPLAY enables you to switch between different display modes on monitors that support different modes.

In FoxPro for Windows and FoxPro for Macintosh, SET DISPLAY changes the font for the main FoxPro window to 7 or 9 point FoxFont.  The size of the main FoxPro window is increased if necessary to accommodate the number of lines for the option you specify.  If the graphical status bar appears when you issue SET DISPLAY, it is turned off.

The error message "Display mode not available" is displayed if an option isn't supported by your video hardware.  The SET MESSAGE line is reset to the last line of the desktop (FoxPro for MS-DOS) or the main FoxPro window whenever SET DISPLAY is issued.

Clauses

CGA

In FoxPro for MS-DOS, switches display mode to CGA.

In FoxPro for Windows and FoxPro for Macintosh, switches the font size for the main FoxPro window font to 9 point FoxFont.

COLOR

In FoxPro for MS-DOS, switches display mode to color.

EGA25

In FoxPro for MS-DOS, switches display mode to EGA and 25 lines.

In FoxPro for Windows and FoxPro for Macintosh, switches the font size for the main FoxPro window to 9-point and the main FoxPro window size to 25 lines.

EGA43

In FoxPro for MS-DOS, switches display mode to EGA and 43 lines.

In FoxPro for Windows, switches the font size for the main FoxPro window to 7-point and the main FoxPro window size to 50 lines.

In FoxPro for Macintosh, switches the font size for the main FoxPro window to 8 point.

MONO

In FoxPro for MS-DOS, switches display mode to monochrome.

VGA25

In FoxPro for MS-DOS, switches display mode to VGA and 25 lines.

In FoxPro for Windows and FoxPro for Macintosh, switches the font size for the main FoxPro window to 9-point and the main FoxPro window size to 25 lines.

VGA50

In FoxPro for MS-DOS, switches display mode to VGA and 50 lines.

In FoxPro for Windows, switches the main FoxPro window font to 9 point FoxFont and the main FoxPro window to 50 lines.

In FoxPro for Macintosh, switches the font size for the main FoxPro window to 8 point.


SET DOHISTORYISPLAY SeeAlso
See Also

SET MESSAGE Command

SYS(2006) Function - Current Graphics Card


SET DOHISTORY Command

See Also

Determines whether or not commands from a program are placed into the Command window.

Syntax

SET DOHISTORY ON | OFF

Remarks

SET DOHISTORY is included for backward compatibility.  Use the Trace window instead.

Use SET DOHISTORY to place commands from a program into the Command window as the program executes.  The commands can then be edited and re-executed as if they had been entered directly into the Command window.

Important   Programs execute many times slower when SET DOHISTORY is ON.  DOHISTORY constructs a temporary file as the program executes since the Command window is a special type of FoxPro editor session.  This file can fill up even a large disk very quickly.

Use SET DOHISTORY only as a debugging aid to isolate particularly stubborn bugs.  Be sure to remove any SET DOHISTORY ON commands from your programs before you execute or distribute them.

Clauses

ON

SET DOHISTORY ON places commands from a program into the Command window.

OFF

SET DOHISTORY OFF doesn't place commands from a program into the Command window.  This is the default setting.


SET DOHISTORY SeeAlso
See Also

SET ECHO Command

SET STEP Command


SET ECHO Command

See Also

Opens the Trace window for program debugging.

Syntax

SET ECHO ON | OFF

Remarks

You can also set breakpoints within a Trace window to suspend program execution.  For more information about the Trace window, see the Debugging Your Applications chapter in the FoxPro Developer's Guide.

Clauses

ON

When SET ECHO is ON, the source code for the program that is executing is displayed in the Trace window.  The line currently executing is highlighted.

OFF

SET ECHO OFF closes the Trace window in FoxPro versions earlier than 2.0.  From within a program, the Trace window can be closed with DEACTIVATE WINDOW TRACE.

The default value of SET ECHO is OFF.


SET ECHO SeeAlso
See Also

RESUME Command

SET STEP Command

SUSPEND Command


SET ESCAPE Command

See Also

Determines whether or not pressing the Esc key interrupts program and command execution.

Syntax

SET ESCAPE ON | OFF

Remarks

Use SET ESCAPE to control the effect of pressing Esc on program and command execution.

Clauses

ON

SET ESCAPE ON enables command execution to be interrupted by pressing Esc.

If you press Esc during the execution of a command while the cursor is in the Command window, the following message is displayed:

*** INTERRUPTED ***

If you press Esc during program execution, processing completes at the current program line, and an alert appears with three options:

Choose Cancel to immediately stop program execution and return to the Command window.  This is the default choice.

Chose Suspend to pause program execution and return to the Command window.  This option is useful for debugging a program.  Choose Resume from the Program menu or enter RESUME in the Command window to restart the program at the line at which it was paused.

Choose Ignore to continue program execution at the line at which it was paused.

The default for SET ESCAPE is ON.

OFF

If SET ESCAPE is OFF, pressing Esc doesn't interrupt command and program execution.


SET ESCAPE SeeAlso
See Also

ON ESCAPE Command

ON KEY LABEL Command


SET EXACT Command

See Also

Specifies the rules used when comparing strings of different lengths.

Syntax

SET EXACT ON | OFF

Remarks

SET EXACT specifies the rules used when comparing two strings with different lengths.  The EXACT setting has no effect if both strings are the same length.

For a table showing how the choice of operator and the SET EXACT setting affect comparisons, see SET EXACT in the FoxPro Language Reference.

Clauses

ON

If SET EXACT is ON, expressions must match character for character for the expressions to be equivalent.  Any trailing blanks in the expressions are ignored for the comparison.  For the comparison, the shorter of the two expressions is padded on the right with blanks to match the length of the longer expression.

OFF

If SET EXACT is OFF, the expressions are considered equivalent if they match character for character until the end of the expression on the right side is reached.

The default value of SET EXACT is OFF.

String Comparisons

FoxPro has two relational operators that test for equality.

The = operator performs a comparison between two values of the same type.  This operator is suited for comparing character, numeric, date and logical data.

However, when you compare character expressions with the = operator, the results may not be exactly what you expect.  Character expressions are compared character for character from left to right until one of the expressions isn't equal to the other, or until the end of the expression on the right side of the = operator is reached (SET EXACT OFF) or until the ends of both expressions are reached (SET EXACT ON).

The == operator can be used when an exact comparison of character data is needed.  If two character expressions are compared with the == operator, the expressions on both sides of the == operator must contain exactly the same characters, including blanks, to be considered equal.  The SET EXACT setting is ignored when character strings are compared with ==.


SET EXACT SeeAlso
See Also

SET NEAR Command


SET EXCLUSIVE Command

See Also

Specifies whether FoxPro opens table files for exclusive or shared use on a network.

Syntax

SET EXCLUSIVE ON | OFF

Remarks

Changing the setting of SET EXCLUSIVE doesn't change the status of previously opened tables.  For example, if a table is opened with SET EXCLUSIVE ON, and SET EXCLUSIVE is later changed to OFF, the table retains its exclusive use status.

Clauses

ON

A table opened on a network when SET EXCLUSIVE is ON is made available only to the user who opened the table.  The table isn't accessible to other users on the network.  Unlike FLOCK( ), SET EXCLUSIVE ON also prevents all other users from having read-only access.  A file can also be opened on a network for exclusive use by including EXCLUSIVE with USE.  It isn't necessary to perform record or file locking on a table opened for exclusive use.

Opening a table for exclusive use ensures that the file can't be changed by other users.  Some commands require that a table be opened for exclusive use before they can be executed.  These commands are INSERT, INSERT BLANK, MODIFY STRUCTURE, PACK, REINDEX and ZAP.

The default for SET EXCLUSIVE is ON.

OFF

If a table is opened on a network when SET EXCLUSIVE is OFF, the table can be shared and modified by any user on the network.

For additional information about record and file locking and sharing tables on a network, see the FoxPro in a Multi-User Environment chapter in the FoxPro Developer's Guide.


SET EXCLUSIVE SeeAlso
See Also

FLOCK( ) Function

RLOCK( ) Function

USE Command


SET FIELDS Command

See Also

Specifies which fields in a table can be accessed and whether all or only specified fields can be accessed.

Syntax

SET FIELDS ON | OFF | LOCAL | GLOBAL
or
SET FIELDS TO
[[<field1> [, <field2> ...]] | ALL [LIKE <skel> | EXCEPT <skel>]]

Clauses

ON

Only the fields specified in the field list can be accessed when SET FIELDS is ON.

OFF

All the fields in the current table are accessible if SET FIELDS is OFF.  SET FIELDS OFF is the default setting.

LOCAL

Issue SET FIELDS LOCAL to access only the fields in the current work area listed in the fields list.

GLOBAL

Issue SET FIELDS GLOBAL to access all fields in the field list, including fields in other work areas. SET FIELDS GLOBAL lets you access fields in other work areas without issuing SET COMPATIBLE TO DB4.

TO [<field1> [, <field2> ...] ]

<field1>, <field2> ... are the names of fields that can be accessed.  You can include fields from tables open in other work areas if the fields are prefaced with their table aliases, but these fields cannot be accessed unless you issue SET FIELDS GLOBAL or SET COMPATIBLE DB4.  An alias must be included with a field name when referring to a field in a table in another work area or when field names are the same in two or more tables.

Calculated Fields

The field list can contain statements for creating calculated fields.  A calculated field contains read-only data created with an expression.  This expression can take any form, but it must be a valid FoxPro expression. Calculated fields cannot be accessed unless you issue SET FIELDS GLOBAL or SET COMPATIBLE DB4.

The format of the statement you use to create a calculated field is:

<calculated field name> = <expr>

This example creates a calculated field called LOCATION:

CLOSE DATABASES
USE customer

SET FIELDS TO LOCATION = ALLTRIM(city) + ', ' + state

CITY and STATE are the names of fields from the selected table.

SET FIELDS TO is additive [image] issuing SET FIELDS TO with a field list adds the specified fields to those that are currently accessible.

Issuing SET FIELDS TO without any additional arguments implicitly performs SET FIELDS OFF.

ALL [LIKE <skel> | EXCEPT <skel>]

Use SET FIELDS TO ALL to access all the fields in the current table.

You can selectively access fields by including the LIKE or EXCEPT clause or both. If you include LIKE <skel>, you can access fields that match <skel>. If you include EXCEPT <skel>, you can access all fields except those that match <skel>.

The skeleton <skel> supports wildcard characters.  For example, to access fields that begin with the letters A and P, use:

SET FIELDS TO ALL LIKE A*,P*

The LIKE clause can be combined with the EXCEPT clause:

SET FIELDS TO ALL LIKE A*,P* EXCEPT PARTNO*


SET FIELDS SeeAlso
See Also

SET FILTER Command

SET COMPATIBLE Command


SET FILTER Command

See Also

Specifies a condition that records in the current table must meet to be accessible.

Syntax

SET FILTER TO
[<expL>]

Remarks

SET FILTER is used to designate a group of records within the current table that satisfy the condition specified in the logical expression <expL>.  Once SET FILTER is issued, only the records that satisfy the condition are displayed in the table.  All commands that access the table respect the SET FILTER condition.

The condition specified by SET FILTER isn't evaluated until the record pointer is moved in the table.

Clause

<expL>

<expL> specifies the condition that records must satisfy.  Issuing SET FILTER TO without <expL> turns off the filter for the current table.

A separate filter can be set for every open table.


SET FILTER SeeAlso
See Also

FILTER( ) Function


SET FIXED Command

See Also

Specifies whether or not the number of decimal places used in the display of numeric data is fixed.

Syntax

SET FIXED ON | OFF

Clauses

ON

The number of decimal places displayed is determined by SET DECIMALS if SET FIXED is ON.  The default number of decimal places is 2.

OFF

If SET FIXED is OFF, the number of decimal places displayed in results depends on the specific constants, variables and operators used in a numeric expression.  The contents of fields are displayed with the declared number of decimal places.

The default for SET FIXED is OFF.


SET FIXED SeeAlso
See Also

SET DECIMALS Command


SET FORMAT Command

See Also

Opens a format file.

Syntax

SET FORMAT TO
[<file> | ?]

Remarks

SET FORMAT is included for backward compatibility with FoxPro version 1.0 and FoxBASE+.  Use a multiple window READ instead.

SET FORMAT opens a format file for use with APPEND, BROWSE, INSERT and READ.

Format files can contain initialization code before the @ ... SAY commands. Cleanup code can follow the @ ... SAY commands. The initialization code is executed immediately after APPEND, CHANGE, EDIT, INSERT or READ is issued. The cleanup code is executed immediately after APPEND, CHANGE, EDIT, INSERT or READ are finished executing.

Clause

<file> | ?

Specify the format file to open with <file>.  SET FORMAT TO ? displays a list of available format files.  Format files have an .FMT or .PRX extension.

Issue SET FORMAT TO without <file> to close a format file in the current work area.


SET FORMAT SeeAlso
See Also

@ ... SAY Command

APPEND Command

CHANGE Command

EDIT Command

INSERT Command

READ Command

SYS(7) Function - Current Format File


SET FULLPATH Command

See Also

Specifies whether or not CDX( ), DBF( ), IDX( ) and NDX( ) return the path in a file name.

Syntax

SET FULLPATH ON | OFF

Remarks

SET FULLPATH is supported in FoxPro for MS-DOS and FoxPro for Windows. It is ignored in FoxPro for Macintosh.

Use SET FULLPATH to include or exclude a path in the filename returned by CDX( ), DBF( ), MDX( ), and NDX( ). In FoxPro for Macintosh, the path is always returned with the filename.

Clauses

ON

If SET FULLPATH is ON, CDX( ), DBF( ), MDX( ), and NDX( ) return the drive designator, path and file name.  This is the default setting.

OFF

Only the drive designator and file name are returned if SET FULLPATH is OFF.


SET FULLPATH SeeAlso
See Also

CDX( ) Function

DBF( ) Function

NDX( ) Function


SET FUNCTION Command

See Also

Assigns an expression (keyboard macro) to a function key.

Syntax

SET FUNCTION <expN> | <key label> TO
[<expr>]

Clauses

<expN> | <key label>

Specify the number of the function key you want to assign the macro to with <expN>.  For example, use SET FUNCTION 2 to specify the F2 function key.

FoxPro also supports key combinations that include function keys.  You can use the Ctrl or Shift key in combination with a function key to create additional programmable keys.  Use <key label> to specify the function key combination to program.  See ON KEY LABEL for a list of key label expressions.

<expr>

Specify the series of keystrokes stored to the function key with <expr>.  FoxPro translates a semicolon (;) in the expression as a carriage return.

Function key definitions can be cleared with CLEAR MACROS.


SET FUNCTION SeeAlso
See Also

CLEAR MACROS Command

FKLABEL( ) Function

FKMAX( ) Function

ON KEY LABEL Command


SET HEADINGS Command

See Also

Determines whether or not column headings are displayed for fields.

Syntax

SET HEADINGS ON | OFF

Remarks

SET HEADINGS specifies whether a field name is displayed as a column heading above each field in the output of AVERAGE, CALCULATE, DISPLAY, LIST and SUM.

Clauses

ON

The field names are displayed if SET HEADINGS is ON.  This is the default setting.

OFF

The field names aren't displayed if SET HEADINGS is OFF.


SET HEADING SeeAlso
See Also

AVERAGE Command

CALCULATE Command

DISPLAY Command

LIST Command

SUM Command


SET HELP Command

See Also

Enables or disables FoxPro online Help or specifies a help file.

Syntax

SET HELP ON | OFF
or
SET HELP TO
[<file>]

Remarks

See the FoxPro User's Guide for more information on FoxPro online Help.

Clauses

ON

If SET HELP is ON, you can display the Help window by pressing F1 or issuing HELP in the Command window.  In FoxPro for MS-DOS, you can also choose Help... from the System menu to display Help.

In FoxPro for Windows you can also choose Contents... from the Help menu to display Help.

In FoxPro for Macintosh, you can also choose Microsoft FoxPro Help... from the Help menu or press [image] +1 or [image] +? to display Help.

In FoxPro for Windows and FoxPro for Macintosh, you can press Shift+F1 to change the pointer to the question mark pointer. Clicking the question mark pointer on a window or a menu option displays context-sensitive Help for the window or menu option.

The default setting for SET HELP is ON.

OFF

If SET HELP is OFF, FoxPro online Help isn't available.

<file>

You can specify a different help file with <file>.  This is a convenient way to provide a tailored online Help within a custom application or to switch between the different help files in FoxPro for Windows or FoxPro for Macintosh.

If you issue SET HELP TO without including a filename, FoxPro for MS-DOS looks for a Help file with the name FOXHELP.DBF. FoxPro for Windows and FoxPro for Macintosh look for a Help file with the name FOXHELP.HLP if you issue SET HELP TO without a filename.

Choosing an Online Help Style

FoxPro for Windows and FoxPro for Macintosh give you the option of using either graphical Help or DBF-style Help. If you use FoxPro for MS-DOS and like its Help system, use DBF-style help.

When you install FoxPro for Windows or FoxPro for Macintosh, you are prompted to install either one or both styles of help.  To use either help style, the required help files must be installed.  To use graphical Help, FOXHELP.HLP must be installed.  To use DBF-style help, FOXHELP.DBF and FOXHELP.FPT must be installed.  If you install both, FOXHELP.HLP is used by default.

Changing Help Styles

You can switch between help styles at any time in the Command or View window or from within a program.  A default startup help style can be specified in your CONFIG.FPW configuration file.

Specifying a Help Style in the Command Window

Issue one of the following commands in the Command window or from within a program to change help styles:

SET HELP TO foxhelp.hlp [image] Switch to graphical Help.

SET HELP TO foxhelp.dbf [image] Switch to DBF-style help.

Specifying a Help Style in the View Window

Open the View window by issuing SET in the Command window or by choosing View from the Window menu.  Choose the Files push button, and then choose the Help ...  push button.

When you choose the Help ...  push button, the Open dialog appears.  To specify a help style:

For graphical Help, choose FOXHELP.HLP from the scrollable list.

For FoxPro DBF-style help, choose FOXHELP.DBF from the scrollable list.

Specifying a Startup Help Style in Your Configuration File

To specify a default startup Help file, place one of the following lines in your CONFIG.FPW (FoxPro for Windows) or CONFIG.FPM (FoxPro for Macintosh) configuration file:

HELP = FOXHELP.HLP [image] Specifies graphical Help.

HELP = FOXHELP.DBF [image] Specifies DBF-style help.

If the help file you specify in the Command or View window or your configuration file is in a directory or folder other than the current default directory or folder, include a path with the Help filename.


SET HELP SeeAlso
See Also

HELP Command

SET HELPFILTER Command

SET TOPIC Command


SET HELPFILTER Command

See Also	Example

Enables FoxPro to display a subset of help topics in the Help window by evaluating the logical expression <expL> and displaying only the topics for which <expL> evaluates to true (.T.).

Syntax

SET HELPFILTER [AUTOMATIC] TO [<expL>]

Remarks

In FoxPro for Windows and FoxPro for Macintosh, you can set a filter only for DBF-style help.  You cannot set a filter for graphical Help.

Clauses

AUTOMATIC

You can automatically remove the criteria specified with SET HELPFILTER after the Help window is closed by including the AUTOMATIC clause.  Including AUTOMATIC is identical to issuing SET HELPFILTER TO immediately after the Help window is closed.  AUTOMATIC must be placed directly before TO <expL>.

<expL>

The help topics are filtered based on the evaluation of the logical expression <expL>.  Only records in the help table that satisfy the logical expression are displayed in the Help window. <expL> typically includes a the name of a field from the help .DBF.  You can include the name of any field from the help .DBF.

Help File Structure

In FoxPro for MS-DOS, the default help table used by the FoxPro online Help is FOXHELP.DBF.  In FoxPro for Windows and FoxPro for Macintosh, FOXHELP.DBF is used when you specify DBF-style help.  The following table lists the structure of FOXHELP.DBF.

Field	Field type and description

TOPIC	A character field.  The list of topics is displayed in the Help window.

DETAILS	A memo field.  The details are displayed in the second panel of the Help window.

CODE	A character field.  Codes are used to classify the help topics.

The CODE field contains two-letter abbreviations that classify each record and can be used to filter help topics.  The following tables list the help categories and their codes.

Help Filter Category	Code
General	General
What's New	wn
Compatibility	cm
Configuration	cf
Error Messages	em
Help Filter Category	Code
Commands	Command
Table (Fields, Indexes, Records, Relations)	db
Enhanced in FoxPro version 2.5	ex
Environment (SET Commands Screen Keys)	en
Errors and Debugging	er
Event Handlers (ON ERROR, ON KEY)	eh
File Management	fm
Indexing	ix
Keyboard and Mouse	km
Memory Variables and Arrays	mv
Menus and Popups (System Names)	mp
New in FoxPro 2.5	nx
Printing	pr
Program Execution	pe
Structured Programming	sp
SQL	s
Text Merge	tm
Windows	wi
Interface	in
Multi-User	mu
Help Filter Category	Code
Functions	Function
Character	ch
Numeric	nu
Date and Time	dt
File Input/Output	fi
Logical	lo
Table (Fields, Indexes, Records, Relations),	db
Data Conversion	dc
Environment	en
File Management	fm
Keyboard and Mouse	km
Low-Level	ll
Memory Variables and Arrays	mv
Menus and Popups (System Names)	mp
Windows	wi
Printing	pr
Multi-User	mu
Help Filter Category	Code
System Memory Variables	Sysmemvar
Desk Accessories	da
Printing	pr
Interface Operations	in
Text Merge	tm
System Menu Names	sn
Help Filter Category	Code
Interface	Interface
Dialogs	di
General	ge
Menus	me
Windows	wi
Choosing a topic from the See Also popup may display a "No help found for ... " message.  If you have issued SET HELPFILTER TO, topics in the See Also popup must meet the filter condition for additional help to be displayed.

Issue SET HELPFILTER TO without additional arguments to remove a filter.  The filter criteria are removed, and all help topics are displayed in the Help window.


SET HELPFILTER Example

SET HELP TO foxhelp.dbf
SET HELPFILTER TO topic = 'ACTIVATE'
SET HELPFILTER TO 'WINDOW' $ topic
SET HELPFILTER AUTOMATIC TO 'BROWSE' $ details
SET HELPFILTER TO 'Command' $ class AND 'db' $ class


SET HELPFILTER SeeAlso
See Also

HELP Command

SET HELP Command

SET TOPIC Command


SET HOURS Command

See Also

Sets the system clock to a 12- or 24-hour time format.

Syntax

SET HOURS TO
[12 | 24]

Remarks

Use SET HOURS TO without 12 or 24 to return to the default 12-hour format.

TIME( ) always returns a value in 24-hour format and isn't affected by SET HOURS.

Clauses

12

Include 12 to specify a 12-hour format.  This is the default setting.

24

Include 24 to specify a 24-hour format.


SET HOURS SeeAlso
See Also

SECONDS( ) Function

SET CLOCK Command

TIME( ) Function


SET INDEX Command

See Also

Opens one or more index files for use with the current table.

Syntax

SET INDEX TO
[<index file list> | ?]
[ORDER <expN> | <idx index file> | [TAG] <tag name> [OF <cdx file>]
[ASCENDING | DESCENDING]]
[ADDITIVE]

Remarks

Records in a table that has an index file or files open can be displayed and accessed in an order determined by one of the index files.  Both .IDX and .CDX (compound) index files can be opened with SET INDEX.  If a table has a structural compound index file, the file is opened automatically when the table is opened.

Only one .IDX index file (the controlling index file) or tag from a .CDX compound index file (the controlling tag) controls the order in which records in the table are displayed or accessed.  Certain commands (SEEK, for example) use the controlling index file or tag to search for records.

Issuing SET INDEX TO without any additional arguments closes all open index files (except a structural compound index file) in the current work area.

Clauses

<index file list> | ?

You can open a single index file by specifying the index file name with <index file list>.  You don't have to include the file name extensions unless another .IDX or .CDX file exists with the same name.

You can open more than one index file by including a list of index file names separated by commas in the index file list.  The index file list can contain any combination of .IDX and .CDX index file names.

The first index file in the index file list becomes the controlling index file, which controls how records are accessed and displayed.  The table records are displayed and accessed in physical record order if the first index file is a compound index file and SET ORDER TO TAG has not been issued.

You can also open a single .IDX index file with SET INDEX TO ?.  The Open dialog appears displaying a list of available index files to choose from.

ORDER <expN>

Use ORDER <expN> to designate a controlling index file or tag.  The numeric expression <expN> specifies the index files as they appear in the index file list.  .IDX index files are numbered first in the order in which they appear in the index file list.  Tags in the structural compound index file (if one exists) are numbered in the order in which the tags are created.  Finally, tags in any independent .CDX compound index files are numbered in the order in which they were created.  See SET ORDER for a further discussion of the numbering of index files and tags.

If <expN> is 0, records in the table are displayed and accessed in physical record order, but the index files remain open.  ORDER 0 enables you to update open index files while accessing records in physical order.  ORDER with no arguments is identical to ORDER 0.

The error message "Index tag not found" is displayed if <expN> is greater than the number of .IDX index files and .CDX compound index file tags.

ORDER <idx index file>

Include <idx index file> to designate the specified .IDX index file as the controlling index file.

ORDER [TAG] <tag name> [OF <cdx file>]

Include <tag name> to designate a tag of the specified .CDX index file as the controlling tag.  The tag can be from the structural compound index file or any open compound index file.

Include OF <cdx file> if tags with the same name exist in open compound index files.

ASCENDING | DESCENDING

Include ASCENDING or DESCENDING to specify whether table records are displayed and accessed in ascending or descending order.  The index files or tags aren't changed in any way; only the order in which the records are displayed and accessed is changed.  Include the ASCENDING or DESCENDING key word immediately after the ORDER clause.

ADDITIVE

When you open an index file or files for a table with SET INDEX, any previously opened index files (except a structural compound index) are closed unless you include ADDITIVE.


SET INDEX SeeAlso
See Also

CLOSE INDEXES Command

INDEX Command

SET ORDER Command

USE Command


SET INTENSITY Command

See Also

Determines whether or not FoxPro uses the enhanced screen color attribute for the display of editing fields.

Syntax

SET INTENSITY ON | OFF

Remarks

SET INTENSITY is included for backward compatibility.  Use SET COLOR OF SCHEME instead.

In FoxPro for MS-DOS, SET INTENSITY specifies whether the enhanced screen attribute is used for fields displayed with @ ... GET, APPEND, BROWSE, CHANGE or EDIT.

In FoxPro for Windows, SET INTENSITY specifies if a Windows color setting is used for editing regions created with @ ... GET.

In FoxPro for Macintosh, SET INTENSITY is ignored.

Clauses

ON

In FoxPro for MS-DOS, the enhanced screen attribute is used to highlight fields if SET INTENSITY is ON.

In FoxPro for Windows and FoxPro for Macintosh, the background color of an editing region created with @ ... GET is determined by the Windows color setting for button faces when INTENSITY is ON.  This color can be changed by choosing the Colors icon in the Windows Control Panel.

ON is the default setting.

OFF

The normal screen attribute is used if SET INTENSITY is OFF.


SET INTENSITY SeeAlso
See Also

SET BLINK Command


SET KEY Command

See Also

Specify access to a range of records based on their index keys.

Syntax

SET KEY TO [<expr1> | RANGE <expr2>, <expr3>] [IN <expC> | <expN>]

Remarks

Use SET KEY to limit the range of records you can access in a table. The table must be indexed, and the index key value or values you include must be the same data type as the index expression of the master index file or master tag.

Issue SET KEY TO without any additional clauses to restore access to all records in the table.

Clauses

<expr1>

A set of records with identical index keys can be accessed by including the single index key value <expr1>. All records with index keys that match <expr1> are accessible.

RANGE <expr2>, <expr3>

Include the RANGE clause to access a set of records with index keys that fall within a range of index key values.  Include <expr2> to access records with index keys equal to or greater than <expr2>. Include <expr3> (preceded by a comma) to access records with index keys equal to or less than <expr3>. Include both <expr2> and <expr3> (separated by a comma) to access records with index keys equal to or greater than <expr2> and equal to or less than the <expr3>.

For example, the CUSTOMER table includes a character field containing zip codes.  If the table is indexed on the zip code field, you can specify a range of zip codes with SET KEY clause.

In this example, only records with zip codes falling within the range of 43000 to 43999 appear in a Browse window:

CLOSE DATABASES
USE customer
SET ORDER TO zip
SET KEY TO '43000', '43999'

IN <expC> | <expN>

If you omit the work area and alias, SET KEY operates on the table in the current work area.  To provide access to a range of records in a specific work area, include the table alias <expC> or the work area number <expN>.

If no table has the alias you specify, the message "Alias not found" appears.


SET KEY SeeAlso
See Also

INDEX Command

KEY( ) Function

SET FILTER Command


SET KEYCOMP Command

See Also

Controls FoxPro keystroke navigation on different platforms.

Syntax

SET KEYCOMP TO DOS | MAC | WINDOWS

Remarks

SET KEYCOMP is supported in FoxPro for Windows and FoxPro for Macintosh.

SET KEYCOMP determines the keystrokes that you use to move through the FoxPro for Windows and FoxPro for Macintosh interfaces. SET KEYCOMP lets you choose a set of keystroke and keystroke combinations used to navigate the interface controls (buttons, lists, popups, menus, and so on).

The effect of the SET KEYCOMP setting depends on the control.

If you are familiar with FoxPro for MS-DOS, you can issue SET KEYCOMP TO DOS to navigate using the keystrokes you are accustomed to.  If you are familiar with Windows and prefer to navigate with the keystrokes Windows uses, issue SET KEYCOMP TO WINDOWS.

In FoxPro for Windows, you can specify the DOS or WINDOWS option. The default is WINDOWS.

In FoxPro for Macintosh, you can specify the DOS, WINDOWS or MAC option. The default setting is MAC.

You can specify a startup KEYCOMP setting in your FoxPro configuration file CONFIG.FPW (FoxPro for Windows) or CONFIG.FPM (FoxPro for Macintosh). For example, placing the following line in you configuration file sets KEYCOMP to DOS:

KEYCOMP = DOS

FoxPro for Windows

This section describes how the DOS and WINDOWS options affect FoxPro for Windows.

Default ButtonsDOS

The default button in a dialog is always the same and is chosen by pressing Ctrl+Enter.

SET KEYCOMP TO WINDOWS

The default button in a dialog can change when you move between controls.  The default button is surrounded by a bolder border to indicate it is the current default and is chosen by pressing Enter.  Pressing Enter always performs the default button's action.

For an illustration of how the default button changes in a dialog, issue SET KEYCOMP TO WINDOWS and tab through the Open dialog.

Popups

DOS

A hot key for a control is a single key. If you aren't in a control that has keyboard steering (a popup or a list), pressing the hot ke chooses it.

WINDOWS

A hot key for a control can be a single key or a key combination. If the current control has keyboard steering (a popup or a list), you can press Alt plus the hot key to choose the control. To choose other controls, you can press the hot key or Alt plus the hot key.

PopupsDOS

Popups are opened by pressing Enter or the Spacebar.  Keyboard steering within a popup is unavailable until the popup is open.

SET KEYCOMP TO WINDOWS

Popups are opened by pressing the Spacebar, Alt+Up Arrow or Alt+Down Arrow.  Keyboard steering within a popup is available when the popup is selected (not open) and when it is open.

For example, a selected popup contains a list of available drives.  If the A, B and C drives are available and the B drive is currently displayed, you can choose the C drive without opening the popup by pressing C or the Down Arrow key.  The C drive is chosen and you move to the next control.

Hot Keys

SET KEYCOMP TO DOS

A hot key for a control is a single key.  If you aren't in a control that has keyboard steering (a popup or a list ), pressing the hot key moves you to the control and chooses it.

SET KEYCOMP TO WINDOWS

A hot key for a control can be a single key or a key combination.  If the current control has keyboard steering (a popup or a list), you can press Alt and the hot key to move you to the control.  To move to other controls, you can press the hot key or Alt and the hot key.

Radio Buttons

SET KEYCOMP TO DOS

Pressing the Tab key when a group of radio buttons is selected moves you among the radio buttons.

SET KEYCOMP TO WINDOWS

Pressing the Tab key when a group of radio buttons is selected moves you from the radio buttons to the next control.  To move among buttons in a set of radio buttons, press the Left and Right Arrow keys.

Browse Windows

SET KEYCOMP TO DOS

A field is not selected upon entry into the field.

SET KEYCOMP TO WINDOWS

A field is automatically selected upon entry into the field.

You can specify a startup KEYCOMP setting in your FoxPro for Windows CONFIG.FPW configuration file.  For example, placing the following line in your CONFIG.FPW configuration file sets KEYCOMP to DOS:

KEYCOMP = DOS

FoxPro for Macintosh

This section describes how the DOS, MAC and WINDOWS options affect FoxPro for Macintosh.

Default Buttons

DOS

The default button in a dialog is surrounded by a bolder border and is always the same. It is chosen by pressing Ctrl+Enter.

MAC

The default button in a dialog is surrounded by a bolder border and is always the same. It is chosen by pressing Enter. However, pressing Enter when a text editing region is the current control moves the cursor to the next line in the text editing region. In text editing regions, press Ctrl+Enter to chose the default button.

WINDOWS

The default button in a dialog is surrounded by a bold border and is always the same. It is chosen by pressing Enter or Ctrl+Enter. However, pressing Enter when a text editing region is the current control moves the cursor to the next line in the text editing region. In text editing regions, press Ctrl+Enter to chose the default button.

Hot Keys

DOS

Hot keys are underlined, and a control within a dialog can be chosen by pressing the appropriate hot key. Controls cannot be chosen by pressing their corresponding hot keys from within popups, scrollable lists, text boxes and text editing regions.

MAC

Hot keys are not underlined. However, hot keys are available for most controls in dialogs. (You must set KEYCOMP to DOS or WINDOWS to determine the hot keys.) Controls cannot be chosen by pressing their corresponding hot keys from within popups, text boxes and text editing regions.

WINDOWS

Hot keys are underlined, and a control in a dialog can be chosen by pressing the appropriate hot key. From within a scrollable list, text box or a text editing region you can press Alt plus the hot key to chose a control. However, you cannot chose a control or menu option with a hot key from within a popup.

Popups

DOS

When a popup has the focus, it can by opened by pressing Enter or the Spacebar. Keyboard steering within a popup is not available until the popup is open.

MAC

Popups cannot have the focus. You must click a popup to open it.

WINDOWS

When a popup has the focus, it can by opened by pressing the Spacebar, Alt+Up Arrow or Alt+Down Arrow. Keyboard steering within a popup is available when the popup is selected (not open), and when it is open.

For example, a selected popup contains a list of available drives. If the A, B and C drives are available and the B drive is currently displayed, you can choose the C drive without opening the popup by pressing C or the Down Arrow key. The C drive is chosen and you move to the next dialog option.

Radio Buttons

DOS

Press Enter or the Spacebar to choose a radio button that has the focus.

MAC

Radio buttons cannot have the focus. You must click a radio button to choose it.

WINDOWS

Press the Spacebar to choose a radio button that has the focus.

Check Boxes

DOS

Press Enter or the Spacebar to choose a check box that has the focus.

MAC

Check boxes cannot have the focus. You must click a check box to choose it.

WINDOWS

Press the Spacebar to choose a check box that has the focus.

Focus

DOS

Press Tab or Shift+Tab to move the focus to the next or previous control. How the control with the focus is chosen depends on the control, this is described in the following control sections.

MAC

Only scrollable lists and text boxes can have the focus. Press Tab or Shift+Tab to move the focus to the next or previous scrollable list or text box.

WINDOWS

Press Tab or Shift+Tab to move the focus to the next or previous control. How the control with the focus is chosen depends on the control; this is described in the following control sections.

Activating the System Menu

DOS

The FoxPro System menu is activated by pressing F10 or Alt.

MAC

The FoxPro System menu is activated by pressing F10 or [image] +0.

WINDOWS

The FoxPro System menu is activated by pressing F10 or Alt.

Multiple Selection in Lists

DOS

To choose multiple nonconsecutive items from a list, hold down the Shift key when you choose the items with the Spacebar. To select consecutive items, choose one item and hold down the Shift key while pressing the Up or Down Arrow key.

MAC

To choose multiple nonconsecutive items from a list, hold down the Shift key when you choose the items with the Spacebar. To choose consecutive items, choose one item and hold down the Shift key while pressing the Up or Down Arrow key.

WINDOWS

To choose multiple nonconsecutive items from a list, hold down the Ctrl key when you choose the items with the Spacebar. To choose consecutive items, choose one item and hold down the Shift key while pressing the Up or Down Arrow key. You can also choose consecutive items this way:  choose an item with the Spacebar ("anchor" the item), press the Up or Down Arrow key to move to the last item you'd like to choose, then press Shift+Spacebar.


SET KEYCOMP SeeAlso
See Also

SET COMPATIBLE


SET LIBRARY Command
SET LIBRARY

See Also

Opens an external library file or a procedure file.

Syntax

SET LIBRARY TO
[<file name> [ADDITIVE]]

Remarks

Use SET LIBRARY to open external API (Application Program Interface) routine libraries or a procedure file.

API routine libraries extend the capabilities of the FoxPro language and user interface.  Once an external API routine library is opened, you can use the API functions as if they were FoxPro functions.  The functions available in the library can be displayed with DISPLAY STATUS or LIST STATUS.

You can use existing API libraries or create your own API routine libraries with the FoxPro Library Construction Kit.

If you specify a procedure file, the procedures within the procedure file made are available to all programs, and are also available interactively through the Command window.

Note   The ability to open a procedure file with SET LIBRARY provides compatibility with dBASE IV. Using SET LIBRARY to open a procedure file will close all open API libraries; using SET LIBRARY to open API libraries will close a procedure file opened with SET LIBRARY. Use SET PROCEDURE to open a procedure file and prevent API libraries from being unloaded.

See PROCEDURE and SET PROCEDURE for additional information about procedure files.

Clauses

<file name>

Specify the file name of the API library or procedure file to open with <file name>.

FoxPro for MS-DOS assumes a .PLB extension for libraries.  If the library has a .PLB extension, you don't have to include the extension with the file name.  If a library has an extension other than .PLB, you must include the extension with the file name.

FoxPro for Windows assumes an .FLL extension for libraries.  If the library has an .FLL extension, you don't have to include the extension with the file name.  If a library has an extension other than .FLL, you must include the extension with the file name.

FoxPro for Macintosh assumes an .MLB extension.

You cannot use libraries built for one platform on another platform.  For example, libraries created for FoxPro for MS-DOS cannot be used in FoxPro for Windows; libraries created for FoxPro for Windows cannot be used in FoxPro for MS-DOS.

You cannot use libraries built for FoxPro for MS-DOS version 2.0 in FoxPro for MS-DOS version 2.5. You must recompile and link with the FoxPro 2.5 Library Construction Kit.

FoxPro assumes a .PRG extension for a procedure file.

When you execute a procedure with DO <procedure name>, FoxPro searches for the procedure in a specific order.

First, the file containing DO <procedure name> is searched.

Second, a procedure file opened with SET PROCEDURE (if one is set) is searched.

Third, FoxPro looks through the programs in the execution chain.  Program files are searched beginning with the most recently executed program and continuing back to the first executed program.

Fourth, a procedure file opened with SET LIBRARY (if one is set) is searched.

Fifth, FoxPro searches for a stand-alone program file.  If a program file with the same name as the file name specified with DO is found, the program is executed.  If a matching program file name isn't found, an error message "File doesn't exist" is returned.

ADDITIVE

To open additional API libraries, include ADDITIVE after the file name in successive SET LIBRARY commands.

To remove all API libraries from memory, issue SET LIBRARY TO without including <file name> or ADDITIVE.  To remove an individual library from memory, issue RELEASE LIBRARY <library name>.

The ADDITIVE keyword is ignored when you use SET LIBRARY to open a procedure file.


SET LIBRARY SeeAlso
See Also

CALL Command

DISPLAY STATUS Command

LIST Commands

LOAD Command

PROCEDURE Command

RELEASE Commands

SET PROCEDURE Command


SET LOCK Command

See Also

Enables or disables automatic file locking in certain commands.

Syntax

SET LOCK ON | OFF

FoxPro doesn't place a lock on a file when executing commands that require read-only access to a table.  Here is a list of commands that require read-only access to a table:

AVERAGE	DISPLAY (with a scope)	REPORT
CALCULATE	INDEX	SORT
COPY TO	JOIN (both files)	SUM
COPY TO ARRAY	LIST	TOTAL
COUNT	LABEL
While they are being executed, these commands don't change the contents of a table, and access to the table is available to other users on the network.  The table can be changed while you are executing one of these commands.  For example, you may begin printing a report before another user changes a record included in the report.  Your report now contains outdated information.

Clauses

ON

Use SET LOCK ON to ensure that you are using the most current data.  If SET LOCK is ON, the commands listed above automatically lock the table.  This provides read-only access to other users on the network.

The results in the above example can be achieved by issuing FLOCK( ) followed by REPORT FORM and UNLOCK.  In this case, files aren't locked automatically.

OFF

Use SET LOCK OFF to enable shared access of tables with the commands listed above.  SET LOCK OFF can be used if having the most current information isn't essential.

The default for SET LOCK is OFF.


SET LOCK SeeAlso
See Also

FLOCK( ) Function

LOCK( ) Function

RLOCK( ) Function

SET MULTILOCKS Command


SET LOGERRORS Command

See Also

Determines whether or not FoxPro sends compilation error messages to a text file.

Syntax

SET LOGERRORS ON | OFF

Remarks

Using SET LOGERRORS, you can save compilation error messages to a text file when programs are compiled.

Clauses

ON

Issuing SET LOGERRORS ON creates a compilation error message log file that has the same name as the compiled program and an .ERR extension.  If a log file with the same name already exists, it is overwritten.

The default for SET LOGERRORS is ON.

OFF

A log file isn't created if a program compiles without error or if SET LOGERRORS is OFF.  If a log file exists with the same name as the compiled program and the program compiles without error, the log file is deleted.


SET LOGERRORS SeeAlso
See Also

COMPILE


SET MACDESKTOP Command

See Also

Provides window compatibility in applications created in FoxPro for MS-DOS and FoxPro for Windows.

Syntax

SET MACDESKTOP ON | OFF

Remarks

SET MACDESKTOP ensures that windows in applications created in FoxPro for MS-DOS and FoxPro for Windows behave correctly in FoxPro for Macintosh. SET MACDESKTOP is available in FoxPro for Macintosh only.

SET MACDESKTOP specifies if FoxPro system windows, desk accessories and user-defined windows are placed on the main FoxPro window or the Macintosh desktop. Some examples of system windows are the View window, Browse windows, the Screen Design window, and so on. Desk accessories are the Calculator, the Calendar/Diary, the Filer and the Puzzle. User-defined windows are created with DEFINE WINDOW.

The default for SET MACDESKTOP is ON. When SET MACDESKTOP is ON, windows reside on the Macintosh desktop. Windows reside at the same level as the main FoxPro window; windows can be moved outside of the main FoxPro window and the main FoxPro window can be brought forward over the top of windows. When SET MACDESKTOP is ON, windows behave in the same manner as windows in FoxBASE+ for Macintosh.

When SET MACDESKTOP is OFF, windows reside on the main FoxPro window. Windows cannot be moved outside the main FoxPro window. When SET MACDESKTOP is OFF, windows behave in the same manner as windows in FoxPro for MS-DOS and FoxPro for Windows. If you run an application created in FoxPro for MS-DOS or FoxPro for Windows in FoxPro for Macintosh, be sure SET MACDESKTOP is OFF so your application runs properly.

Note   By default, the Command window is placed on the Macintosh desktop and ignores the SET MACDESKTOP setting. To place the Command window on the main FoxPro window, issue ACTIVATE WINDOW COMMAND IN SCREEN.

SET MACDESKTOP determines the behavior of windows that are not defined, activated or opened with the IN SCREEN, IN DESKTOP or IN MACDESKTOP clauses. When IN SCREEN, IN DESKTOP or IN MACDESKTOP is included, the window behavior is determined by the clause you include.

For example, if you issue SET MACDESKTOP ON and then issue ACTIVATE WINDOW PUZZLE IN SCREEN, the puzzle is activated on the main FoxPro window  the IN SCREEN clause overrides the SET MACDESKTOP setting.

IN SCREEN places a window on the main FoxPro window. IN MACDESKTOP places a window on the Macintosh desktop and the main FoxPro window can be brought forward over the window. IN DESKTOP (available only in DEFINE WINDOW) places a user-defined window on the main FoxPro window and the main FoxPro window cannot be brought forward over the window.

The following table lists commands that support the IN SCREEN and IN MACDESKTOP clauses.

Command	Command	Command

ACTIVATE WINDOW	DEFINE WINDOW	MODIFY MEMO

BROWSE	EDIT	MODIFY MENU

CHANGE	HELP*	MODIFY PROJECT

CREATE LABEL	HIDE WINDOW	MODIFY REPORT

CREATE MENU	MODIFY COMMAND	MODIFY SCREEN

CREATE PROJECT	MODIFY FILE	SHOW WINDOW

CREATE REPORT	MODIFY GENERAL

CREATE SCREEN	MODIFY LABEL

* DBF-style Help only.


SET MACDESKTOP SeeAlso
See Also

ACTIVATE WINDOW

DEFINE WINDOW

MODIFY WINDOW


SET MACHELP Command

See Also	Example

Manipulates the Help menu option in the Help menu.

Syntax

SET MACHELP DISABLE | ENABLE | PROMPT [<expC>]

Remarks

Use SET MACHELP to manipulate the Microsoft FoxPro Help... menu option in the Help menu. SET MACHELP, when used with ON MACHELP, can be used to invoke a custom Help system for your application.

For more information about creating a custom Help system, see SET HELP or Chapter 13, "Customizing Help," in the FoxPro Developer's Guide.

Clauses

DISABLE

Issue SET MACHELP DISABLE to disable the Microsoft FoxPro Help... menu option. The Microsoft FoxPro Help... menu option remains on the Help menu, but it cannot be chosen and appears in disabled colors.

ENABLE

Issue SET MACHELP ENABLE to enable the Microsoft FoxPro Help... menu option when it has been disabled with SET MACHELP DISABLE.

PROMPT [<expC>]

Use the PROMPT option with <expC> to specify the text that appears on the Help menu. Issue SET MACHELP PROMPT without <expC> to restore the default "Microsoft FoxPro Help..." text to the Help menu.


SET MACHELP Example

This example replaces the Microsoft FoxPro Help... menu option on the Help menu with an option that provides customized Help. When you choose this option, the WAIT command in ON MACHELP is executed and a window appears.

SET MACHELP PROMPT 'My Application Help...'
ON MACHELP WAIT WINDOW "This is My Application's Help"


SET MACHELP SeeAlso
See Also

ON APLABOUT

ON MACHELP

SET APLABOUT

SET HELP


SET MACKEY Command
SET MACKEY

See Also

Specifies a key or key combination that displays the Macros dialog.

Syntax

SET MACKEY TO
[<expC>]

Remarks

By default, pressing Shift+F10 brings forward the Macros dialog. In FoxPro for Macintosh, you can also press Shift+ [image] +0 (0 on the numeric key pad) to display the Macros dialog. You can change this key combination to another key or key combination with SET MACKEY.

Clause

<expC>

Specify the key or key combination that displays the Macros dialog with <expC>.  See ON KEY LABEL for the syntax of the key names and key combinations.

If you issue SET MACKEY TO without a key name or key combination name, you cannot activate the Macros dialog by pressing a key or key combination.


SET MACKEY SeeAlso
See Also

CLEAR Commands

ON KEY LABEL Command

PLAY MACRO Command

RESTORE MACROS Command

SAVE MACROS Command


SET MARGIN Command

See Also

Sets the left printer margin and affects all output directed to the print device.

Syntax

SET MARGIN TO <expN>

Remarks

If you use SET MARGIN to adjust the left margin, the value specified with SET MARGIN is stored to the system memory variable _PLOFFSET.  You can also set the left margin by storing a value directly to _PLOFFSET.

The value of the system memory variable _LMARGIN also affects the left margin setting.

Important   The left margin setting specified in SET MARGIN doesn't affect reports created with the Report Writer and run with REPORT FORM.  Although _PLOFFSET is adjusted during the running of a report created with the Report Writer, it is reset to its original value after the report is run.  The Printer Indent setting in the Page Layout dialog of the Report Writer determines the offset from the left edge of the paper.

Clause

<expN>

Specify the left margin in columns with <expN>.  The default is 0 columns.


SET MARGIN SeeAlso
See Also

_LMARGIN System Memory Variable

_PLOFFSET System Memory Variable


SET MARK OF Commands

See Also

Specifies a menu pad or popup option mark character.

Syntax

SET MARK OF MENU <menu name1> TO <expC1> | TO <expL1>
or
SET MARK OF PAD <pad name> OF <menu name2> TO <expC2> | TO <expL2>
or
SET MARK OF POPUP <popup name1> TO <expC3> | TO <expL3>
or
SET MARK OF BAR <expN> OF <popup name2> TO <expC4> | TO <expL4>

Remarks

Mark characters cannot be changed in FoxPro for Windows and FoxPro for Macintosh.

In FoxPro for Windows and FoxPro for Macintosh, you cannot specify a different mark character for a menu pad or popup option.  The mark character is always a check mark ( [image]).  However, you can use SET MARK OF to display or remove the check mark for a menu pad or popup option.

You can place a mark character to the left of a menu bar pad or a popup option.  A mark character can be used to indicate that a certain condition exists; for example, that a popup is available for the pad, an option controlled by the pad is on or off, and so forth.

Mark characters can be placed to the left of pads in the system menu bar and options on the system popups.

These commands also let you display or remove the mark character.  MRKPAD( ) and MRKBAR( ) facilitate the display or removal of mark characters for menu pad and popup options.

Clauses

MENU <menu name1>

A mark character can be specified for every pad in a menu with SET MARK OF <menu name1>.  Specify the name of the menu with <menu name1>.

TO <expC1> [image] FoxPro for MS-DOS only

In FoxPro for MS-DOS, the mark character is specified with <expC1>.  If <expC1> contains more than one character, only the first character is used as the mark character.

TO <expL1>

If the logical expression <expL1> evaluates to true (.T.), the mark character is displayed beside every pad in the menu.  Set <expL1> to false (.F.) to remove the mark character.

PAD <pad name> OF <menu name2>

You can specify a mark character for an individual menu pad with SET MARK OF PAD <pad name> OF <menu name2>.  Specify the name of the menu with <menu name2> and the name of the pad with <pad name>.

TO <expC2> [image] FoxPro for MS-DOS only

In FoxPro for MS-DOS, a different mark character can be specified for each pad in a menu.  The mark character for a pad is specified with <expC2>.

TO <expL2>

Use the logical expression <expL2> to display or clear the mark character.  If <expL2> evaluates to true (.T.), the mark character is displayed.  The mark character is cleared if <expL2> evaluates to false (.F.).

POPUP <popup name1>

Place mark characters beside every option on a popup with SET MARK OF POPUP <popup name1>.

TO <expC3> [image] FoxPro for MS-DOS only

In FoxPro for MS-DOS, <expC3> is the mark character you want to display beside every option on a popup.

TO <expL3>

Mark characters for all options are displayed or cleared with the logical expression <expL3>.

BAR <expN> OF <popup name2>

Place mark characters beside individual popup options with SET MARK OF BAR <expN> OF <popup name2>.

TO <expC4> [image] FoxPro for MS-DOS only

In FoxPro for MS-DOS, <expC4> is the mark character you want to display beside individual options.

TO <expL4>

The mark characters for individual popup options are displayed or cleared with <expL4>.

You cannot mark options on a popup created with any of the PROMPT clauses (FIELD, FILES or STRUCTURE).

For an example using SET MARK OF, see CNTBAR( ).


SET MARK OF SeeAlso
See Also

CNTBAR( ) Function

CNTPAD( ) Function

DEFINE BAR Command

DEFINE MENU Command

DEFINE PAD Command

DEFINE POPUP Command

MRKBAR( ) Function

MRKPAD( ) Function


SET MARK TO Command

See Also

Specifies a delimiter to use in the display of date expressions.

Syntax

SET MARK TO
[<expC>]

Remarks

SET MARK TO specifies the character that separates the month, day and year in displayed dates.

Clause

<expC>

<expC> is the character you want to use as the date delimiter.

Use SET MARK TO without <expC> to reset the delimiter to the default forward slash (/).


SET MARK TO SeeAlso
See Also

SET DATE Command


SET MEMOWIDTH Command

See Also

Specifies the displayed width of memo fields and character expressions.

Syntax

SET MEMOWIDTH TO <expN>

Remarks

SET  MEMOWIDTH specifies the width of output sent to the desktop in FoxPro for MS-DOS, the main FoxPro window or a user-defined window by commands like ?/??, DISPLAY or LIST.  It affects the output width of memo fields and character expressions that are longer than 254 characters.  It also affects the values returned by the ATCLINE( ), ATLINE( ), MEMLINE( ) and MLINE( ) functions.

In FoxPro for Windows and FoxPro for Macintosh, if output is directed to the main FoxPro window, the width of the output is determined by the font for the main FoxPro window.  If output is directed to a user-defined window, the width of the output is determined by the font for user-defined window.

Clause

<expN>

You can specify a width between 8 and 256 columns.

The default width for output is 50 columns. If you issue SET COMPATIBLE ON or SET COMPATIBLE DB4, the default width is changed to 80 columns. However, if you issue SET COMPATIBLE OFF or SET COMPATIBLE FOXPLUS, the default width is not restored to 50 columns.


SET MEMOWIDTH SeeAlso
See Also

ATCLINE( ) Function

ATLINE( ) Function

MEMLINES( ) Function

MLINE( ) Function


SET MESSAGE Command

See Also

Defines a message for display under the status bar or specifies the location of messages defined with user-defined menu bars and popup commands.

Syntax

SET MESSAGE TO
[<expC>]
or
SET MESSAGE TO
[<expN> [LEFT | CENTER | RIGHT]]
or
SET MESSAGE WINDOW
[<window name>]

Remarks

SET MESSAGE lets you create a message.  It also lets you specify where to display messages created with @ ... PROMPT, DEFINE BAR, DEFINE MENU, DEFINE PAD or DEFINE POPUP.

In FoxPro for MS-DOS, messages are displayed on the last line of the desktop by default.  In FoxPro for Windows and FoxPro for Macintosh, messages are placed on the last line of the main FoxPro window if the graphical status bar isn't displayed.  If the graphical status bar is displayed, messages are placed in the status bar.

Clauses

TO
[<expC>]

Specify the message to display with <expC>.  The status bar must be displayed before the message is displayed.

TO
[<expN> [LEFT | CENTER | RIGHT]]

<expN> specifies the row on the desktop or main FoxPro window on which messages are displayed.  If <expN> is 0, no messages are displayed.  Issuing SET MESSAGE TO without any arguments places messages on the last row of the desktop or in the status bar.

You can also specify the horizontal screen placement of messages in @ ... PROMPTs with LEFT, CENTER and RIGHT.

In FoxPro for Windows and FoxPro for Macintosh, a message location specified with SET MESSAGE is ignored when the graphics-based status bar is displayed.

WINDOW

[<window name>]

If WINDOW <window name> is included, the message is displayed in the window specified with <window name>.  To remove a message from the window and display it on the screen, issue SET MESSAGE WINDOW.


SET MESSAGE SeeAlso
See Also

SET STATUS Command

SET STATUS BAR Command


SET MOUSE Command

See Also

Enables or disables the mouse and controls its sensitivity.

Syntax

SET MOUSE ON | OFF
or
SET MOUSE TO
[<expN>]

Remarks

SET MOUSE is supported in FoxPro for MS-DOS only.

In FoxPro for MS-DOS, you can enable or disable the mouse and control its sensitivity with SET MOUSE.

In FoxPro for Windows and FoxPro for Macintosh, SET MOUSE is ignored.  In FoxPro for Windows, you can use the Windows Control Panel to make adjustments to the mouse. In FoxPro for Macintosh, you can use the Mouse Control Panel to make adjustments to the mouse.

Clauses

ON

Include ON to enable the mouse.

OFF

Include OFF to disable the mouse.

TO
[<expN>]

SET MOUSE TO controls the sensitivity of the mouse.  The value of <expN> controls how fast the pointer moves in response to movement of the mouse.  <expN> can range from 1 through 10; 1 is the least sensitive and 10 is the most sensitive.

The default value for <expN> is 5.


SET MOUSE SeeAlso
See Also

_DBLCLICK System Memory Variable


SET MULTILOCKS Command

See Also	Example

Determines whether or not you can lock multiple records with LOCK( ) or RLOCK.

Syntax

SET MULTILOCKS ON | OFF

Remarks

When a table is opened for shared use on a network, you can attempt to lock more than one record in a table file.  The MULTILOCKS setting determines whether you can attempt to lock either a single record or a set of records.  Records can be locked with the LOCK( ) or RLOCK( ) function.

Note   Note that toggling MULTILOCKS from ON to OFF or from OFF to ON implicitly issues UNLOCK ALL [image] all record locks in all work areas are released.

For more information about record locking, see LOCK( ) and  RLOCK( ).

Clauses

ON

You can attempt to lock a set of records if SET MULTILOCKS is ON.  You can try to lock multiple records by including a set of record numbers in LOCK( ) or RLOCK( ).

OFF

You can attempt to lock a single record with LOCK( ) or RLOCK( ) if SET MULTILOCKS is OFF.

The default value for SET MULTILOCKS is OFF.

For more information about record and file locking and sharing tables on a network, see the FoxPro in a Multi-User Environment chapter in the FoxPro Developer's Guide.


SET MULTILOCKS Example

SET MULTILOCKS ON
SELECT 0
USE customer
? LOCK('1,2,3,4,5', 1)
? RLOCK('1,2,3,4,5', 'customer')
USE


SET MULTILOCKS SeeAlso
See Also

LOCK( ) Function

RLOCK( ) Function


SET NEAR Command

See Also

Determines where the record pointer is positioned after FIND or SEEK unsuccessfully searches for a record.

Syntax

SET NEAR ON | OFF

Remarks

A search is unsuccessful when no record meets the search criteria.

ON

The record pointer is positioned on the closest matching record if SET NEAR is ON and a record search using FIND or SEEK is unsuccessful.  RECNO( ) returns the record number of the closest matching record, FOUND( ) returns false (.F.), and EOF( ) returns false (.F.).

OFF

The record pointer is positioned at the end of the table if SET NEAR is OFF and a record search is unsuccessful.  RECNO( ) returns the number of records in the table plus 1, FOUND( ) returns false (.F.), and EOF( ) returns true (.T.).

Issuing RECNO( ) with an argument of 0 returns the record number of the closest matching record if a search is unsuccessful, regardless of the setting of SET NEAR.

The default value for SET NEAR is OFF.


SET NEAR SeeAlso
See Also

EOF( ) Function

FIND Command

FOUND( ) Function

RECNO( ) Function

SEEK Command


SET NOTIFY Command

See Also

Enables or disables the display of certain system messages.

Syntax

SET NOTIFY ON | OFF

Remarks

Examples of system messages are the "Expression is valid" message in the Expression Builder dialog and the "Do Canceled" message displayed when program execution is canceled.

In FoxPro for MS-DOS, system messages are displayed in a window in the upper-right corner of the main FoxPro window.

In FoxPro for Windows and FoxPro for Macintosh, system messages are displayed in the graphical status bar at the bottom of the main FoxPro window.

Clauses

ON

If SET NOTIFY is ON, certain system messages are displayed.  This is the default setting.

OFF

If SET NOTIFY is OFF, the display of certain system messages is suppressed.


SET NOTIFY SeeAlso
See Also

SET MESSAGE Command

WAIT Command


SET ODOMETER Command

See Also

Determines the reporting interval of the record counter for commands that process records.

Syntax

SET ODOMETER TO
[<expN>]

Remarks

Use SET ODOMETER to change the interval at which commands display information about the number of records processed.

For example, COPY displays the number of records that are copied to a new file while the command is executing.  The record counter can be turned off by setting TALK OFF.

Clause

<expN>

The value of <expN> can range from 1 to 32,767 records.  The default value is 100 records.


SET ODOMETER SeeAlso
See Also

SET TALK Command

_TALLY System Memory Variable


SET OPTIMIZE Command

See Also

Enables or disables Rushmore optimization.

Syntax

SET OPTIMIZE ON | OFF

Remarks

FoxPro uses a technology called Rushmore to optimize data retrieval.  Table commands that support a FOR clause use Rushmore technology to enhance their performance.  In rare cases, you should disable Rushmore optimization.  When a command that uses Rushmore technology is issued, Rushmore determines which records match the FOR criterion.  The command is executed on records in the table that match the Rushmore record set.

If a command that benefits from Rushmore optimization modifies a query's index keys, the Rushmore record set may become outdated.  You can disable Rushmore optimization to ensure that you have the most current information from the table.

Rushmore technology can be globally disabled (or enabled) for all commands that benefit from it with SET OPTIMIZE.  Every command that uses Rushmore has a NOOPTIMIZE clause that can be included to disable Rushmore optimization for the command.  For more information, see the discussion of Rushmore optimization in the Optimizing Your Application chapter in the FoxPro Developer's Guide.

Here are the commands whose performance is optimized by Rushmore:

AVERAGE	COUNT	LABEL	SCAN
BROWSE	DELETE	LIST	SORT
CALCULATE	DISPLAY	LOCATE	SUM
CHANGE	EDIT	RECALL	TOTAL
COPY TO	EXPORT	REPLACE
COPY TO ARRAY	INDEX	REPORT
Clauses

ON

Issuing SET OPTIMIZE ON enables Rushmore optimization.

OFF

Issuing SET OPTIMIZE OFF disables Rushmore optimization.


SET OPTIMIZE SeeAlso
See Also

INDEX Command

SET ORDER Command


SET ORDER Command

See Also

Designates a controlling index file or tag for the current or specified table.

Syntax

SET ORDER TO
[<expN1> | <idx index file> | [TAG] <tag name> [OF <cdx file>]
[IN <expN2> | <expC>]
[ASCENDING | DESCENDING]]

Remarks

A table can have many index files open simultaneously.  However, only one index file (the controlling index file) or tag from a compound index file (the controlling tag) determines the order in which the records in a table are displayed or accessed.  Certain commands (SEEK, for example) use the controlling index file or controlling tag to search for records.  SET ORDER lets you designate the controlling index file or controlling tag.  The controlling index also controls the order in which data is accessed.

You can open index files with a table by including the INDEX clause in USE.  If a table has an associated structural compound index file, it is automatically opened with the table.  After a table has been opened, you may open and close index files for the table using SET INDEX.

Clauses

<expN1>

<expN1> is the name of a controlling index file or controlling tag.  <expN1> refers to the index files as they are listed in USE or SET INDEX. Open .IDX index files are numbered first in the order in which they appear in USE or SET INDEX.  Tags in the structural compound index file (if one exists) are then numbered in the order in which the tags were created.  Finally, tags in any open independent compound index .CDX files are numbered in the order in which they were created.

The following example illustrates how different index file types and tags are numbered.  (The file names are for illustration only and don't necessarily exist.)  A table named VIDEO.DBF is opened with three indexes (TITLE.IDX, COSTS.CDX and RATING.IDX) in the first work area with this command:

USE video INDEX title.idx, costs.cdx, rating.idx IN 1

VIDEO.DBF has a structural compound index file (VIDEO.CDX) with two tags, NUMBERSOLD and YEARSOLD.  The structural compound index file is automatically opened when VIDEO.DBF is opened.

Since .IDX index files are numbered first, issue SET ORDER TO 1 to make TITLE.IDX the controlling index and SET ORDER TO 2 to make RATING.IDX the controlling index:

SET ORDER TO 1
Controlling index: C:\FOXPROW\TITLE.IDX

SET ORDER TO 2
Controlling index: C:\FOXPROW\RATING.IDX

The tags in VIDEO.CDX are numbered next:

SET ORDER TO 3
Controlling index: C:\FOXPROW\VIDEO.CDX  Tag: NUMBERSOLD

SET ORDER TO 4
Controlling index: C:\FOXPROW\VIDEO.CDX  Tag: YEARSOLD

Finally, the tags in the independent COSTS.CDX compound index file are numbered:

SET ORDER TO 5
Controlling index: C:\FOXPROW\COSTS.CDX  Tag: RENTALCOST

SET ORDER TO 6
Controlling index: C:\FOXPROW\COSTS.CDX  Tag: BUYCOST

SET ORDER TO 0 enables open index files to be updated without a performance penalty for tracing an index file structure.  Issuing SET ORDER TO without additional arguments is identical to issuing SET ORDER TO 0.

If <expN> is greater than the number of .IDX index files and .CDX compound index file tags, the error message "Index tag not found" is displayed.

<idx index file>

You can also explicitly designate an .IDX index file as the controlling index file by specifying its name with <idx index file>.

[TAG] <tag name> [OF <cdx file> ]

To explicitly designate a tag of a .CDX index file as the controlling tag, specify the tag name with <tag name>.  The tag name can be from the structural compound index file or any open compound index file.

If identical tag names exist in open compound index files, include OF <cdx file> with the name of the .CDX file containing the desired tag.

Note   The .IDX file takes precedence if duplicate .IDX file and tag names exist.

IN <expN2> | <expC>

SET ORDER designates the controlling index or controlling tag for the table open in the current work area.  You can designate the controlling index file or controlling tag for a table open in another work area by specifying the work area number with <expN2> or the table alias with <expC>.

ASCENDING | DESCENDING

Include ASCENDING or DESCENDING to specify whether table records are displayed and accessed in ascending or descending order.  Including ASCENDING or DESCENDING doesn't change the index file or tag in any way.


SET ORDER SeeAlso
See Also

INDEX Command

ORDER( ) Function

SET INDEX Command


SET PALETTE Command

See Also

Specifies whether or not the FoxPro color palette is used.

Syntax

SET PALETTE ON | OFF

Remarks

SET PALETTE is supported in FoxPro for Windows only.

You can display and manipulate .BMP (bitmap) pictures and OLE (Object Linking and Embedding) objects in FoxPro for Windows.

.BMP pictures and OLE objects can contain color palettes that determine how the pictures and objects appear when they are displayed.  The color palette of the last picture or object displayed is used for all subsequent pictures or objects.  Since a single color palette is used for all the pictures and objects, the colors of some of the pictures and objects can be changed in a unexpected manner.

Clauses

ON

FoxPro for Windows has a default color palette designed to improve the appearance of multiple .BMP pictures and OLE objects.  This color palette is used by default.  Use SET PALETTE ON to restore the default FoxPro for Windows color palette.

OFF

Use SET PALETTE OFF to use the color palettes from the .BMP pictures and OLE objects.


SET PALETTE SeeAlso
See Also

@ ... SAY Command

MODIFY GENERAL Command


SET PATH Command

See Also

Specifies a path for file searches.

Syntax

SET PATH TO
[<path>]

Remarks

In FoxPro for MS-DOS and FoxPro for Windows,SET PATH is used to designate a set of directories where FoxPro searches for files it can't find in the default directory.  The default directory can be specified with SET DEFAULT.

In FoxPro for Macintosh, SET PATH is used to designate a set of folders where FoxPro searches for files that it can't find in the current default folder.

Issue SET PATH TO without <path> to restore the path to the current default directory or folder.

Use SET DEFAULT to specify the default directory or folder and CURDIR( ) to return the current default directory or folder.

Clause

<path>

In FoxPro for MS-DOS and FoxPro for Windows, specify the directories you want FoxPro to search with <path>.

The directories listed in <path> should be separated with commas or semicolons.

In FoxPro for Macintosh, specify the folders you want FoxPro to search with <path>. You can use either MS-DOS path-naming conventions or Macintosh path-naming conventions. For more information about MS-DOS path-naming conventions, see your MS-DOS manual.

Note the following about Macintosh path-naming conventions in FoxPro for Macintosh:

A path can be fully qualified.

SET PATH TO Volume:Folder1:Folder2:File

A path that begins with a colon is considered a relative path.

SET PATH TO :Folder1:File

A path that begins with a volume name must include a colon immediately after the volume name.

SET PATH TO Volume:

A path with a volume or folder name that contains a space must be enclosed in quotation marks.

SET PATH TO 'Volume:Sales Figures'

 Paths are not case sensitive  the following commands are equivalent:

SET PATH TO 'Volume:Sales Figures'
SET PATH TO 'volume:sales figures'

Double colons can be used to move one folder toward the root of folder structure.

SET PATH TO ::

Because other FoxPro platforms do not support colons as delimiters, use the MS-DOS path-naming conventions if you plan to port a FoxPro for Macintosh application to another FoxPro platform. Use SYS(2027) in FoxPro for Macintosh to convert a folder or path containing MS-DOS shorthand notation to one using Macintosh shorthand notation.

On all FoxPro platforms, functions that return path information (CURDIR( ), DBF( ), SYS(2003), and so on) use MS-DOS path-naming conventions in their return values.


SET PATH SeeAlso
See Also

GETFILE( )

LOCFILE( )

SET DEFAULT


SET PDSETUP Command

See Also

Loads a printer driver setup or clears the current printer driver setup.

Syntax

SET PDSETUP TO
[[<expC>[, <expr1>[, <expr2> ...]]]
[WITH <expr3>[, <expr4> ...]]]

Remarks

SET PDSETUP loads a printer driver setup or clears the current printer driver setup.  A printer driver setup is used in FoxPro for Windows and FoxPro for Macintosh when printing character-based reports created in FoxPro for MS-DOS.

A printer driver setup is a combination of settings that include the printer driver program and printing information such as page orientation, default font size and style, margins and so on.

Printer driver setups are stored in your FoxPro resource file, FOXUSER.DBF, and can be created interactively and assigned a name in the Printer Setup Editing dialog.

A printer driver setup can also be loaded or cleared with the _PDSETUP system memory variable.

When SET PDSETUP is issued, the current printer setup interface application is executed.  The interface application is passed the name of the printer driver setup included in SET PDSETUP.  The interface application can be specified with the _GENPD system memory variable.  The default interface application is GENPD.APP, the printer setup interface application included with FoxPro for MS-DOS.

Clauses

<expC>

You can load a printer driver setup by specifying its name with <expC>.

When you load a printer driver setup, the name of the setup is stored in the _PDSETUP system memory variable, and a special memory variable array, _PDPARMS, can be created.

If the printer driver setup name you specify with <expC> doesn't exist in your resource file, the current printer driver setup application is executed so you can create a setup with this name.  If the current printer driver setup application is GENPD.APP, the Printer Setup Editing dialog appears so you can create the setup.

If the name begins with a dash (-), the _GENPD program won't be executed, but the name following the dash is stored in _PDSETUP.

If you issue SET PDSETUP TO without <expC>, the current printer driver setup is cleared, the null string is stored in _PDSETUP and the _PDPARMS array is cleared from memory.

You can load a default printer driver setup when you start FoxPro for MS-DOS by including the following line your CONFIG.FP configuration file:

PDSETUP = '<setup name>' WITH <parm list>

<setup name> is the name of the setup to load when FoxPro for MS-DOS is started.  Be sure to enclose the setup name in quotation marks.  The default printer driver setup specified in CONFIG.FP takes precedence over a default printer driver setup specified in the Printer Driver Setup dialog.

<expr1>[, <expr2> ...]

You can also specify any number of optional parameters (<expr1>, <expr2> ...) with the printer driver setup name.  These parameters are passed to the printer setup interface application and may be of any type (character, numeric, logical, and so on).  The first line in your printer setup interface application must be a PARAMETERS statement to accept the parameters passed from SET PDSETUP.

If you are using GENPD.APP, don't include these optional parameters.  GENPD.APP doesn't accept parameters passed from SET PDSETUP, so including them generates an error.

WITH <expr3>,[<expr4> ...]

The optional WITH clause can be included in SET PDSETUP to create the special _PDPARMS printer array.  Each parameter you specify with <expr3> and <expr4> becomes an element in _PDPARMS.  The first parameter (<expr3>) is stored to the first element of _PDPARMS, the second parameter (<expr4>) is stored to the second element and so on.  These parameters may be of any type (character, numeric, logical, and so on).

If you are using GENPD.APP, any parameters you include are overwritten by the application.


SET PDSETUP SeeAlso
See Also

_GENPD System Memory Variable

_PDRIVER System Memory Variable

_PDSETUP System Memory Variable

SET PRINTER Commands


SET POINT Command

See Also	Example

Determines the decimal point character used in the display of numeric expressions.

Syntax

SET POINT TO
[<expC>]

Remarks

Use SET POINT to change the decimal point from the default, which is a period (.).  Issue SET POINT TO without <expC> to reset the decimal point to a period.  Although you can set the displayed decimal point to a different character, you must use a period as the decimal point in calculations.

Clause

<expC>

<expC> is the character you want to represent a decimal point.


SET POINT Example

x = 1.25
newpoint = '_'
SET POINT TO newpoint
? x

SET POINT TO	&& Reset the decimal point to a period (.)
? x


SET POINT SeeAlso
See Also

SET DECIMALS Command

SET FIXED Command


SET PRINTER Commands

See Also

Enables or disables output to the printer and routes output to a file or a port.

Syntax

SET PRINTER ON [PROMPT] | OFF
or
SET PRINTER TO
[<file> [ADDITIVE] | <port>]
or
SET PRINTER TO
[\\<machine name> \<printer name> = <dest>]
or
SET PRINTER TO
[\\SPOOLER [\N] [\F=<expN>] [\B=<banner>] [\C=<expN>] [\P=<expN>]]
[\S=<server>]
[\Q=<queue>]

Remarks

These commands let you turn output to a printer on or off and direct the output to a file, port or network printer.

Clauses

ON [PROMPT]

Include ON to enable output to the printer.  Output formatted with  @ ... SAY isn't routed to the printer when SET PRINTER is ON.  Use SET DEVICE TO PRINTER to direct output from @ ... SAY to the printer.

In FoxPro for Windows and FoxPro for Macintosh, you can include the optional PROMPT clause to display a dialog before printing starts. In this dialog you can adjust printer settings, including the number of copies and page numbers to print. The printer settings that you can adjust depend on the currently installed printer driver. Place the PROMPT key word immediately after TO PRINTER.  PROMPT is ignored in FoxPro for MS-DOS.

OFF

Include OFF to disable output to the printer.  This is the default setting.

TO
[<file> [ADDITIVE] | <port>]

You can specify a file or a port where output is directed with SET PRINTER TO.  To direct output to a file, specify a file name with <file>.  Output is appended to the existing contents of the file if you include ADDITIVE.  Any existing contents of the file are overwritten if you omit ADDITIVE.

To send output to different local printers,  you can specify one of three parallel ports in FoxPro for MS-DOS and FoxPro for Windows (LPT1, LPT2 or LPT3) or one of two serial ports in all FoxPro versions (COM1 or COM2) with <port>.

In FoxPro for Macintosh, you can specify COM1 or COM2 for the <port>. Include COM1 to specify the modem port or COM2 to specify the printer port. You can also specify the port settings with the following six parameters.

Parameter	Values

<baud rate>	300, 600, 1200, 1800, 2400, 3600, 4800, 7200, 9600, 19200, 57600

<parity>	N (None), O (Odd), E (Even)

<data bits>	5, 6, 7, 8

<stop bits>	1, 1.5, 2

<hand shake>	H (Hardware CTS), S (Software Xon/Xoff), N (None)

<end line>	R (Return), L (Line Feed)  up to four total. For example, RLRL

The default settings are 9600 baud rate, no parity, 8 data bits, 1 stop bit, hardware hand shake and a return and line feed for the end line.

The following command restores the default settings for the COM1 modem port:

SET PRINTER TO COM1, 9600, N, 8, 1, H, RL

In FoxPro for MS-DOS and FoxPro for Windows, use SET PRINTER TO without an argument to reset output to the default MS-DOS PRN print utility.

Printer output can be redirected to a network printer.  Once SET PRINTER is issued for a network printer, output prints or collects in a print spooler until a new SET PRINTER command is issued.  Consult your network documentation for additional information about printing on your network.

\\<machine name>\<printername> = <dest>

The first format of the network SET PRINTER command spools printer output to a network printer.  <machine name> is the network name assigned to your workstation.  This name is assigned by the network administrator and must be unique.  <printer name> is a name assigned to the printer and is also assigned by the network administrator. LPT1, LPT2 or LPT3 is used to identify the destination (<dest>) of the installed printer.

The second format of the network SET PRINTER command is specifically designed for printing under Novell Advanced Netware version 2.00 or later.

\\SPOOLER

Although SPOOLER must be included for compatibility, it is ignored.  Any character string can be substituted.  When using the options below, don't include any space between the clauses.

\N

Include this clause to suppress printing a banner page (No Banner).

\F = <expN>

This clause specifies the form number <expN> (0 through 255) that the output is printed on.  This option is useful for producing different types of printed output, such as checks, invoices, letters, and so on.

\B = <banner>

This clause specifies the heading that is printed on the banner page.  <banner> can contain up to 12 characters.  The default heading is your network user name.

\C = <expN>

This clause specifies the number of copies (1 through 255) queued to a network printer.  The default is 1.

\P = <expN>

This clause specifies the network printer where output is sent.  <expN> is a number assigned to the printer by the network.  The default is 0.

\S = <server>

This clause specifies the network server to which the printer is attached.  <server> shouldn't be a character string (that is, it shouldn't be surrounded by quotation marks).

\Q = <queue>

This clause specifies the queue name assigned to the printer you send output to.  <queue> shouldn't be a character string (that is, it shouldn't be surrounded by quotation marks).


SET PRINTER SeeAlso
See Also

PRINTSTATUS( ) Function

SET DEVICE Command


SET PROCEDURE Command

See Also

Opens a procedure file.

Syntax

SET PROCEDURE TO
[<file>]

Remarks

Use SET PROCEDURE TO without a file name to close the currently open procedure file.

When you execute a program or a function, the procedure file is searched if the program or function isn't located in the currently executing program.

For more information about procedure files, see PROCEDURE.

Clause

<file>

Specify the name of the procedure file you want to open with <file>.  If <file> doesn't include an extension, .PRG is assumed.


SET PROCEDURE SeeAlso
See Also

PROCEDURE Command

SET LIBRARY Command


SET READBORDER Command

See Also	Example

Determines if borders are placed around editing regions created with @ ... GET.

Syntax

SET READBORDER ON | OFF

Remarks

In FoxPro for Windows, SET READBORDER specifies whether single-line borders are placed around editing regions created with @ ... GET.

SET READBORDER is ignored in FoxPro for MS-DOS.

Clauses

ON

If SET READBORDER is ON, a single-line border is placed around all editing regions created with @ ... GET.  If SET READBORDER is ON when the first @ ... GET is issued, all subsequent @ ... GETs created in the same READ level also have borders.

OFF

If SET READBORDER is OFF, a border isn't placed around editing regions created with @ ... GET.  If SET READBORDER is OFF when the first @ ... GET is issued, all subsequent @ ... GETs created in the same READ level do not have borders.

The default for SET READBORDER is OFF.


SET READBORDER Command Example
SET READBORDER Example

In the following example, the first three editing regions created with @ ... GET have borders.  The third editing region has a border even though SET READBORDER was SET to OFF before it was created.  The fourth editing region does not have a border since READBORDER was SET to OFF and it is encompassed in a different READ than the first three editing regions.

SET READBORDER ON

@ 2,2 GET w DEFAULT 1   && 1st READ
@ 4,2 GET x DEFAULT 1   && 1st READ

SET READBORDER OFF

@ 6,2 GET y DEFAULT 1   && 1st READ
READ

@ 8,2 GET z DEFAULT 2	&& 2nd READ
READ


SET READBORDER Command SeeAlso
See Also

@ ... GET Command

READ Command


SET REFRESH Command

See Also

Determines whether or not your screen displays changes made to records by other users on the network.

Syntax

SET REFRESH TO <expN1>
[, <expN2>]

Remarks

Tables can be opened for shared use on a network.  It is possible that records you are viewing are being edited by other users on the network.  Use SET REFRESH to specify whether open Browse windows are updated with changes made by other users on the network.

SET REFRESH affects records displayed in a Browse window opened with BROWSE, CHANGE or EDIT.  Memo fields opened for editing in a Browse window are also updated.  SET REFRESH specifies how often these windows are updated.

SET REFRESH can also be used to specify how often data buffered locally on your workstation is updated.

Clauses

<expN1>

The numeric expression <expN1> specifies how often a Browse or memo editing window is updated.  <expN1> is the number of seconds between updates and can be a value from 0 to 3,600; the default value is 0 seconds.  When <expN1> is a non-zero value and other users change records you are viewing, the records you are viewing are updated when the refresh interval elapses.  The records you are viewing aren't updated if <expN1> is 0.

FoxPro attempts to lock a record when you try to modify the record in a Browse window.  Regardless of the setting of SET REFRESH, if a record you are trying to lock is locked by another user on the network, you receive the updated record when the lock is released by the other user.  The message "Record has changed" may also be displayed.

<expN2>

The network versions of FoxPro buffer portions of tables in memory on your workstation.  <expN2> specifies how often these local data buffers are updated with current data from the network.  <expN2> is the number of seconds between data buffer updates.  The default value of <expN2> is 5; you can specify a value between 0 and 3,600.  The buffers are never refreshed if <expN2> is set to 0.

If you specify a value for <expN1> other than 0 but don't include <expN2>, <expN2> is set to the same value as <expN1>.  However, <expN2> is set to 5 if you specify 0 for <expN1> and don't include <expN2>.

Performance can be improved by increasing the value of <expN2>.


SET REFRESH SeeAlso
See Also

BROWSE Command

CHANGE Command

EDIT Command

MODIFY MEMO Command


SET RELATION Command

See Also	Example

Links or unlinks two or more open tables.

Syntax

SET RELATION TO
[<expr1> INTO <expN1> | <expC1>
[, <expr2> INTO <expN2> | <expC2> ...]
[ADDITIVE]]

Remarks

SET RELATION establishes a relationship between two open tables.  Before you establish a relationship, one table (the parent table) must be open in the current work area, and the other (the child table) must be open in another work area.  Then you can use SET RELATION to create the relationship.

After the relationship is created, moving the record pointer in the parent table moves the record pointer to the corresponding record in the child table.  If a matching record can't be found in the child table, the record pointer in the child table is positioned at the end of the table.

Related tables typically have a common field.  For example, suppose a table (CUSTOMER.DBF) contains customer information.  It has fields for name, address and a unique customer number.  A second table (INVOICES.DBF) contains billing information.  It too has a field for the customer number, along with fields for credit limit and payment terms.

You can use SET RELATION to relate these two tables on their common field [image] the customer number field.  To set the relation, the child table must be indexed on the common field.  After you set the relation, whenever you move the record pointer to a record with a given customer number in the parent (CUSTOMER) table, the record pointer in the child (INVOICES) table moves to the record with the same customer number.

Clauses

<expr1>

The general relational expression <expr1> establishes the relationship between the parent and child tables.  The relational expression is usually the index expression of the controlling index of the child table, although it can be a numeric expression.

A child table is typically indexed on a character, numeric or date type field.  The index for the child table can be a single-entry (.IDX ) index, a multiple-entry structural compound index or an independent compound (.CDX) index.  If the index is compound, specify the proper index tag to order the child table.  SET ORDER can be used to specify the index tag that orders the child table.

For example, consider the CUSTOMER and INVOICES tables described above.  Suppose the child (INVOICES) table has been indexed and ordered on the customer number with this command:

SET ORDER TO TAG cno

To relate the CUSTOMER and INVOICES tables on customer number, use SET RELATION, specifying the index expression as the following relational expression:

SET RELATION TO cno INTO invoices

The child table must be indexed unless the relational expression is numeric.  The alert "Database isn't ordered" is displayed if you issue SET RELATION with a non-numeric relational expression and the child table isn't ordered with an index.

If <expr1> is numeric, it is evaluated when the record pointer in the parent table is moved.  The record pointer in the child table is then moved to record number <expr1>.

Issue SET RELATION TO to remove all relationships in the current work area.  Issue SET RELATION OFF to remove a specific parent-child relationship.

INTO <expN1> | <expC1>

The child table is identified by the work area in which it's open or its table alias.  Specify the child table's work area number with <expN1> or its table alias with <expC1>.

<expr2> INTO <expN2> | <expC2> ...

You can create multiple relations from a single parent table with a single SET RELATION.  Include a list of relations separated by commas to create relations to multiple child tables.

ADDITIVE

Include ADDITIVE to preserve all existing relationships in the current work area and create the specified relationship.  If ADDITIVE isn't included, any relationships in the current work area are broken, and the specified relationship is created.


SET RELATION Example

The following example opens CUSTOMER.DBF (the parent) in the first work area, and INVOICES.DBF (the child) in the second work area.  SET ORDER is used to specify the order of INVOICES.DBF.

The first work area is selected again, and a relationship is established between CUSTOMER.DBF and INVOICES.DBF.  A Browse window is opened for each table.  Move the record pointer in the parent Browse window through several records.  The record pointer moves to the related record in the child (INVOICES) Browse window.

CLOSE DATABASES
USE customer IN 1	&& The parent table
USE invoices  IN 2	&& The child table
SELECT invoices
SET ORDER TO TAG cno	&& Specify the table order
SELECT customer	&& Parent work area
SET RELATION TO cno INTO invoices	&& Create the relationship

SELECT invoices	&& Open two Browse windows
BROWSE NOWAIT	&& Moving the record pointer
SELECT customer	&& in the parent table
BROWSE NOWAIT	&& moves the pointer in the child


SET RELATION SeeAlso
See Also

INDEX Command

RELATION( ) Function

SET ORDER Command

SET RELATION OFF Command

SET SKIP Command

TARGET( ) Function


SET RELATION OFF Command

See Also

Breaks an established relationship between the current table, which is the parent table, and another open table.

Syntax

SET RELATION OFF INTO <expN> | <expC>

Clauses

INTO <expN> | <expC>

Specify the child table work area number with <expN> or its table alias with <expC>.


SET RELATION OFF SeeAlso
See Also

RELATION( ) Function

SELECT Command

SET RELATION Command

SET SKIP Command

TARGET( ) Function


SET REPROCESS Command

See Also

Specifies how many times or for how long FoxPro attempts to lock a file or record after an unsuccessful locking attempt.

Syntax

SET REPROCESS TO <expN> [SECONDS] | TO AUTOMATIC

Remarks

A record or file lock isn't always successful on the first attempt.  Frequently, a record or file is locked by another user on the network.  If an initial record or file lock is unsuccessful, SET REPROCESS controls whether additional attempts will be made to lock the record or file.

With SET PROCESS, you can specify either how many times additional attempts are made or for how long the attempts are made.  An ON ERROR routine affects how unsuccessful lock attempts are handled.

Clauses

TO <expN> [SECONDS]

The numeric expression <expN> specifies how many times FoxPro tries to lock a record or file after an unsuccessful attempt.  The default value is 0.

SET REPROCESS TO 0

If <expN> is 0 (the default value), and you issue a command or function that attempts to lock a record or file, FoxPro attempts to lock the record or file indefinitely.  The system message "Attempting to lock ...  Press Escape to Cancel" is displayed while FoxPro attempts to lock the record or file.  The lock is placed and the system message is cleared if the record or file becomes available for locking while you wait.  If a function attempted to place the lock, the function returns true (.T.).

If you press Esc in response to the system message, an appropriate alert is displayed (for example, "Record is in use by another").  If a function attempted to place the lock, the alert isn't displayed, and the function returns false (.F.).

If an ON ERROR routine is in effect and a command is attempting to lock the record or file, the ON ERROR routine takes precedence over additional attempts to lock the record or file.  The ON ERROR routine is immediately executed.  No additional record or file locks are attempted, and the system message isn't displayed.

If a function attempted to place the lock, no system message is displayed, an ON ERROR routine isn't executed, and the function returns false (.F.).

SET REPROCESS TO -1

If <expN> is -1, FoxPro attempts to lock the record or file indefinitely.  You can't cancel the locking attempts by pressing the Esc key, and an ON ERROR routine isn't executed.

A system message ("Waiting for lock ... ") is displayed only if SET STATUS is ON.

If a lock has been placed by another user on the record or file you are attempting to lock, you must wait until the user releases the lock.

SET REPROCESS TO <expN> > 0 [SECONDS]

You can specify how many times or for how long FoxPro attempts to lock a record or file if <expN> is greater than 0.  To specify the number of times, omit the key word SECONDS; to specify the length of time, include SECONDS.

For example, if <expN> is 30, FoxPro attempts to lock a record or file up to 30 times.  If you also include the optional key word SECONDS (SET REPROCESS TO 30 SECONDS), FoxPro continuously attempts to lock a record or file for up to 30 seconds.

A system message ("Waiting for lock ... ") is displayed if SET STATUS is ON.

If an ON ERROR routine is in effect and attempts by a command to lock the record or file are unsuccessful, the ON ERROR routine is executed.  However, if a function attempted the lock, an ON ERROR routine isn't executed and the function returns  false (.F.).

If an ON ERROR routine isn't in effect and the record or file lock can't be placed, an appropriate alert is displayed (for example, "Record is in use by another").  If a function attempted to place the lock, the alert isn't displayed, and the function returns  false (.F.).

TO AUTOMATIC

If you issue SET REPROCESS TO AUTOMATIC (or SET REPROCESS TO -2), FoxPro attempts to lock the record or file indefinitely.  The system message "Attempting to lock ...  Press Escape to Cancel" is displayed while FoxPro attempts to lock the record or file.  If the record or file becomes available to lock while you are waiting, the lock is placed and the system message is cleared.  If a function is used to place the lock, the function returns true (.T.).

If an ON ERROR routine isn't in effect and you press Esc in response to the system message, an appropriate alert is displayed (for example, "Record is in use by another").  If a function attempted to place the lock, the alert isn't displayed and the function returns  false (.F.).

If an ON ERROR routine is in effect and Esc is pressed, the ON ERROR routine is executed.  If a function attempted to place the lock, an ON ERROR routine isn't executed and the function returns  false (.F.).

For more information about record and file locking and sharing tables on a network, see the FoxPro in a Multi-User Environment chapter in the FoxPro Developer's Guide.


SET REPROCESS SeeAlso
See Also

FLOCK( ) Function


SET RESOURCE Command

See Also

Specifies or updates a resource file.

Syntax

SET RESOURCE ON | OFF
or
SET RESOURCE TO
[<file>]

Remarks

The resource file is a FoxPro table that contains information on system and user-defined resources like keyboard macros, preferences, system window locations and sizes, diary entries, and so on.

For more information on resource files, refer to the Customizing FoxPro chapter in the FoxPro Installation and Configuration manual.

Clauses

ON

Any changes made to the FoxPro environment is saved to the resource file if SET RESOURCE is ON.

The default for SET RESOURCE is ON.

OFF

Any changes made to the FoxPro environment aren't saved to the resource file if SET RESOURCE is OFF.

TO

[<file>]

Use SET RESOURCE TO <file> to specify a resource file.  You can save the FoxPro environment to a resource file other than the default FOXUSER.DBF resource file by specifying the name of the file with <file>.

Issue SET RESOURCE TO without a resource file name to open the default FOXUSER.DBF resource file.  Issuing SET RESOURCE TO performs an implicit SET RESOURCE ON.


SET RESOURCE SeeAlso
See Also

SYS(2005) Function - Current Resource File


SET SAFETY Command

See Also

Determines whether or not FoxPro displays a warning before overwriting an existing file.

Syntax

SET SAFETY ON | OFF

Remarks

Use SET SAFETY to display a warning before you overwrite a file.

In FoxPro for Macintosh, SET SAFETY also determines if you are prompted when you close a text editing window after making changes to the text.

Clauses

ON

If SET SAFETY is ON and you execute a command that overwrites a file, a dialog is first displayed asking if you want to overwrite the file.

In FoxPro for Macintosh, if SET SAFETY is ON a dialog is displayed when you close a text editing window after making changes to the text. The dialog allows you to save or discard the changes or return to the text editing window. Text editing windows are closed by pressing Ctrl+W, clicking the Close box or choosing Close from the File menu.

The default for SET SAFETY is ON.

OFF

No dialog is displayed before a file is overwritten if SET SAFETY is OFF.

In FoxPro for Macintosh, if SET SAFETY is OFF a dialog is not displayed when you close a text editing window after making changes to the text. Your changes are saved if you close the text editing window by pressing Ctrl+W, clicking the Close box or choosing Close from the File menu. Your changes are discarded if you close the text editing window by pressing Esc.


SET SAFETY SeeAlso
See Also

SET TALK


SET SCOREBOARD Command

See Also

Specifies where FoxPro displays the status of the NumLock, CapsLock, and Insert keys.

Syntax

SET SCOREBOARD ON | OFF

Remarks

SET SCOREBOARD is supported in FoxPro for MS-DOS only and is included for backward compatibility.

In FoxPro for MS-DOS, SET SCOREBOARD specifies where the status of the NumLock, CapsLock and Insert keys is displayed.

In FoxPro for Windows and FoxPro for Macintosh, SET SCOREBOARD is ignored.

Clauses

ON

The status of the NumLock, CapsLock and Insert keys is displayed on line 0 if SET SCOREBOARD is ON and the status bar isn't displayed.  Because the FoxPro system menu bar is displayed on line 0, you must press Shift+Ctrl+Alt to hide the menu bar to see the key status.

If the status bar is displayed, the status of the NumLock, CapsLock and Insert keys is displayed in the status bar.

OFF

If both SET SCOREBOARD and SET STATUS are OFF, the status of the NumLock, CapsLock and Insert keys isn't displayed.  Issuing SET SCOREBOARD OFF clears the main FoxPro window.

The default for SET SCOREBOARD is OFF.


SET SCOREBOARD SeeAlso
See Also

SET BRSTATUS Command


SET SEPARATOR Command

See Also	Example

Specifies the character that separates each group of three digits to the left of the decimal point.

Syntax

SET SEPARATOR TO
[<expC>]

Remarks

Use SET SEPARATOR to specify the numeric place separator in an @ ...  SAY PICTURE clause to a different character.

The default separator is a comma (,).

Clause

<expC>

Specify the character you want to use as the numeric place separator with <expC>.

Use SET SEPARATOR TO without <expC> to reset the separator to the default comma.


SET SEPARATOR Example

SET SEPARATOR TO '#'
x = 1000
@ 2,2 GET x PICTURE '9,999.99'
READ
SET SEPARATOR TO 	&& Reset the separator to a comma (,)


SET SEPARATOR SeeAlso
See Also

SET DECIMALS Command


SET SHADOWS Command

See Also

Places or removes shadows from all user-defined windows, popups created with DEFINE POPUP, and FoxPro system windows and popups.

Syntax

SET SHADOWS ON | OFF

Remarks

SET SHADOWS is supported in FoxPro for MS-DOS only.

In FoxPro for MS-DOS, SET SHADOWS globally displays or removes shadows from all system and user-defined windows, popups, dialogs and alerts.

SET SHADOWS is ignored in FoxPro for Windows and FoxPro for Macintosh.

A window created with DEFINE WINDOW isn't affected by SET SHADOWS unless the window was created with the SHADOW clause.

If you specify a SHADOW setting in your configuration file, it is overridden by the SHADOW setting of the color set that loads when you start FoxPro.

Clauses

ON

Issue SET SHADOWS ON to display shadows. This is the default setting.

OFF

Issue SET SHADOWS OFF to remove shadows.


SET SHADOWS SeeAlso
See Also

DEFINE WINDOW Command


SET SKIP Command

See Also	Example

Creates one-to-many relationships between tables.

Syntax

SET SKIP TO
[<alias1>[, <alias2>] ...]

Remarks

You can establish relations between tables open in different work areas with SET RELATION.  When the record pointer is moved in the parent table, the record pointer in the child table is moved to the first corresponding record.  Where the record pointer is moved in the child table is determined by the relational expression in SET RELATION.  A one-to-one relation is created [image] for each record in the parent table, the record pointer moves to the first matching record in the child file. If a matching record can't be found in the child table, the record pointer in the child table is moved to the end of the file.

Frequently, a child table contains multiple records that correspond to one record in the parent table.  SET SKIP lets you establish a one-to-many relationship between one record in the parent table and multiple records in the child table.  When you skip through the parent file, the record pointer remains on the same parent record until the record pointer moves through all related records in the child file.

You establish a one-to-many relationship in a manner similar to the way you create a one-to-one relationship:  First, you establish the relationship between the parent and child table with SET RELATION;  then, you issue SET SKIP to create a one-to-many relationship.

Clause

TO <alias1>[, <alias2>] ...

If the parent table is related to several child tables, include a list of table aliases separated by commas to create a one-to-many relationship with each child table specified with <alias1>, <alias2>, and so on.  In commands that support a scope (DISPLAY, LIST, and so on), records in the parent table are repeated for each corresponding record in the child table.

Use SET SKIP TO without any additional arguments to remove the one-to-many relationship between tables in the current work area.  The one-to-one relationship remains and can be removed with SET RELATION TO.


SET SKIP Example

This example uses SET SKIP to create a one-to-many relationship between two tables.  There is a single record in the parent table (OFFICES) for each invoice created.  The child table (CUSTOMER) contains multiple records for each record in the parent table.  After the relationship is created, a Browse window displaying records from both the parent and child tables is opened.

The FIELDS clause fields list contains records from both the parent and child tables.  The names of fields are prefaced with their table alias (CUSTOMER or OFFICES) and a period.

CLEAR
CLOSE DATABASES
USE offices INDEX offices ORDER ono IN 0	&& Parent table
USE customer INDEX customer ORDER ono IN 0	&& Child table
SELECT offices	&& Back to parent work area
SET RELATION TO ono INTO customer	&& Establish relationship
SET SKIP TO customer	&& One-to-many relationship
WAIT WINDOW 'Scroll to see companies for each office' NOWAIT

BROWSE FIELDS offices.ono :H='Office Number', ;
offices.city :H='Office City', customer.company


SET SKIP SeeAlso
See Also

RELATION( ) Function

SET RELATION Command

SKIP Command


SET SKIP OF Command

See Also

Enables or disables a menu bar, menu pad, popup or popup bar for user-defined menus or the FoxPro system menu.

Syntax

SET SKIP OF MENU <menu name> <expL>
or
SET SKIP OF PAD <pad name> OF <menu name> <expL>
or
SET SKIP OF POPUP <popup name> <expL>
or
SET SKIP OF BAR <expN> | <system option name>
OF <popup name> <expL>

Remarks

You can use SET SKIP OF with the FoxPro menu system or user-defined menus and popups.  For a complete listing of the names of the FoxPro system menu bar, menu pads, popups and popup options, see MENU [image] System Menu Names.  (You can also use SYS(2013) to return the system menu names.)

If the logical expression <expL> evaluates to true (.T.), the menu, menu pad, popup or popup option included in SET SKIP OF is disabled (can't be selected) and is displayed in disabled colors.  If <expL> evaluates to false (.F.), the menu, menu pad, popup or popup option is enabled (can be selected) and is displayed in enabled colors.

Clauses

MENU <menu name> <expL>

SET SKIP OF MENU lets you enable or disable a menu bar.  For example, the FoxPro system menu bar _MSYSMENU can be disabled with this command:

SET SKIP OF MENU _MSYSMENU .T.

It can be enabled with this command:

SET SKIP OF MENU _MSYSMENU .F.

SET SKIP OF MENU can also be used to enable or disable user-defined menus created with DEFINE MENU.

PAD <pad name> OF <menu name> <expL>

SET SKIP OF PAD lets you enable or disable a FoxPro system menu pad or a user-defined menu pad created with DEFINE PAD.

For example, the FoxPro Edit menu pad can be disabled with this command:

SET SKIP OF PAD _MSM_EDIT OF _MSYSMENU .T.

It can be enabled with this command:

SET SKIP OF PAD _MSM_EDIT OF _MSYSMENU .F.

POPUP <popup name> <expL>

SET SKIP OF POPUP lets you enable or disable a FoxPro system popup or a user-defined popup created with DEFINE POPUP.

For example, the FoxPro Edit menu can be disabled with this command:

SET SKIP OF POPUP _MEDIT .T.

It can be enabled with this command:

SET SKIP OF POPUP _MEDIT .F.

BAR <expN> | <system option name>

OF <popup name> <expL>

SET SKIP OF BAR lets you enable or disable an option in a FoxPro system popup or a user-defined popup option created with DEFINE BAR.

For example, the New ...  option in the FoxPro File menu can be disabled with this command:

SET SKIP OF BAR _MFI_NEW OF _MFILE .T.

It can be enabled with this command:

SET SKIP OF BAR _MFI_NEW OF _MFILE .F.


SET SKIP OF SeeAlso
See Also

CREATE MENU Command

DEFINE BAR Command

DEFINE MENU Command

DEFINE PAD Command

DEFINE POPUP Command

MENU - System Menu Names Overview

SKPBAR( ) Function


SET SPACE Command

See Also	Example

Determines whether or not a space is displayed between fields or expressions when you use the ? or ?? command.

Syntax

SET SPACE ON | OFF

Remarks

Issuing SET SPACE inserts or removes a space between fields or expressions when you use the ? or ?? commands.

Clauses

ON

SET SPACE ON inserts a space between fields and expressions.  This is the default setting.

OFF

SET SPACE OFF removes all spaces between fields or expressions and runs them together.


SET SPACE Example

x = 'John'
y = 'Smith'
SET SPACE OFF
? x,y

SET SPACE ON
? x,y


SET SPACE SeeAlso
See Also

? | ?? Commands


SET STATUS Command

See Also

Displays or removes the status bar.

Syntax

SET STATUS ON | OFF | TIMEOUT TO [<expN>]

Remarks

SET STATUS displays or removes the status bar.  In FoxPro for Windows and FoxPro for Macintosh, you can use SET STATUS to specify how long messages are displayed in the graphical status bar.

Clauses

ON

If SET STATUS is ON, the status bar is displayed showing the name of the program currently executing (if any) the alias of the active table, the current record pointer position, the number of records in the table, and the state of the Insert, NumLock and CapsLock keys.  The record or file lock status is also shown in the status bar when the table is opened for shared use.  The status bar is updated each time you execute a command that changes status information.

SET STATUS ON displays a character-based status bar in FoxPro for Windows and FoxPro for Macintosh. Use SET STATUS BAR ON to display a graphical status bar.

OFF

Use SET STATUS OFF to remove the status bar.

The default for SET STATUS is OFF.

TIMEOUT TO [<expN>]

Include the TIMEOUT clause to specify how long messages are displayed in the graphical status bar in FoxPro for Windows and FoxPro for Macintosh.

The TIMEOUT clause is ignored in FoxPro for MS-DOS.

The numeric expression <expN> specifies how many seconds messages are displayed in the graphical status bar.  For example, if <expN> is 10, a message is displayed for 10 seconds and then cleared.  If <expN> is 0, messages remain in the status bar until a key is pressed.

By default, messages are displayed in the graphical status bar for 5 seconds.  To restore the default setting, issue the following command without the numeric expression <expN>:

SET STATUS TIMEOUT TO


SET STATUS SeeAlso
See Also

SET BRSTATUS Command

SET MESSAGE Command

SET SCOREBOARD Command

SET STATUS BAR Command


SET STATUS BAR Command

See Also

Displays a graphical status bar in FoxPro for Windows and FoxPro for Macintosh.

Syntax

SET STATUS BAR ON | OFF

Remarks

SET STATUS BAR is supported in FoxPro for Windows and FoxPro for Macintosh.

In FoxPro for Windows and FoxPro for Macintosh, you can display a graphical status bar at the bottom of the main FoxPro window.  Use SET STATUS BAR to display the graphical status bar or to remove it from the main FoxPro window.

When you select a menu pad or menu option, information about the menu or option is displayed in the status bar.  Additional information displayed in the status bar includes the alias of the table in the current work area, the current record number, the number of records in the table, the currently executing program, and the status of the Insert, Num Lock, and Caps Lock keys.  You can place a clock in the graphical status bar with SET CLOCK STATUS.

When the graphical status bar is displayed, messages created in commands that support messages (DEFINE MENU, DEFINE POPUP, DEFINE BAR, and so on) always appear in the status bar.  A message location specified with SET MESSAGE is ignored when the graphical status bar is displayed.

The graphical status bar is displayed by default.  To prevent the graphical status bar from being displayed when FoxPro for Windows or FoxPro for Macintosh is started, place the following line in your FoxPro configuration file:

STATUS BAR = OFF

The character-based status bar familiar to FoxBASE+ and FoxPro for MS-DOS users can be displayed with SET STATUS ON.  If the graphical status bar is displayed, issuing SET STATUS ON removes the graphical status bar from the main FoxPro window and displays the character-based status bar.  Issuing SET STATUS OFF removes the character-based style status bar from the main FoxPro window.

When the character-based style status bar is displayed, messages created in commands that support messages (DEFINE MENU, DEFINE POPUP, DEFINE BAR, and so on) appear under the status bar.  You can specify a different location for messages with SET MESSAGE.

Clauses

ON

Issue SET STATUS BAR ON to display the graphical status bar.

OFF

Issue SET STATUS BAR OFF to remove the graphical status bar from the main FoxPro window.


SET STATUS BAR SeeAlso
See Also

SET BRSTATUS Command

SET MESSAGE Command

SET SCOREBOARD Command

SET STATUS Command


SET STEP Command

See Also

Opens the Trace window and suspends program execution for debugging.

Syntax

SET STEP ON | OFF

Remarks

Choosing Step in the Trace window menu bar executes a single program line.  Choosing Resume resumes execution without stepping through the program one line at a time.

You can pass parameters to a program and then trace its execution by following these steps:

1	Open the Trace window.

2	From the Program menu in the Trace window, choose the Open ...  option and choose the program to trace.

3	Set a breakpoint on the first executable line of the program.

4	In the Command window, DO the program WITH the parameters.

See the FoxPro User's Guide for more information on the Trace window.


SET STEP SeeAlso
See Also

SET ECHO Command


SET STICKY Command

See Also

Specifies how the mouse displays menu popups.

Syntax

SET STICKY ON | OFF

Remarks

SET STICKY is supported in FoxPro for MS-DOS and FoxPro for Macintosh only.

In FoxPro for MS-DOS, SET STICKY controls the display of FoxPro system menu popups.

In FoxPro for Macintosh, SET STICKY controls the display of user-defined menu popups created with DEFINE POPUP, and menus in the Trace Window. Menus that use the FoxPro system menu are not affected by SET STICKY. Menus created with the Menu Builder use the FoxPro system menu.Clauses

ON

If SET STICKY is ON and you select a menu pad with the mouse, the popup remains open until you choose an option, press Esc or click outside the popup.

The default for SET STICKY is ON.

OFF

If SET STICKY is OFF and you select a menu pad with the mouse, the popup remains on the desktop only while the mouse button is pressed.


SET STICKY SeeAlso
See Also

SET SYSMENU Command


SET SYSMENU Command

See Also	Example

Enables or disables access to the FoxPro system menu bar during program execution.

Syntax

SET SYSMENU ON | OFF | AUTOMATIC |
TO [<menu popup list>] | TO [<menu pad list>] | TO [DEFAULT] |
SAVE | NOSAVE

Remarks

SET SYSMENU controls the main FoxPro menu bar during program execution and lets you selectively remove and restore menu pads and popup options from the main FoxPro menu system.

Clauses

ON

The main FoxPro menu bar is accessible during program execution when SET SYSMENU is ON and FoxPro is waiting for keyboard input (during commands such as BROWSE, READ, MODIFY COMMAND, and so on).  The main FoxPro menu bar isn't displayed, but in FoxPro for MS-DOS and FoxPro for Windows you can display and make it accessible by pressing the Alt or F10 key or by double-clicking the right mouse button. In FoxPro for Macintosh, press Alt or [image] +0 to activate the main FoxPro menu bar.

The default for SET SYSMENU in FoxPro for MS-DOS is ON. In FoxPro for Windows and FoxPro for Macintosh, the default is AUTOMATIC.

OFF

If SET SYSMENU is OFF, you can't access the main FoxPro menu bar during program execution.

AUTOMATIC

Include AUTOMATIC to make the main FoxPro menu bar visible during program execution.  The menu bar is accessible as appropriate, and menu options are enabled and disabled as appropriate for the current command.

In FoxPro for Windows, the default for SET SYSMENU is AUTOMATIC.

TO [<menu popup list>]
TO [<menu pad list>]

You can add a subset of menu popups to the main FoxPro menu bar by including a menu popup list or pad list.  The menu popup or pad list can contain any combination of menu popup or pad names separated by commas.  The names for the menu popups and pads are listed in Menu [image] System Menu Names.

For example, issuing the following command removes all menus from the main FoxPro menu bar except the File and Window menus.

SET SYSMENU TO _MFILE, _MWINDOW

You can't include the names of options that appear in the main FoxPro menus.  Use RELEASE BAR to specify popup options.

TO [DEFAULT]

Issuing SET SYSMENU TO without any arguments disables the main FoxPro menu bar.  If you modify the main menu bar or its popups, you can restore it to the default configuration by issuing SET SYSMENU TO DEFAULT.  You can specify a default configuration with SET SYSMENU SAVE.

SAVE

Issuing SET SYSMENU SAVE makes the current menu system the default configuration.  If you modify the menu system after issuing SET SYSMENU SAVE, you can restore the previous configuration by issuing SET SYSMENU TO DEFAULT.

NOSAVE

Issuing SET SYSMENU NOSAVE returns the main menu bar and its popups to the standard FoxPro startup configuration.


SET SYSMENU Example

Type the following commands in the Command window.

SET SYSMENU SAVE
SET SYSMENU TO _msm_file, _msm_edit
SET SYSMENU TO
SET SYSMENU TO DEFAULT


SET SYSMENU SeeAlso
See Also

MENU - System Menu Names Overview

POP MENU Command

PUSH MENU Command

RELEASE Command

SET STICKY Command

SYS(2013) Function - System Menu Name String


SET TALK Command

See Also	Example

Determines whether or not FoxPro displays command results.

Syntax

SET TALK  ON | OFF | WINDOW [<window name>] | NOWINDOW

Remarks

Some table processing commands return information about their status while they execute.  This status information is often referred to as "talk."  These commands include the following:

APPEND FROM	COUNT	PACK	SORT
AVERAGE	DELETE	REINDEX	SUM
CALCULATE	INDEX	REPLACE	TOTAL
COPY TO	SELECT [image] SQL
Talk can be directed to the main FoxPro window, the system message window or a user-defined window in FoxPro for MS-DOS.  In FoxPro for Windows and FoxPro for Macintosh, talk can be directed to the main FoxPro window, the graphical status bar or a user-defined window.  Talk can also be turned off.

Clauses

ON

Talk can be turned on with SET TALK ON.  If SET TALK  is OFF and is then changed to ON, the talk is directed to the same location (the desktop, the main FoxPro window, the status bar, the system message window or a user-defined window) it was sent to before you issued SET TALK OFF.  ON is the default setting.

OFF

Use SET TALK OFF to prevent talk from being sent to the desktop, the main FoxPro window, the status bar, the system message window or a user-defined window.

WINDOW [<window name>]

In FoxPro for MS-DOS, talk is displayed in the system message window if you issue SET TALK WINDOW and  SET NOTIFY  is ON.  The system message window is removed when you press a key or move the mouse.

You can direct talk to a user-defined window by specifying a window name with <window name>.  You must create the user-defined window before you can direct talk to the window.  A user-defined window doesn't have to be active or visible to direct talk to it.  In FoxPro for MS-DOS, talk is directed to the FoxPro system window if the window you specify doesn't exist.

NOWINDOW

To direct talk to the desktop or main FoxPro window, issue SET TALK NOWINDOW.

Reporting Interval

The TALK reporting interval can be specified with SET ODOMETER.  The default value for SET ODOMETER is 100.  Note that execution speed can be degraded when SET TALK is ON because the desktop, main FoxPro window or user-defined window must be frequently updated.  If you just need the total number of records processed by a command, you can issue SET TALK OFF and display the _TALLY system memory variable once the command has completed executing.


SET TALK Example

The following example demonstrates how you can save the TALK setting without generating talk on main FoxPro window or user-defined window.

IF SET('TALK') = 'ON'	&& TALK handled as a special case.
SET TALK OFF	&& Turn TALK OFF
savetalk = 'ON'	&& TALK was ON, save the setting
ELSE   	&& TALK is OFF
savetalk = 'OFF'	&& TALK was OFF, save the setting
ENDIF

*** Additional commands ***

SET TALK &savetalk	&& Restore original setting


SET TALK SeeAlso
See Also

DEFINE WINDOW Command

SET NOTIFY Command

SET ODOMETER Command

SYS(103) Function - Talk Setting

_TALLY System Memory Variable


SET TEXTMERGE Command

See Also

Enables or disables the evaluation of fields, functions and expressions that are surrounded by text merge delimiters.

Syntax

SET TEXTMERGE
[ON | OFF]
[TO [<file>]
[ADDITIVE]]
[WINDOW <window name>]
[SHOW | NOSHOW]

Remarks

\, \\ and TEXT ... ENDTEXT are used to merge text with the contents of tables, memory variables, array elements and the results of functions and expressions.  If a field, memory variable, array element, function or expression is surrounded by text merge delimiters (by default, << and >>), it can be evaluated and merged with text.  This text merge capability lets you produce letters, programs and templates that create programs.

SET TEXTMERGE determines how fields, memory variables, array elements, functions or expressions surrounded by the text merge delimiters are evaluated.  SET TEXTMERGE also lets you direct text merge output to the desktop in FoxPro for MS-DOS, main FoxPro window in FoxPro for Windows, a user-defined window or a file.

For more information about merging text, see the Text Merge chapter in the FoxPro Developer's Guide.

Clauses

ON

If SET TEXTMERGE is ON, any fields, memory variables, array elements and functions and expressions surrounded by the text merge delimiters are evaluated and output when placed after the \ or \\ or between TEXT and ENDTEXT.

The following short program example (run on the Fourth of July) demonstrates how the contents of the variable MTODAYDATE and the DATE(  ) and TIME( ) functions are evaluated when SET TEXTMERGE is ON.  MTODAYDATE, DATE( ) and TIME( ) are evaluated because they are enclosed by the text merge delimiters and SET TEXTMERGE is ON.

CLEAR
SET TALK OFF
STORE 'Today is: ' TO mtodaydate
SET TEXTMERGE ON
\<<mtodaydate>>
\\<<DATE( )>>
\The time is:
\\ <<TIME( )>>

Here is the output from the program above:

Today is: 07/04/92
The time is: 10:55:19

OFF

If SET TEXTMERGE is OFF, any fields, memory variables, array elements, functions and expressions are literally output along with the text merge delimiters surrounding them.  Note the difference in output when SET TEXTMERGE is OFF in the previous example.

CLEAR
SET TALK OFF
STORE 'Today is: ' TO mtodaydate
SET TEXTMERGE OFF
\<<mtodaydate>>
\\<<DATE( )>>
\The time is:
\\ <<TIME( )>>

Here is the output from this program:

<<mtodaydate>><<DATE( )>>
The time is: <<TIME( )>>

The default for TEXTMERGE is OFF.

TO [<file>]

[ADDITIVE]

By default, output from \, \\ and TEXT ... ENDTEXT is sent to the desktop or main FoxPro window.  You can also direct the output to a text file by including FILE and specifying a file name with <file>.  If a file with that name doesn't exist, a new file is created.  If a file with the same name already exists, you are given the option of overwriting the existing file if SET SAFETY is ON.

The text file is opened as a low-level file, and its file handle is stored to the _TEXT system memory variable.  You can close the file by issuing SET TEXTMERGE TO without any additional arguments.  If the file handle of another file was previously stored in _TEXT, that file is closed.

You can append output from \, \\ and TEXT ... ENDTEXT to the end of an existing file by including the ADDITIVE key word.

For more information on directing text merge output to a file, see _TEXT.

WINDOW <window name>

Output from \, \\ and TEXT ... ENDTEXT is directed to the desktop or main FoxPro window by default.  You can redirect output to a window by including WINDOW.  Specify the name of the window you want to redirect output to with <window name>.  The window must first be created with DEFINE WINDOW before output can be sent to it.  The window doesn't have to be active or visible.

SHOW | NOSHOW

Output generated by \, \\ and TEXT ... ENDTEXT is sent to the desktop, the main FoxPro window or a user-defined window by default.  You can suppress output to the desktop, the main FoxPro window or a user-defined window by including NOSHOW.  To display text merge output again, include SHOW in SET TEXTMERGE.  The default is SHOW.

Memo Fields and Text Merge

Memo fields can be used to nest merged text.  If a memo field contains field names, memory variables, functions or expressions surrounded by the current text merge delimiters, they are evaluated and output with the contents of the memo field.  The memo field name must also be enclosed in text merge delimiters.


SET TEXTMERGE SeeAlso
See Also

\ | \\ Commands

_PRETEXT System Memory Variable

SET TEXTMERGE DELIMITERS Command

_TEXT System Memory Variable


SET TEXTMERGE DELIMITERS Command

See Also

Specifies the text merge delimiters.

Syntax

SET TEXTMERGE DELIMITERS
[TO <expC1> [, <expC2>]]

Remarks

\, \\ and TEXT ... ENDTEXT are used to merge text with the contents of tables, memory variables, array elements and the results of functions and expressions.  If a field, memory variable, array element, function or expression is surrounded by text merge delimiters, it can be evaluated and merged with text.  This text merge capability lets you produce letters, programs and templates that create programs.

The default text merge delimiters are double angle brackets (<< and >>).  You can specify a different set of text merge delimiters with SET TEXTMERGE DELIMITERS.

The current delimiters can be displayed with DISPLAY STATUS.

Clause

TO <expC1> [, <expC2>]

If you specify only one delimiter with <expC1>, both the left and right delimiters are set to <expC1>.  If you specify both delimiters by including <expC1> and <expC2>, the left delimiter is set to <expC1> and the right delimiter is set to <expC2>.

If you issue SET TEXTMERGE DELIMITERS without any additional arguments, the default delimiters are restored.


SET TEXT MERGE DELIMITERS SeeAlso
See Also

\ | \\ Commands

_PRETEXT System Memory Variable

SET TEXTMERGE Command

_TEXT System Memory Variable


SET TOPIC Command

See Also

Specifies the initial help topic or topics when you invoke the FoxPro help system.

Syntax

SET TOPIC TO [<expC> | <expL>]

Clauses

<expC>

<expC> is the name of the help topic you want to display.

<expL>

You can also specify the help topic or topics to open based on the value of the logical expression <expL>.  This is useful for creating your own online help.  See the Customizing Help chapter in the FoxPro Developer's Guide for more information on creating your own help system.


SET TOPIC SeeAlso
See Also

HELP Command

SET HELP Command

SET HELPFILTER Command


SET TRBETWEEN Command

See Also

Enables or disables tracing between breakpoints in the Trace window.

Syntax

SET TRBETWEEN ON | OFF

Remarks

The Trace window displays the source code for a program as the program executes.  The executing program line is highlighted.

The Trace window can also be opened by issuing ACTIVATE WINDOW TRACE, SET ECHO ON or SET STEP ON.

Clauses

ON

Every line of program code is displayed and highlighted in the Trace window as it is executed when SET TRBETWEEN is ON.  Issuing SET TRBETWEEN ON is identical to turning on the Trace Between Breaks option in the Trace window Program menu.

The default for TRBETWEEN is ON.

OFF

Only the last line at which program execution was paused is highlighted in the Trace window when SET TRBETWEEN is OFF.  Issuing SET TRBETWEEN OFF is identical to turning off the Trace Between Breaks option.


SET TRBETWEEN SeeAlso
See Also

ACTIVATE WINDOW Command

SET ECHO Command

SET STEP Command


SET TYPEAHEAD Command

See Also

Specifies the maximum number of characters that can be stored in the typeahead buffer.

Syntax

SET TYPEAHEAD TO <expN>

Remarks

The typeahead buffer can store as many as 128 characters until they are ready to be processed.

Clause

<expN>

Specify the maximum number of characters to store in the typeahead buffer with <expN>.

No characters are held in the typeahead buffer if SET TYPEAHEAD is 0.  Issuing SET TYPEAHEAD TO 0 deactivates INKEY( ) and ON KEY.


SET TYPEAHEAD SeeAlso
See Also

INKEY( ) Function

ON KEY Command


SET UDFPARMS Command

See Also	Examples

Specifies whether FoxPro passes parameters to a user-defined function (UDF) by value or by reference.

Syntax

SET UDFPARMS TO VALUE | REFERENCE

Remarks

By default, variables are passed to UDFs by value.  (Variables are always passed to procedures by reference.)  When a variable is passed by value, the variable's value can be changed in the procedure or UDF, but the variable's original value in the calling program isn't changed.

When a variable is passed by reference and the UDF changes the value of the passed variable, the variable's original value in the calling program is also changed.


SET UDFPARMS Example
SET UDFPARMS Examples

The following example illustrates the difference between passing variables by value and by reference.

*** Pass memory variable by value ***

CLEAR
SET TALK OFF
WAIT 'Press a key to pass by value' WINDOW
SET UDFPARMS TO VALUE
STORE 1 TO X
*** The value of x is unchanged ***
@ 2,2 SAY 'UDF value:  ' + STR(plusone(X))
@ 4,2 SAY 'Value of X: ' + STR(X)

*** Pass memory variable by reference ***

WAIT 'Press a key to pass by reference' WINDOW
CLEAR
SET UDFPARMS TO REFERENCE
STORE 1 TO X
*** The value of x is changed ***
@ 2,2 SAY 'UDF value:  ' + STR(plusone(X))
@ 4,2 SAY 'Value of X: ' + STR(X)

*** This is a UDF that adds one to a number ***

FUNCTION plusone
PARAMETER Z
Z = Z + 1
RETURN Z

*** End of UDF ***

You can force parameters to be passed by value or reference, regardless of the setting of UDFPARMS.  Enclose a variable in parentheses to force the variable to be passed by value.  Preface the variable with an @ symbol to force the variable to be passed by reference.

Tip   Entire arrays can be passed to a procedure or UDF.  The entire array is passed if you issue SET UDFPARMS TO REFERENCE or preface the array name with @.  The first element of the array is passed by value if you issue SET UDFPARMS TO VALUE or enclose the array name by parentheses.  Array elements are always passed by value.

Here is the above example with variables passed by value and reference through the use of parentheses and @, respectively:

*** Pass memory variable by value ***

CLEAR
SET TALK OFF
WAIT 'Press a key to pass by value' WINDOW
STORE 1 TO X
@ 2,2 SAY 'UDF value:  ' + STR(plusone((X)))
@ 4,2 SAY 'Value of X: ' + STR(X)

*** Pass memory variable by reference ***

WAIT 'Press a key to pass by reference' WINDOW
CLEAR
STORE 1 TO X
@ 2,2 SAY 'UDF value:  ' + STR(plusone(@X))
@ 4,2 SAY 'Value of X: ' + STR(X)

*** This is a UDF that adds one to a number ***

FUNCTION plusone
PARAMETER Z
Z = Z + 1
RETURN Z
*** End of UDF ***


SET UDFPARMS SeeAlso
See Also

DO Command

PARAMETERS( ) Function

PROCEDURE Command

User-Defined Functions (UDFs)


SET UNIQUE Command

See Also

Specifies whether or not records with duplicate index key values are maintained in an index file.

Syntax

SET UNIQUE ON | OFF

Remarks

An index file retains its UNIQUE status when you REINDEX.  For more information, see INDEX and REINDEX.

Clauses

ON

Any record with a duplicate key isn't included in the index file if SET UNIQUE is ON.  Only the first record with the duplicate key is included in the index file.

OFF

If SET UNIQUE is OFF, records with duplicate index keys are included in the index file.

The default for SET UNIQUE is OFF.


SET UNIQUE SeeAlso
See Also

INDEX Command

REINDEX Command


SET VIEW Command

See Also

Opens or closes the View window or restores the FoxPro environment from a view file.

Syntax

SET VIEW ON | OFF
or
SET VIEW TO <file> | ?

Remarks

Issue SET VIEW ON to open the View window.  The View window is one of the most useful FoxPro tools.  It provides an easy way to open tables, establish relations and set or change many FoxPro options.  See the FoxPro User's Guide for more information on the View window.

For more information on view files, see CREATE VIEW.

Clauses

ON

Include ON to open the View window.

OFF

Include OFF to close the View window.

The default for SET VIEW is OFF.

TO <file> | ?

Issuing SET VIEW TO <file> restores the FoxPro environment to the state it was in when the view file specified with <file> was created.  View files are created with CREATE VIEW.


SET VIEW SeeAlso
See Also

CREATE VIEW

SET


SET VOLUME Command

See Also	Examples

Maps MS-DOS drive designators to volumes or folders in FoxPro for Macintosh.

Syntax

SET VOLUME <expC1> TO [<expC2>]

Remarks

SET VOLUME is for use in FoxPro for Macintosh only.

Use SET VOLUME to facilitate moving applications created in FoxPro for MS-DOS and FoxPro for Windows to FoxPro for Macintosh. SET VOLUME maps occurrences of MS-DOS drive designators (A:, B:, C:, and so on.) to a specified Macintosh volume or folder. For every occurrence of a specified MS-DOS drive designator, FoxPro for Macintosh internally substitutes the Macintosh volume or folder you designate.

When you start FoxPro for Macintosh, there is no default volume or folder designation. However, you can specify a default volume or folder in your FoxPro configuration file with the VOLUME configuration item.

Use DISPLAY STATUS to display the current volume or folder mapping.

Clauses

<expC1>

<expC1> is an MS-DOS drive designator, any letter between A and Z. The drive delimiter colon, as in A: or C:, is optional.

<expC2>

<expC2> can be one of the following:

A drive designator

A drive designator with a folder name

A nested folder

Macintosh shorthand notation (: or ::) and MS-DOS  (\ or ..) shorthand notation

If <expC2> includes a volume or folder name that contains a space, <expC2> must be enclosed in quotation marks. If you include a path in <expC2> that is not fully qualified, the path is relative to the current default folder.

Note   FoxPro for Macintosh does not recognize folder names that contain embedded back slashes (\). If a folder name contains an embedded back slash, an "Invalid path or filename" error message is generated.


SET VOLUME Example
SET VOLUME Examples

The following commands map every occurrence of an MS-DOS C drive to a Macintosh volume named MacHD or Mac HD:

SET VOLUME C: TO MacHD:
SET VOLUME C: TO 'Mac HD:'
SET VOLUME C TO 'Mac HD:'

You can also specify a folder with a Macinosh volume:

SET VOLUME C: TO MacHD:FolderOne
SET VOLUME C TO 'MacHD:Folder One'

You can use MS-DOS and Macintosh shorthand notation. To map every occurrence of an MS-DOS C drive to the current Macintosh volume, issue the following command:

SET VOLUME C TO \

To map every occurrence of an MS-DOS C drive to the FoxPro startup volume, issue SET VOLUME without <expC2>:

SET VOLUME C TO


SET VOLUME SeeAlso
See Also

SYS(5) - Default Drive

SYS(2003) - Current Directory


SET WINDOW OF MEMO Command
SET WINDOW OF MEMO

See Also

Specifies a window in which memo fields are edited.

Syntax

SET WINDOW OF MEMO TO <window name>

Remarks

SET WINDOW OF MEMO is included for backward compatibility.  Use @ ...  EDIT instead.

Use SET WINDOW to edit memo fields within a user-defined window.  You can then open the memo editing window by issuing @ ... GET, APPEND, BROWSE, CHANGE, EDIT, or MODIFY MEMO.  The user-defined window in which the memo editor is placed must be defined before you include it in SET WINDOW OF MEMO.

To edit a memo field within the specified window, move the cursor to the memo field and press Ctrl+Home, Ctrl+Page Up, or Ctrl+Page Down, or double-click the memo field.

Clause

<window name>

Specify the name of the window in which you want to edit the memo fields with <window name>.


SET WINDOW OF MEMO SeeAlso
See Also

@ ...  EDIT - Text Edit Regions Command

MODIFY MEMO


SET XCMDFILE Command

See Also

Opens a Macintosh external command resource file.

Syntax

SET XCMDFILE TO [<file name>]

Remarks

SET XCMDFILE is available in FoxPro for Macintosh only.

Use SET XCMDFILE to open a resource file of external commands (XCMDs) and functions (XFCNs). Once a resource file is open, use LOAD to place an external command or function into memory, then use CALL to execute it.

Up to 16 external commands or functions can be loaded at once. External command resource files extend the capabilities of FoxPro for Macintosh.

You can display open external command resource files with DISPLAY STATUS. DISPLAY STATUS also shows the external commands and functions placed into memory with LOAD.

Clauses

<file name>

Specify the external command resource file to open with <file name>.

Issue SET XCMDFILE TO without <file name> to close all open external command resource files. Use RELEASE MODULE to remove a single external command or function from memory.


SET XCMDFILE SeeAlso
See Also

CALL

DISPLAY STATUS

LIST

LOAD

RELEASE


SET( ) Function

See Also	Example

Returns the status of a SET command.

Syntax

SET(<expC>[, 1])

Returns

Return values [image] Character or Numeric

Remarks

This function returns the status of various SET commands.  Not all SET commands can be specified with the SET( ) function; those that can are listed in the table at the end of this topic.

SET( ) recognizes the four-character abbreviation for all FoxPro SET key words.  For example, STAT and PRIN can be used for SET STATUS and SET PRINTER, respectively.

The SET( ) function is identical to SYS(2001).

Parameters

<expC>

SET( ) returns information about the SET command you specify with the character expression <expC>.  The current setting of the specified command is returned as a character or numeric string.

1

Additional information about a SET command can be returned if the 1 argument is included.  Including the optional argument 1 doesn't return additional information for all the SET commands, just those listed with a 1 in the table at the end of this topic.

SET commands that behave differently than described above include:

DEFAULT	SET("DEFAULT") returns the default drive   or volume.The default directory  or folder is returned by SYS(2003).
VIEW	The SET( ) function will not accept "VIEW" as its parameter.
VOLUME	The SET( ) function will not accept "VOLUME" as its parameter.
SET Command	Value Returned
ALTERNATE	ON or OFF
ALTERNATE, 1	Alternate file
ANSI	ON or OFF
APLABOUT	ENABLED or DISABLED
APLABOUT, 1	<expC>
ATTRIBUTE	SET COLOR values
AUTOSAVE	ON or OFF
BELL	ON or OFF
BLINK	ON or OFF
BLOCKSIZE	<expN>
BRSTATUS	ON or OFF
CARRY	ON or OFF
CENTURY	ON or OFF
CLEAR	ON or OFF
CLOCK	ON or OFF
CLOCK, 1	<row> and <column>
COLOR	ON or OFF
COMPATIBLE	ON or OFF
COMPATIBLE, 1	PROMPT or NOPROMPT
CONFIRM	ON or OFF
CONSOLE	ON or OFF
CPCOMPILE	<expN>
CPDIALOG	ON or OFF
CURRENCY	LEFT or RIGHT
CURRENCY, 1	<expC>
CURSOR	ON or OFF
DATE	<expC>
DEBUG	ON or OFF
DECIMALS	0 through 18
DEFAULT	Default drive
DELETED	ON or OFF
DELIMITERS	ON or OFF
DELIMITERS, 1	<expC>
DEVELOPMENT	ON or OFF
DEVICE	PRINTER or SCREEN
DISPLAY	Display mode (EGA25, VGA50, ...)
DOHISTORY	ON or OFF
ECHO	ON or OFF
ESCAPE	ON or OFF
EXACT	ON or OFF
EXCLUSIVE	ON or OFF
FIELDS	ON or OFF
FIELDS, 1	<field1>, <field2> ...
FIELDS, 2	LOCAL or GLOBAL
FILTER	ON or OFF
FIXED	ON or OFF
FULLPATH	ON or OFF
HEADING	ON or OFF
HELP	<file>
HELP, 1	ON or OFF
HISTORY	12 or 24
HOURS	ON or OFF
INTENSITY	DOS, MAC or WINDOWS
KEYCOMP	ON or OFF
LIBRARY	Last API or procedure file loaded
LOCK	ON or OFF
LOGERRORS	ON or OFF
MACDESKTOP	ENABLED or DISABLED
MACHELP	<expC>
MACHELP,1	<expC>
MACKEY	0 to 254
MARGIN	Mark character
MARK	8 to 256
MBLOCK	<expN>
MEMOWIDTH	ON or OFF
MENU	<expN>
MESSAGE	<expC>
MESSAGE, 1	ON or OFF
MOUSE	ON or OFF
MULTILOCKS	ON or OFF
NEAR	ON or OFF
NOTIFY	ON or OFF
ODOMETER	1 to 32,767
OPTIMIZE	ON or OFF
ORDER	Index file or index tag
PALETTE	ON or OFF
PATH	<path>
POINT	<expC>
PRINTER	ON or OFF
PRINTER, 1	<file> or <port>
PROCEDURE	<file>
REFRESH	0 through 3,600
REPROCESS	-2 to 32,000
RESOURCE	ON or OFF
RESOURCE, 1	<file>
SAFETY	ON or OFF
SCOREBOARD	ON or OFF
SEPARATOR	<expC>
SHADOWS	ON or OFF
SPACE	ON or OFF
STATUS	ON or OFF
STATUS BAR	ON or OFF
STEP	ON or OFF
STICKY	ON or OFF
SYSMENU	ON, OFF or AUTOMATIC
TALK	ON or OFF
TALK, 1	WINDOW, NOWINDOW or window name
TEXTMERGE	ON or OFF
TEXTMERGE, 1	Textmerge delimiters
TOPIC	<expC> or <expL>
TYPEAHEAD	0 to 32,000
UDFPARMS	VALUE or REFERENCE
UNIQUE	ON or OFF
VIEW	Not supported


SET( ) Example

The following program example uses SET( ) to save the TALK setting without creating talk on the screen or in a window.

IF SET('TALK') = 'ON'	&& TALK handled as a special case.
SET TALK OFF	&& Turn TALK OFF
savetalk = 'ON'	&& TALK was ON, save the setting
ELSE	&& TALK is OFF
savetalk = 'OFF'	&& TALK was OFF, save the setting
ENDIF
SET TALK OFF
SET TALK &savetalk	&& Restore original TALK setting


SET() SeeAlso
See Also

DISPLAY STATUS Command

LIST Commands

SET Command

SYS(2001) Function - SET ... Command Status


SHOW GET Command

See Also

Redisplays the @ ... GET object that represents the specified memory variable.

Syntax

SHOW GET <var>
[, <expN1> [PROMPT <expC>]]
[ENABLE | DISABLE]
[LEVEL <expN2>]
[COLOR SCHEME <expN3> | COLOR <color pair list>]

Remarks

Picture prompts are supported in FoxPro for Windows and FoxPro for Macintosh.

SHOW GET redisplays a single control (a check box, field, invisible button, push or radio button, list, popup, spinner or text-editing region).  When the value in an  @ ... GET field changes (the cursor moves to a new record, for example), SHOW GET updates the value displayed in the @ ... GET field.  When a control is redisplayed, it can be enabled or disabled.  SHOW GET can also be used to redisplay an individual button within a set of invisible, radio or push buttons.  You can also change the prompts of check boxes and buttons with SHOW GET.

SHOW GET is typically used in a routine executed in a control-level VALID or WHEN clause or a READ-level ACTIVATE or DEACTIVATE clause.

SHOW GET vs. SHOW GETS and SHOW OBJECT

Individual controls are redisplayed with SHOW GET or SHOW OBJECT.  All controls created with @ ... GET are redisplayed with SHOW GETS.  SHOW GETS executes the READ LEVEL SHOW routine.  SHOW GET and SHOW OBJECT don't.

SHOW OBJECT is similar to SHOW GET except that SHOW OBJECT references controls by their object number, and SHOW GET references controls by <var>, the memory variable, array element or field specified when the control is created.

For more information on control numbering, see OBJNUM( ) or _CUROBJ.

Clauses

<var>

<var> is the memory variable, array element or field specified when the control was created.

In the following example, three radio buttons with the prompts Apples, Oranges and Lemons are created.  In this example, <var> is a memory variable named FRUIT that initializes the radio buttons (since FRUIT equals 2, the second button is initially selected).  The button number is stored to FRUIT when you choose a button.

CLEAR
STORE 2 TO fruit
@ 4,2 GET fruit PICTURE '@*R Apples;Oranges;Lemons'
READ CYCLE

<expN1>

expN1> is the number of the button you want to redisplay within a set of invisible, radio, or push buttons.  A button's number is determined by the order in which the button prompts are created.  In the example above, Apples is created first and is button number one.  The second button created is Oranges; it is button number two.  The last button, Lemons, is button three.

The following program creates the same buttons as in the previous example.  However, when one of the radio buttons is chosen, the NOORANGE VALID routine is executed.  The routine disables the Oranges button with SHOW GET and DISABLE.

CLEAR
STORE 2 TO fruit
@ 4,2 GET fruit PICTURE '@*R Apples;Oranges;Lemons' VALID noorange( )
READ CYCLE

FUNCTION noorange
SHOW GET fruit,2 DISABLE  && Disables the second button
_CUROBJ = 1
RETURN .T.

PROMPT <expC>

You can replace the prompt for an individual push button, radio button or check box with another prompt by including PROMPT <expC>.  <expC> replaces the original button or check box prompt.  You can also change the button or check box attributes (which determine whether the control is enabled or disabled, what hot keys are assigned, and whether it is the default or Esc choice) by specifying the appropriate special characters with <expC>.

SHOW GET is typically placed in a VALID routine for the check box, push button or radio button.

In the following example, a check box is created.  When the check box is chosen, the VALID clause routine Newprompt is executed.  The routine changes the check box prompt and the hot key.

CLEAR
STORE 1 TO check
@ 4,2 GET check FUNCTION '*C \<Checked' SIZE 1,13 VALID NEWPROMPT( )
READ CYCLE

FUNCTION newprompt
IF check = 0
SHOW GET check,1 PROMPT '\<Unchecked'
ELSE
SHOW GET check,1 PROMPT '\<Checked'
ENDIF
RETURN .T.

In FoxPro for Windows and FoxPro for Macintosh, you can use PROMPT to specify picture files that are displayed on a picture check box, push button or radio button when it is enabled, selected and disabled.  The PROMPT clause is ignored if picture files are specified in the PROMPT clause in FoxPro for MS-DOS.

In FoxPro for Windows, the picture file can be a bitmap file with a .BMP extension. In FoxPro for Macintosh, you can use a picture file of PICT type or a .BMP bitmap file.

Include a set of up to three picture files separated by commas in <expC>.  The first picture file is displayed on the picture check box, push button or radio button when it is enabled.  The second picture file is displayed when the picture check box, push button or radio button is selected.  The third picture file is displayed when the picture check box, push button or radio button is disabled.

ENABLE | DISABLE

Including ENABLE allows the specified control to be selected or chosen.  Including DISABLE prevents the control from being selected or chosen and displays the control in disabled colors.

LEVEL <expN2>

You can nest READs by issuing @ ... GET and a READ in a routine called in an active READ.  READs can be nested to five levels.

If you don't include a LEVEL clause, SHOW GET defaults to the current READ level.  Include a LEVEL clause to redisplay a control on a level other than the current level.  The numeric expression <expN2> can assume the value 1, 2, 3, 4 or 5 corresponding to the READ level of the control to redisplay.  Use RDLEVEL( ) to return the current READ level.

COLOR SCHEME <expN3> | COLOR <color pair list>

Controls can be redisplayed in the colors you specify.  You can specify a color scheme or a color pair list.  For more information about control colors, see to @ ... GET and @ ... EDIT - Text Edit Regions.


SHOW GET SeeAlso
See Also

@ ... GET Command

CLEAR READ Command

_CUROBJ System Memory Variable

OBJNUM( ) Function

RDLEVEL( ) Function

READ Command

SHOW GETS Command

SHOW OBJECT Command


SHOW GETS Command

See Also	Example

Redisplays all @ ... GET controls.

Syntax

SHOW GETS
[ENABLE | DISABLE]
[LEVEL <expN1>]
[OFF | ONLY]
[WINDOW <window name>]
[LOCK]
[ COLOR SCHEME <expN2> | COLOR <color pair list> ]

Remarks

SHOW GETS redisplays all controls (check boxes; fields; invisible; push or radio buttons; lists; popups; spinners or text editing regions).  When values in @ ... GET fields change (the cursor moves to a new record, for example), SHOW GETS updates the values of the @ ... GET fields.  Controls can be enabled or disabled when they are redisplayed.

A routine containing SHOW GETS can be used to redisplay @ ... GET controls.  A GET LEVEL VALID or WHEN, or a READ LEVEL ACTIVATE or DEACTIVATE routine can contain SHOW GETS.

READ supports a SHOW clause that executes a routine whenever SHOW GETS is issued.  A READ SHOW routine is often used to refresh output of @ ... SAYs.  When SHOW GETS is issued, the SHOW routine is executed all the controls are redisplayed.

Issuing SHOW GETS resets UPDATED( ) to false (.F.).

SHOW GETS vs. SHOW GET and SHOW OBJECT

All controls created with @ ... GET are redisplayed with SHOW GETS.  Individual controls are redisplayed with SHOW GET or SHOW OBJECT.  SHOW GETS executes the READ-level SHOW routine.  SHOW GET and SHOW OBJECT don't.

SHOW OBJECT is similar to SHOW GET except that SHOW OBJECT references controls by their object number, and SHOW GET references controls by <var>, the memory variable, array element or field specified when the control is created.  For more information on control numbering, see OBJNUM( ) or _CUROBJ.

Clauses

ENABLE | DISABLE

Including ENABLE allows all controls to be selected or chosen.  Including DISABLE prevents all controls from being selected or chosen and redisplays them in disabled colors.

LEVEL <expN1>

You can nest READs by issuing @ ... GETs and a READ in a routine called in an active READ.  READs can be nested to five levels.

If you don't include a LEVEL clause, SHOW GETS defaults to the current READ level.  Include a LEVEL clause to redisplay controls on a level other than the current level.  The numeric expression <expN2> can assume the value 1, 2, 3, 4 or 5 corresponding to the READ level of the controls to redisplay.  RDLEVEL( ) returns the current READ level.

OFF | ONLY

When OFF is included, SHOW GETS executes only the READ SHOW routine and doesn't refresh any controls.  When ONLY is included, SHOW GETS refreshes only the controls and doesn't execute the READ SHOW routine.

WINDOW <window name>

Controls can be placed in different windows and activated with a single READ.  The WINDOW clause lets you redisplay controls in a specific window without redisplaying controls in all windows.  Specify the window name for the controls to redisplay with <window name>.  SYS(2016) returns an asterisk (*) if you issue SHOW GETS without a WINDOW clause.  SYS(2016) returns the name of the window if you issue SHOW GETS with a WINDOW clause.

LOCK

When a READ is issued and a table is opened for shared access on a network, FoxPro may attempt to lock all records involved in the READ.  If READ or READ LOCK is issued, FoxPro attempts to lock all the records involved in the READ.  If READ NOLOCK is issued, FoxPro makes no attempt to lock the records and makes all fields involved in the READ read-only.

SHOW GETS assumes the record locking behavior of the READ.  If READ or READ LOCK is issued, SHOW GETS attempts to lock the records involved in the READ.  If READ NOLOCK is issued, SHOW GETS makes no attempt to lock the records, and all fields involved in the READ are made read-only.

If LOCK is included in SHOW GETS, SHOW GETS always attempts to lock the records involved in the READ.  Issuing SHOW GETS LOCK lets you override READ NOLOCK.

See READ in this  for further information on how record locking is attempted during a READ.

COLOR SCHEME <expN2> | COLOR <color pair list>

Controls can be redisplayed in the colors you specify.  You can specify a color scheme or a color pair list.  Refer to @ ... GET and the Controls section in this  for information about control colors.


SHOW GETS Example

The following example creates a data entry window and a control window that uses DO to call procedures that move you through CUSTOMER.DBF.

CLOSE ALL
SET TALK OFF
DEFINE WINDOW customer FROM 3,3 TO 13,57 ;
FLOAT SHADOW DOUBLE
DEFINE WINDOW panel2 FROM 2, 61 TO 14,74 ;
FLOAT SHADOW DOUBLE COLOR SCHEME 5
USE customer
ACTIVATE WINDOW customer NOSHOW
@ 3,3 SAY 'Company'
@ 3,14 GET customer.company SIZE 1,35
@ 5,3 SAY 'Contact'
@ 5,14 GET customer.contact SIZE 1,35
@ 7,3 SAY 'City/State'
@ 7,14 GET customer.city SIZE 1,21
@ 7,36 GET customer.state
@ 7,39 GET customer.zip
@ 0,3 SAY 'Customer #'
@ 0,15 SAY cno SIZE 1,6
@ 0,36 SAY 'Record #'
@ 0,46 SAY RECNO( ) SIZE 1,3
ACTIVATE WINDOW panel2
@ 1,2 GET act PICTURE;
'@*VN Top;Prior;Next;Bottom;\?Quit' ;
SIZE 1,8,1 DEFAULT 0 VALID actvalid( )
READ CYCLE SHOW readshow( ) COLOR ,R/BG
RELEASE WINDOWS customer,panel2

FUNCTION actvalid
DO CASE
CASE act = 1
GO TOP
CASE ACT = 2
DO go_prev
CASE ACT = 3
DO go_next
CASE act = 4
GO BOTTOM
CASE act = 5
CLEAR READ
ENDCASE
SHOW GETS
RETURN 0

FUNCTION readshow
STORE WOUTPUT( ) TO currwind
IF SYS(2016) = 'customer' OR SYS(2016) = '*'
ACTIVATE WINDOW customer SAME
@ 0,15 SAY cno SIZE 1,6
@ 0,46 SAY RECNO( ) SIZE 1,3
ENDIF
IF NOT EMPTY(currwind)
ACTIVATE WINDOW (currwind) SAME
ENDIF
RETURN .T.
PROCEDURE go_prev
SKIP -1
IF BOF( )
GO TOP
ENDIF
RETURN

PROCEDURE go_next
SKIP 1
IF EOF( )
GO BOTTOM
ENDIF
RETURN


SHOW GETS SeeAlso
See Also

@ ... GET Command

CLEAR READ Command

_CUROBJ System Memory Variable

OBJNUM( ) Function

RDLEVEL( ) Function

READ Command

SHOW GET Command

SHOW OBJECT Command

SYS(2016) Function - SHOW GETS WINDOW Name


SHOW MENU Command

See Also	Example

Displays one or more user-defined menu bars without activating them.

Syntax

SHOW MENU <menu name1>[, <menu name2> ...] | ALL
[PAD <pad name>]
[SAVE]

Remarks

The menu bars are displayed but can't be used.  Before they can be displayed, the menu bars must first be created with DEFINE MENU.

Clauses

<menu name1>[,<menu name2> ...]

Specify the name of one or more menu bars to display with <menu name1>, <menu name2>, and so on.

ALL

Include ALL to display all currently defined menu bars.

PAD <pad name>

Specify the name of a pad to be highlighted on a menu bar with <pad name>.

SAVE

Include SAVE to retain an image of the specified menu bars without activating the menu bars.  The menu bar images can be cleared with CLEAR.


SHOW MENU Example

CLEAR

DEFINE MENU example BAR AT LINE 2

DEFINE PAD convpad OF example PROMPT '\<Conversions' COLOR SCHEME 3 ;
KEY ALT+C, ''
DEFINE PAD cardpad OF example PROMPT 'Card \<Info' COLOR SCHEME 3 ;
KEY ALT+I, ''

SHOW MENU example


SHOW MENU SeeAlso
See Also

ACTIVATE MENU Command

CREATE MENU Command

DEFINE MENU Command


SHOW OBJECT Command

See Also	Example

Redisplays the @ ... GET control that has the specified object number.

Syntax

SHOW OBJECT <expN1>
[ENABLE | DISABLE]
[LEVEL <expN2>]
[PROMPT <expC>]
[COLOR SCHEME <expN3> | COLOR <color pair list>]

Remarks

SHOW OBJECT redisplays a single control (a check box, a field, an invisible, push or radio button, a list, a popup, a spinner or a text editing region).  When the value in an @ ... GET field changes (the cursor moves to a new record, for example), SHOW OBJECT updates the value displayed in the @ ... GET field.  When a control is redisplayed, it can be enabled or disabled.  SHOW OBJECT can also be used to redisplay an individual button within a set of invisible, radio or push buttons change the prompts of check boxes and buttons.

SHOW OBJECT is typically used in a routine executed in a control-level VALID or WHEN clause or a READ-level ACTIVATE or DEACTIVATE clause.

SHOW GET vs. SHOW GETS and SHOW OBJECT

Individual controls can be redisplayed with SHOW OBJECT or SHOW GET.  All controls can be redisplayed with SHOW GETS.  SHOW GETS executes a READ-level SHOW routine.  SHOW GET and SHOW OBJECT don't.

SHOW OBJECT is similar to SHOW GET except SHOW OBJECT references controls by their object number, and SHOW GET references controls by a memory variable, array element or field.

For more information on control numbering, see OBJNUM( ) or _CUROBJ.

Clauses

<expN1>

Every control has an associated control number (<expN1>), which is determined by the order in which that control was created.  Each button within a set of push, radio and invisible buttons is considered a separate control.  A field, check box, popup, list, spinner or text editing region is also a single control.

ENABLE | DISABLE

Including ENABLE allows the specified control to be selected or chosen.  Including DISABLE prevents the control from being selected or chosen.

LEVEL <expN2>

You can nest READs by issuing @ ... GETs and a READ in a routine called in an active READ.  READs can be nested to five levels.

SHOW OBJECT defaults to the current READ level if LEVEL is omitted.  Including LEVEL lets you redisplay a control on a level other than the current level.  The numeric expression <expN2> can assume the value 1, 2, 3, 4 or 5, corresponding to the READ level of the control to redisplay.  RDLEVEL( ) returns the current READ level.

PROMPT <expC>

You can replace the prompt for an individual push button, radio button or check box with another prompt by including PROMPT <expC>. <expC> replaces the original button or check box prompt.  You can also change the button or check box attributes (which determine whether the control is enabled or disabled, which hot keys are assigned, and whether it is the default or Esc choice) by specifying the appropriate special characters with <expC>.

COLOR SCHEME <expN3> | COLOR <color pair list>

Controls can be redisplayed in the colors you specify.  For more information about control colors, see @ ... GET and @ ... EDIT - Text Edit Regions.


SHOW OBJECT Example

The following example creates a check box.  When the check box is chosen, the VALID routine Newprompt is executed.  The routine changes the check box prompt and the hot key.

CLEAR
STORE 1 TO check
@ 4,2 GET check FUNCTION '*C \<Checked' SIZE 1,13 VALID NEWPROMPT( )
READ CYCLE

FUNCTION newprompt
IF check = 0
SHOW OBJECT 1 PROMPT '\<Unchecked'
ELSE
SHOW OBJECT 1 PROMPT '\<Checked'
ENDIF
RETURN .T.


SHOW OBJECT SeeAlso
See Also

@ ... GET Command

CLEAR READ Command

_CUROBJ System Memory Variable

OBJNUM( ) Function

RDLEVEL( ) Function

READ Command

SHOW GET Command

SHOW GETS Command

SYS(2016) Function - SHOW GETS WINDOW Name


SHOW POPUP Command

See Also	Example

Displays one or more popups defined with DEFINE POPUP without activating them.

Syntax

SHOW POPUP <popup name1>[, <popup name2> ...] | ALL
[SAVE]

Remarks

The popups are displayed but can't be used.  Before they can be shown, the popups must first be created with DEFINE POPUP.

Clauses

<popup name1>[, <popup name2> ...]

Specify the name of one or more popups to display with <popup name1>, <popup name2>, and so on.

ALL

Include ALL to display all currently defined popups.

SAVE

Include SAVE to retain an image of the specified popups without activating them.  The popup images can be cleared with CLEAR.


SHOW POPUP Example

SHOW POPUP is used in this example to display an image of a popup when you choose a special menu pad.

The current system menu bar is saved to memory with SET SYSMENU SAVE, and all system menu pads are removed with SET SYSMENU TO.  Three new system menu pads are created with DEFINE PAD, and DEFINE POPUP is used to create a popup for the Show Card Info menu pad.

When you choose the Show Card Info menu pad, SHOW POPUP displays an image of the Card Info popup.  You can view the popup, but you can't choose options from it.  To clear this image, choose the Clear Card Info menu pad.  Choose the Exit option from the Card Info popup to restore the system menu bar.

*** Name this program SHOW.PRG ***

CLEAR

SET SYSMENU SAVE
SET SYSMENU TO
DEFINE PAD cardpad OF _MSYSMENU PROMPT '\<Card Info' COLOR SCHEME 3 ;
KEY ALT+I, ''
DEFINE PAD showpad OF _MSYSMENU PROMPT '\<Show Card Info' ;
COLOR SCHEME 3 	KEY ALT+I, ''
DEFINE PAD clearpad OF _MSYSMENU PROMPT 'C\<lear Card Info' ;
COLOR SCHEME 3 	KEY ALT+I, ''

ON PAD cardpad OF _MSYSMENU ACTIVATE POPUP cardinfo
ON SELECTION PAD showpad  OF _MSYSMENU ;
DO choice IN show WITH PROMPT( ), POPUP( )
ON SELECTION PAD clearpad OF _MSYSMENU ;
DO choice IN show WITH PROMPT( ), POPUP( )

DEFINE POPUP cardinfo MARGIN RELATIVE SHADOW COLOR SCHEME 4
DEFINE BAR 1 OF cardinfo PROMPT '\<View Charges' ;
KEY ALT+V, ''
DEFINE BAR 2 OF cardinfo PROMPT 'View \<Payments' ;
KEY ALT+P, ''
DEFINE BAR 3 OF cardinfo PROMPT 'Vie\<w Users' ;
KEY ALT+W, ''
DEFINE BAR 4 OF cardinfo PROMPT '\-'
DEFINE BAR 5 OF cardinfo PROMPT '\<Charges '
DEFINE BAR 6 OF cardinfo PROMPT '\-'
DEFINE BAR 7 OF cardinfo PROMPT 'E\<xit '

ON SELECTION POPUP cardinfo;
DO choice IN show WITH PROMPT( ), POPUP( )

PROCEDURE choice
PARAMETERS mprompt, mpopup

IF mprompt = 'Show Card Info'
SHOW POPUP cardinfo
RETURN
ENDIF

IF mprompt = 'Clear Card Info'
CLEAR
RETURN
ENDIF

WAIT WINDOW 'You chose ' + mprompt + ;
' from popup ' + mpopup NOWAIT

IF mprompt = 'Exit'
SET SYSMENU TO DEFAULT
ENDIF


SHOW POPUP SeeAlso
See Also

ACTIVATE POPUP Command

DEFINE POPUP Command


SHOW WINDOW Command

See Also	Example

Displays one or more user-defined windows or FoxPro system windows without activating them.

Syntax

SHOW WINDOW <window name1>[, <window name2> ...] | ALL | SCREEN
[IN [WINDOW] <window name3> | IN SCREEN | IN MACDESKTOP]
[REFRESH]
[TOP | BOTTOM | SAME]
[SAVE]

Remarks

The SAVE clause is supported in FoxPro for MS-DOS only.

SHOW WINDOW controls the display and front-to-back screen placement of windows.  If windows are defined as hidden or haven't been activated, SHOW WINDOW displays the windows without activating them.

You can also display system windows, such as the Command window, the Calculator, the Calendar/Diary, and so on.  Desk accessories (the Filer, the Calculator, and so on) must be active before they can be displayed.  If one or more windows are currently displayed, SHOW WINDOW lets you change the front-to-back order of the windows.

You can't specify where output is directed with SHOW WINDOW.  Use ACTIVATE WINDOW to direct output to a window.

Clauses

<window name1>[, <window name2> ...]

Specify the name of one or more windows to display with <window name1>, <window name2>, and so on.

ALL

Include ALL to display all windows.

SCREEN

The SCREEN option is available in FoxPro for Macintosh only.

Include SCREEN to display the main FoxPro window when it is hidden. You can also choose the Screen menu option from the Window menu to display the main FoxPro window when it is hidden.

You can hide the main FoxPro window by clicking its close box or issuing DEACTIVATE WINDOW SCREEN, HIDE WINDOW SCREEN or RELEASE WINDOW SCREEN.

IN [WINDOW] <window name3>

If IN WINDOW <window name3> is included, the window is displayed inside a parent window without assuming the characteristics of the parent window.  A window activated inside a parent window can't be moved outside the parent window.  If the parent window is moved, the child window moves with it.

The parent window specified with <window name3> must first be created with DEFINE WINDOW.

IN SCREEN

By including IN SCREEN, you can explicitly place a window on the desktop in FoxPro for MS-DOS or the main FoxPro window instead of in another window.  Windows are placed in the main FoxPro window by default.

IN MACDESKTOP

MACDESKTOP is available in FoxPro for Macintosh only.

Include the MACDESKTOP clause to place a window on the Macintosh desktop. The window resides at the same level as the main FoxPro window. The window can be moved outside of the main FoxPro window and the main FoxPro window can be brought forward over the top of it. When you include the MACDESKTOP clause, the window behaves in the same manner as windows in FoxBASE+ for Macintosh.

Including the MACDESKTOP clause overrides the current SET MACDESKTOP setting. SET MACDESKTOP determines if windows are placed on the main FoxPro window or the Macintosh desktop when the SCREEN or MACDESKTOP clause is not included. For more information about placing windows on the main FoxPro window or the Macintosh desktop, see SET MACDESKTOP.

REFRESH

You can include the REFRESH clause to redraw a Browse window.  This is useful on a network to ensure that you are browsing the most current version of a table.  The work area for the Browse window table is selected.

Memo editing windows are refreshed with changes made to the memo field by other users on a network.  SET REFRESH determines the interval between memo editing window refreshes.  Refer to SET REFRESH for additional information on how data is refreshed in tables opened for shared use on a network.

TOP

Include TOP to place the specified window in front of all other windows.

BOTTOM

Include BOTTOM to place the specified window behind all other windows.

SAME

SAME affects only windows that have been previously displayed or activated and then cleared from the desktop or main FoxPro window with DEACTIVATE WINDOW.  Issuing SHOW WINDOW SAME places the specified window back into a stack of windows in the same position the window occupied before it was deactivated.

SAVE [image] FoxPro for MS-DOS only

Including SAVE keeps an image of a window in the main FoxPro window or in another window after the window has been hidden.  Normally, windows are removed from the main FoxPro window after they are hidden.  The window image can be cleared from the main FoxPro window or a window with CLEAR.  You can't save an image of the current output window.

SAVE is ignored in FoxPro for Windows and FoxPro for Macintosh.


SHOW WINDOW Example

In this example, a window named Output is created and displayed.  Since SHOW WINDOW is used to display the window, output can't be directed to the window until it is activated.

CLEAR
DEFINE WINDOW output FROM 2,1 TO 13,75 TITLE 'Output' ;
CLOSE FLOAT GROW SHADOW ZOOM
SHOW WINDOW output


SHOW WINDOW SeeAlso
See Also

ACTIVATE WINDOW Command

DEFINE WINDOW Command


SIGN( ) Function

See Also	Example

Returns a numeric value of 1, -1 or 0 depending on whether the specified numeric expression evaluates to a positive, negative, or 0 value.

Syntax

SIGN(<expN>)

Returns

Numeric

Parameter

<expN>

SIGN( ) returns 1 if <expN> evaluates to a positive number, -1 if <expN> is evaluates to a negative number, and 0 if <expN> evaluates to 0.


SIGN( ) Example

STORE 10 to num1
STORE -10 TO num2
STORE 0 TO zero
? SIGN(num1)

? SIGN(num2)

? SIGN(zero)


SIGN() SeeAlso
See Also

ABS( ) Function


SIN( ) Function

See Also	Example

Returns the sine of an angle.

Syntax

SIN(<expN>)

Returns

Numeric

Parameter

<expN>

SIN( ) returns the sine of the angle specified with <expN>.  The numeric expression <expN> can assume any value and the value returned by SIN( ) ranges between -1 and 1.

The numeric expression <expN> is given in radians.  Use DTOR( ) to convert an angle from degrees to radians.  The number of decimal places displayed by SIN( ) can be specified with SET DECIMALS.


SIN( ) Example

? SIN(0)

? SIN(PI( )/2)

? SIN(DTOR(90))


SIN() SeeAlso
See Also

ACOS( ) Function

COS( ) Function

DTOR( ) Function

RTOD( ) Function

SET DECIMALS Command


SIZE POPUP Command

See Also	Example

Changes the size of a popup defined with DEFINE POPUP.

Syntax

SIZE POPUP <popup name> TO <expN1>, <expN2> | BY <expN3>, <expN4>

Remarks

The popup can be changed to a specific size relative to its current size.  If a user-defined popup has been created, its size can be changed; it doesn't have to be active or visible.

Clauses

<popup name>

Specify the name of the popup whose size you want to change with <popup name>.

TO <expN1>, <expN2>

Use the TO clause to change the size of a popup to a specific size.  <expN1> and <expN2> specify the new row and column coordinates, respectively, of the lower-right corner of the popup.

BY <expN3>, <expN4>

To change the size of a popup relative to its current size, use the BY clause.  The numeric expressions <expN3> and <expN4> specify the change in size of the popup in rows and columns, relative to the current row and column coordinates of the lower-right corner of the popup.


SIZE POPUP Example

This example creates a popup containing files with a .PRG extension and moves, enlarges and shrinks the popup before closing it.

CLEAR
DEFINE POPUP movinpop FROM 2,2 TO 7, 14 PROMPT FILES LIKE *.PRG ;
TITLE 'Programs'
ACTIVATE POPUP movinpop NOWAIT
=CHRSAW(2)
MOVE POPUP movinpop BY 5,5 	&& Move popup down
=CHRSAW(2)
SIZE POPUP movinpop BY 5,5 	&& Enlarge the popup
=CHRSAW(2)
SIZE POPUP movinpop BY -5,-5 	&& Shrink the popup
=CHRSAW(2)
MOVE POPUP movinpop BY -5,-5 	&& Move popup up
=CHRSAW(2)
DEACTIVATE POPUP movinpop
RELEASE POPUP movinpop


SIZE POPUP SeeAlso
See Also

ACTIVATE POPUP Command


SKIP Command

See Also	Example

Moves the record pointer forward or backward in the current or specified table.

Syntax

SKIP
[<expN1>]
[IN <expN2> | <expC>]

Clauses

<expN1>

<expN1> specifies the number of records to move the record pointer.  Issuing SKIP without <expN1> advances the record pointer to the next record.  The sequence of the records is the same as the key sequence in the controlling index or index tag if an index is enabled.

The record pointer moves toward the end of the file <expN1> records if <expN1> evaluates to a positive number.  The record pointer moves towards the beginning of the file <expN1> records if <expN1> evaluates to a negative number.

If the record pointer is positioned on the last record of a table and SKIP with no arguments is executed, RECNO( ) returns a value one greater than the number of records in the table and EOF( ) returns  true (.T.).  If the record pointer is positioned on the first record of a table and SKIP -1 is executed, RECNO( ) returns 1 and BOF( ) returns true (.T.).

IN <expN2> | <expC>

Include a work area number <expN2> or a table or work area alias <expC> to move the record pointer in a work area other than the current work area.


SKIP Example

CLOSE DATABASES
SELECT 2
USE invoices
SELECT 1
USE customer
SKIP 4 IN 2
? RECNO(2)

GO BOTTOM
SKIP -5
? RECNO( )


SKIP SeeAlso
See Also

GO/GOTO Commands

SET SKIP Command


SKPBAR( ) Function

See Also

Determines whether a popup bar is enabled or disabled with SET SKIP OF.

Syntax

SKPBAR(<expC>, <expN>)

Returns

Logical

Remarks

SKPPAD( ) returns true (.T.) if the popup bar is disabled, and false (.F.) if the popup bar is enabled.

Parameters

<expC>

Specify the name of the popup that contains the bar with <expC>.

<expN>

SKPBAR( ) returns the enabled or disabled status of the popup bar whose number you specify with <expN>.


SKPBAR() SeeAlso
See Also

DEFINE BAR Command

SET SKIP OF Command

SKPPAD( ) Function


SKPPAD( ) Function

See Also

Determines whether a menu pad is enabled or disabled with SET SKIP OF.

Syntax

SKPPAD(<expC1>, <expC2>)

Returns

Logical

Remarks

SKIPPAD( ) returns true (.T.) if the menu pad is disabled, and false (.F.) if the menu pad is enabled.

Parameters

<expC1>

Specify the name of the menu bar that contains the menu pad with <expC1>.

<expC2>

SKPPAD( ) returns the enabled or disabled status of the menu pad whose name you specify with <expC2>.


SKPPAD() SeeAlso
See Also

DEFINE BAR Command

SET SKIP OF Command

SKPBAR( ) Function


SORT Command

See Also

Sorts records in the current table and outputs the sorted data to a new table.

Syntax

SORT TO <file> ON <field1>
[/A | /D] [/C]
[, <field2> [/A | /D] [/C] ...]
[ASCENDING | DESCENDING]
[<scope>]
[FOR <expL1>]
[WHILE <expL2>]
[FIELDS <field list> | FIELDS LIKE <skel> | FIELDS EXCEPT <skel>]
[NOOPTIMIZE]

Remarks

One or more specified fields in the current table determine the order in which the records appear in the new table.

Important   Be sure you have enough disk space for the new table and the temporary work files created during the sort.  The disk space needed to perform a sort can be as much as three times the size of the source file.  The amount of available disk space can be determined with DISKSPACE( ) and SYS(2020).  If you run out of disk space during a sort, the alert "Not enough disk space" is displayed, and the temporary work files are deleted.

Character type fields that contain numbers and spaces may not sort in the order you expect.  Numeric fields fill from right to left, with empty spaces to the left.  In contrast, character fields fill from left to right, with empty spaces to the right.

For example, if two records in a table contain a character field with 1724 in one record and 18 in the other, and the table is sorted on this field in ascending order, the record containing 1724 appears before the record containing 18.  This is because FoxPro reads each character in the character fields from left to right, and because 17 (in 1724) is less than 18 (in 18), it puts 1724 first.  To avoid this problem, always precede lower numbers with leading zeros (0018) or make the field numeric.

Clauses

<file>

When a table is sorted, a new table is created.  <file> specifies the name of the new table file.  FoxPro assumes a .DBF file name extension for tables.  A .DBF extension is automatically assigned if the file name you include doesn't have an extension.

ON <field1>

You must include a name of a field (<field1>) from the current table.  The contents and data type of the field determine the order of the records in new table.  By default, the sort is done in ascending order.  You can't sort on memo or general fields.

You can include additional field names (<field2>, <field3>) to further order the new table.  The first field <field1> is the primary sort field, the second field <field2> is the secondary sort field, and so on.

Here is an example that sorts a table on three fields.  CUSTOMER.DBF is opened and sorted to a new table named TEMP.  The records in TEMP are ordered by the CNO field.

CLOSE DATABASES
CLEAR
USE customer
LIST FIELDS company, cno NEXT 3
SORT TO temp ON cno
USE temp
LIST FIELDS company, cno NEXT 3
WAIT WINDOW 'Now sorted on CNO' NOWAIT

[/A | /D] [/C]

For each field you include in the sort you can specify an ascending or descending sort order.  The /A option specifies an ascending order for the field, and the /D option specifies a descending order.  /A or /D can be included with any type of field.

By default, the field sort order for character fields is case sensitive (lower- or upper-case dependent).  If you include the /C option after the name of a character field, case is ignored.  You can combine the /C option with the /A or /D option.  Use one slash (/AC or /DC) if you include the /C option with /A or /D.

In the following example, a new table named CLIENTS is created.  INVOICES.DBF is sorted on the IDATE field in ascending order and the ITOTAL field in descending order.

USE invoices
SORT TO clients ON idate/A,itotal/D

ASCENDING | DESCENDING

You can specify a sort order for all sort fields not followed by the /A or /D options.  All sort fields are sorted in ascending order if you include ASCENDING.  All sort fields are sorted in descending order if DESCENDING is included.  The sort fields default to an ascending order if ASCENDING or DESCENDING isn't included.

<scope>

The scope clauses are:  ALL, NEXT <expN>, RECORD <expN>, and REST.  These are explained in the Overview of the FoxPro Language chapter of the FoxPro Language Reference.  Commands which include <scope> operate only on the table in the active work area.

You can specify a scope of records to sort.  Only the records that fall within the range of records specified by the scope are sorted.

The default scope for SORT is ALL records.

FOR <expL1>

If the FOR clause is included, only the records in the current table for which the logical condition <expL1> evaluates to true (.T.) are included in the sort.  Including FOR lets you conditionally sort records, filtering out undesired records.

Rushmore optimizes a SORT ... FOR command if <expL1> is an optimizable expression.  For best performance, use an optimizable expression in the FOR clause.  A discussion of expressions Rushmore can optimize appears in the Optimizing Your Application chapter in the FoxPro Developer's Guide.

WHILE <expL2>

If the WHILE clause is included, records from the current table are included in the sort for as long as the logical expression <expL2> evaluates to true (.T.).

FIELDS <fields list>

The new table that SORT creates can contain a subset of fields from the original table.  All fields from the original table are included in the new table if the FIELDS clause isn't included.  Include FIELDS and a <fields list> to include specific fields from the original table.

FIELDS LIKE <skel> | FIELDS EXCEPT <skel>

You can specify the fields that appear in the new table by including the LIKE or EXCEPT clause or both. If you include LIKE <skel>, the fields that match <skel> are included in the new table. If you include EXCEPT <skel>, all fields except those that match <skel> are included in the new table.

The skeleton <skel> supports wildcard characters.  For example, to specify that all fields that begin with the letters A and P are included in the new table, use:

SORT TO mytable ON myfield FIELDS LIKE A*,P*

The LIKE clause can be combined with the EXCEPT clause:

SORT TO mytable ON myfield FIELDS LIKE A*,P* EXCEPT PARTNO*

NOOPTIMIZE

To cause Rushmore to not optimize SORT, include NOOPTIMIZE.  For more information, see SET OPTIMIZE or the discussion of Rushmore optimization in the Optimizing Your Application chapter in the FoxPro Developer's Guide.


SORT SeeAlso
See Also

COPY FILE Command

DISKSPACE( ) Function

INDEX Command

SYS(2020) Function - Default Disk Size


SOUNDEX( ) Function

See Also	Example

Returns a phonetic representation of the specified character expression.

Syntax

SOUNDEX(<expC>)

Returns

Character

Remarks

SOUNDEX( ) returns a four-character string.  By comparing the results SOUNDEX( ) returns for two character expressions, you can determine if the two expressions are phonetically similar, indicating that they sound alike.  This can be useful when searching for duplicate records in a table.

SOUNDEX( ) isn't case sensitive and generally disregards vowels.

Parameter

<expC>

Specify the character expression SOUNDEX( ) evaluates with <expC>.


SOUNDEX( ) Example

? SOUNDEX('Smith')=SOUNDEX('Smyth')

? SOUNDEX('Computer')

USE customer
INDEX ON SOUNDEX(company) TO newcus
SET INDEX TO newcus
SEEK SOUNDEX('Furst')
? company


SOUNDEX() SeeAlso
See Also

DIFFERENCE( ) Function


SPACE( ) Function

See Also	Example

Returns a character string composed of a specified number of spaces.

Syntax

SPACE(<expN>)

Returns

Character

Parameter

<expN>

Specify the number of spaces returned by SPACE( ) with <expN>.  The maximum value for <expN> is 65,504 in the Standard version of FoxPro for MS-DOS.  The maximum value of <expN> is limited only by memory in the 32-bit Extended version of FoxPro for MS-DOS, FoxPro for Windows and FoxPro for Macintosh.


SPACE( ) Example

STORE SPACE(15) TO blank
? LEN(blank)


SPACE() SeeAlso
See Also

PADC( ) | PADL( ) | PADR( ) Functions

REPLICATE( ) Function


SQL Commands Overview

See Also

Structured Query Language (SQL) commands.

FoxPro supports Structured Query Language (SQL) commands.  FoxPro's SQL commands make use of Rushmore technology to optimize performance, and a single SQL command may be used to replace multiple FoxPro commands.

FoxPro supports the following SQL commands:

SELECT

Used to retrieve data from one or more databases.  When you use the SELECT command to pose a query, FoxPro interprets the query and retrieves the specified data from the database(s).  The SELECT command is built into FoxPro like any other FoxPro command.  You can create a SELECT command query:

In the Command window.

In a FoxPro program (like any other FoxPro command).

In the RQBE window.

CREATE CURSOR

Creates a temporary database.  Each field in the temporary database is defined with a name, type, precision and scale.  These definitions can be obtained from the command itself or from an array.

CREATE TABLE

Creates a database.  Each new database field is defined with a name, type, precision and scale.  These definitions can be obtained from the command itself or from an array.

INSERT

Appends a record to the end of an existing database.  The new record includes data listed in the INSERT command or included in the specified array.


SQL SeeAlso
See Also

CREATE CURSOR Command - SQL

CREATE QUERY Command

CREATE TABLE Command - SQL

INSERT Command - SQL

MODIFY QUERY Command

SELECT Command - SQL

SQL Cursors


SQRT( ) Function

See Also	Example

Returns the square root of the specified numeric expression.

Syntax

SQRT(<expN>)

Returns

Numeric

Remarks

The number of decimal places in the value returned by SQRT( ) is the larger of the current decimal place setting and the number of decimal places contained in <expN>.  The current decimal place setting is specified with SET DECIMALS.

Parameter

<expN>

Specify the numeric expression to be evaluated by SQRT( ) with <expN> .  <expN> can't be a negative number.


SQRT( ) Example

? SQRT(4)

? SQRT(57.6*14.3)


SQRT() SeeAlso
See Also

SET DECIMALS Command


SROWS( ) Function

See Also	Example

This function returns the number of rows available in the main FoxPro window.

Syntax

SROWS( )

Returns

Numeric

Remarks

In FoxPro for MS-DOS and FoxPro for Windows, the value returned by SROWS( ) depends on the current display mode.  The display mode can be changed with SET DISPLAY.

In FoxPro for Macintosh, the value returned by SROWS( ) depends on the MACDESKTOP setting and the current screen font. If MACDESKTOP is set to ON, SROWS( ) returns the number of rows for the Macintosh desktop. If MACDESKTOP is set to OFF, SROWS( ) returns the number of rows for the FoxPro for Macintosh desktop. The screen font can be changed with the MODIFY WINDOW command, or in the Font dialog. To display the Font dialog, hold down the Shift key and choose the Text menu, then choose the Screen Font option.


SROWS( ) Example

? SROWS( )


SROWS() SeeAlso
See Also

COL( ) Function

ROW( ) Function

SCOLS( ) Function

SET DISPLAY Commands

WCOLS( ) Function

WROWS( ) Function


STORE Command

See Also	Example

Stores data to a memory variable or to an array.

Syntax

STORE <expr> TO <memvar list> | <array list>
or
<memvar> | <array> = <expr>

Remarks

STORE sets the value of a memory variable or an existing array.  An alternative to STORE is the equal sign (=).  The memory variable or array must be on the left side of the equal sign and the value on the right side.

Dates can be stored directly to memory variables or arrays by using braces:

STORE {12/25/92} TO XMAS

Clauses

<expr>

The value of the expression <expr> is stored to the memory variable or the array.  If the memory variable doesn't exist, it is created and initialized to <expr>.  An array must be previously defined with DIMENSION.  STORE replaces the value in an existing memory variable or array with the new value.

<memvar list>

Include in <memvar list> a memory variable name or array element, or a list of memory variables names or array elements.  Separate memory variable names or array elements with a comma.

<array list>

Include the name of an existing array name or a list of names of existing arrays in <array list>.  Separate array names with commas.

STORE initializes every element in the arrays to the specified value if SET COMPATIBLE is OFF.  STORE stores the specified value to memory variables of the specified names if SET COMPATIBLE is ON, overwriting any existing arrays that have those names.


STORE Example

STORE DATE( ) TO mdate
STORE 50 TO mnum
STORE 'Hello' TO mchar
STORE .T. TO mlog
DISPLAY MEMORY LIKE m*

DIMENSION x(2,2)
STORE 2 TO x
DISPLAY MEMORY LIKE x


STORE SeeAlso
See Also

DIMENSION Command

SET COMPATIBLE Command


STR( ) Function

See Also

Returns the character string equivalent to a specified numeric expression.

Syntax

STR(<expN1>[, <expN2>[, <expN3>]])

Returns

Character

Parameters

<expN1>

The numeric expression evaluated by STR( ) is specified by <expN1>.

<expN2>

The length of the character string returned by STR( ) is specified with <expN2>.  The length includes one character for the decimal point and on character for each digit to the right of the decimal point.

STR( ) pads the character string with leading spaces if you specify a length larger than the number of digits left of the decimal point.  STR( ) returns a string of asterisks, indicating numeric overflow, if you specify a length less than the number of digits left of the decimal point.

<expN3>

The number of decimal places in the character string returned by STR( ) is specified by the numeric expression <expN3>.  You must include <expN2> to specify the number of decimal places.

If you specify fewer decimal places than are in the numeric expression <expN1>, the extra digits are truncated.

? STR(123.456,10,4)


STR() SeeAlso
See Also

VAL( ) Function


STRTRAN( ) Function

See Also	Example

Searches a character expression or memo field for occurrences of a second character expression or memo field, and then replaces each occurrence with a third character expression or memo field.

Syntax

STRTRAN(<expC1>, <expC2>[, <expC3>] [, <expN1>] [, <expN2>])

Returns

Character

Remarks

You can specify where the replacement begins and how many replacements are made. STRTRAN( ) returns the resulting character string.

Parameters

<expC1>

The character expression that's searched is specified with <expC1>.  <expC1> can be a memo field.

<expC2>

The character expression that's searched for in <expC1> is specified with <expC2>.  The search is case-sensitive (lower-case and upper-case are respected).  <expC2> can be a memo field.

<expC3>

The search character expression <expC2> is replaced in <expC1> by the character expression <expC3>.  If <expC3> is omitted, <expC2> is replaced with the null string.

<expN1>

The optional numeric expression <expN1> specifies which occurrence of <expC2> is the first to be replaced.  For example, if <expN1> is 4,  replacement begins with the fourth occurrence of <expC2> in <expC1>, counting from the left, and the first three occurrences of <expC2> remain unchanged.  The occurrence where replacement begins defaults to 1 if <expN1> is omitted.

<expN2>

<expN2> specifies the number of occurrences of <expC2> to replace.  If <expN2> is omitted, all occurrences of <expC2>, starting with the occurrence specified in <expN1>, are replaced.


STRTRAN( ) Example

STORE 'abracadabra' TO mystring
? STRTRAN(mystring, 'a', 'z')

? STRTRAN(mystring, 'a', 'q', 1, 2)

CLOSE DATABASES
USE parts
REPLACE descript WITH STRTRAN(descript, 'Abashed', 'Abrasive')
WAIT WINDOW 'Now you see Abrasive Goat in first descript' NOWAIT
BROWSE TIMEOUT 5
WAIT WINDOW 'Now you see Abashed Goat in first descript' NOWAIT
REPLACE descript WITH STRTRAN(descript, 'Abrasive', 'Abashed')
BROWSE TIMEOUT 5
WAIT CLEAR


STRTRAN() SeeAlso
See Also

STUFF( ) Function


STUFF( ) Function

See Also	Example

Returns a character string created by replacing a specified number of characters in a character expression with another character expression.

Syntax

STUFF(<expC1>, <expN1>, <expN2>, <expC2>)

Returns

Character

Parameters

<expC1>

Specify the character expression <expC1> in which the replacement occurs.

<expN1>

<expN1> specifies the position in <expC1> where the replacement begins.

<expN2>

The number of characters to be replaced is specified by <expN2>.  If <expN2> is 0, the replacement string <expC2> is inserted into <expC1>.

<expC2>

The replacement character expression is specified by <expC2>.  If <expC2> is the null string, the number of characters specified by <expN2> are removed from <expC1>.


STUFF( ) Example

STORE 'abcdefghijklm' TO str1
STORE '12345' TO str2

? STUFF(str1, 4, 0, str2)	&& insert

? STUFF(str1, 4, 3, str2)	&& replace

? STUFF(str1, 4, 6, '')	&& delete

? STUFF(str1, 4, 1, str2) 	&& replace and insert

? STUFF(str1, 4, 4, str2)	&& replace and delete

? STUFF(str1, 4, LEN(str1), str2)	&& replace and delete rest


STUFF () SeeAlso
See Also

LEFT( ) Function

PADC( ) | PADL( ) | PADR( ) Functions

RIGHT( ) Function

STRTRAN( ) Function

SUBSTR( ) Function


SUBSTR( ) Function

See Also	Example

Returns a specified number of characters from the given character expression or memo field.

Syntax

SUBSTR(<expC>, <expN1>[, <expN2>])

Returns

Character

Remarks

This function extracts and returns characters from a character expression, starting at a specified position in the character expression and continuing for a specified number of characters.

Parameters

<expC>

The character expression from which characters are extracted is specified by <expC>.  The expression <expC> can be a memo field.

<expN1>

The position in the character expression <expC> where character extraction begins is specified by <expN1>.  The first character of <expC> is position 1.

Note that if TALK is SET ON and <expN1> is greater than the number of characters in <expC>, FoxPro generates a "Beyond string" error. If TALK is SET OFF, the null string is returned.

<expN2>

<expN2> specifies the number of characters to extract from <expC>.  If <expN2> is omitted, characters are extracted until the end of the character expression is reached.


SUBSTR( ) Example

STORE 'abcdefghijklm' TO mystring
? SUBSTR(mystring, 1, 5)

? SUBSTR(mystring, 6)


SUBSTR() SeeAlso
See Also

AT( ) Function

LEFT( ) Function

RIGHT( ) Function

STRTRAN( ) Function

STUFF( ) Function


SUM Command

See Also	Example

Totals all or specified numeric field values in the current table.

Syntax

SUM
[<expr list>]
[<scope>]
[FOR <expL1>]
[WHILE <expL2>]
[TO <memvar list> | TO ARRAY <array>]
[NOOPTIMIZE]

Clauses

<expr list>

One or more fields or field expressions to total.  All numeric fields are totaled if the expression list is omitted.

<scope>

The scope clauses are:  ALL, NEXT <expN>, RECORD <expN>, and REST.  These are explained in the Overview of the FoxPro Language chapter of the FoxPro Language Reference.  Commands which include <scope> operate only on the table in the currently active work area.

You can specify a scope of records used in the total.  Only the records that fall within the range of records specified by the scope are included in the total.

The default scope for SUM is ALL records.

FOR <expL1>

If the FOR clause is included, only the records for which the logical condition <expL1> evaluates to true (.T.) are included in the total.  Including FOR lets you conditionally total records, filtering out undesired records.

Rushmore optimizes a SUM ...  FOR command  if <expL1> is an optimizable expression.  For best performance, use an optimizable expression in the FOR clause.  A discussion of expressions Rushmore can optimize appears in the Optimizing Your Application chapter in the FoxPro Developer's Guide.

WHILE <expL2>

If the WHILE clause is included, records from the current table are included in the total for as long as the logical expression <expL2> evaluates to true (.T.).

TO <memvar list>

Use the TO <memvar list> clause to store each total to a memory variable.  If you specify a memory variable name in <memvar list> that doesn't exist, FoxPro automatically creates it.  Separate the memory variable names in the list with a comma.

TO ARRAY <array>

The TO ARRAY clause causes SUM to store totals to a memory variable array.  If the array you specify in SUM doesn't exist, FoxPro automatically creates it.  If the array exists and is too small to contain all the totals, the size of the array is automatically increased to accommodate the totals.

NOOPTIMIZE

Include NOOPTIMIZE to cause Rushmore to not optimize SUM.  For more information, see SET OPTIMIZE or the discussion of Rushmore optimization in the Optimizing Your Application chapter in the FoxPro Developer's Guide.


SUM Example

The following example sums and displays the totals of the ONHAND and ONORDER fields in PARTS.DBF, along with a sum of the two totals.

CLOSE DATABASES
USE parts
SUM onhand, onorder, onhand+onorder ;
TO tonhand, tonorder, tunits
?
? 'Total on hand  : ', tonhand
? 'Total on order : ', tonorder
? 'Total # units    : ', tunits


SUM SeeAlso
See Also

AVERAGE Command

CALCULATE Command

COUNT Command


SUSPEND Command

See Also

Use SUSPEND to pause program execution and return to interactive FoxPro.

Syntax

SUSPEND

Remarks

While a program is paused, you can execute intervening commands, check memory variable values, open the Trace and Debug windows and so on.

All memory variables created while the program is paused are PRIVATE.

Issue RESUME to restart execution of a suspended program.  Program execution continues with the line following the line containing SUSPEND.


SUSPEND SeeAlso
See Also

CANCEL Command

RESUME Command


SYSMETRIC( ) Function

See Also

Returns the size of a Windows-style display element.

Syntax

SYSMETRIC(<expN>)

Returns

Numeric

Remarks

SYSMETRIC( ) is supported in FoxPro for Windows and FoxPro for Macintosh.

SYSMETRIC( ) returns the size of display elements. Display elements include menus, windows, window controls and the cursor.  Values are returned in pixels unless otherwise noted and can vary for different display drivers and video hardware.  For further information on Microsoft Windows display elements, refer to the GetSystemMetrics function in the Microsoft Windows Programmer's Reference.

SYSMETRIC( ) enables you precisely to determine the size of menus, windows and window controls you create in FoxPro for Windows and FoxPro for Macintosh. Windows and menus created with DEFINE WINDOW and DEFINE MENU use the same display element sizes as the operating system's windows and menus.

Parameter

<expN>

Use <expN> to specify a screen element.  The following table shows values for <expN> and the corresponding screen element.

<expN>	Display Element

1	Screen width

2	Screen height. The Macintosh screen height excludes the menu bar height.

3	Width of sizable window frame

4	Height of sizable window frame

5	Width of scroll arrows on vertical scroll bar

6	Height of scroll arrows on vertical scroll bar

7	Width of scroll arrows on horizontal scroll bar

8	Height of scroll arrows on horizontal scroll bar

9	Height of window title

10	Width of non-sizable window frame

11	Height of non-sizable window frame

12	Width of DOUBLE or PANEL window frame

13	Height of DOUBLE or PANEL window frame

14	Scroll box width on horizontal scroll bar in text editing windows

15	Scroll box height on vertical scroll bar in text editing windows

16	Minimized window icon width*

17	Minimized window icon height*

18	Maximum cursor width

19	Maximum cursor height

20	Single line menu bar height

21	Maximized window width

22	Maximized window height

23	Kanji window height

24	Minimum sizable window width

25	Minimum sizable window height

26	Minimum window width

27	Minimum window height

28	Window controls width

29	Window controls height

30	1 if mouse hardware present; 0 otherwise. FoxPro for Macintosh always returns 1.

31	1 for Microsoft Windows debugging version; 0 otherwise*

32	1 if mouse buttons swapped; 0 otherwise*

*These display elements are not available in FoxPro for Macintosh, and always return 0.


SYSMETRIC() SeeAlso
See Also

FONTMETRIC( )

GETFONT( )

TXTWIDTH( )

WFONT( )


SYS( ) Functions Overview

Returns FoxPro system information.

Syntax

SYS( )

Returns

Character

Remarks

The various FoxPro SYS( ) functions return character values that contain useful system information.  The following table lists the SYS( ) functions and includes a brief description of the information returned by each function.

Function	Information Returned
SYS(0)	Network machine number
SYS(1)	Julian system date
SYS(2)	Seconds since midnight
SYS(3)	Unique file name
SYS(5)	Default drive
SYS(6)	Current printer device
SYS(7)	Current format file
SYS(9)	FoxPro serial number
SYS(10)	String from day number
SYS(11)	Julian day number
SYS(12)	Available memory in bytes
SYS(13)	Printer status
SYS(14)	Index expression
SYS(15)	Character translation
SYS(16)	Executing program file name
SYS(17)	Processor in use
SYS(18)	Current @ ... GET field or object
SYS(20)	Transform German text
SYS(21)	Controlling index number
SYS(22)	Controlling tag or index name
SYS(23)	FoxPro EMS memory usage
SYS(24)	EMS memory limit
SYS(100)	Console setting
SYS(101)	Device setting
SYS(102)	Printer setting
SYS(103)	Talk setting
SYS(1001)	FoxPro memory
SYS(1016)	User object memory use
SYS(1037)	Print Setup Dialog
SYS(2000)	File name wildcard match
SYS(2001)	SET ... command status
SYS(2002)	Turn cursor on or off
SYS(2003)	Current directory
SYS(2004)	FoxPro start directory
SYS(2005)	Current resource file
SYS(2006)	Current graphics card
SYS(2007)	Check sum value
SYS(2008)	Cursor shape
SYS(2009)	Swap cursor shape
SYS(2010)	CONFIG.SYS file settings
SYS(2011)	Current lock status
SYS(2012)	Memo field blocksize
SYS(2013)	System menu name string
SYS(2014)	Minimum path
SYS(2015)	Unique procedure name
SYS(2016)	SHOW GETS WINDOW name
SYS(2017)	Display sign-on screen
SYS(2018)	Error message parameter
SYS(2019)	Configuration file name and location
SYS(2020)	Default disk size
SYS(2021)	Filtered index expression
SYS(2022)	Disk cluster size
SYS(2023)	Temporary file drive
SYS(2027)	Platform Specific Path Conversion


SYS(0) Function - Network Machine Number

See Also

SYS(0) returns the machine number and machine name when using FoxPro in a network environment.

Syntax

SYS(0)

Returns

Character

Remarks

A machine number and name must first be assigned by the network software and the network shell must be loaded.

If a machine number or name haven't been assigned or the network shell hasn't been loaded, SYS(0) returns a character string consisting of 15 spaces, a pound sign (#) followed by another space and then 0.  Consult your network manual for further information on defining a machine number and name.

SYS(0) returns 1 when using FoxPro in a stand-alone environment.

In FoxPro for MS-DOS and FoxPro for Windows, SYS(0) returns the machine name and machine number.

In FoxPro for Macintosh, SYS(0) returns the machine name and user name.


SYS(0) SeeAlso
See Also

SYS( ) Functions Overview


SYS(1) Function - Julian System Date

See Also	Example

Returns current system date as a Julian day number character string.

Syntax

SYS(1)

Returns

Character

Remarks

The value returned by SYS(1) is valid in the U.S.A. FoxPro versions for any system date after September 14, 1752 and before December 31, 9999.


SYS(1) Example

? SYS(1)

? SYS(10,VAL(SYS(1)))


SYS(1) SeeAlso
See Also

CDOW( ) Function

CTOD( ) Function

DATE( ) Function

DAY( ) Function

DOW( ) Function

DTOC( ) Function

SYS( ) Functions Overview


SYS(2) Function - Seconds Since Midnight

See Also	Example

Returns the number of seconds elapsed since midnight.

Syntax

SYS(2)

Returns

Character


SYS(2) Example

? TIME( )

? SYS(2)


SYS(2) SeeAlso
See Also

SECONDS( ) Function

SYS( ) Functions Overview

TIME( ) Function


SYS(3) Function - Unique File Name

See Also	Example

Returns a unique, legal file name that can be used to create temporary files.

Syntax

SYS(3)

Returns

Character

Remarks

A different file name is returned each time SYS(3) executes.


SYS(3) Example

USE offices
outfile = SYS(3)+'.DBF'
? outfile
COPY TO (outfile)


SYS(3) SeeAlso
See Also

FILE( ) Function

SYS( ) Functions Overview


SYS(5) Function - Default Drive

See Also	Example

Returns current default drive.

Syntax

SYS(5)

Returns

Character

Remarks

This function returns the current SET DEFAULT setting.

In FoxPro for Macintosh, you can use SET VOLUME to map occurrences of MS-DOS drive designators (A:, B:, C:, and so on.) to a specified Macintosh volume or folder. If you have used SET VOLUME to map an MS-DOS drive designator to the default Macintosh volume, SYS(5) returns the MS-DOS drive designator.


SYS(5) Example

SET DEFAULT TO C:
? SYS(5)


SYS(5) SeeAlso
See Also

SET DEFAULT Command

SYS( ) Functions Overview


SYS(6) Function - Current Printer Device

See Also	Example

Returns the current print device.

Syntax

SYS(6)

Returns

Character

Remarks

This function returns the current SET PRINTER TO setting.


SYS(6) Example

? SYS(6)

SET PRINTER TO output.txt
? SYS(6)


SYS(6) SeeAlso
See Also

SET PRINTER Commands

SYS( ) Functions Overview


SYS(7) Function - Current Format File

See Also

Returns the name of the current format file.

Syntax

SYS(7[, <expN>])

Returns

Character

Remarks

A format file is opened with SET FORMAT.  The null string is returned if a format file isn't open for the specified work area.

The format file for the current work area is returned if you don't include a work area number <expN>.


SYS(7) SeeAlso
See Also

SET FORMAT Command

SYS( ) Functions Overview


SYS(9) Function - FoxPro Serial Number

See Also

Returns your FoxPro serial number.

Syntax

SYS(9)

Returns

Character


SYS(9) SeeAlso
See Also

SYS( ) Functions Overview

VERSION( ) Function


SYS(10) Function - String from Day Number

See Also	Example

Converts a Julian day number to a character string.

Syntax

SYS(10, <expN>)

Returns

Character

Remarks

SYS(10) returns a character type date from a Julian day number <expN>.  The value returned by SYS(10) is valid in U.S.A. FoxPro versions for any Julian day number after September 14, 1752 and before December 31, 9999 (2,361,222 to 5,373,484).


SYS(10) Example

? SYS(1)

? SYS(10,VAL(SYS(1)))


SYS(10) SeeAlso
See Also

CDOW( ) Function

CTOD( ) Function

DATE( ) Function

DAY( ) Function

DOW( ) Function

DTOC( ) Function

SYS( ) Functions Overview


SYS(11) Function - Julian Day Number

See Also	Example

Converts date expression or character string in date format to a Julian day number.

Syntax

SYS(11, <expD> | <expC>)

Returns

Character

Remarks

SYS(11) returns a Julian day number from a date expression <expD> or a character expression in a date format <expC>.  The day number is returned as a character string.


SYS(11) Example

? SYS(11, {10/31/92})

? SYS(11,'10/31/92')


SYS(11) SeeAlso
See Also

CDOW( ) Function

CTOD( ) Function

DATE( ) Function

DAY( ) Function

DOW( ) Function

DTOC( ) Function

SYS( ) Functions Overview


SYS(12) Function - Available Memory in Bytes

See Also

Returns amount of memory below 640KB which is available to execute an external program.

Syntax

SYS(12)

Returns

Character

Remarks

In FoxPro for MS-DOS, SYS(12) returns the amount of memory below 640KB which is available to execute an external program.  Any available expanded memory isn't included in the value returned by this function, and the value can vary throughout a FoxPro for MS-DOS session.

In FoxPro for Windows and FoxPro for Macintosh, SYS(12) always returns 655,360.

SYS(12) is similar to MEMORY( ), with two exceptions:

SYS(12) returns the amount of available memory in bytes. MEMORY( ) returns available memory in kilobytes.

SYS(12) returns a character string.  MEMORY( ) returns a numeric value.


SYS(12) SeeAlso
See Also

MEMORY( ) Function

RUN | ! Command

SYS( ) Functions Overview

SYS(23) Function - FoxPro EMS Memory Usage

SYS(24) Function -  EMS Memory Limit

SYS(1001) Function - FoxPro Memory

SYS(1016) Function - User Object Memory Use


SYS(13) Function - Printer Status

See Also	Example

Returns the status of the printer.

Syntax

SYS(13)

Returns

Character

Remarks

In FoxPro for MS-DOS and FoxPro for Windows,OFFLINE is returned if the printer isn't ready.  READY is returned if the printer is ready.

In FoxPro for Macintosh, SYS(13) always returns READY.

If the printer is connected to a COM port, SYS(13) returns READY if the printer returns Clear To Send Data or Data Set Ready to FoxPro.

If the printer is connected to a parallel port, SYS(13) returns OFFLINE if the printer returns Out of paper, I/O error, Time out, Printer Busy or Printer Not Selected to FoxPro.


SYS(13) Example

IF SYS(13) = 'OFFLINE'
WAIT WINDOW 'Printer is offline'
ENDIF


SYS(13) SeeAlso
See Also

PRINTSTATUS( ) Function

SET PRINTER Commands

SYS( )

Functions Overview


SYS(14) Function - Index Expression

See Also	Example

Returns index expression of an open single-entry .IDX index file or index expressions for tags in compound .CDX index files.

Syntax

SYS(14, <expN1>[, <expN2> <expC>])

Returns

Character

Remarks

An index expression is specified when an index file or tag is created with INDEX.  The index expression determines how a table is displayed and accessed when an index file or tag is used to order the table.

For more information on index expressions and creating index files and tags, see INDEX.  SYS(14) is similar to the KEY( ) function.

USE and SET INDEX both support an index file name list that lets you open index files for a table.  Any combination of single-entry index files, structural compound or independent compound index file names can be included in the index file list.

The numeric expression <expN1> specifies which index expression to return from the open index files or tags.  SYS(14) returns index expressions from open index files and tags in the following order:

1	Index expressions from single-entry index files (if any are open) are returned first.  The order the single-entry index files are included in USE or SET INDEX determines the order the index expressions are returned.

2	Index expressions for each tag in the structural compound index (if one is present) are returned next.  The index expressions are returned from the tags in the order the tags are created in the structural index.

3	Index expressions for each tag in any open independent compound indexes are returned last.  The index expressions are returned from the tags in the order the tags are created in the independent compound indexes.

The null string is returned if <expN1> is greater than the total number of open single-entry files and structural compound and independent compound index tags.

Index expressions are returned from index files open in the current work area unless you include a work area number <expN2> or a table or work area alias <expC>.

If a table doesn't have the alias you specify, the message "Alias not found" is displayed.


SYS(14) Example

CLOSE DATABASES
USE customer
INDEX ON cno TO cus_cno
INDEX ON company TO cus_com
SET INDEX TO cus_cno, cus_com
? SYS(14,1)

? SYS(14,2,'customer')

USE


SYS(14) SeeAlso
See Also

CDX( ) Function

KEY( ) Function

INDEX Command

MDX( ) Function

NDX( ) Function

REINDEX Command

SET INDEX Command

SET ORDER Command

SYS( ) Functions Overview

TAG( ) Function


SYS(15) Function - Character Translation

See Also

Translates second character string by first character string.

Syntax

SYS(15, <expC1>, <expC2>)

Returns

Character

Remarks

This function is primarily intended for the convenience of European users who must use letters with diacritical marks.  Since there are different versions of most vowels (with different diacritical marks), indexing on fields containing such characters doesn't preserve normal alphabetical order.

This function takes each character in the character expression <expC2> and uses the character's numeric value as a subscript into the table <expC1> and replaces the character in <expC2> with the character found at that position in the table.

If table <expC1> doesn't have a character corresponding to a character from <expC2>, those characters in <expC2> aren't translated.

We have included sample translation tables in a memory variable file called EUROPEAN.MEM.  Stored in this memory variable file is a character variable called EUROPEAN, for use with FoxPro for MS-DOS.  Another character variable, EUROANSI, is provided for use with FoxPro for Windows and FoxPro for Macintosh. These memory variables can be used with SYS(15) to translate characters with diacritical marks to the corresponding characters without the diacritical marks. In FoxPro for MS-DOS and FoxPro for Windows, EUROPEAN.MEM is located in the directory in which you install FoxPro. In FoxPro for Macintosh, EUROPEAN.MEM is located in the Goodies:Misc folder.

As an example, the following command can be used to index a table on a field containing characters with diacritical marks while preserving normal alphabetical order:

INDEX ON SYS(15,EUROPEAN,field) TO euroidx


SYS(15) SeeAlso
See Also

SYS( ) Functions Overview

SYS(20) Function - Transform German Text


SYS(16) Function - Executing Program File Name

See Also	Example

Returns the file name of the program being executed.

Syntax

SYS(16[, <expN>])

Returns

Character

Remarks

This is useful when recovering from errors.  SYS(16) is similar to PROGRAM( ).  However SYS(16) returns a path with the program name; PROGRAM( ) returns just the program name.  If the program being executed is a procedure or function, SYS(16) also returns the name of the file containing the procedure or function.

When the executing program is part of an application (APP), SYS(16) only returns the name of the program [image] the path isn't returned with the program name.

<expN> indicates from how many levels back the program name is fetched.  This value can range from 1 to the depth programs are nested.

If <expN> is 1 or 0, SYS(16) returns the name of the master program (the program first executed).  The name of the currently executing program is returned if <expN> is omitted.  The null string is returned if <expN> is greater that the program nesting depth.


SYS(16) Example

The program nesting can be returned with the following short program example.

STORE 1 TO i
DO WHILE LEN(SYS(16,i)) <> 0
? SYS(16,i)
STORE i+1 TO i
ENDDO


SYS(16) SeeAlso
See Also

LINENO( ) Function

ON ERROR Command

PROGRAM( ) Function

SYS( ) Functions Overview


SYS(17) Function - Processor in Use

See Also	Example

Returns processor in use.

Syntax

SYS(17)

Returns

Character

Remarks

This function returns the type of central processing unit you are using:  8086/88, 80286, 80386 or 80486.


SYS(17) Example

? 'Processor in use:', SYS(17)


SYS(17) SeeAlso
See Also

SYS( ) Functions Overview


SYS(18) Function - Current @ ... GET Field or Object

See Also

Returns the name in upper-case of the memory variable, array element or field used to create the current @ ... GET control.

Syntax

SYS(18)

Returns

Character

Remarks

Controls are check boxes, fields, invisible, push or radio buttons, lists, popups, spinners or text editing regions.  If a Browse, Change or Edit window is active, the name of the current field is returned.

SYS(18) is identical to VARREAD( ).  Both can be used to pass the name of the current control to a procedure.


SYS(18) SeeAlso
See Also

SYS( ) Functions Overview

VARREAD( ) Function


SYS(20) Function - Transform German Text

See Also	Example

Transforms a character expression containing German text to a character string.

Syntax

SYS(20, <expC>, <expN>)

Returns

Character

Remarks

SYS(20) is used to order fields containing German words and names.  The fields are ordered to resemble the ordering in a German phone book [image] upper- and lower-case are intermixed, eszets sort immediately after double s and characters with umlauts sort immediately after the unadorned character followed by the letter e.

For the sort order of a sample set of characters, see the SYS(20) section of the FoxPro Language Reference.

SYS(15) can also be used for indexing and sorting fields that contain diacritical marks.

SYS(20) transforms the character expression <expC>.  The numeric expression <expN> specifies the number of characters in <expC> to transform, starting with the first character in <expC>.  Any additional characters after the position specified by <expN> are ignored.  The length of character string returned by SYS(20) is 2 * <expN> + 10 characters, with a maximum length of 254 characters.


SYS(20) Example

In the following example, the CONTACT field contains the names of customers.  This field is indexed using SYS(20) and the first 20 characters in the field.  An structural index tag named GCONTACT is created.

USE CUSTOMER
INDEX ON SYS(20, contact, 20) TAG gcontact


SYS(20) SeeAlso
See Also

CHRTRAN( ) Function

STRTRAN( ) Function

SYS( ) Functions Overview

SYS(15) Function - Character Translation


SYS(21) Function - Controlling Index Number

See Also

Returns the index position number of the master controlling index or index tag in the selected work area.

Syntax

SYS(21)

Returns

Character

Remarks

The controlling index is the first index specified in USE or SET INDEX.  SET ORDER can also be used to specify which index is the controlling index.  For more information on the controlling index, see USE and SET ORDER.


SYS(21) SeeAlso
See Also

CDX( ) Function

KEY( ) Function

INDEX Command

MDX( ) Function

NDX( ) Function

REINDEX Command

SET INDEX Command

SET ORDER Command

SYS( ) Functions Overview

SYS(22) Function - Controlling Tag or Index Name

TAG( ) Function

USE Command


SYS(22) Function - Controlling Tag or Index Name

See Also

Returns name of the master controlling tag or index for a table.

Syntax

SYS(22[, <expN>])

Returns

Character

Remarks

The controlling tag or index is returned for the current work area unless another work area number <expN> is included.


SYS(22) SeeAlso
See Also

CDX( ) Function

KEY( ) Function

INDEX Command

MDX( ) Function

NDX( ) Function

REINDEX Command

SET INDEX Command

SET ORDER Command

SYS( ) Functions Overview

SYS(21) Function - Controlling Index Number

TAG( ) Function


SYS(23) Function - FoxPro EMS Memory Usage

See Also

Returns amount of EMS memory (in 16K segments) that is currently being used by FoxPro.

Syntax

SYS(23)

Returns

Character

Remarks

0 is returned if no EMS memory is in use.

SYS(23) always returns 0 in the 32-bit Extended version of FoxPro for MS-DOS, FoxPro for Windows and FoxPro for Macintosh.


SYS(23) SeeAlso
See Also

SYS( ) Functions Overview

SYS(12) Function - Available Memory in Bytes

SYS(24) Function - EMS Memory Limit

SYS(1001) Function - FoxPro Memory

SYS(1016) Function - User Object Memory Use


SYS(24) Function - EMS Memory Limit

See Also

Returns the EMS limit set in your FoxPro configuration file.

Syntax

SYS(24)

Returns

Character

Remarks

SYS(24) returns 0 if an EMS limit was not included in your configuration file.  SYS(23) always returns 0 in the 32-bit Extended version of FoxPro for MS-DOS, FoxPro for Windows and FoxPro for Macintosh.

See the Customizing FoxPro chapter in the FoxPro Installation and Configuration manual for complete information on this configuration setting.


SYS(24) SeeAlso
See Also

SYS( ) Functions Overview

SYS(12) Function - Available Memory in Bytes

SYS(23) Function - FoxPro EMS Memory Usage

SYS(1001) Function - FoxPro Memory

SYS(1016) Function - User Object Memory Use


SYS(100) Function - Console Setting

See Also	Example

Returns the current SET CONSOLE setting.

Syntax

SYS(100)

Returns

Character


SYS(100) Example

IF SYS(100) <> 'ON'
SET CONSOLE ON
ENDIF


SYS(100) SeeAlso
See Also

SET CONSOLE Command

SYS( ) Functions Overview


SYS(101) Function - Device Setting

See Also	Example

Returns the current SET DEVICE setting.

Syntax

SYS(101)

Returns

Character


SYS(101) Example

IF SYS(101) <> 'SCREEN'
SET DEVICE TO SCREEN
ENDIF


SYS(101) SeeAlso
See Also

SET DEVICE Command

SYS( ) Functions Overview


ACTIVATE WINDOW Command

See Also	Example

Displays and activates one or more user-defined windows or FoxPro system windows.

Syntax

ACTIVATE WINDOW [<window name1>[, <window name2> ...]] | ALL
| ALL | SCREEN
[IN [WINDOW] <window name3> | SCREEN | MACDESKTOP]
[BOTTOM | TOP | SAME]
[NOSHOW]

Remarks

User-defined windows are created with DEFINE WINDOW.

Activating a window makes it the frontmost window and directs all output to that window.  Output can be directed to only one window at a time.  A window remains the active output window until it is deactivated or released, or until another window or the main FoxPro window is activated.

The names of user-defined windows appear in the bottom section of the Window menu popup.  The name of the active user-defined window is marked with a diamond in FoxPro for MS-DOS and a check mark in FoxPro for Windows and FoxPro for Macintosh.

More than one window can be placed in the main FoxPro window at a time, but output is directed only to the last window activated.  When more than one window is open, deactivating the active output window removes it from the screen and sends subsequent output to another window.  If there is no active output window, output is directed to the main FoxPro window.

Note   To ensure that output is directed to a specific window when you deactivate the active output window, you must explicitly activate the window you want to send output to with ACTIVATE WINDOW.

All activated windows are displayed until DEACTIVATE WINDOW or HIDE WINDOW is issued to remove them from view.  Issuing either command removes windows from view but not from memory.  Windows can be redisplayed by issuing ACTIVATE WINDOW or SHOW WINDOW.

To remove windows from view and from memory, use CLEAR WINDOWS, RELEASE WINDOWS or CLEAR ALL.  Windows that are removed from memory must be redefined to place them back in the main FoxPro window.

You can use ACTIVATE WINDOW to place FoxPro desk accessories and system windows in the main FoxPro window or in a parent window.

In FoxPro for Macintosh, the desk accessories, except the Filer, can only be opened with ACTIVATE WINDOW. Issue FILER in the Command window or a program to open the Filer.

The following desk accessories and system windows can be opened with ACTIVATE WINDOW:

Desk Accessories

Filer

Calculator

Calendar/Diary

Special Characters*

ASCII Chart*

Puzzle

* Not available in FoxPro for Windows and FoxPro for Macintosh

System Windows

Command

Debug

Trace

View

To activate a desk accessory whose name has two parts (Calendar/Diary, Special Characters, ASCII Chart), include the first part of the name in upper case. For example, use ACTIVATE WINDOW CALENDAR to activate the Calendar/Diary.

Use RELEASE WINDOW to remove a desk accessory or a system window from the Clauses

<window name1>[, <window name2> ...]

This clause lists the names of windows to activate.  Separate the window names with a comma.

ALL

If you specify ALL, all defined windows are activated. The last window activated is the active output window.

SCREEN

The SCREEN option is available in FoxPro for Macintosh only.

Include SCREEN to display the main FoxPro window when it is hidden. You can also choose the Screen menu option from the Window menu to display the main FoxPro window when it is hidden.

You can hide the main FoxPro window by clicking its close box or issuing DEACTIVATE WINDOW SCREEN, HIDE WINDOW SCREEN or RELEASE WINDOW SCREEN.

IN [WINDOW] <window name3>

When you include this clause, the window is placed and activated in the parent window specified with <window name3>.  The activated window is referred to as a child window.  A parent window can have multiple child windows.  A child window activated inside a parent window cannot be moved outside the parent window.  If the parent window is moved, the child window moves with it.

Note   The parent window must be visible for any of its child windows to be visible.

IN [WINDOW] SCREEN

By default, windows are activated in the main FoxPro window rather than in a parent window.  You can explicitly place and activate a window in the main FoxPro window by including IN WINDOW SCREEN or IN SCREEN.  If an IN WINDOW clause was included in DEFINE WINDOW when a window was created, the IN SCREEN clause takes precedence and the window is placed in the main FoxPro window.

IN [WINDOW] MACDESKTOP

MACDESKTOP is available in FoxPro for Macintosh only.

Include the MACDESKTOP clause to activate a window on the Macintosh desktop. The window resides at the same level as the main FoxPro window. The window can be moved outside of the main FoxPro window and the main FoxPro window can be brought forward over the top of it. When you include the MACDESKTOP clause, the activated window behaves in the same manner as windows in FoxBASE+ for Macintosh.

Including the MACDESKTOP clause overrides the current SET MACDESKTOP setting. SET MACDESKTOP determines if windows are activated on the main FoxPro window or the Macintosh desktop when the SCREEN or MACDESKTOP clause is not included. For more information about activating windows on the main FoxPro window or the Macintosh desktop, see SET MACDESKTOP.

main FoxPro window or a parent window.

BOTTOM | TOP | SAME

By default, a window becomes the frontmost window when it is activated.  Include BOTTOM, TOP or SAME to specify where windows are activated with respect to other previously activated windows.  Including BOTTOM places a window behind all other windows;  including TOP places it in front of all other windows.  Issuing ACTIVATE WINDOW with SAME activates a window without affecting its front-to-back placement.

NOSHOW

Include NOSHOW to activate and direct output to a window without displaying the window.

In FoxPro version 2.0 and later, including NOSHOW automatically displays the window when it becomes the current READ window.  In earlier FoxPro versions, the window is not displayed.

Note   Activate a window using NOSHOW to draw an input window.  Once the window is drawn, issue SHOW WINDOW to "pop" the window open.  This technique displays windows quickly.


ACTIVATE WINDOW Example

This example defines a window named Output and activates it, placing it in the main FoxPro window.  The WAIT command pauses execution, the window is hidden and then redisplayed.

CLEAR
DEFINE WINDOW output FROM 2,1 TO 13,75 TITLE 'Output' ;
CLOSE FLOAT GROW SHADOW ZOOM

ACTIVATE WINDOW output
WAIT WINDOW 'press any key to hide window output'
HIDE WINDOW output
WAIT WINDOW 'press any key to show window output'
SHOW WINDOW output
WAIT WINDOW 'press any key to release window output'
RELEASE WINDOW output


ACTIVATE WINDOW SeeAlso
See Also

CLEAR WINDOWS Command

DEACTIVATE WINDOW Command

DEFINE WINDOW Command

HIDE WINDOW Command

RELEASE WINDOW Command

SHOW WINDOW Command


ADEL( ) Function

See Also	Example

Deletes an element from a one-dimensional array or a row or column from a two-dimensional array.

Syntax

ADEL(<array>, <expN>[, 2])

Returns

Numeric

Remarks

Deleting an element, row or column from an array doesn't change the size of the array; instead, the trailing elements, rows or columns are moved to the start of the array, and the last element, row or column in the array is set to a logical false (.F.).

If the element, row or column is successfully deleted, 1 is returned.

Note   You can refer to an element in a two-dimensional array in two ways.  The first uses two subscripts to specify the row and column position of the element in the array; the other uses a single-element number.  This function and others that manipulate two-dimensional arrays require single-element numbers (here, the numeric expression <expN>).  You can use AELEMENT( ) to return the proper element number for a two-dimensional array from its row and column subscripts.

For more information on how to reference elements in an array, see DIMENSION.


ADEL( ) Function Example

The following example creates and fills an array, then searches for a particular company name, which, if the company is found, it removes from the array.

CLOSE DATABASES
SELECT company FROM customer ;
WHERE state = 'TN' ;
INTO ARRAY companies
m.count = _TALLY
m.name = 'Data Inc.'
m.pos  = ASCAN(companies, m.name)  && Search for company

IF m.pos != 0

*** Company found, remove it from the array ***

= ADEL(companies, m.pos)
m.count = m.count - 1
ENDIF
DISPLAY MEMORY LIKE companies*


ADEL( ) Function SeeAlso
See Also

ACOPY( ) Function

ADIR( ) Function

AELEMENT( ) Function

AFIELDS( ) Function

AINS( ) Function

ALEN( ) Function

ASCAN( ) Function

ASORT( ) Function

ASUBSCRIPT( ) Function

DIMENSION Command


ADIR( ) Function

See Also	Example

Places information about all files in the current directory or all files that match a file skeleton into an array, and then returns the number of files.

Syntax

ADIR(<array>[, <expC1>[, <expC2>]])

Returns

Numeric

Remarks

For each file, ADIR( ) places into the array the file name, size, date, time and MS-DOS attributes.

Parameters

<array>

Information about the files is placed into the memory variable array specified in <array>.  If the array you include doesn't exist, FoxPro automatically creates the array.  If the array exists and isn't large enough to contain all the information, the size of the array is automatically increased to accommodate the information.  If the array is larger than necessary, the array size is truncated.  If the array exists and ADIR( ) returns 0 because no matching files were found, the array remains unchanged.

The following table describes what each column in the array contains and the data type of each column:

Column	Information	Data Type
1	File names	Character
2	File sizes	Numeric
3	File dates	Date
4	File times	Character
5	File attributes	Character
The last array column contains the file attributes of the matching files.  Each file attribute is expressed by a letter, and a file can have more than one attribute. File attributes can be set in the Filer. The following table indicates what file attribute each letter represents:

Letter	Attribute
A	Archive (Read and Write)
H	Hidden
R	Read only
S	System
D	Directory
<expC1>

You can include a file skeleton <expC1> that lets you store information about files with names or extensions that match a criterion.  For example, the criterion can be all tables, all text files, all files with names that have A as their second letter and so on.  These general searches are done by including the wildcard characters * and ? in <expC1>.  A question mark represents a single character and an asterisk represents any number of characters.  You can use any number of wild card characters in any position within the file skeleton.

In FoxPro for MS-DOS and FoxPro for Windows, a drive and/or directory specification can be included in <expC1> to search for matching file names on a specific drive and directory.  If a drive and directory specification is omitted, information about files in the current directory is placed into the array.

In FoxPro for Macintosh, a volume and/or folder specification can be included in <expC1> to search for matching file names on a specific volume and folder. If a volume and folder specification is omitted, information about files in the current folder is placed into the array.

<expC2>

Include <expC2> to expand the search to subdirectories or nested folders, hidden or system files, or a volume name.

The character expression <expC2> can contain any combination of D, H, and S.  Including D returns subdirectory or nested folder names off the current directory or folder in addition to file names that match the file skeleton specified in <expC1>.  Including H returns information about hidden files that match the file skeleton specified in <expC1>.  Including S returns information about system files that match the file skeleton specified in <expC1>.

You can include V in <expC2> to return the volume name of the current drive.  Only the volume name is returned to the array if V is included with D, H, and S.  The volume name is stored in the first array element and the remainder of the array is truncated.

<expC3> - FoxPro for Macintosh only

In FoxPro for Macintosh, you can include <expC3> to search for files with a specific creator type.

If you include the null string in <expC1>, only files that match the creator type specified in <expC3> are placed in the array. If you include a file skeleton in <expC1>, files that match the file skeleton and have the creator type specified in <expC3> are placed in the array.

For a list FoxPro file extensions and corresponding creator types, see the File Types and Extensions table in Appendix A of the Developer's Guide.


ADIR( ) Example
ADIR( ) Examples

In FoxPro for MS-DOS and FoxPro for Windows, this procedure returns the volume label when you supply the drive letter:

PROCEDURE volume
PARAMETER drive
string = drive + ':'
DIMENSION temparray(1)
=ADIR(temparray,(string),'V')
RETURN temparray(1)

The following example shows how to call the procedure above:

? VOLUME('C')

In FoxPro for Macintosh, the following example shows how <expC3> can be used to store files with a specific creator in an array. All programs in the current folder that were created in FoxPro for Macintosh are stored in an array named marray.

=ADIR(marray,'*.prg','','F+PR')


ADIR() SeeAlso
See Also

ADEL( )

AELEMENT( )

AFIELDS( )

AINS( )

ALEN( )

ASCAN( )

ASORT( )

ASUBSCRIPT( )

DIMENSION

DIR or DIRECTORY

FILER


AELEMENT( ) Function

See Also	Example

Returns the number of an array element from the element's subscripts.

Syntax

AELEMENT(<array>, <expN1>[, <expN2>])

Returns

Numeric

Remarks

You can reference an element in a two-dimensional array in one of two ways.  The first method uses two subscripts to specify the row and column position of the element in the array and the second method uses a single element number.  AELEMENT( ) returns the element number when supplied an element's row and column subscripts.

The FoxPro functions ADEL( ), ADIR( ), AFIELDS( ), AINS( ), ALEN( ), ASCAN( ), ASORT( ) and ASUBSCRIPT( ) can manipulate two-dimensional arrays, and require that elements be referred to by their element number.  AELEMENT( ) facilitates conversion from subscripts to an element number for use by these functions.  The corresponding row and column subscripts can be returned from an element number with ASUBSCRIPT( ).

In the following example, an array with two rows and three columns is created.  DISPLAY MEMORY shows the contents of the elements of the array listed in element number order.

DIMENSION x(2,3)
DISPLAY MEMORY LIKE x

X           Pub    A
  (   1,   1)     L  .F.  (element number 1)
  (   1,   2)     L  .F.  (element number 2)
  (   1,   3)     L  .F.  (element number 3)
  (   2,   1)     L  .F.  (element number 4)
  (   2,   2)     L  .F.  (element number 5)
  (   2,   3)     L  .F.  (element number 6)

An element can be referred by its subscripts or its element number. The commands STORE 'INVOICE' TO X(2, 1) and STORE 'INVOICE' TO X(4) both store the character string INVOICE to the same array element.

In one-dimensional arrays an element number is identical to its single row subscript.  It isn't necessary to use AELEMENT( ) with one-dimensional arrays.

Parameters

<array>

Include the name of the array whose element number you want to return.

<expN1>

Specify the row subscript with <expN1>.  If the array is one-dimensional, AELEMENT( ) identically returns <expN1>.

<expN2>

Specify the column subscript with <expN2>. If the array is two-dimensional, include both <expN1> and <expN2>.

If you include just <expN1>, the element number is returned until <expN1> exceeds the number of rows in the array, then the error message "Subscript out of bounds" is displayed.


AELEMENT( ) Example

The following example creates and fills an array then sorts and displays a list of the companies in the CUSTOMER table.

CLOSE DATABASES
USE customer
COUNT TO m.count
DIMENSION companies[m.count,2]
COPY TO ARRAY companies FIELD Cno,Company

*** The first three elements are not sorted ***

= ASORT(companies, AELEMENT(companies,4,2))
@ 5,30 SAY 'List of Companies:'
@ 7,30 GET m.choice ;
FROM companies ;
RANGE 2 ;
SIZE 10,30 ;
DEFAULT 1
READ
CLEAR


AELEMENT() SeeAlso
See Also

ADEL( ) Function

ADIR( ) Function

AFIELDS( ) Function

AINS( ) Function

ALEN( ) Function

ASCAN( ) Function

ASORT( ) Function

ASUBSCRIPT( ) Function

DIMENSION Command

DISPLAY MEMORY Command


AFIELDS( ) Function

See Also

Places table structure information into an array.

Syntax

AFIELDS(<array>)

Returns

Numeric

Remarks

AFIELDS( ) places information about the structure of the current table into an array and returns the number of fields in the table.  AFIELDS( ) stores each field name, type, length, and the number of decimal places in numeric fields.  You can use COPY STRUCTURE EXTENDED to place the same information into a table instead of an array.

Parameter

<array>

Information about the table structure is placed into a four-column memory variable <array>.  If the array you include in AFIELDS( ) doesn't exist, FoxPro automatically creates it.  If the array exists and isn't large enough to contain all the information returned by AFIELDS( ), the size of the array is automatically increased to accommodate the information.

The following table describes what each column in the array contains and the data type of the information stored in each column.

Col #	Field Info	Data Type
1	Field names	Character
2	Field types   C = Character   D = Date   L = Logical   M = Memo   N = Numeric   F = Float   G = General	Character
2 Field types Character3	Field lengths	Numeric
4	Decimal places	Numeric


AFIELDS() SeeAlso
See Also

ADEL( ) Function

AELEMENT( ) Function

ADIR( ) Function

AINS( ) Function

ALEN( ) Function

ASCAN( ) Function

ASORT( ) Function

ASUBSCRIPT( ) Function

COPY STRUCTURE Command

DIMENSION Command


SYS(102) Function - Printer Setting

See Also	Example

Returns the current SET PRINTER setting.

Syntax

SYS(102)

Returns

Character


SYS(102) Example

IF SYS(102) <> 'OFF'
SET PRINTER OFF
ENDIF


SYS(102) SeeAlso
See Also

SET PRINTER Commands

SYS( ) Functions Overview


SYS(103) Function - Talk Setting

See Also	Example

Returns the current SET TALK setting.

Syntax

SYS(103)

Returns

Character


SYS(103) Example

IF SYS(103) <> 'ON'
SET TALK ON
ENDIF


SYS(103) SeeAlso
See Also

SET TALK Command

SYS( ) Functions Overview


SYS(1001) Function - FoxPro Memory

See Also

Returns the total amount of memory available to the FoxPro memory manager.

Syntax

SYS(1001)

Returns

Character

Remarks

In FoxPro for MS-DOS, if you have 64K of LIM 4.0 compatible expanded memory available, this is also included. High memory between 640K and 1MB available to MS-DOS is also included.

Use SYS(12) and MEMORY( ) in FoxPro for MS-DOS to return memory below 640KB that's available when you execute an external program.


SYS(1001) SeeAlso
See Also

SYS( ) Functions Overview

SYS(12) Function - Available Memory in Bytes

SYS(23) Function - FoxPro EMS Memory Usage

SYS(24) Function - EMS Memory Limit

SYS(1016) Function - User Object Memory Use


SYS(1016) Function - User Object Memory Use

See Also

Returns amount of memory being used by objects you define.

Syntax

SYS(1016)

Returns

Character

Remarks

The defined objects include: user-defined windows, menu bars, popups, memory variables, arrays, open tables, files opened with low-level file functions and so on.


SYS(1016) SeeAlso
See Also

SYS( ) Functions Overview

SYS(12) Function - Available Memory in Bytes

SYS(23) Function - FoxPro EMS Memory Usage

SYS(24) Function - EMS Memory Limit

SYS(1001) Function - FoxPro Memory


SYS(1037) - Print Setup Dialog

See Also

Displays the Macintosh Page Setup dialog.

Syntax

SYS(1037)

Returns

Character

Remarks

SYS(1037) is for use in FoxPro for Macintosh only. It is ignored in FoxPro for MS-DOS and FoxPro for Windows.

SYS(1037) displays the Macintosh Page Setup dialog, allowing you to make adjustments to printer settings such as the paper size and orientation. The settings you can adjust in this dialog depend on the printer you've installed.

SYS(1037) always returns the null string.


See Also

PRINTSTATUS( )

PRTINFO( ) Function

SET DEVICE

SET PRINTER


SYS(2000) Function - File Name Wildcard Match

See Also	Example

Returns the name of the first file that matches the skeleton <expC>.

Syntax

SYS(2000, <expC>[, 1])

Returns

Character

Remarks

The name of the next matching file is returned if 1 is included.   The null string is returned if a matching file can't be found.  The file skeleton can contain the wildcard characters ? and *.


SYS(2000) Example

? SYS(2000,'CUSTOMER.*')

? SYS(2000,'CUSTOMER.*',1)


SYS(2000) SeeAlso
See Also

SYS( ) Functions Overview


SYS(2001) Function - SET ... Command Status

See Also	Example

Returns the status of the specified SET ... ON/OFF or SET ... TO commands.

Syntax

SYS(2001, <expC>[, 1])

Returns

Character

Remarks

SYS(2001) is identical to SET( ).

Some SET commands have two settings (for example, SET PRINTER ON | OFF and SET PRINTER TO <file>).  Use SYS(2001) without 1 to return the ON | OFF switch setting.  Use SYS(2001) with 1 to return the an additional setting.


SYS(2001) Example

? SYS(2001,'PRINTER')

? SYS(2001,'PRINTER',1)


SYS(2001) SeeAlso
See Also

SET( ) Function

SYS( ) Functions Overview


SYS(2002) Function - Turn Cursor On or Off

See Also

Turns the cursor on or off.

Syntax

SYS(2002[, 1])

Returns

None

Remarks

SYS(2002) turns the cursor off.  SYS(2002, 1) turns the cursor on.  For more information about turning the cursor on and off, see SET CURSOR.


SYS(2002) SeeAlso
See Also

INKEY( ) Function

SET CURSOR Command

SYS( ) Functions Overview


SYS(2003) Function - Current Directory
SYS(2003) Function - Current Directory or Folder

See Also	Example

Returns the name of the current directory or folder on the default drive or volume.

Syntax

SYS(2003)

Returns

Character

Remarks

You can use SYS(5) to determine the current drive or volume.

In FoxPro for Macintosh, the folder returned by SYS(2003) uses MS-DOS shorthand notation. MS-DOS shorthand notation is supported in FoxPro for Macintosh to provide compatibility with applications created on other FoxPro platforms. See SET PATH for more information about MS-DOS and Macintosh shorthand notation. Use SYS(2027) to convert a folder or path containing MS-DOS shorthand notation to one using Macintosh shorthand notation.


SYS(2003) Example

IF _MAC
? 'Current folder:', SYS(2003)
ELSE
? 'Current directory:', SYS(2003)
ENDIF


SYS(2003) See Also
See Also

CURDIR( )

SET DEFAULT

SYS( ) Functions Overview

SYS(5) Function - Default Drive


SYS(2004) Function - FoxPro Start Directory
SYS(2004) - FoxPro Start Directory or Folder

See Also	Example

Returns the name of the directory or folder that FoxPro was started from.

Syntax

SYS(2004)

Returns

Character

Remarks

In FoxPro for Macintosh, the folder returned by SYS(2004) uses MS-DOS shorthand notation. MS-DOS shorthand notation is supported in FoxPro for Macintosh to provide compatibility with applications created on other FoxPro platforms. See SET PATH for more information about MS-DOS and Macintosh shorthand notation. Use SYS(2027) to convert a folder or path containing MS-DOS shorthand notation to one using Macintosh shorthand notation.


SYS(2004) Example

IF _MAC
? 'FoxPro launch folder: ', SYS(2004)
ELSE

? 'FoxPro launch directory: ', SYS(2004)

ENDIF


SYS(2004) SeeAlso
See Also

SYS( ) Functions Overview


SYS(2005) Function - Current Resource File

See Also	Example

Returns the name of the current resource file.

Syntax

SYS(2005)

Returns

Character

Remarks

The resource file defaults to FOXUSER.DBF.


SYS(2005) Example

? 'Current resource file:', SYS(2005)


SYS(2005) SeeAlso
See Also

SET RESOURCE Command

SYS( ) Functions Overview


SYS(2006) Function - Current Graphics Card

See Also	Example

In FoxPro for MS-DOS and FoxPro for Windows, returns as a character string the type of graphics card and monitor you are using.

In FoxPro for Macintosh, returns the type of graphics support (for example, 32-bit Color QuickDraw).

Syntax

SYS(2006)

Returns

Character


SYS(2006) Example

? 'Current graphics card/monitor:', SYS(2006)


SYS(2006) SeeAlso
See Also

ISCOLOR( ) Function

SET DISPLAY Commands

SYS( ) Functions Overview


SYS(2007) Function - Check Sum Value

See Also

Returns the check sum value of the character expression <expC>.

Syntax

SYS(2007, <expC>)

Returns

Character

Remarks

A check sum can be used to test the validity of data or to compare two character expressions.


SYS(2007) SeeAlso
See Also

SET RESOURCE Command

SYS( ) Functions Overview


SYS(2008) Function - Cursor Shape

See Also	Example

Specifies shape of insert and overwrite mode cursors.

Syntax

SYS(2008[, <expC>[, <expN>]])

Returns

None

Remarks

SYS(2008) is supported in FoxPro for MS-DOS only.

SYS(2008) is ignored in FoxPro for Windows and FoxPro for Macintosh.

The default setting for the insert cursor is an underline and for the overwrite cursor is a block.

Use <expC> to specify the cursor to change.  Include an I to change the insert cursor or O to change the overwrite cursor.  You can specify the cursor shape with <expN>.  Use 0 for underline, 1 for a block and 2 for a half size block.

The insert or overwrite cursor is reset to their default settings if you omit the optional <expN> but include <expC>.  Both the insert and overwrite cursors are reset to their default settings if you omit <expN> and <expC>.


SYS(2008) Example

=SYS(2008, 'I', 2)

=SYS(2008, 'I')

=SYS(2008)

This example works only in FoxPro for MS-DOS.

The insert mode cursor is set to a half size block in the first example.  The insert cursor is reset to its default shape, an underline in the second example.  Both the insert and overwrite cursors are reset to their default values in the third example.


SYS(2008) SeeAlso
See Also

INSMODE( ) Function

SET CURSOR Command

SYS( ) Functions Overview

SYS(2009) Function - Swap Cursor Shape


SYS(2009) Function - Swap Cursor Shape

See Also

Swaps the shape of the insert and overwrite mode cursors.

Syntax

SYS(2009)

Returns

None

Remarks

SYS(2009) is supported in FoxPro for MS-DOS only.

SYS(2009) is ignored in FoxPro for Windows and FoxPro for Macintosh.

If the insert cursor is a block and the overwrite cursor is an underline, for example, issuing = SYS(2009) changes the insert cursor to an underline and the overwrite cursor to a block.

The insert and overwrite cursor shapes can be set with  SYS(2008).


SYS(2009) SeeAlso
See Also

INSMODE( ) Function

SYS(2008) Function - Cursor Shape


SYS(2010) Function - CONFIG.SYS File Settings

See Also

Returns the files setting in CONFIG.SYS.

Syntax

SYS(2010)

Returns

Character

Remarks

In FoxPro for MS-DOS, SYS(2010) returns as a character string the files setting in your CONFIG.SYS configuration file.

In FoxPro for Windows and FoxPro for Macintosh, SYS(2010) always returns 255.

Most CONFIG.SYS files contain a line specifying the maximum number of files that can be opened at the same time under MS-DOS.  This line usually reads FILES=NNN where NNN is a number.  SYS(2010) returns this number.

A CONFIG.SYS configuration file doesn't have to have a files setting and you may not have a CONFIG.SYS file.  SYS(2010) returns the default MS-DOS files setting in either case.

The number returned by SYS(2010) isn't the number of files you can open in FoxPro.  MS-DOS opens files for its own use.  FoxPro also open files for its own internal use and the number of these open files can vary throughout a FoxPro session.  The file setting in your CONFIG.SYS file must be somewhat greater than the number of files you would like to open in FoxPro.

For more information on the CONFIG.SYS configuration file, see your MS-DOS manual.


SYS(2010) SeeAlso
See Also

SYS( ) Functions Overview


SYS(2011) Function - Current Lock Status

See Also

Returns the record or database file lock status for the current work area.

Syntax

SYS(2011)

Returns

Character

Remarks

Unlike the FLOCK( ), LOCK( ) and RLOCK( ) functions, SYS(2011) doesn't attempt to lock the file or record.

The character string returned by SYS(2011) is identical to the message displayed in the status bar (Exclusive, Record Unlocked, Record Locked ...).

SYS(2011) returns Exclusive only at the workstation that opened the table exclusively and Record Locked only at the workstation that applied the record lock.


SYS(2011) SeeAlso
See Also

FLOCK( ) Function

LOCK( ) Function

RLOCK( ) Function

SYS( ) Functions Overview


SYS(2012) Function - Memo Field Blocksize

See Also

Returns the memo field blocksize for a table.

Syntax

SYS(2012[, <expN> | <expC>])

Returns

Character

Remarks

For more information on specifying the memo field blocksize for a table, see SET BLOCKSIZE.

The memo field blocksize is returned for the current work area.  To return the blocksize from a table open in another work area, include the optional work area number <expN> or the table alias <expC>.

SYS(2012) returns 0 if a table isn't open in the specified work area or the table doesn't have a memo field.


SYS(2012) SeeAlso
See Also

SET BLOCKSIZE Command

SYS( ) Functions Overview


SYS(2013) Function - System Menu Name String

See Also

Returns a space delimited character string containing names used by the FoxPro menu system.

Syntax

SYS(2013)

Returns

Character

Remarks

SYS(2013) facilitates utilization of the system menu bar and system menu popups.  SYS(2013) returns a space delimited character string containing the names of the system menu bar, each pad in the system menu bar, system menu popups and each option in the menu popups.


SYS(2013) SeeAlso
See Also

DEFINE BAR Command

DEFINE MENU Command

DEFINE POPUP Command

MENU - System Menu Names Overview

SYS( ) Functions Overview


SYS(2014) Function - Minimum Path

See Also

Returns the minimum path relative to the current or specified directory or folder for a specified file.

Syntax

SYS(2014, <expC1>[, <expC2>])

Returns

Character

Remarks

SYS(2014), when used with FULLPATH( ), can be used to make applications portable.  That is, given the location of the current program and the location of other files used by the program, FULLPATH( ) and SYS(2014) are used to obtain the proper paths of these files.  Once the files' paths are determined, the files can be accessed by the program.

In FoxPro for Macintosh, the path returned by SYS(2014) uses MS-DOS shorthand notation. MS-DOS shorthand notation is supported in FoxPro for Macintosh to provide compatibility with applications created on other FoxPro platforms. See SET PATH for more information about MS-DOS and Macintosh shorthand notation. Use SYS(2027) to convert a folder or path containing MS-DOS shorthand notation to one using Macintosh shorthand notation.

To return the minimum path between a file and the current directory or folder, include the name of the file in the character expression <expC1>.  The current directory or folder can be changed with SET DEFAULT.

You can also return the relative minimum path between a file and a specified directory or folder by including the filename in <expC1> and the directory or folder specification in <expC2>.

See FULLPATH( ) in the FoxPro Language Reference for additional information and an example of the use of SYS(2014) and FULLPATH( ).


SYS(2014) SeeAlso
See Also

FULLPATH( ) Function

SET DEFAULT Command

SET PATH Command

SYS( ) Functions Overview


SYS(2015) Function - Unique Procedure Name

See Also

Returns a unique ten-character procedure name that begins with an underscore followed by letters and numbers.

Syntax

SYS(2015)

Returns

Character

Remarks

The character name SYS(2015) returns can be used to create unique procedure or function names.

The string returned is created from the system date and system time (with a millisecond resolution).  Calling SYS(2015) more than once during the same millisecond interval still returns a unique character string.


SYS(2015) SeeAlso
See Also

SYS( ) Functions Overview

SYS(3) Function - Unique File Name


SYS(2016) Function - SHOW GETS WINDOW Name

See Also

Returns the window name included in the last SHOW GETS WINDOW command; returns a value only in a READ SHOW routine.

Syntax

SYS(2016)

Returns

Character

Remarks

SHOW GETS supports an optional WINDOW clause that lets you refresh controls (check boxes, fields, invisible, push or radio buttons, lists, popups, spinners or text editing regions) in a specific window.

SYS(2016) returns an asterisk (*) if you issue SHOW GETS without a WINDOW clause (refreshing @ ... GETs in all windows).  Use SHOW GETS WINDOW "" to refresh only controls on the desktop in FoxPro for MS-DOS or the main FoxPro window. SYS(2016) returns the null string when you refresh controls in themain FoxPro window.


SYS(2016) SeeAlso
See Also

READ Command

SHOW GETS Command

SYS( ) Functions Overview


SYS(2017) Function - Display Sign-On Screen

See Also

Clears the screen and displays the FoxPro sign-on screen.

Syntax

SYS(2017)

Returns

None

Remarks

SYS(2017) clears the desktop in FoxPro for MS-DOS or the main FoxPro window and displays the FoxPro sign-on screen.  Your FoxPro serial number and version number is shown in the sign-on screen.  Either of these commands display the sign-on screen:

=SYS(2017)
? SYS(2017)


SYS(2017) SeeAlso
See Also

SYS( ) Functions Overview


SYS(2018) Function - Error Message Parameter

See Also

Returns the error message parameter for the most recent error.

Syntax

SYS(2018)

Returns

Character

Remarks

Certain error messages return additional information about the cause of the error.  For example, if you reference a memory variable that doesn't exist, the name of the memory variable is included in the error message.  SYS(2018) returns this additional information, called the error message parameter.  Some examples of error message parameters are memory variable names and files names.

Suppose you try to run a program named REPORTS, and the program doesn't exist:

DO REPORTS

The text of the error message displayed is

File REPORTS does not exist.

REPORTS is the error message parameter, and it is returned by SYS(2018):

? SYS(2018)


SYS(2018) SeeAlso
See Also

ERROR( ) Function

MESSAGE( ) Function

ON ERROR Command

SYS( ) Functions Overview


SYS(2019) Function - Configuration File Name and Location

See Also

Returns the name and location of your FoxPro configuration file.

Syntax

SYS(2019)

Returns

Character

Remarks

The name of the FoxPro configuration file is CONFIG.FP in FoxPro for MS-DOS and CONFIG.FPW in FoxPro for Windows. In FoxPro for Macintosh, the FoxPro configuration file is named CONFIG.FPM.

 If a configuration file can't be located, the null string is returned.

The FoxPro configuration file is typically located in the directory or folder where FoxPro is started, but can be located elsewhere.  FoxPro first looks for the FoxPro configuration file in the directory or folder where FoxPro is started.

 In FoxPro for MS-DOS and FoxPro for Windows, if the FoxPro configuration file isn't located in the startup directory, the MS-DOS path is then searched.

In FoxPro for MS-DOS and FoxPro for Windows, two options let you tell FoxPro where your configuration file is located and its name (which may differ from CONFIG.FP or CONFIG.FPW).  An MS-DOS environmental variable named FOXPROCFG can be created with the MS-DOS SET command.  You can store the location and name of your configuration file in FOXPROCFG.

You can also use the -C switch when starting FoxPro to designate a configuration file.  Include the location and name of the configuration file immediately after -C.

See the Customizing FoxPro chapter in the FoxPro Installation and Configuration manual for further information on the FoxPro configuration file.


SYS(2019) SeeAlso
See Also

SYS( ) Functions Overview


SYS(2020) Function - Default Disk Size

See Also

Returns the total size in bytes of the default disk.

Syntax

SYS(2020)

Returns

Character

Remarks

The default disk can be specified with SET DEFAULT.


SYS(2020) SeeAlso
See Also

DISKSPACE( ) Function

SET DEFAULT Command

SYS( ) Functions Overview


SYS(2021) Function - Filtered Index Expression

See Also

Returns filter expression of an open single-entry .IDX index file or filter expressions for tags in compound .CDX index files.

Syntax

SYS(2021, <expN1>[, <expN2> | <expC>])

Returns

Character

Remarks

You can create filtered indexes in FoxPro.  If you include the optional FOR clause in INDEX, the index file acts as a filter on the table.  Only records that match the filter expression <expL> are available for display and access.  Index keys are created in the index file for just those records matching the filter expression.

The null string is returned if the index is created without a FOR clause.

USE and SET INDEX both support an index file name list that lets you open index files for a table.  Any combination of single-entry index file names, structural compound or independent compound index file names may be included in the index file name list.

The numeric expression <expN1> specifies which filter expression to return from the open index files or tags.  SYS(2021) returns filter expressions from open index files and tags in the following order:

1	Filter expressions from single-entry index files (if any are open) are returned first.  The order the single-entry index files are included in USE or SET INDEX determines the order the filter expressions are returned.

2	Filter expressions for each tag in the structural compound index (if one is present) are returned next.  The filter expressions are returned from the tags in the order the tags are created in the structural index.

3	Filter expressions for each tag in any open independent compound indexes are returned last.  The filter expressions are returned from the tags in the order the tags are created in the independent compound indexes.

The null string is returned if <expN1> is greater than the total number of open single-entry files and structural compound and independent compound index tags.

Filter expressions are returned from index files open in the current work area unless you include an optional work area or alias.  To return filter expressions from index files open in a specific work area, include the work area number <expN2> or the table alias <expC>.  If a table doesn't have the alias you specify, the message "Alias not found" is displayed.


SYS(2021) SeeAlso
See Also

CDX( ) Function

KEY( ) Function

INDEX Command

MDX( ) Function

NDX( ) Function

REINDEX Command

SET INDEX Command

SET ORDER Command

SYS( ) Functions Overview

TAG( ) Function


SYS(2022) Function - Disk Cluster Size

See Also

Returns the cluster size in bytes of a specified disk.

Syntax

SYS(2022[, <drive>])

Returns

Character

Remarks

To return the cluster size of a disk other than the current default disk, include the disk drive letter (A, B, C, ...) in <drive>. (In FoxPro for Macintosh, clusters are called blocks.)


SYS(2022) SeeAlso
See Also

SET DEFAULT Command

SYS( ) Functions Overview


SYS(2023) Function - Temporary File Drive

See Also

Returns the drive and directory in which FoxPro stores its temporary files.

Syntax

SYS(2023)

Returns

Character

Remarks

You can specify the drive where temporary files are stored by including the special TMPFILES configuration item in your FoxPro configuration file.  See the Customizing FoxPro chapter in the FoxPro Installation and Configuration manual for additional information about the special TMPFILES configuration item.


SYS(2023) SeeAlso
See Also

SYS( ) Functions Overview


SYS(2027) - Platform Specific Path Conversion

See Also

Returns an MS-DOS path with the shorthand notation for the Macintosh.

Syntax

SYS(2027,<expC>)

Returns

Character

Remarks

In FoxPro for Macintosh, functions (such as CURDIR( ) and DBF( )) that return paths use MS-DOS shorthand notation for the paths for compatibility with FoxPro for MS-DOS and FoxPro for Windows. You can use SYS(2027) with these functions to return their results using Macintosh shorthand notation.

? CURDIR( )
? SYS(2027,CURDIR( ))

See SET PATH for more information about platform specific shorthand notation.


SYS(2027) SeeAlso
See Also

SYS( ) Functions Overview

SET PATH

SET VOLUME


TAG( ) Function

See Also	Example

Returns a tag name from an open multiple-entry compound index file or the name of an open single-entry index file.

Syntax

TAG([<cdx file>,] <expN1>[, <expN2> | <expC>])

Returns

Character

Remarks

Tags are index entries in compound index files created with INDEX.

Note   Index files can be opened for a table with the INDEX clause of USE or with SET INDEX.  A structural compound index file is automatically opened with its table.

Parameters

<cdx file>

<cdx file> is the name of the compound index file from which you want to return a tag name.

<expN1>

The tag names in the compound index file are returned in the order in which the tags were created.  For example, if <expN1> is 1, the name of the first tag created in the compound index file is returned.  If <expN1> is 2, the name of the second tag created is returned, and so on.  The null string is returned when <expN1> exceeds the number of tag names.

If you omit <cdx file>, TAG( ) returns compound index file tag names and single-entry index file names in a specific order.  First, the names of single-entry index files are returned based on their order in the INDEX clause of USE or SET INDEX.  Next, tag names from the structural compound index file (if one exists for the table) are returned.  Finally, tag names from other open compound index files are returned, again in the order in which the tags were created in the compound index files and in the order in which the compound index files are specified in the INDEX clause of  USE or SET INDEX.

<expN2> | <expC>

Tag names and index file names are returned from files in the current work area if <expN2> or <expC> isn't included.

You can return tag names and  index file names from files open in other work areas by specifying the work area number with <expN2> or the table alias with <expC>.


TAG( ) Example

The following example creates an array and stores 'Record #' in the first element.  The names of all the index files tags for CUSTOMER.DBF are returned and stored in the array.  The size of the array is adjusted to accommodate the names of the indexes.  The number and names of the indexes are then displayed.

CLOSE DATABASES
USE customer
DIMENSION dbftags(256)
dbftags(1) = 'Record #'
FOR i = 2 TO 256
IF EMPTY(TAG(i-1))
i = i - 1
DIMENSION dbftags(i)
EXIT
ELSE
dbftags(i) = TAG(i-1)
ENDIF
ENDFOR
DISPLAY MEMORY LIKE dbftags


TAG() SeeAlso
See Also

CDX( ) Function

INDEX Command

MDX( ) Function

NDX( ) Function

SET INDEX Command

SYS(14) Function - Index Expression

TAGCOUNT( ) Function

TAGNO( ) Function

USE Command


TAGCOUNT( ) Function

See Also

Returns the number of .CDX compound index file tags and open .IDX single-entry index files.

Syntax

TAGCOUNT([<cdx file> [, <expN> | <expC>]])

Remarks

Included for dBASE compatibility.

Returns

Numeric

<cdx file>

Specifies the name of a compound index file for which TAGCOUNT( ) returns the number of tags. If <cdx file> is omitted, TAGCOUNT( ) returns the number of tags in all .CDX compound index files and open .IDX single-entry index files in the currently selected work area.

<expN>

Specifies the work area of the table for which TAGCOUNT( ) returns the number of tags for the .CDX compound index file.

<expC>

Specifies the alias of the table for which TAGCOUNT( ) returns the number of tags for the .CDX compound index file.


TAGCOUNT( ) SeeAlso
See Also

CDX( ) Function

INDEX Command

MDX( ) Function

NDX( ) Function

SYS(14) Function - Index Expression

TAG( ) Function

TAGCOUNT( ) Function


TAGNO( ) Function

See Also

Returns the index position for .CDX compound index file tags and open .IDX single-entry index files.

Syntax

TAGNO([<index name> [, <.cdx file> [, <expN> | <expC>]]])

Returns

Numeric

Remarks

Included for dBASE compatibility.

TAGNO( ) returns 0 if a master index isn't set (the table is in natural record number order) and the optional parameters are omitted.

Parameters

<index name>

Specifies the name of a .CDX compound index file tag or an open .IDX single-entry index file for which TAGNO( ) returns the index position.

<.cdx file>

Specifies the name of a .CDX compound index file containing the name of the tag you specify with <index name>.

<expN>

Specifies the work area of the table for which TAGNO( ) returns the index position for .CDX compound index file tags and .IDX single-entry index files.

<expC>

Specifies the alias of the table for which TAGNO( ) returns the index position for .CDX compound index file tags and .IDX single-entry index files.


TAGNO( ) SeeAlso
See Also

CDX( ) Function

INDEX Command

MDX( ) Function

NDX( ) Function

SET INDEX Command

SYS(14) Function - Index Expression

TAG( ) Function

TAGCOUNT( ) Function

USE Command


TAN( ) Function

See Also	Example

This trigonometric function returns the tangent of an angle.

Syntax

TAN(<expN>)

Returns

Numeric

Parameters

<expN>

TAN( ) returns the tangent of the angle specified with <expN>, which is given in radians.  To convert an angle from degrees to radians, use DTOR( ).  The number of decimal places returned by TAN( ) can be specified with SET DECIMALS.


TAN( ) Example

? TAN(0)

? TAN(PI( )/4)

? TAN(PI( )*3/4)


TAN() SeeAlso
See Also

COS( ) Function

DTOR( ) Function

RTOD( ) Function

SET DECIMALS Command

SIN( ) Function


TARGET( ) Function

See Also	Example

Returns the alias of a table that is the target for a relation as specified in the INTO clause of  SET RELATION.

Syntax

TARGET(<expN1>[, <expN2> | <expC>])

Returns

Character

Parameters

<expN1>

Include a number from 1 to the number of relationships out of the specified work area.  The alias of the target databases are returned (in no specific order) until <expN1> is greater than the number of relationships.  When <expN1> is greater than number of relationships, the null string is returned.

<expN2> | <expC>

The alias of the target table from the current work area is returned if you don't specify the work area or alias.  Specify a work area number with <expN2> or table alias with <expC> to return the alias of the target table in another work area.


TARGET( ) Example

In this example, a relation is set on the field ONO from SALESMAN.DBF into CUSTOMER.DBF, and another is set on the same field into OFFICES.DBF.  The ADDITIVE key word is used with the second relation to add the relation to the existing relation without replacing it.  The TARGET( ) function is then used to return the alias of the target table.

CLOSE DATABASES
USE salesman IN 0 ORDER ono
USE customer IN 0 ORDER ono
USE offices IN  0 ORDER ono
SELECT salesman
SET RELATION TO ono INTO customer
SET RELATION TO ono INTO offices ADDITIVE

? TARGET(1)

? TARGET(2)
? TARGET(3)	&& null string


TARGET() SeeAlso
See Also

RELATION( ) Function

SET RELATION Command


TEXT ... ENDTEXT Command

See Also	Example

Outputs lines of text, the results of expressions and functions, and the contents of memory variables.

Syntax

TEXT
<text lines>
ENDTEXT

Remarks

This structured programming command sends text lines placed between TEXT and ENDTEXT to the main FoxPro window, a user-defined window, a printer, a text file or a low-level file.

TEXT sends the text lines to the current output device.  This continues until an ENDTEXT statement is encountered or until the program ends.

By default, output from TEXT ... ENDTEXT is sent to the desktop, the main FoxPro window or the active window.  Issue SET CONSOLE OFF to suppress output to the desktop, the main FoxPro window or the active window.  Issue SET PRINTER to send output to a printer or a text file.

Output from TEXT ... ENDTEXT can also be sent to a low-level file created or opened with FCREATE( ) or FOPEN( ).  If a file handle returned by FCREATE( ) or FOPEN( ) is stored to the _TEXT system memory variable, output is directed to the corresponding low-level file.

Clause

<text lines>

<text lines> can consist of text, memory variables, array elements, expressions, functions or any combination of these.

Expressions, functions, memory variables and array elements specified with <text lines> are evaluated only if SET TEXTMERGE is ON and must be enclosed in the delimiters specified by SET TEXTMERGE DELIMITERS.  If SET TEXTMERGE is OFF, the expressions, functions, memory variables and array elements are output as literals along with their delimiters.

For example, today's date is output if SET TEXTMERGE is ON and a text line contains <<DATE( )>>.  If SET TEXTMERGE is OFF, <<DATE( )>> is output literally.

If you place comments within TEXT and ENDTEXT or after \ or \\, the comments are also output.


TEXT ... ENDTEXT Example

The following example demonstrates how you can use SET TEXTMERGE, SET TEXTMERGE DELIMITERS, TEXT ... ENDTEXT and the _TEXT system memory variable.

A low-level file named NAMES.TXT is created and its file handle is stored in the _TEXT system memory variable.  The program is exited if NAMES.TXT can't be created.  SALESMAN.DBF is opened, and the names of the first 10 salesmen are output to NAMES.TXT.  Text and the results of functions are output to the text file.

The text file containing the names is then opened with MODIFY FILE.

CLEAR
CLOSE DATABASES
SET TALK OFF
SET TEXTMERGE ON	&& Enable embedding of expressions and functions
STORE FCREATE('names.txt') TO _TEXT	 	&& Create low-level file
IF _TEXT = -1	&& Can't create low-level file then exit program
WAIT WINDOW 'Cannot create an output file, press a key to exit'
CANCEL
ENDIF
SET HELP OFF
USE salesman
TEXT
SALES FORCE NAMES

<<DATE( )>>	<<TIME( )>>

ENDTEXT

WAIT WINDOW 'Press a key to generate the first ten names'
SCAN NEXT 10
TEXT
<<name>>
ENDTEXT
ENDSCAN

CLOSE ALL	 	&& close the text file the table
MODIFY FILE names.txt
ERASE names.txt


TEXT ... ENDTEXT SeeAlso
See Also

FOPEN( ) Function

_PRETEXT System Memory Variable

SET TEXTMERGE Command

SET TEXTMERGE DELIMITERS Command

_TEXT System Memory Variable


TIME( ) Function

See Also

Returns the current system time in 24-hour, eight-character string (HH:MM:SS) format.

Syntax

TIME([<expN>])

Returns

Character

Parameter

<expN>

The time returned includes hundredths of a second if <expN> is included.  The numeric expression <expN> can be any value.  However, the actual maximum resolution is about 1/18 second.  Use SECONDS( ) for greater resolution.


TIME() SeeAlso
See Also

SECONDS( ) Function

SYS(2) Function - Seconds Since Midnight


TOTAL Command

See Also	Example

Creates summary records in a new table with one record for each group of identically keyed records in the current table.

Syntax

TOTAL TO <file> ON <expr>
[FIELDS <field list>]
[<scope>]
[FOR <expL1>]
[WHILE <expL2>]
[NOOPTIMIZE]

Remarks

TOTAL computes totals for numeric fields in the current table.  The table must be sorted or indexed.  A separate total is calculated for each set of records with a unique index key value.  The results are placed into records in a second table.  One record is created in the second table for each unique index key value.

Numeric overflow can occur if the numeric fields in the second table aren't wide enough to contain the totals.  FoxPro conserves the most significant portions of the totals when numeric overflow occurs.  When a field is too small to accept a total:

Decimal places are truncated, and the remaining decimal portion of the total is rounded.

If the total still doesn't fit, scientific notation is used if the total field contains seven or more digits.

Finally, asterisks replace the field contents.

Clauses

<file>

<file> is the name of the output table.  If the specified table doesn't exist, FoxPro creates it.  If the output table does exist and SET SAFETY is ON, FoxPro asks if you would like to overwrite the existing table.  If SET SAFETY is OFF, you aren't prompted, and the output table is overwritten.

<expr>

<expr> is the expression on which the source table is indexed or sorted.

FIELDS <field list>

By default, all numeric fields are totaled unless FIELDS <field list> is included.  If you do include this clause, only the fields specified with <field list> are totaled.  Separate the field names in the list with commas.

<scope>

The scope clauses are:  ALL, NEXT <expN>, RECORD <expN>, and REST.  These are explained in the Overview of the FoxPro Language chapter of the FoxPro Language Reference.  Commands which include <scope> operate only on the table in the active work area.

You can specify a scope of records to total.  Only the records that fall within the range of records specified by the scope are totaled.

The default scope for TOTAL is ALL records.

FOR <expL1>

Including the FOR clause lets you conditionally total records, filtering out undesired records.  If the FOR clause is included, only the records that satisfy the logical condition <expL1> are included in the totals.

Rushmore optimizes a query created with TOTAL ... FOR if <expL1> is an optimizable expression.  For best performance, use an optimizable expression in the FOR clause.  A discussion of Rushmore optimizable expressions appears in the Optimizing Your Application chapter in the FoxPro Developer's Guide.

WHILE <expL2>

If the WHILE clause is included, records from the current table are included in the totals for as long as the logical expression <expL2> evaluates to true (.T.).

NOOPTIMIZE

Include NOOPTIMIZE to disable Rushmore optimization of TOTAL.  For more information, see SET OPTIMIZE or the discussion of Rushmore optimization in the Optimizing Your Application chapter in the FoxPro Developer's Guide.


TOTAL Example

This example creates a new table named CUSTOTAL.DBF containing totals from the CUSTOMER.DBF.  A Browse window is opened displaying the totals in the CUSTOTAL.DBF.

CLOSE DATABASES
USE customer ORDER ono
TOTAL ON ono TO custotal
USE custotal
WAIT WINDOW 'Here are your totals' NOWAIT
BROWSE FIELDS ono, ytdpurch
CLOSE DATABASES
ERASE custotal.dbf


TOTAL SeeAlso
See Also

AVERAGE Command

CALCULATE Command

INDEX Command

SORT Command

SUM Command


TRANSFORM( ) Function

See Also	Example

Formats character or numeric expressions using PICTURE and FUNCTION codes available for @ ... SAY.

Syntax

TRANSFORM(<expr>, <expC>)

Returns

Character

Remarks

TRANSFORM( ) returns a character string in a format determined by a character expression containing the PICTURE  or FUNCTION codes.

Parameters

<expr>

Specify the numeric or character expression to format with <expr>.

<expC>

<expC> is one or more PICTURE or FUNCTION codes that specify how the expression is formatted.  For information about the available PICTURE and FUNCTION codes, see @ ... GET and @ ... SAY.


TRANSFORM( ) Example

STORE 15.89 TO Price
? TRANSFORM (Price, '$$$$.99')


TRANSFORM() SeeAlso
See Also

@ ... SAY Command


TRIM( ) Function

See Also	Example

Returns the specified character expression with all trailing blanks removed.

Syntax

TRIM(<expC>)

Returns

Character

Remarks

TRIM( ) is identical to RTRIM( ).

Parameter

<expC>

<expC> is the character expression from which you want to trim all trailing blanks.


TRIM( ) Example

CLOSE DATABASES
USE customer
GOTO 3
? 'The contact for '+ TRIM(company) + ' is ' + contact


TRIM() SeeAlso
See Also

ALLTRIM( ) Function

LTRIM( ) Function

RTRIM( ) Function


TXTWIDTH( ) Function

See Also

Returns the length of a character expression with respect to the average character width for a font.

Syntax

TXTWIDTH(<expC1>[, <expC2>, <expN>[, <expC3>]])

Returns

Numeric

Remarks

TXTWIDTH() returns the number of characters a character expression <expC1> occupies, based on the average character width of a specified font.  Use FONTMETRIC(6) to determine the average character width of a font.

If you don't include a font in TXTWIDTH(), the value returned by TXTWIDTH() is determined by the current font for the main FoxPro window if output is directed to the main FoxPro window when TXTWIDTH() is issued.  If output is being directed to a user-defined window, the value returned is determined by the window's current font.

Parameters

<expC1>

TXTWIDTH() returns the length of the character expression specified with <expC1>.  If you include only <expC1>, the length of the character expression is returned for the current font for the active output window.  A non-proportional font always returns a value equal to the number of characters in <expC1>.

In FoxPro for MS-DOS, only one font is available.  TXTWIDTH() (like LEN()) always returns the number of characters in <expC1>.

Include the optional arguments <expC2>, <expN> and <expC3> to determine the length of a character expression with a specific font, font size or font style.  These options are ignored in FoxPro for MS-DOS.

<expC2>

Include <expC2> to return the length of a character expression with a specific font.  <expC2> is the name of the font.

<expN>

Include <expN> to return the length of a character expression with a specific font size.  <expN> is a number that corresponds to the font size in points.

<expC3>

Include <expC3> to specify a special font style for the character expression.  <expC3> is a font style code specified by a character or a set of characters.  The normal font style is used if <expC3> isn't included.  Here are the characters for each font style:

Character	Font Style
B	Bold
C	Condense*
E	Extend*
I	Italic
N	Normal
O	Outline
Q	Opaque
S	Shadow
-	Strikeout *
T	Transparent
U	Underline
*The Condense and Extend styles are available only in FoxPro for Macintosh. The Strikeout style is available only in FoxPro for Windows.

You can include more than one character to specify a combination of font styles.  For example, BI specifies a bold italic font style.

The following command displays a message in a Courier normal 24-point font, centered on the main FoxPro window:

@ 25,(WCOLS()-TXTWIDTH('Hello!','Courier ',24)* ;
FONTMETRIC(6,'Courier ',24)/FONTMETRIC(6))/2  ;
SAY 'Hello!' FONT 'Courier ',24


TXTWIDTH() SeeAlso
See Also

FONTMETRIC( )

GETFONT( )

SYSMETRIC( )

WFONT( )


TYPE Command

See Also

Displays the contents of an ASCII file.

Syntax

TYPE <file1>
[AUTO]
[WRAP]
[TO PRINTER [PROMPT] | TO FILE <file2>]
[NUMBER]

Remarks

TYPE displays the contents of text files.  This display can be directed to the desktop in FoxPro for MS-DOS, the main FoxPro window, the active user-defined window, a printer or another file.

When SET HEADING is ON, FoxPro inserts a form feed, the path and name of the file and the date at the beginning of output produced with TYPE.  If SET HEADING is OFF, this information isn't included.

In FoxPro for MS-DOS, if a printer driver setup is loaded and you direct output from TYPE to a file or a printer, TYPE displays the file contents using the settings from the printer driver setup.

Clauses

<file1>

<file1> is the name of the file to display.  The name must include a file extension.

AUTO

Include the AUTO key word to turn automatic indentation on.  When you also include WRAP, TYPE automatically indents wrapped text in each paragraph by the same amount it indents the first line of the paragraph.  For example:

Wrapped lines are aligned with the tab when a paragraph begins with a tab.

Wrapped lines are aligned with the tab when a paragraph begins with a number (or other text) followed by a tab and text.

Wrapped lines are indented by the same amount as the first line when the first line of a paragraph is indented with spaces.

WRAP

Include WRAP to enable word wrap.  When word wrap is enabled, a word that is too long to fit at the end of a line is automatically moved to the next line.

TO PRINTER [PROMPT]

Include TO PRINTER to direct output to the printer.

In FoxPro for Windows and FoxPro for Macintosh, you can include the optional PROMPT clause to display a dialog before printing starts. In this dialog you can adjust printer settings, including the number of copies and page numbers to print The printer settings you can adjust depend on the currently installed printerkeyword immediately after TO PRINTER.  PROMPT is ignored in FoxPro for MS-DOS.

TO FILE <file2>

Include TO FILE <file2> to direct output to the file specified with <file2>.

NUMBER

Include NUMBER to place line numbers at the beginning of each line in the output.


TYPE SeeAlso
See Also

SET HEADINGS Command


TYPE( ) Function

See Also	Examples

Returns the data type of the specified memo field or character, numeric, logical or date expression.

Syntax

TYPE(<expC>)

Returns

Character

Remarks

The following table lists the characters TYPE( ) returns and their corresponding data types:

Data Type	Character Returned
Character	C
Numeric (also float)	N
Date	D
Logical	L
Memo	M
Undefined type of expression	U
Parameter

<expC>

<expC> is the name of a memo field or a character expression.  TYPE( ) evaluates the contents of <expC> and returns the appropriate data type.


TYPE( ) Example
TYPE( ) Examples

CLOSE DATABASES
USE salesman
? TYPE('salesman.name')

? TYPE('(12 * 3) + 4')

? TYPE('DATE( )')

? TYPE('.F. OR .T.')

? TYPE('ANSWER=42')


TYPE() SeeAlso
See Also

EVALUATE( ) Function


UNIQUE( ) Function

See Also

Returns true (.T.) if the specified index tag or index file was created with the UNIQUE keyword or with SET UNIQUE ON; otherwise, false (.F.) is returned.

Syntax

UNIQUE([<cdx file>,] <expN1> [, <expN2> | <expC>])

Returns

Logical

Remarks

Included for dBASE compatibility.

If the optional parameters are omitted, UNIQUE( ) returns the UNIQUE status for the master controlling index tag or index file. UNIQUE( ) returns false (.F.) if a master controlling index tag or index file isn't in effect (the table is in natural record number order).

Parameters

<cdx file>

Specifies the name of a compound index file for which UNIQUE( ) returns the UNIQUE status for a tag.

<expN1>

Specifies the index position for the .CDX compound index file tag or open .IDX single-entry index file for which UNIQUE( ) returns the UNIQUE status.

<expN2>

Specifies the work area of the table for which UNIQUE( ) returns the UNIQUE status for the .CDX compound index file tag or open .IDX single-entry index file.

<expC>

Specifies the alias of the table for which UNIQUE( ) returns the UNIQUE status for the .CDX compound index file tag or open .IDX single-entry index file.


UNIQUE( ) SeeAlso
See Also

INDEX Command

SET UNIQUE Command


UNLOCK Command

See Also	Example

Releases a record lock, multiple record locks or a file lock from the current or specified table, or releases all record and file locks from all open tables.

Syntax

UNLOCK
[IN <expN> | <expC> | ALL]

Remarks

Record and file locks can be removed from a table only by the user who issued the locks.  UNLOCK cannot unlock a table opened for exclusive use.

A record lock (or locks) or a file lock is released from the table in the current work area if you issue UNLOCK without arguments.

If relations are established between tables, releasing a record lock (or locks) or a file lock from one of the tables doesn't release locks from the related records or files.  You must explicitly release the record or file locks in each of the related files.  You can release all locks on any related tables by issuing UNLOCK ALL (this also releases locks in unrelated files).

Clauses

IN <expN> | <expC>

If you don't include <expN> or <expC>, UNLOCK releases a record lock or locks or a file lock from a table in the current work area.  Specify a work area number with <expN> or a table alias with <expC> to release a record lock or locks or a file lock from a table in another work area.

ALL

Include ALL to release all record and file locks in all work areas.

For more information about record and file locking and sharing tables on a network, see the FoxPro in a Multi-User Environment chapter in the FoxPro Developer's Guide.


UNLOCK Example

CLOSE DATABASES
SET REPROCESS TO 3 AUTOMATIC
STORE '1,2,3,4' TO mreclist	&& Lock records 1 through 4
old_exc = SET('EXCLUSIVE')	&& Save the EXCLUSIVE setting
SET EXCLUSIVE OFF	&& Allow sharing of tables

SELECT 0
USE salesman

SELECT 0
USE customer

? LOCK('1,2,3,4', 'customer')	&& Lock the first 4 records in customer
? RLOCK(mreclist, 'salesman')	&& Lock the first 4 records in salesman

UNLOCK IN customer
UNLOCK IN salesman

SET EXCLUSIVE &old_exc	&& Restore original EXCLUSIVE setting


UNLOCK SeeAlso
See Also

FLOCK( ) Function


UPDATE Command

See Also

Updates fields in the current table with data from another table open in another work area.

Syntax

UPDATE ON <field> FROM <expN> | <expC>
REPLACE <field1> WITH <expr1>
[, <field2> WITH <expr2> ...]
[RANDOM]

Clauses

ON <field>

To use UPDATE, the current table and the table you update from must have a common field.  <field> specifies the common field that controls the update.  The current table must be indexed or sorted in ascending order on the common field.  Update performance is improved if the update table is also sorted or indexed.

FROM <expN> | <expC>

The current table is updated with data from a table open in another work area.  Specify the work area number (<expN>) or the table alias (<expC>) of the table open in the other work area.

REPLACE <field1> WITH <expr1> ...

Issuing UPDATE replaces a field (<field1>) in the current table with an update expression (<expr1>).  You can update more than one field in the current table by including a list of fields (<field2>, <field3>, and so on) and corresponding update expressions (<expr2>, <expr3>, and so on).

The update expressions usually are the names of fields from the update table.  They can also be general expressions or constants.

Note that for each record in the current table, there can be multiple matching records in the update table.  If there are multiple matching records, the record in the current table is updated by each of the matching records.  If the current table contains identical key field records, only the first of the matching records is updated.

RANDOM

You must include the RANDOM key word if the update table isn't indexed or sorted in ascending order.

Caution   An incorrect number of records may be updated if the update table isn't indexed or sorted in ascending order and RANDOM isn't included.


UPDATE SeeAlso
See Also

INDEX Command

SORT Command


UPDATED( ) Function

See Also

Returns true (.T.) if you changed any data during the most recent READ.

Syntax

UPDATED( )

Returns

Logical

Remarks

UPDATED( ) returns true if the data in a field, spinner or text editing region was changed or if a choice was made from a check box; an invisible, push or radio button; a list; or a popup.

UPDATED( ) returns false (.F.) if the data in a field, spinner or text editing region wasn't changed or no choices were made from a check box; an invisible, push or radio button; a list; or a popup during the most recent READ.  UPDATED( ) returns false if a control was updated from within a program (for example, with REPLACE or SHOW GETS).


UPDATED() SeeAlso
See Also

@ ... GET Command

INKEY( ) Function

READ Command

READKEY( ) Function

SHOW GETS Command


UPPER( ) Function

See Also	Example

Returns the specified character expression in upper-case.

Syntax

UPPER(<expC>)

Returns

Character

Remarks

Each lower-case letter (a [image] z) in the character expression is converted to upper-case (A [image] Z) in the returned string.  All other characters remain unchanged.

Parameter

<expC>

<expC> is the character expression you want to convert to upper-case.


UPPER( ) Example

? UPPER('abcdefgh')


UPPER() SeeAlso
See Also

ISLOWER( ) Function

ISUPPER( ) Function

LOWER( ) Function


USE Command

See Also	Example

Opens a table file and associated index files in the current work area.

Syntax

USE
[<file> | ?]
[IN <expN1>]
[AGAIN]
[INDEX <index file list> | ?
[ORDER [<expN2> | <idx index file> | [TAG] <tag name> [OF <cdx file>]
[ASCENDING | DESCENDING]]]]
[ALIAS <alias>]
[EXCLUSIVE]
[SHARED]
[NOUPDATE]

Remarks

If USE is issued without a table name and a table file is open in the current work area, the table is closed.  A table is also closed when another table is opened in the same work area.

Clauses

<file> | ?

The name of the table to open is specified with <file>.  The Open dialog appears with a list of available tables to choose from if you include ? instead of a table name.

IN <expN1>

You can open a table in a non-current work area by specifying the work area number with <expN1>.  You can close a table in a non-current work area by issuing USE without a file name and specifying the work area number.

The IN clause supports 0 as a work area.  Including 0 opens a table in the lowest available work area.  For example, if tables are open in work areas one through ten, the command

USE customer IN 0

opens the client table in work area 11.

AGAIN

To open a table concurrently in multiple work areas, you can do one of the following:

Select another work area and issue USE with the table name and the AGAIN clause.

Issue USE with the table name and the AGAIN clause, and specify a different work area.

When you use a table again in another work area, the table in the new work area takes on the attributes of the table in the original work area.  For example, if a table is opened for read-only or exclusive access and is used again in another work area, the table is opened for read-only or exclusive access in the new work area.

Index files opened for the original table are available for the table you open again if you don't open indexes when you reopen the table.  The index order is set to 0 in the work areas where the table is reopened.

You can open indexes that weren't opened with the original table.  This sets the index order to 0 for the original table.

A reopened table is assigned the default alias of the work area.  You can include an alias every time you open a table in multiple work areas as long as the aliases are unique.

Using a table again in another work area doesn't consume an additional file handle.

INDEX <index file list> | ?

You can open index files with the table by including INDEX and specifying a set of indexes with <index file list>.  If a table has a structural compound index file, the index file is automatically opened with the table.  You can open a single index file by issuing INDEX ?.  The Open dialog appears with a list of available index files.

<index file list> can contain any combination of names of .IDX and .CDX index files.  You don't have to include the file name extensions for index files unless an .IDX and a .CDX index file in the index file list have the same name.

The first index file named in the index file list is the controlling index file, which controls how records in the table are accessed and displayed.  If the first index file is a .CDX compound index file, records in the table are displayed and accessed in physical record order.

ORDER [<expN2>]

Include the ORDER clause to specify a controlling index file or tag other than the first index file in <index file list>.  <expN2> specifies the controlling tag or index file as it appears in the index file list.  .IDX index files are numbered first in the order in which they appear in the index file list.  Tags in the structural compound index file (if one exists) are then numbered in the order in which the tags were created.  Finally, tags in any independent compound index files are numbered in the order in which they were created.  You can also use SET ORDER to specify the controlling index file or tag.  See SET ORDER for a further discussion of the numbering of index files and tags.

If <expN2> is 0, records in the table are displayed and accessed in physical record order, and the indexes remain open.  Including ORDER 0 enables open index files to be updated while presenting the file in record number order.  Including ORDER without <expN> is identical to including ORDER 0.

ORDER [idx index file]
ORDER [TAG <tag name>] [OF <cdx file>]

You can also designate an .IDX index file as the controlling index file by specifying its name with <idx index file>.

To designate a tag of a .CDX index file as the controlling tag, specify the tag name with <tag name>.  The tag name can be from the structural compound index file or any open compound index file.  If identical tag names exist in open compound index files, include OF <cdx file> and specify the name of the compound index file containing the desired tag.

ASCENDING | DESCENDING

Include the ASCENDING or DESCENDING key word after the ORDER clause to specify whether the table records are accessed and displayed in ascending or descending order.  Including one of these key words doesn't change the index file or tag; it alters only the order in which records are displayed and accessed.

ALIAS <alias>

Include ALIAS <alias> to create an alias for the table.  You can refer to a table by its alias in commands and functions that require or support an alias.

When a table is opened, it is automatically assigned an alias, which is the table name if ALIAS isn't included.  You can create a different alias for the table by including ALIAS and a new alias.  An alias can contain up to 10 letters, digits or underscores and must begin with a letter or an underscore.

A default alias is assigned automatically if you open a single table simultaneously in multiple work areas with AGAIN and you don't specify an alias when you open the table in each work area.

A default alias is also assigned if a conflict occurs.  For example:

CLOSE DATABASES
ACTIVATE WINDOW View	&& Open the View Window
USE customer ALIAS invoices IN 1  	&& Alias is INVOICES
USE invoices IN 3	&& Conflict, alias is C

EXCLUSIVE

Including EXCLUSIVE opens a table for exclusive use on a network.  For more information on the exclusive use of tables, see SET EXCLUSIVE.

SHARED

Including SHARE opens a table for shared use on a network.  SHARE allows you to open a table for shared use even when EXCLUSIVE is set ON.  DBFs.

NOUPDATE

Including NOUPDATE prevents changes to the table and its structure.


USE Example

This example opens three tables in three different work areas.  The View window is opened to show where the tables are open and their aliases.

CLOSE DATABASES
ACTIVATE WINDOW View
SELECT A
USE customer IN 0
USE invoices IN 0
USE salesman IN 0


USE SeeAlso
See Also

CREATE Command

DBF( ) Function

USED( ) Function


USED( ) Function

See Also	Example

Returns true (.T.) if a table is open in a specified work area; returns false (.F.) if a table isn't open in the specified work area.

Syntax

USED([<expN> | <expC>])

Returns

Logical

Parameters

<expN> | <expC>

The current work area is checked for an open table if you don't specify a work area or alias.  To test for an open table in another work area, specify the table's work area with <expN> or its alias with <expC>.

If you include a table alias, USED( ) returns true if a table with the alias you specify is open in one of the work areas.


USED( ) Example

CLOSE DATABASES
SELECT A
USE customer
SELECT B
USE invoices
SELECT C
USE salesman
? USED(1)

? USED('B')

? USED(4)


USED() SeeAlso
See Also

ALIAS( ) Function

SELECT( ) Function


User-Defined Functions (UDFs)

See Also

Creates new functions.

Remarks

Although FoxPro includes over 200 built-in functions, there are times when you'll want to create specialized functions for your programs.  These functions are called user-defined functions (UDFs).  User-defined functions let you extend the FoxPro language.

UDFs are a powerful part of the FoxPro language.  They can be included in many FoxPro commands, enhancing their versatility.  For example, issuing BROWSE opens a Browse window in which you view and change information in a table.  You can include a UDF in BROWSE to restrict and validate data entered in the Browse window.

What Is a UDF?

A UDF is a FoxPro program that returns a value to the calling program (the program that executes the UDF).  A value can be returned to the calling program with RETURN <expr>.  A UDF can be a stand-alone program or a procedure or function in a program.

Constructing a UDF

If a UDF is a function or a procedure, the first line must be a FUNCTION or PROCEDURE command that assigns the function or procedure a name.  Any number of statements can follow this first line.  For more information on creating functions and procedures in FoxPro, see FUNCTION and PROCEDURE.

UDFs shouldn't be given the same name or abbreviation as a built-in FoxPro function because the built-in function takes precedence [image] the FoxPro function is executed, not the UDF.  Also, UDFs shouldn't be given the same name as a memory variable or an array.

Returning a Value

A value can be returned to the calling program with RETURN <expr>.

Be sure to return the proper type data to the calling program.  For example, if the calling program expects a numeric value to be returned by the UDF and the UDF returns a character value, an error is generated.

A true (.T.) value is automatically returned to the calling program if a UDF doesn't return a value (because RETURN wasn't included or a value wasn't included with RETURN).

Parameter Passing

Data can be passed in the form of parameters to a UDF.  A PARAMETERS statement in the UDF identifies the data passed to the UDF and assigns local names to the data.

When parameters are passed to a UDF and the UDF is a stand-alone program, the first executable line in the UDF must be a PARAMETERS statement.  If the UDF is a function or a procedure, a PARAMETERS statement must be the first executable line following the FUNCTION or PROCEDURE declaration.  A maximum of 24 parameters can be passed to a UDF.

Variable Parameters

A variable number of parameters can be passed to a UDF.  Use PARAMETERS( ) to determine the number of parameters passed to the UDF.

The number of parameters passed to a UDF can be less than the number of parameters listed in the PARAMETERS statement.  In that case, the remaining parameters are initialized to false (.F.).  If the number of parameters passed to the UDF is greater than the number of parameters listed in the PARAMETERS statement, the error message "Wrong number of parameters" is displayed.

The following UDF, called HOWMANY ( ), accepts up to 10 parameters.  PARAMETERS( ) is used to return the number of parameters passed to the UDF:

PARAMETERS n1, n2, n3, n4, n5, n6, n7, n8, n9, n10  && Up to 10
RETURN PARAMETERS( )

Executing HOWMANY( ) with four parameters returns 4:

? HOWMANY('A', 'B', 'C', 'D')

Memory variables or array elements can be passed as parameters by reference or by value.  By default, they are passed to a UDF by value.  When memory variables and array elements are passed to a UDF by value, the values of the variables and array elements can be changed within the UDF, but aren't changed in the calling program.

When variables or array elements are passed by reference and the UDF changes the values of the passed parameters, the values of the variables or array elements in the calling program are changed.  Issue SET UDFPARMS TO REFERENCE before calling the UDF to pass a parameter by reference to a UDF.

For more information on passing parameters to a UDF, see PARAMETERS and PARAMETERS( ).  For information on passing parameters by value or reference, see SET UDFPARMS.

Calling a UDF

Like all FoxPro functions, UDFs are referenced by their name followed by a set of parentheses.  The parentheses can contain parameters that are passed to the UDF.  See the table at the end of this section for a list of commands that support UDFs.

UDFs in Logical Expressions

If you include one or more UDFs in a logical expression, the UDFs are evaluated from left to right.

When two operands (which can be UDFs) are connected with the AND relational operator, evaluation of the expression ends when an operand evaluates to false (.F.).  For example, the two UDFs below return logical values and are connected with the AND operator:

logical1( ) AND logical2( )

If LOGICAL1( ) returns true, LOGICAL2( ) is evaluated.  LOGICAL2( ) isn't evaluated if LOGICAL1( ) returns false.

If two operands are connected with the OR relational operator, evaluation of the expression ends when an operand evaluates to true (.T.).

UDFs in Commands

Many FoxPro commands support UDFs.  UDFs let you execute routines that can validate data, display a message, enable or disable objects and so on.  The following example demonstrates how a UDF can be used in a VALID clause in BROWSE to ensure that a proper tax rate is entered.

In this example a temporary table named TEMPDATA is created and BROWSE is issued to open a Browse window for the table.  The VALID clause calls the RIGHTCOST( ) UDF, which tests whether a proper cost has been entered in the COST field.  Costs can range from 5.00 to 20.00.

If the value you enter in the COST field doesn't fall within this range, a message is displayed with the proper tax rate range.  The cursor can't move to another record until a proper tax rate is entered.

CLOSE DATABASES
CREATE TABLE tempdata (item c(10), cost n(5,2))
INSERT INTO tempdata (item,cost) VALUES ('widget',10.00)
INSERT INTO tempdata (item,cost) VALUES ('flimjan',18.00)
GO TOP
BROWSE FIELDS item, cost:F VALID rightcost( )
CLOSE DATABASES
ERASE tempdata.dbf
RETURN

FUNCTION rightcost  && Called by BROWSE VALID

IF NOT BETWEEN(cost, 5.00, 20.00)	&& Bad cost entered
WAIT WINDOW 'Enter cost from 5.00 to 20.00' NOWAIT
RETURN 0	&& Stay on current record
ELSE	&& Good cost entered
RETURN .T.	&& Okay to move to another field or record
ENDIF

Where UDFs Can Be Used

may not be used in certain places.  For a complete listing of where UDFs may be used, see the User-Defined Functions section in the FoxPro Language Reference.


User-Defined Functions (UDFs) SeeAlso
See Also

FUNCTION Command

PARAMETERS Command

PARAMETERS( ) Function

PROCEDURE Command

RETURN Command

SET UDFPARMS Command


VAL( ) Function

See Also	Example

Returns a numeric expression from a specified character expression composed of numbers.

Syntax

VAL(<expC>)

Returns

Numeric

Remarks

VAL( ) processes the numbers in the character expression from left to right until a non-numeric character is encountered (leading blanks are ignored).  VAL( ) returns 0 if the first character of the character expression isn't a number.

Parameter

<expC>

Specify a character expression composed of eight numbers with <expC>.


VAL( ) Example

STORE '12' TO A
STORE '13' TO B
? VAL(A) + VAL(B)

STORE '1.25E3' TO C
? 2 * VAL(C)


VAL() SeeAlso
See Also

SET DECIMALS Command

STR( ) Function


VARREAD( ) Function

See Also	Example

Returns in upper-case the name of the memory variable, array element, or field used to create the current @ ... GET field or control.

Syntax

VARREAD( )

Returns

Character

Remarks

Controls include check boxes; fields; invisible, push or radio buttons; lists; popups; spinners; and text editing regions.

If a Browse, Change or Edit window is active, the name of the current field is returned with the first letter of the field name capitalized.

VARREAD( ) is identical to SYS(18).  Both can be used to pass the current field or control name to a procedure that in turn can provide context-sensitive help.


VARREAD( ) Example

SET TALK OFF
CLOSE DATABASES
ON KEY LABEL F1 DO Help WITH VARREAD( )
USE customer
SCATTER TO temp
DEFINE WINDOW input FROM 6,10 to 18,70 PANEL
ACTIVATE WINDOW input
@ 1,3  SAY 'Customer: ' GET company
@ 3,3  SAY 'Address: '  GET address
@ 5,3  SAY 'City: '     GET city
@ 7,3  SAY 'State: '    GET state
@ 7,18 SAY 'Zip: '      GET zip
@ 9,7  SAY 'Press <Esc> to cancel or <F1> for help'
READ
GATHER FROM temp
DEACTIVATE WINDOW input
RELEASE WINDOW input
ON KEY LABEL F1
RETURN

*** Help Procedure ***

PROCEDURE Help
PARAMETERS fieldname
DO CASE
CASE fieldname = 'COMPANY'
WAIT WINDOW 'Enter the company name' NOWAIT
CASE fieldname = 'ADDRESS'
WAIT WINDOW 'Enter the street address' NOWAIT
CASE fieldname = 'CITY'
WAIT WINDOW 'Enter the city name' NOWAIT
CASE fieldname = 'STATE'
WAIT WINDOW 'Enter a two character state abbreviation' NOWAIT
CASE fieldname = 'ZIP'
WAIT WINDOW 'Enter the five digit Zip code' NOWAIT
ENDCASE
RETURN


VARREAD() SeeAlso
See Also

@ ... GET Command

BROWSE Command

CHANGE Command

EDIT Command

SYS(18) Function - Current @ ... GET Field or Object


VERSION( ) Function

See Also	Example

Returns a character string containing the FoxPro version number you are using.

Syntax

VERSION( )

Returns

Character

Remarks

Use VERSION( ) to conditionally execute version-specific portions of code.


VERSION( ) Example

? VERSION( )


VERSION() SeeAlso
See Also

GETENV( ) Function

OS( ) Function


WAIT Command

See Also	Example

Halts FoxPro operation until you press a key or click the mouse.

Syntax

WAIT
[<expC>]
[TO <memvar>]
[WINDOW [NOWAIT]]
[CLEAR]
[TIMEOUT <expN>]

Clauses

<expC>

Include <expC> to display your own message.  If <expC> is omitted, the default system message "Press any key to continue ... " is displayed.

TO <memvar>

Include TO <memvar> to save the key pressed to a memory variable or an array element.  If the memory variable or an array element you specify with <memvar> doesn't exist, it is created.  The null string is stored in <memvar> if you press Enter or a nonprintable key or key combination.

WINDOW

If you include WINDOW, the message is displayed in the system message window in the upper-right corner of the main FoxPro window. The window can be temporarily hidden by pressing the Ctrl or Shift key.  In FoxPro for MS-DOS, you can move the window to a different location in the main FoxPro window by dragging it with the mouse or by pressing the Ctrl+F7 key combination.

In FoxPro for Macintosh and FoxPro for Windows version 2.5a and higher, WAIT WINDOW supports multiple line messages. Use a carriage return (CHR(13)) in <expC> to move portions of your message to additional lines. The message window is automatically expanded to accommodate the additional lines. For example,this command creates a message window that contains two lines:

WAIT WINDOW "This is the 1st line" + CHR(13) + ;

    "This is the 2nd line"

The width of the message window is adjusted to fit the longest line in the message. All lines in the message are left-justified in the message window. Line feeds (CHR(10)) following CHR(13) are ignored.

NOWAIT

Include NOWAIT to create a message that behaves like a FoxPro system message, which is displayed in the upper-right corner of the main FoxPro window.  An example of a FoxPro system message is the "Not found" message displayed after an unsuccessful search in a text editor or a Browse window.

As with a FoxPro system message, you can move the mouse or press a key to remove the message.  A message created with NOWAIT doesn't discard the keystroke you use to remove the message from the main FoxPro window.  The keystroke is discarded if NOWAIT  is omitted.

CLEAR

CLEAR provides a method to remove a system window or a WAIT window message from within a program.  For example, talk from indexing, sorting and so on is directed to a system window if you issue SET TALK WINDOW.  The window is removed when you press a key or move the mouse.  Issue WAIT CLEAR to remove the window from within a program.

TIMEOUT <expN>

Include TIMEOUT to specify how long operation is halted.  The numeric expression <expN> specifies how many seconds (fractional seconds are permitted) can elapse without input from the keyboard or the mouse before the WAIT is terminated. If TIMEOUT is included but isn't the last clause in WAIT, a syntax error occurs.


WAIT Example

The following example uses WAIT WINDOW to display a message whenever the beginning or the end of CUSTOMER.DBF is encountered.  Press Forward several times to advance through the table, then press Backward several times to take you to the beginning of the table.  A message is displayed when you reach the beginning of the table.

SET TALK OFF
CLOSE DATABASES
CLEAR
USE customer
STORE .F. TO mexit
DEFINE WINDOW mskip FROM 9,30 TO 17,50 DOUBLE
DO WHILE NOT mexit
ACTIVATE WINDOW mskip
@ 1,5 PROMPT 'Forward  '
@ 3,5 PROMPT 'Backward '
@ 5,5 PROMPT 'Quit     '
MENU TO mchoice
DEACTIVATE WINDOW mskip
DO CASE
CASE mchoice = 1
SKIP
IF EOF( )
WAIT WINDOW 'End of file encountered'
SKIP -1
ENDIF
CASE mchoice = 2
SKIP -1
IF BOF( )
WAIT 'Beginning of file encountered' WINDOW
GO TOP
ENDIF
CASE MCHOICE = 3
STORE .T. TO mexit
LOOP
ENDCASE
@ 20,10 SAY 'Company: ' + company
ENDDO
RELEASE WINDOW mskip


WAIT SeeAlso
See Also

ACCEPT Command


WBORDER( ) Function

See Also

Determines whether or not the specified window has a border.

Syntax

WBORDER([<window name>])

Returns

Logical

Remarks

This function returns true (.T.) if the specified window has a border, and it returns false (.F.) if the window doesn't have a border.  By default, windows have borders.  Include the NONE clause in DEFINE WINDOW to create a window without a border.

Parameter

<window name>

<window name> is the name of the window whose border is in question.

WBORDER( ) returns a logical value for the current output window if a window name isn't included.


WBORDER() SeeAlso
See Also

ACTIVATE WINDOW Command

DEFINE WINDOW Command


WCHILD( ) Function

See Also

Returns either the number of child windows in a parent window or the names of the child windows in the order in which they are stacked in the parent window.

Syntax

WCHILD([<window name>] [<expN>])

Returns

Character or Numeric

Remarks

You can create a window (the parent window) and place other windows (child windows) inside.  Including the IN or IN WINDOW clause in DEFINE WINDOW creates a child window inside the parent window.  A child window created and activated inside a parent window cannot be moved outside the parent window.  If the parent window is moved, the child window moves with it.

The number of child windows in the current output window is returned if you issue WCHILD( ) without any arguments.

Parameters

<window name>

To return the number or names of child windows for a window other than the current output window, specify the window's name with <window name>.  The number of child windows in the specified window is returned if you include just a window name without the numeric expression <expN>.  If you include both <window name>  and <expN>, WCHILD( ) returns the names of the child windows in the specified window.

<expN>

WCHILD( ) returns the names of child windows in the current output window if you include <expN> but not <window name>.

The numeric expression <expN> can be 0 or any positive value.  The name of the child window at the bottom of the stack of child windows in the current output window is returned if <expN> is 0.

If <expN> is a positive number, WCHILD( ) returns the name of the next child window in the window stack.  The name of next child window in the stack is returned if you issue WCHILD( ) again with a positive number and so on.  The null string is returned if WCHILD( ) is called more times than the number of child windows in the parent window.  For more information on window stacking, see ACTIVATE WINDOW.

Tip   In FoxPro for MS-DOS and FoxPro for Windows, if the main FoxPro window is active, all windows are children of the main FoxPro window.  Issuing a series of WCHILD( ) functions with positive numbers returns the names of the active windows. In FoxPro for Macintosh, windows are only children of the main FoxPro window when you include the IN

SCREEN clause in DEFINE WINDOW or ACTIVATE WINDOW.

If you include both a window name and <expN>, separate the window name and <expN> with a comma.


WCHILD() SeeAlso
See Also

ACTIVATE WINDOW Command

DEFINE WINDOW Command

WPARENT( ) Function


WCOLS( ) Function

See Also	Example

Returns the number of columns within the specified window.

Syntax

WCOLS([<window name>])

Returns

Numeric

Remarks

If you don't specify a window, the number of columns in the active output window is returned.  If no window is active, the number of columns in the main FoxPro window is returned.

Parameter

<window name>

WCOLS( ) returns the number of columns in the window you specify with <window name>.

In FoxPro for Windows and FoxPro for Macintosh, the value returned by WCOLS( ) depends on the font specified for the window.  Most fonts Microsoft Windows uses can be displayed in a wide variety of sizes, and some are proportionally spaced.  A column corresponds to the average width of a letter in the current font.  For more information, see Fonts.

You can specify the name of a system window (the Command window, the View window, a Browse window, and so on) in WCOLS( ) if the system window has been opened and is visible or is hidden.  If you specify the name of a system window that is closed, the alert "WINDOW <window name> has not been defined" is displayed.  The Debug window is an exception.  Once the Debug window has been opened, its name can be included in WCOLS( ) if it is visible, hidden or closed.

You can also include the null string as the window name to return the number of columns in the main FoxPro window.

Note that the null string can be used to specify the main FoxPro window in functions such as WLCOL( ), WLROW( ), WCOLS( ), WROWS( ) that return window locations or sizes.


WCOLS( ) Example

This example centers a short output message in the last row of a window of unknown size.

DO SendMesg WITH 'Message', WCOLS( ), WROWS( ) -1
*** SendMesg ***
PROCEDURE SendMesg
PARAMETERS msg_string, w_cols, row
STORE (w_cols - LEN(msg_string))/2 TO col
@ row, col SAY msg_string
RETURN


WCOLS() SeeAlso
See Also

SCOLS( ) Function

SROWS( ) Function

WLCOL( ) Function

WLROW( ) Function

WROWS( ) Function


WEXIST( ) Function

See Also	Example

Determines whether or not the definition of the specified window is in memory.

Syntax

WEXIST(<window name>)

Returns

Logical

Remarks

WEXIST( ) returns true (.T.) if the window you specify exists, and it returns false (.F.) if the window doesn't exist.  The specified window doesn't have to be active or visible for WEXIST( ) to return true, but it must be defined.

Parameter

<window name>

Specify the name of the window with <window name>.

You can specify the name of a system window (the Command window, the View window, a Browse window, and so on) in WEXIST( ).  WEXIST( ) returns true (.T.) if the system window you specify is visible or hidden.  WEXIST( ) returns false (.F.) if the specified system window is closed.

Two exceptions are the Command and Debug windows.  Including the Command window's name in WEXIST( ) always returns a true value.  If the Debug window has been opened, WEXIST( ) returns true, even if the Debug window is closed.


WEXIST( ) Example

DEFINE WINDOW screen1 FROM 10,10 TO 20,69
DEFINE WINDOW screen2 FROM 1,0 TO 19,79
? WEXIST('screen1')

STORE 'screen2' TO win_name
? WEXIST(win_name)

? WEXIST('screen3')

RELEASE WINDOWS screen1, screen2


WEXIST() SeeAlso
See Also

ACTIVATE WINDOW Command

DEFINE WINDOW Command

WONTOP( ) Function

WOUTPUT( ) Function

WVISIBLE( ) Function


WFONT( ) Function

See Also	Example

Returns the name, size or style of the current font for a window in FoxPro for Windows and FoxPro for Macintosh.

Syntax

WFONT(<expN>[, <window name>])

Returns

Character and Numeric

Remarks

WFONT( ) is supported in FoxPro for Windows and FoxPro for Macintosh. In FoxPro for MS-DOS, WFONT( ) returns constant values.

Parameters

<expN>

<expN> specifies the font attribute you want to return.  If <expN> is 1, WFONT( ) returns the name of the current font for the active or specified window. In FoxPro for MS-DOS, WFONT( ) always returns "FoxFont."

If <expN> is 2, WFONT( ) returns the font size. In FoxPro for MS-DOS, WFONT( ) always returns 1.

If <expN> is 3, WFONT( ) returns a code that identifies the font style. In FoxPro for MS-DOS, WFONT( ) always returns "N."

The font style code is a character or set of characters that correspond to the current font style.  For example, the current font style is bold italic if WFONT(3) returns BI.

Here are the codes for each font style:

Code	Font Style

B	Bold

C	Condense*

E	Extend*

I	Italic

N	Normal

O	Outline

Q	Opaque

S	Shadow

-	Strikeout*

T	Transparent

U	Underline

*The Condense and Extend styles are only available in FoxPro for Macintosh. The Strikeout style is only available in FoxPro for Windows.

<window name>

<window name> is the name of the window for which you want to determine the current font, font size or font style.  Include the null string to return the current font, font size or font style for the main FoxPro window.

<window name> can be the name of a user-defined window created with DEFINE WINDOW or a text or memo editing window.

You can also include the name of a FoxPro system window (View, Trace, Debug, and so on).  WFONT( ) can return font attributes only for a FoxPro system window that has been opened and is currently visible or hidden.  If the system window you specify is closed, the alert "WINDOW <window name> has not been defined" is displayed.

WFONT( ) returns the current font, font size or font style for the active output window if a window name is omitted.


WFONT( ) Example

The following example creates a user-defined window called FONTCHAR.  The window is activated and its font characteristics are displayed in the window.  The font characteristics are then displayed for the main FoxPro window.

DEFINE WINDOW fontchar ;
FROM 1,1 TO 3,35 ;
FONT 'MS SANS SERIF',8 ;
STYLE 'BI'	&& Define window with font and style
ACTIVATE WINDOW fontchar

?WFONT(1), WFONT(2), WFONT(3)	&& Fontchar window
ACTIVATE SCREEN
?
?
?
? 'Font characteristics for the window FONTCHAR'
?
?
?
? WFONT(1,''), WFONT(2,''), WFONT(3,'')	&& Main FoxPro window
?
? 'Font characteristics for the main FoxPro window'
?
?
?
WAIT WINDOW
RELEASE WINDOW fontchar
CLEAR


WFONT() SeeAlso
See Also

FONTMETRIC( ) Function

GETFONT( ) Function

TXTWIDTH( ) Function

SYSMETRIC( ) Function


WLAST( ) Function

See Also

Returns the name of the window that was active prior to the current window or determines whether or not the named window was active prior to the current window.

Syntax

WLAST([<window name>])

Returns

Character or Logical

Remarks

WLAST( ) returns the null string if the window that was active prior to the current window is the Debug, Trace or Command window.  Program execution isn't be affected by bringing these windows forward when you are debugging a program that uses WLAST( ).

Parameter

<window name>

To determine if a specific window was active prior to the current window, specify the window's name with <window name>.  WLAST( ) returns true (.T.) if the specified window was active prior to the current window.  It returns false (.F.) if the specified window wasn't active prior to the current window or if the window you specify doesn't exist.

The name of the window that was active prior to the current window is returned if you omit <window name>.


WLAST() SeeAlso
See Also

ACTIVATE WINDOW Command

DEFINE WINDOW Command

WEXIST( ) Function

WONTOP( ) Function

WOUTPUT( ) Function

WVISIBLE( ) Function


WLCOL( ) Function

See Also

Returns the column coordinate of the top-left corner of the current or specified window.

Syntax

WLCOL([<window name>])

Returns

Numeric

Remarks

The column coordinate is relative to the desktop in FoxPro for MS-DOS or the main FoxPro window.

The value returned by WLCOL( ) depends on the current video display mode.  In FoxPro for MS-DOS, the display mode can be changed with SET DISPLAY.

Windows can be positioned off the main FoxPro window.  If the specified window is to the left of the main FoxPro window, WCOL( ) returns a negative value.  If the window's left border is to the right of the main FoxPro window, WCOL( ) returns a positive value greater than the width of the main FoxPro window.

Parameter

<window name>

The column coordinate of the top-left of the active output window is returned if <window name> isn't included.  If no window is active, the column coordinate of the top-left border of the desktop or the main FoxPro window is returned.  The column coordinate for the main FoxPro window is also returned if the null string is included as the window name.

If you specify a window name with <window name>, the column coordinate of the top-left of the specified window is returned.

If a FoxPro system window (the Command window, the View window, a Browse window, and so on) has been opened and is visible or hidden (its name appears on the Window menu), you can include its name in WLCOL( ).  If you specify the name of a FoxPro system window that is closed, the alert "WINDOW <window name> has not been defined" is displayed.  The Debug window is an exception.  Once the Debug window has been opened, its name can be included in WLCOL( ) if it is visible, hidden or closed.


WLCOL() SeeAlso
See Also

SET DISPLAY Command

WCOLS( ) Function

WLROW( ) Function

WROWS( ) Function


WLROW( ) Function

See Also

Returns the row coordinate of the top-left corner of the current or specified window.

Syntax

WLROW([<window name>])

Returns

Numeric

Remarks

The row coordinate is relative to the main FoxPro window.

The value returned by WLROW( ) depends on the current video display mode.  The display mode can be changed with SET DISPLAY.

Windows can be positioned off the main FoxPro window.  If the top of the window is above the main FoxPro window, WLROW( ) returns a negative value.  If the top of the window is below the bottom of the main FoxPro window, WLROW( ) returns a positive value greater than the height of the main FoxPro window.

Parameter

<window name>

The row coordinate of the top border of the active output window is returned if <window name> isn't included.  If no window is active, the row coordinate of the top-left border of the desktop or the main FoxPro window is returned.  The row coordinate for the desktop or the main FoxPro window is also returned if the null string is included as the window name.

If you specify a window name with <window name>, the row coordinate of the top-left border of the specified window is returned.

If a FoxPro system window (the Command window, the View window, a Browse window, and so on) has been opened and is visible or hidden (its name appears on the Window menu), you can include its name in WLROW( ).  If you specify the name of a FoxPro system window that is closed, the alert "WINDOW <window name> has not been defined" is displayed.  The Debug window is an exception.  Once the Debug window has been opened, its name can be included in WLROW( ) if it is visible, hidden or closed.


WLROW() SeeAlso
See Also

SET DISPLAY Command

WCOLS( ) Function

WLCOL( ) Function

WROWS( ) Function


WMAXIMUM( ) Function

See Also

Determines whether or not the current or specified window is maximized.

Syntax

WMAXIMUM([<window name>])

Returns

Logical

Remarks

Windows can be enlarged to fill the main FoxPro window.

A user-defined window created with DEFINE WINDOW can be maximized only if the ZOOM key word is included in its definition.

WMAXIMUM( ) returns true (.T.) if the current or specified window is maximized.  It returns false (.F.) if the window isn't maximized.

In FoxPro for MS-DOS, you can maximize a window by choosing the Zoom [image] option from the Window menu, by pressing Ctrl+F10, by clicking on the zoom control or by issuing ZOOM WINDOW.

In FoxPro for Windows, you can maximize a window by choosing the Maximize option from the window's Control menu, by pressing Ctrl+F10, by clicking on the Maximize button, by double-clicking on the top border of the window or by issuing ZOOM WINDOW.

In FoxPro for Macintosh, you can maximize a window by clicking on the window's zoom box or by issuing ZOOM WINDOW.

Parameter

<window name>

To determine whether a specific window is maximized, specify the window's name with <window name>.  You can specify the name of a FoxPro system window (the Command window, the View window, a Browse window, and so on).

A logical value is returned for the current window if <window name> isn't included in WMAXIMUM( ).


WMAXIMUM() SeeAlso
See Also

DEFINE WINDOW Command

WMINIMUM( ) Function

ZOOM WINDOW Command


WMINIMUM( ) Function

See Also

Determines whether or not a current or specified window is minimized.

Syntax

WMINIMUM([<window name>])

Returns

Logical

Remarks

Windows can be reduced to a minimize size in FoxPro for MS-DOS or to an icon in FoxPro for Windows.

Windows cannot be minimized in FoxPro for Macintosh. WMINIMUM( ) always returns false (.F.) in FoxPro for Macintosh.

A user-defined window created with DEFINE WINDOW can be minimized only if the MINIMIZE key word is included in its definition.

WMINIMUM( ) returns true (.T.) if the current or specified window is minimized.  It returns false (.F.) if the window isn't minimized.

In FoxPro for MS-DOS, you can minimize a window by choosing the Zoom [image] option from the Window menu, by pressing Ctrl+F9, by double-clicking on the top border of the window or by issuing ZOOM WINDOW.

In FoxPro for Windows, you can minimize a window by choosing the Minimize option from the window's Control menu, by pressing Ctrl+F9, by clicking on the Minimize button or by issuing ZOOM WINDOW.

Parameter

<window name>

To determine whether a window is minimized, specify the window's name with <window name>.  You can specify the name of a FoxPro system window (the Command window, the View window, a Browse window, and so on).

A logical value is returned for the current window if <window name> isn't included in WMINIMUM( ).


WMINIMUM() SeeAlso
See Also

DEFINE WINDOW Command

WMAXIMUM( ) Function

ZOOM WINDOW Command


WONTOP( ) Function

See Also	Example

Determines whether or not the current or specified window is in front of all other active windows.

Syntax

WONTOP([<window name>])

Returns

Character or Logical

Remarks

WONTOP( ) returns true (.T.) if the specified window is frontmost.  It returns false (.F.) if the window isn't frontmost or doesn't exist.

Parameter

<window name>

If <window name> isn't included in WONTOP( ), the name of the frontmost window is returned.

To determine if a window is frontmost, specify the window's name with <window name>.  You can specify the name of a FoxPro system window (the Command window, the View window, a Browse window, and so on).

If the Debug, Trace or Command window is frontmost, WONTOP( ) (when used without a window name) returns the null string.  When you are debugging a program that uses WONTOP( ), program execution shouldn't be affected by bringing these windows forward.


WONTOP( ) Example

This program example uses WONTOP( ) to display the name of the frontmost window.  Before you run this program, open some windows (Browse windows, the View window, and so on) or desk accessories.

IF NOT EMPTY(WONTOP( ))
WAIT WINDOW 'Foremost window: ' + WONTOP( )
ELSE
WAIT WINDOW 'No windows are open'
ENDIF


WONTOP() SeeAlso
See Also

ACTIVATE WINDOW Command

DEFINE WINDOW Command

WEXIST( ) Function

WOUTPUT( ) Function

WVISIBLE( ) Function


WOUTPUT( ) Function

See Also	Example

Determines whether or not output is being directed to the current or specified window.

Syntax

WOUTPUT([<window name>])

Returns

Character or Logical

Remarks

This function returns true (.T.) if the specified user-defined window is the current output window.  The last user-defined window activated with ACTIVATE WINDOW is the current output window.

Parameter

<window name>

WOUTPUT( ) returns the name of the window to which output is currently directed if <window name> is omitted.  WOUTPUT( ) returns the null string if output is being directed to the main FoxPro window.

To determine whether output is being directed to a window, specify the window's name with <window name>.  False (.F.) is returned if the window you specify doesn't exist or is a FoxPro system window.  Output cannot be directed to a FoxPro system window.


WOUTPUT( ) Example

In this example, a window is created and activated.  WOUTPUT( ) is used to display the name of this active output window.  The window is closed and removed from memory.  If another window is active, its name is displayed.  If another window isn't active, a message is displayed indicating that output is directed to the main FoxPro window.

DEFINE WINDOW output FROM 2,2 TO 12,32 TITLE 'Output Window'
ACTIVATE WINDOW output

WAIT WINDOW 'Output window: ' + WOUTPUT( )

RELEASE WINDOW output

IF EMPTY(WOUTPUT( ))
WAIT WINDOW 'Output being directed to the main FoxPro window'
ELSE
WAIT WINDOW 'Output window: ' + WOUTPUT( )
ENDIF


WOUTPUT() SeeAlso
See Also

ACTIVATE WINDOW Command

DEFINE WINDOW Command

WEXIST( ) Function

WONTOP( ) Function

WVISIBLE( ) Function


WPARENT( ) Function

See Also	Example

Returns the name of the parent window of the current or specified window.

Syntax

WPARENT([<window name>])

Returns

Character

Remarks

You can use DEFINE WINDOW to create a window and place it in a parent window.  The child window becomes integrated with its parent window.  For example, a child window defined and activated inside a parent window can't be moved outside the parent window.  If the parent window is moved, the child window moves with it.

Parameter

<window name>

To return the parent name for a window, specify the window's name with <window name>.  The null string is returned if the specified window doesn't have a parent window.

If <window name> is omitted, the name of the parent window of the current output window is returned.  The null string is returned if the current output window doesn't have a parent window.


WPARENT( ) Example

The following example defines a parent and child window.  It then uses WPARENT( ) to identify which window is the parent.

CLEAR ALL
CLEAR
DEFINE WINDOW test1 ;
FROM 1,1 TO 20,20 ;
TITLE 'Test1'	&& Parent window
ACTIVATE WINDOW test1
DEFINE WINDOW test2 ;
FROM 1,1 TO 10,10 ;
TITLE 'Test2' ;
IN WINDOW test1	&& Child window
ACTIVATE WINDOW test2

WAIT WINDOW 'The parent window is ' + WPARENT( )
RELEASE WINDOW test1, test2


WPARENT() SeeAlso
See Also

ACTIVATE WINDOW Command

DEFINE WINDOW Command

WCHILD( ) Function


WREAD( ) Function

See Also

Determines whether or not the current or specified window is involved in the current READ.

Syntax

WREAD([<window name>])

Returns

Logical

Remarks

WREAD( ) returns true (.T.) if the specified window is participating in the current READ; false (.F.) is returned if the specified window isn't involved in the current READ or doesn't exist.

You can have a window participate in a READ by:

Including the window's title in the READ WITH clause.  Windows that typically aren't involved in a READ can participate in this way.  Browse windows, memo and text editing windows, FoxPro system windows and so on can participate in a READ.

Creating a control in the window.  A READ can span multiple windows if you create controls in multiple windows and then issue READ.

Parameter

<window name>

To determine whether a window is participating in a READ, specify the name of the window with <window name>.

If a window name isn't included, WREAD( ) returns a logical value for the window that is currently frontmost, that is, the window whose name is returned by WONTOP( ).


WREAD() SeeAlso
See Also

RDLEVEL( ) Function

READ Command

READKEY( ) Function

WONTOP( ) Function


WROWS( ) Function

See Also

Returns the number of rows within a specified window.

Syntax

WROWS([<window name>])

Returns

Numeric

Remarks

If you don't specify a window, the number of rows in the active output window is returned.  If no window is active, the number of rows in the main FoxPro window is returned.

Parameter

<window name>

WROWS( ) returns the number of rows in the window you specify with <window name>.

In FoxPro for Windows and FoxPro for Macintosh, the value returned by WROWS( ) depends on the font specified for the window.  Most fonts can be displayed in a wide variety of sizes, and some are proportionally spaced.  A row corresponds to the height of the current font.  For more information, see Fonts.

You can specify the name of a system window (the Command window, the View window, a Browse window, and so on) in WROWS( ) if the system window has been opened and is visible or is hidden.  If you specify the name of a system window that is closed, the alert "WINDOW <window name> has not been defined" is displayed.  The Debug window is an exception.  Once the Debug window has been opened, its name can be included in WROWS( ) if it is visible, hidden or closed.

You can also include the null string as the window name to return the number of rows in the main FoxPro window.

Note that the null string can be used to specify the main FoxPro window in functions such as WLCOL( ), WLROW( ), WCOLS( ), WROWS( ) that return window locations or sizes.

For an example using WROWS( ), see WCOLS( ).


WROWS() SeeAlso
See Also

SCOLS( ) Function

SROWS( ) Function

WCOLS( ) Function

WLCOL( ) Function

WLROW( ) Function


WTITLE( ) Function

See Also

Returns the title assigned to the current or specified window.

Syntax

WTITLE([<window name>])

Returns

Character

Remarks

WTITLE( ) can be used to return a window's title, which appears in the top border of the window.  The title is returned for the frontmost window if <window name> isn't included in WTITLE( ).  WTITLE( ) returns the null string if the Debug, Trace or Command window is frontmost or output is being directed to the main FoxPro window.

Parameter

<window name>

To return the title for a window, specify the name of the window with <window name>.  The title assigned to the window with the TITLE clause is returned if you include the name of a user-defined window.

When you issue BROWSE WINDOW to open a Browse window in a user-defined window, the title of the user-defined window is returned by WTITLE( ) if the Browse window doesn't have a title.  The title of the Browse window is returned if the Browse window does have a title.

Window Names and Titles

Names are assigned to user-defined windows, system windows and Browse windows in the following manner:

User-defined windows are assigned names when they are created with DEFINE WINDOW.  There is a distinction between user-defined window names and titles.  By default, user-defined windows don't have titles.  If the TITLE clause is included when the window is created, the specified title appears in the top border of the window but isn't the name of the window.

By default, each system window, which are part of the FoxPro interface, derives its name from the title of the window. Examples of system windows include the Command window, the View window, the Trace window, the Filer, the Help window, and the Puzzle.

CREATE or MODIFY COMMAND, REPORT, LABEL and FILE windows derive their names from the name of the file being created or modified.  The name of the window includes the file name extension.

A Browse window derives its name from the title of the window.  The name and title of the Browse window is assigned in one of three ways:

1	The default title assignment of the table alias;

2	The window title, if any; or

3	The Browse title, if any.

By default, the Browse window name is the table alias.

Some Additional Notes on Window Names

If you are unsure of the name assigned to a window, check the Window menu.  All window names are listed at the bottom of the Window menu.

Two windows exist if you issue BROWSE WINDOW <window name>.  The Browse window is a separate window and takes on the attributes of the specified user-defined window.  If a window is active when you issue BROWSE and you don't include the WINDOW clause, the Browse window takes on the attributes of the active window.  You can override this behavior by including NORMAL in BROWSE.

You can include window names that contain spaces in commands and functions that accept window names such as MOVE WINDOW, DEACTIVATE WINDOW, WONTOP( ) by specifying the part of the window name that begins with the first non-space character and continuing until the first non-space character is encountered.

For example, a Browse window with the name Invoice Entry can be moved with this command:

MOVE WINDOW invoice BY 1,1

The names of user-defined windows cannot contain spaces, but the names of Browse and System windows can.


WTITLE() SeeAlso
See Also

ACTIVATE WINDOW Command

DEFINE WINDOW Command

WEXIST( ) Function

WLAST( ) Function

WONTOP( ) Function

WOUTPUT( ) Function

WREAD( ) Function


WVISIBLE( ) Function

See Also	Example

Determines whether or not the specified window has been activated and isn't hidden.

Syntax

WVISIBLE(<window name>)

Returns

Logical

Remarks

This function returns true (.T.) if the specified window is shown or activated and isn't hidden.  Windows are shown and activated with  SHOW WINDOW and ACTIVATE WINDOW.

WVISIBLE( ) returns false (.F.) if the window has not been activated, has been hidden with HIDE WINDOW, has been deactivated with DEACTIVATE WINDOW, or doesn't exist.

Parameter

<window name>

<window name> is the name of the window whose visibility you want to determine.


WVISIBLE( ) Example

This example uses WVISIBLE( ) to display the names of all visible desk accessories (the Puzzle, the Calculator, and so on) in a window.  Open some of the FoxPro desk accessories before you run this program.

STORE '' TO mvisible

STORE mvisible + IIF(WVISIBLE('ASCII'), ' ASCII Chart', '') ;
TO mvisible
STORE mvisible + IIF(WVISIBLE('CALCULATOR'), ' Calculator', '') ;
TO mvisible
STORE mvisible + IIF(WVISIBLE('CALENDAR'), ' Calendar', '') ;
TO mvisible
STORE mvisible + IIF(WVISIBLE('FILER'), ' Filer', '') ;
TO mvisible
STORE mvisible + IIF(WVISIBLE('PUZZLE'), ' Puzzle', '') ;
TO mvisible
STORE mvisible+IIF(WVISIBLE('SPECIAL'),' Special Characters','') TO mvisible

IF EMPTY(mvisible)
WAIT WINDOW 'No Desk Accessories are visible'
ELSE
WAIT WINDOW 'Visible:' + mvisible
ENDIF


WVISIBLE() SeeAlso
See Also

ACTIVATE WINDOW Command

DEFINE WINDOW Command

WEXIST( ) Function

WONTOP( ) Function

WOUTPUT( ) Function


YEAR( ) Function

See Also	Example

Returns the year from the specified date expression.

Syntax

YEAR(<expD>)

Returns

Numeric

Remarks

YEAR( ) always returns the year with the century.  The CENTURY setting (ON or OFF) doesn't affect the returned value.

Parameter

<expD>

Specify a date expression with <expD>.  The date expression may be a function that returns a date, or a date type memory variable, array element or field.  It can also be a literal date string (for example, {06/06/92}).


YEAR( ) Example

? YEAR(DATE( ))


YEAR() SeeAlso
See Also

DATE( ) Function

DOW( ) Function

SET CENTURY Command


ZAP Command

See Also

Removes all records from a table, leaving just the table structure.

Syntax

ZAP

Remarks

Issuing ZAP is equivalent to issuing DELETE ALL followed by PACK, but ZAP is much faster.

If SET SAFETY is ON, FoxPro asks if you would like to remove the records from the current table.

Caution   Records zapped from the current table cannot be recalled.


ZAP SeeAlso
See Also

DELETE Command

PACK Command


ZOOM WINDOW Command

See Also	Example

Changes the size and position of a user-defined window or a FoxPro system window.

Syntax

ZOOM WINDOW <window name> MIN [AUTO] | MAX | NORM
[AT <row1, column1> | FROM <row1, column1>
[SIZE <row2, column2> | TO <row2, column2>]]

Remarks

Windows can be reduced to a minimum size, enlarged to fill the entire main FoxPro window, or sized anywhere in between.  If you create a user-defined window with DEFINE WINDOW and the IN DESKTOP clause in FoxPro for Windows, the window you create can be enlarged to fill the entire Windows desktop.

Windows can be "zoomed" directly from minimum to maximum size and vice versa.  You can also specify where to place the resized window on the desktop, main FoxPro window or user-defined window.

You can use ZOOM WINDOW to resize all system windows except the Filer, the Calculator, and the Puzzle.

Clauses

<window name>

<window name> is the name of the window whose size you want to change.

MIN

Include MIN to reduce the window to minimum size.  In FoxPro for MS-DOS, just the name of the window or the window's title remains.  In FoxPro for Windows, the window is reduced to an icon.

In FoxPro for Macintosh, windows cannot be minimized [image] ZOOM WINDOW MIN is ignored.

Reducing a window to a minimum size makes it easy to place many windows in the main FoxPro window, the Windows desktop or in a user-defined window simultaneously and still have ample space for output.  For example, you can minimize the FoxPro desk accessories (the Calculator, the Calendar/Diary, the Puzzle, and so on) and place them in the lower portion of the main FoxPro window for easy access and use.

All system windows can be reduced to a minimum size.  System windows must be open in the main FoxPro window or a user-defined window before they can be minimized.

A user-defined window can be minimized after it is defined.  It doesn't have to be activated before you change its size.

AUTO

In FoxPro for MS-DOS, if you include AUTO and MIN, the window is minimized and docked in the lower-right corner of the main FoxPro window. If AUTO is included with MAX or NORM, it is ignored.

AUTO is ignored in FoxPro for Windows and FoxPro for Macintosh.

MAX

Include MAX to expand a window to fill the main FoxPro window, the Windows desktop or a user-defined window.  If a child window is placed in a parent window and the child is expanded to its maximum size, it expands to fill the parent window.  If any of the additional ZOOM WINDOW clauses (AT, SIZE, TO or FROM) are included with MAX, it is ignored.

Only user-defined windows defined with ZOOM can be zoomed to maximum size.

NORM

Include NORM to return a window to its original size after it has been minimized or maximized.  NORM can also be used to move or resize a window without changing its size.  Use ZOOM WINDOW NORM without any additional clauses to return a minimized or maximized window to its original size and location.

AT <row1, column1> | FROM <row1, column1>

You can specify the placement of a window by including the optional AT or FROM clauses.  In FoxPro for MS-DOS, if NORM or MIN are included, the left edge of the window is placed in the main FoxPro window at the location specified with <row1, column1>.  If MAX is included, AT and FROM are ignored.

In FoxPro for Windows, if NORM is used, the left edge of the window is placed in the main FoxPro window at the location specified with <row1, column1>.  If MIN is included, the window is displayed as an icon in the lower portion of the main FoxPro window.  AT and FROM are ignored.  If MAX is used, AT and FROM are ignored.

In FoxPro for Windows, if the window is created with the IN DESKTOP clause (for example, DEFINE WINDOW mywind FROM 10,10 TO 20,20 IN DESKTOP), the left edge of the window is placed in the Windows desktop at the location specified with <row1, column1>.  If MIN is included, the window is displayed as an icon in the lower portion of the Windows desktop.  AT and FROM are ignored.  If MAX is included, AT and FROM are ignored.

ZOOM WINDOW <window name> NORM AT <row1, column1> restores a minimized or maximized window to its original size at a specific location.  The <row1, column1> coordinates specify where the upper left corner of the window is placed.  A window's location can also be changed with MOVE WINDOW.

SIZE <row2, column2> | TO <row2, column2>

You can also specify a window size that differs from the original by including SIZE or TO.  If SIZE is included, the window is <row2> rows high and <column2> columns wide.  If the TO clause is included, the lower-right corner of the window is placed at the position specified with <row2, column2>.


ZOOM WINDOW Example

In this example, a Browse window is opened for CUSTOMER.DBF.  In FoxPro for MS-DOS and FoxPro for Windows, the Browse window is minimized. The browse window is then returned to its default size. In FoxPro for MS-DOS and FoxPro for Windows, the Browse window is then minimized at a specific location.  The Browse window is then enlarged to a specific size and then maximized.

CLOSE DATABASES
CLEAR ALL
CLEAR
USE customer
BROWSE NORMAL NOWAIT

IF _DOS OR _WINDOWS
ZOOM WINDOW customer MIN
WAIT WINDOW TIMEOUT 3 ;
'MIN clause - This window will timeout. Please wait.'

ZOOM WINDOW customer NORM
WAIT WINDOW TIMEOUT 3 ;
'NORM clause - This window will timeout. Please wait.'

IF _DOS OR _WINDOWS
ZOOM WINDOW customer MIN AT 10,10
WAIT WINDOW TIMEOUT 3 ;
'MIN AT 10,10 clause - This window will timeout. Please wait.'

ZOOM WINDOW customer NORM AT 1,1 SIZE 22,25
WAIT WINDOW TIMEOUT 3 'NORM & SIZE clauses - This window will timeout. Please wait.'

ZOOM WINDOW customer NORM FROM 10,10 TO 22,70
WAIT WINDOW TIMEOUT 3 ;
'NORM & TO clauses - This window will timeout. Please wait.'

ZOOM WINDOW customer MAX
WAIT WINDOW TIMEOUT 3 ;
'MAX clause - This window will timeout. Please wait.'

CLEAR ALL


ZOOM WINDOW SeeAlso
See Also

ACTIVATE WINDOW Command


System Memory Variables Overview

See Also

System memory variables are "built-in" memory variables that FoxPro creates and maintains automatically.  They are PUBLIC by default; you can declare them PRIVATE.

The following table lists the four types of FoxPro system memory variables and their designation in expressions:

Variable Type	Description	Expression
C	Character	<expC>
D	Date	<expD>
L	Logical	<expL>
N	Numeric	<expN>
For more information on expressions, see The FoxPro Language chapter in the FoxPro Language Reference manual.

The following table lists all system memory variables, their types and default values:

Variable	Type	Default Value
_ALIGNMENT	C	LEFT
_ASSIST	C	CATALOG.APP  Null string in 16-bit FoxPro for MS-DOS
_BEAUTIFY	C	BEAUTIFY.APP
_BOX	L	.T.
_CALCMEM	N	0.0
_CALCVALUE	N	0.0
_CLIPTEXT	C	Null string
_CUROBJ	N	0
_DBLCLICK	N	0.5
_DIARYDATE	D	Current date
_DOS	L	.T. in FoxPro for MS-DOS
_FOXDOC	C	FOXDOC.EXE
_FOXGRAPH	C	FOXGRAPH.EXE
_GENGRAPH	C	GENGRAPH.PRG
_GENMENU	C	GENMENU.PRG
_GENPD	C	GENPD.APP
_GENXTAB	C	GENXTAB.PRG
_GENSCRN	C	GENSCRN.PRG
_INDENT	N	0
_LMARGIN	N	0
_MAC	L	.T. in FoxPro for Macintosh
_MLINE	N	0
_PADVANCE	C	FORMFEED
_PAGENO	N	1
_PBPAGE	N	1
_PCOLNO	N	Current column
_PCOPIES	N	1
_PDRIVER	C	Null string
_PDSETUP	C	Null string
_PECODE	C	Null string
_PEJECT	C	BEFORE
_PEPAGE	N	32767
_PLENGTH	N	66
_PLINENO	N	0
_PLOFFSET	N	0
_PPITCH	C	DEFAULT
_PQUALITY	L	.F.
_PRETEXT	C	Null string
_PSCODE	C	Null string
_PSPACING	N	1
_PWAIT	L	.F.
_RMARGIN	N	80
_SPELLCHECK	C	SPELLCHK.APP
_STARTUP	C	STARTUP.APP
_TABS	C	Null string
_TALLY	N	0
_TEXT	C	-1
_THROTTLE	N	0
_TRANSPORT	C	TRANSPORT.PRG
_UNIX	L	.T. in FoxPro for Unix
_WINDOWS	L	.T. in FoxPro for Windows
_WRAP	L	.F.


System Memory Variables SeeAlso
See Also

PUBLIC Command

PRIVATE Command

STORE Command


_ALIGNMENT System Memory Variable

See Also

Aligns text between margins.

Syntax

_ALIGNMENT = <expC>

Remarks

_ALIGNMENT is included for backward compatibility.  Use the Report Writer instead.

_ALIGNMENT contains a character value that determines how output is aligned between the current margins.

<expC> must evaluate to one of the following:

LEFT	Produces left justified output (default).

CENTER	Produces centered output.

RIGHT	Produces right justified output.

_ALIGNMENT is active only when _WRAP is set to true (.T.).


See Also

_LMARGIN System Memory Variable

_RMARGIN System Memory Variable

_WRAP System Memory Variable


_ASSIST System Memory Variable

Specifies the program that is run when the ASSIST command is issued.

Syntax

_ASSIST = <expC>

Remarks

Use _ASSIST to specify a program to run when the ASSIST command is issued.

In FoxPro for Windows and the 32-bit Extended version of FoxPro for MS-DOS, _ASSIST contains CATALOG.APP, the Catalog Manager application, by default. In the 16-bit Standard version of FoxPro for MS-DOS, _ASSIST contains the null string.


_BEAUTIFY System Memory Variable

See Also

Specifies a beautification application for FoxPro programs.

Syntax

_BEAUTIFY = <program name>

Remarks

_BEAUTIFY is supported in FoxPro for Windows and FoxPro for Macintosh only.

In FoxPro for Windows, the Program menu has a Beautify... option that lets you make cosmetic changes to the appearance of a program.  You can change the capitalization of key words and variables to upper-case or lower-case, automatically indent items by the number of spaces you specify, or use established tab settings for indents.  Extra indents can be added automatically beneath procedures or DO CASE statements, and you can choose to leave existing FoxDoc headings unchanged or delete them automatically.

You can also choose to add action diagram symbols to your program to give you a quick visual check on the organization of your program.  You can choose Beautify... as many times as you want, selecting different combinations of options each time to create the appearance you want for your program.

The Beautify dialog contains an Action diagram symbols check box.  Action diagrams are ordinary program files that have been modified to connect structured programming commands such as IF ... ENDIF with vertical lines.  Choosing this check box also causes the Beautify application to do additional checking to ensure the structured programming commands are balanced [image] for example, an ENDIF for every IF.

Action diagrams will not compile in FoxPro, so be sure to remove the action diagram symbols before saving your program.  If you don't remove the action diagram symbols, you can run Beautify again with the Action diagram symbols check box unchecked.  This will remove the symbols.

The _BEAUTIFY system memory variable contains the name of the application that FoxPro for Windows uses when you choose the Beautify... option.  By default, _BEAUTIFY contains BEAUTIFY.APP, installed in your FoxPro for Windows directory.

To specify a different beautification application, store the application's name in _BEAUTIFY.  If your beautification application is in a directory other than the current default directory, include a path with the application name.

If you rename BEAUTIFY.APP or move it to another directory, store the new BEAUTIFY.APP file name and its path in _BEAUTIFY.

You can also specify a beautification application in your FoxPro for Windows CONFIG.FPW configuration file.  Include the line:

_BEAUTIFY = <program name>

The name of your beautification application is specified with <program name> and can include a path to the beautification application.

Ordinarily you won't need to use _BEAUTIFY.  If you write a different version of a beautification program, you can have FoxPro run your beautification application by storing its name in _BEAUTIFY.

Your beautification application must accept a single parameter, the name of the FoxPro program to beautify.  Your beautification application can modify the FoxPro program, write the modifications to a temporary file and then return the name of the temporary file to FoxPro.  FoxPro reads the temporary file back into the editing session under the original FoxPro program name and then deletes the temporary file.


See Also

_FOXDOC System Memory Variable

MODIFY COMMAND / MODIFY FILE Commands


_BOX System Memory Variable

See Also

Prints boxes.

Syntax

_BOX = <expL>

Remarks

_BOX is included for backward compatibility.  Use the Report Writer instead.

_BOX contains a logical value that determines whether or not boxes (as specified with the DEFINE BOX command) are printed around lines of text.  If _BOX is set to .T., the default, then boxes are printed; otherwise, they are not.

This system memory variable affects only boxes that you create with DEFINE BOX.

You can draw boxes on the screen or in a window with @ ... BOX or @ ... TO.


See Also

@ ... BOX Command

@ ... TO Command

DEFINE BOX Command


_CALCMEM System Memory Variable

See Also	Example

Returns or initializes the Calculator memory value.

Syntax

_CALCMEM = <expN>

Remarks

_CALCMEM contains the numeric value that FoxPro stores in the Calculator's memory.  You can save the result of a calculation in the Calculator's memory and return the result to a program, or you can place a specific value in the Calculator's memory before using the Calculator.

To initialize the Calculator's memory, store a numeric value to _CALCMEM with STORE or the = assignment operator.  When you use the Calculator, its memory contains the value you specified.


_CALCMEM  Example

The following program example stores the numeric constant 1234 to _CALCMEM.  The program then displays the Calculator and stuffs the keyboard with the letter R.  The keystroke R displays the value stored in the Calculator's memory.

STORE 1234 TO _CALCMEM
ACTIVATE WINDOW calculator
CLEAR TYPEAHEAD
KEYBOARD CHR(82)


See Also

ACTIVATE WINDOW Command

_CALCVALUE System Memory Variable

STORE Command


_CALCVALUE System Memory Variable

See Also	Example

Returns or initializes the Calculator display value.

Syntax

_CALCVALUE = <expN>

Remarks

_CALCVALUE contains the numeric value that the Calculator displays.  You can return the result of a calculation to a program or you can place a specific value in the Calculator's display before using the Calculator.

To initialize the Calculator's display, store a numeric value to _CALCVALUE with STORE or the = assignment operator.  When you use the Calculator it displays the value you specified.


_CALCVALUE Example

In the following example, the numeric value 1234 is stored to _CALCVALUE.  The Calculator then displays the value 1234.

STORE 1234 TO _CALCVALUE
ACTIVATE WINDOW calculator


See Also

ACTIVATE WINDOW Command

_CALCMEM System Memory Variable

STORE Command


_CLIPTEXT System Memory Variable

See Also	Example

Returns or initializes the clipboard contents.

Syntax

_CLIPTEXT = <expC>

Remarks

The clipboard is a temporary storage area for text.  When you copy text from a text editing area, the text is placed on the clipboard.  The contents of the clipboard can then be pasted into another text editing area.  With _CLIPTEXT, you can return the contents of the clipboard or STORE a character expression on the clipboard.

Some examples of where you can cut, copy or paste text are the FoxPro text editor, memo editing windows, the Browse and Debug windows, dialogs, the Expression Builder and active GETs.  With the Capture desk accessory in FoxPro for DOS, you can copy to the clipboard any text displayed in the main FoxPro window or in a user-defined window.

_CLIPTEXT contains the contents of the clipboard.  You can place a character expression <expC> on the clipboard with STORE or the = assignment operator.   _CLIPTEXT by default is a PUBLIC memory variable; it can be declared PRIVATE.


_CLIPTEXT Example

The following program example displays the clipboard in a window.

*** Clipboard display example ***

*** Initialize variables & define windows ***

SET TALK OFF
STORE _CLIPTEXT TO ctext
STORE 1 TO windtop
*** Define an outline & scrolling window for the clipboard ***
DEFINE WINDOW outline FROM 1,0 to 4,79;
TITLE " clipboard " CLOSE
DEFINE WINDOW clipwind FROM -1,-1 TO 30,78

ACTIVATE WINDOW outline
ACTIVATE WINDOW clipwind IN outline 	&& Place in outline window

*** Show the clipboard in the clipboard window ***

IF EMPTY(ctext) 	&& clipboard empty
@ 1,1 SAY "clipboard is empty!"
ELSE
IF AT(CHR(13),ctext) = 0 	&& No carriage returns (CR)
@ 1,1 SAY ctext	&& Show clipboard
ELSE
STORE AT(CHR(13), ctext, 1) to crpos1 	&& 1st CR
@ 1,1 SAY SUBSTR(ctext, 1, crpos1 - 1) 	&& Show 1st  line
FOR lineno = 1 to 19
STORE AT(CHR(13), ctext, lineno + 1) to crpos2  && Next CR

*** The next line shows each additional clipboard line ***

@ lineno,0 SAY SUBSTR(ctext, crpos1 + 1, (crpos2 - crpos1) - 1)
 	STORE crpos2 to crpos1

NEXT  	&&  Loop for next clipboard line
ENDIF	&& Test for 0 or more carriage returns (CR)
ENDIF	&& Test for empty clipboard

DO WHILE .T.	&& Test for up or down arrows, mouse click, any key

keyval = INKEY(5,'MH') 	&& Check for key press, mouse click
&& or 5 seconds

IF keyval = 24 AND BETWEEN(windtop,1,18)	&& Down arrow
MOVE WINDOW clipwind BY -1,0	&& Move clipboard window up
windtop = windtop + 1
ENDIF
IF keyval = 5 AND BETWEEN(windtop,2,19) 	&& Up arrow
MOVE WINDOW clipwind BY 1,0 	&& Move clipboard window down
windtop = windtop - 1
ENDIF
IF keyval != 5 AND keyval != 24 	&& quit out
DEACTIVATE WINDOW outline,clipwind
SET TALK ON
EXIT
ENDIF
ENDDO


See Also

PRIVATE Command

PUBLIC Command

STORE Command


_CUROBJ System Memory Variable

See Also	Example

Returns or initializes the current @ ... GET object number.

Syntax

_CUROBJ = <expN>

Remarks

_CUROBJ contains the number <expN> of the currently selected GET object.  GET objects are created with @ ... GET and @ ... EDIT and include fields, check boxes, push and invisible buttons, popups, lists and text editing regions.  _CUROBJ is frequently queried or changed in a user-defined function called by a VALID or WHEN clause, or other READ and @ ... GET clauses.

You can return the value from _CUROBJ to determine which object is selected, or you can store a value to _CUROBJ to select a specific GET object.

The GET object number is determined by the order the GETs are issued.  Each individual button in a set of push buttons, radio buttons or invisible buttons is considered a separate object.

You can change the value of _CUROBJ to position the cursor on another GET object.  This is typically done in VALID and WHEN routines.


_CUROBJ Example

The following program example demonstrates how GET objects are numbered and how _CUROBJ can be used to return the object number of the current object.  Press Tab or the arrow keys to select different objects.

Pressing F2 displays the object number for the current object.

CLEAR
SET TALK OFF
STORE 1 to x, y, z

ON KEY LABEL F2 @ 12,2 SAY 'Object # ' + STR(_CUROBJ)	&& Show #

@ 4,2 GET x  PICTURE '@*R \<Apples;\<Oranges;\<Limes'	&& Radio
@ 2,2 GET y  	&& Get field
@ 8,2 GET z  PICTURE '@^ \<Pears;\<Bananas;\<Pineapples'	&& Popup

READ CYCLE

ON KEY LABEL F2	&& Reset F2 key to default
SET TALK ON


See Also

@ ... GET Command

OBJNUM( ) Function

READ Command

SHOW GET Command

SHOW OBJECT Command


_DBLCLICK System Memory Variable

See Also	Example

Specifies the time interval between double and triple mouse clicks.

Syntax

_DBLCLICK = <expN>

Remarks

_DBLCLICK is ignored in FoxPro for Macintosh. Use the Macintosh Mouse control panel to change the double and triple click speed.

_DBLCLICK contains a numeric value that determines the time interval FoxPro uses to check for a double or triple mouse click.  _DBLCLICK is the time interval between mouse clicks.  For example, if _DBLCLICK is set to 0.5 seconds, you have 1/2 second to click twice for a double-click, and 1 second to click three times for a triple-click.

The larger the value of _DBLCLICK, the longer you can wait between the first and second click for FoxPro to interpret the two clicks as a double-click.  If _DBLCLICK is set to a very small value, even quick double (or triple) clicks may be interpreted as two (or three) single clicks.

The numeric expression <expN> specifies seconds.  Internal timing is measured in clock "ticks," which are each about 1/18th of a second.  If you store an integer or decimal value to _DBLCLICK, FoxPro may store it as a slightly different value due to rounding with "ticks."

The default value for _DBLCLICK is 0.5 seconds.  _DBLCLICK can range from 0.05 to 5.5 seconds (1 to 100 "ticks"), inclusive.


_DBLCLICK Example

The following program example demonstrates how you can detect a single or double mouse click:

*** Double-click detection example ***

*** Establish the program environment ***

SET TALK OFF
SET ESCAPE OFF
CLEAR

*** Create and open a window ***

DEFINE WINDOW MOUSECHK FROM 4,4 TO 20,75 DOUBLE
ACTIVATE WINDOW MOUSECHK
@ 6,16 SAY 'Press a key or click the mouse to start'
@ 8,16 SAY ' or press the Esc key to quit'

inval1 = 0	&& Initialize inkey memory variable

*** Main program loop ***

DO WHILE .T.
inval1 = INKEY(.06,'HM')	&& hide cursor, check mouse
IF inval1 = 0  	&& No key or mouse press
LOOP
ENDIF
IF inval1 = 27	&& Esc key pressed, exit main loop
EXIT
ENDIF
IF inval1 = 151	&& Single mouse click
row = MROW( )	&& Get mouse pointer position
col = MCOL( )
TIMELIMIT = SECONDS( ) + _DBLCLICK	 && Time for double-click
inval2 = 0
DO WHILE SECONDS( ) < TIMELIMIT && Check for double mouse click
inval2 = INKEY('HM')

*** Double mouse click and mouse pointer inside window ***

IF inval2 = 151 AND col != -1 AND row != -1
CLEAR
@ 7,11 SAY 'Double-click at '
?? 'Row ' + ALLTRIM(STR(row)) + ', Column ' ;
 	+ ALLTRIM(STR(col)) + ' of this window'
EXIT
ENDIF
ENDDO

*** Single mouse click and mouse pointer inside window ***

IF inval2 = 0 AND col != -1 AND row != -1
CLEAR
@ 7,11 SAY 'Single-click at '
?? 'Row ' + ALLTRIM(STR(row)) + ', Column ' ;
 	+ ALLTRIM(STR(col)) + " of this window"
ENDIF
*** Mouse pointer outside of window ***

IF col = -1 OR row = -1
CLEAR
@ 7,17 SAY 'Mouse clicked outside of this window'
LOOP
ENDIF
ENDIF
*** Keyboard character pressed ***

IF inval1 # 151 AND BETWEEN(inval1, 0, 256)	&& Good CHR() value
CLEAR
@ 7,18 SAY 'Character typed:'
?? ' ' + CHR(inval1) + ', ASCII code ' + ALLTRIM(STR(inval1))
ENDIF

ENDDO  	&& End of main loop

*** Restore original environment ***

SET TALK ON
SET ESCAPE ON
CLEAR WINDOWS

*** End of program ***


See Also

INKEY( ) Function


_DIARYDATE System Memory Variable

See Also	Example

Returns or initializes the date of the Calendar/Diary.

Syntax

_DIARYDATE = <expN>

Remarks

_DIARYDATE contains the selected date in the Calendar/Diary.  With this system memory variable, you can display the Calendar/Diary with a specific date selected, or you can return the selected Calendar/Diary date.

By default, the current date is stored in _DIARYDATE.  When you open the Calendar/Diary, the current date is selected.  You can store a different date to _DIARYDATE so that the Calendar/Diary opens with this new date selected.

Selecting a new date when the Calendar/Diary is open causes the new date to be stored to _DIARYDATE.  When you close the Calendar/Diary, _DIARYDATE contains the last selected date.


_DIARYDATE Example

In the following program example, the Calendar/Diary opens with October 31, 2001 selected and the value of _DIARYDATE appears below.  The program then uses the DATE( ) function to select the current date, and displays _DIARYDATE.  July 4, 1776 is then stored to _DIARYDATE and _DIARYDATE displays again.

CLEAR
SET TALK OFF
SET CENTURY ON
STORE {10/31/2001} TO _DIARYDATE
@ 24,0 SAY _DIARYDATE
ACTIVATE WINDOW calendar
WAIT WINDOW
STORE DATE( ) TO _DIARYDATE
@ 24,16 SAY _DIARYDATE
WAIT WINDOW
STORE {07/04/1776} TO _DIARYDATE
@ 24,32 SAY _DIARYDATE


See Also

STORE Command


_DOS System Memory Variable

See Also

Contains true (.T.) if you are using FoxPro for MS-DOS.

Syntax

_DOS = <expL>

Remarks

_DOS contains a logical true (.T.) if you are using FoxPro for MS-DOS.  _DOS contains a logical false (.F.) if you are using a different FoxPro version (FoxPro for Macintosh, FoxPro for UNIX or FoxPro for Windows).

The value contained in _DOS cannot be changed with STORE or =.


See Also

_MAC

_UNIX

VERSION( )

_WINDOWS


_FOXDOC System Memory Variable

See Also

Specifies the name and location of FoxDoc, the automatic program documenter.

Syntax

_FOXDOC = <program name>

Remarks

With _FOXDOC you can specify the program that FoxPro uses when it documents FoxPro programs.  By default, _FOXDOC uses FOXDOC.APP.  You can include a path with the program name.If you choose to install FoxDoc during supplemental program installation, FoxDoc and its

associated files are installed in the FoxPro directory.  If you rename FOXDOC.APP or move FoxDoc and its associated files to another directory, store the new FOXDOC.APP file name and the directory name in _FOXDOC.

For more information about FoxDoc, see the Documenting Applications with FoxDoc chapter in the FoxPro Developer's Guide.


See Also

_BEAUTIFY System Memory Variable


_FOXGRAPH System Memory Variable

See Also

Specifies the name and location of FoxGraph, the optional graphing package.

Syntax

_FOXGRAPH = <program name>

Remarks

_FOXGRAPH is supported in FoxPro for MS-DOS only.

_FOXGRAPH specifies the program (and its location) that FoxPro uses when it graphs the contents of FoxPro tables.  By default, _FOXGRAPH uses FOXGRAPH.EXE.  You can include a fully qualified path with the program name.

By default, FoxGraph and its associated files are installed in the FoxPro directory.  To run FoxGraph from the Program menu or the Command window, FoxGraph must be in the FoxPro directory or in a directory locatable along the DOS path.  If you move FoxGraph and its associated files to another directory, store FOXGRAPH.EXE and its location in _FOXGRAPH.


See Also

_GENGRAPH System Memory Variable

_GENXTAB System Memory Variable


_GENGRAPH System Memory Variable

See Also

Specifies the program used to output RQBE query results to Microsoft Graph (FoxPro for Windows and FoxPro for Macintosh) or FoxGraph (FoxPro for MS-DOS).

Syntax

_GENGRAPH = <program name>

Remarks

With _GENGRAPH you can specify the program that FoxPro uses to output RQBE query results to Microsoft Graph or FoxGraph. By default, _GENGRAPH uses the application supplied with FoxPro, GENGRAPH.APP. You can include a path with the application name.

 You can include a path with the program name.

Queries are created in the RQBE window.  In the RQBE window, you can choose Graph from the Output popup to specify where the results of a query are directed.  Query results can be directed to a graph created with Microsoft Graph or FoxGraph.For more information about creating a query in the RQBE window, see CREATE QUERY or the RQBE chapter in the FoxPro User's Guide.


See Also

CREATE QUERY Command


_GENMENU System Memory Variable

See Also

Specifies a menu generation program.

Syntax

_GENMENU = <program name>

Remarks

_GENMENU lets you specify the program that FoxPro uses to generate menu code from an .MNX table.  By default, _GENMENU uses the program supplied with FoxPro, GENMENU.PRG.

You can include a path with the menu generation program name.


See Also

CREATE MENU Command

_GENSCRN System Memory Variable


_GENPD System Memory Variable

See Also

Specifies a printer driver interface program for FoxPro for MS-DOS.

Syntax

_GENPD = <expC>

Remarks

_GENPD contains the name of the current printer driver interface program.  By default, this program is the application supplied with FoxPro, GENPD.APP.

In FoxPro for Windows, GENPD.APP is only used to print character-based reports created in FoxPro for MS-DOS.

In FoxPro for Macintosh, a printer driver interface program isn't necessary to print character-based reports created in FoxPro for MS-DOS.

In FoxPro for MS-DOS, the program whose name is stored in _GENPD is executed when you do one of the following:

Choose the Printer Driver Setup check box in the Printer Setup dialog.

Choose the Set Printer Driver check box in the Report Writer's Page Layout or the Label Designer's Label Environment dialog.

Issue SET PDSETUP.

Store a printer driver setup name in _PDSETUP.

Specify a default printer setup before starting FoxPro.

If you store the name of your printer driver interface program in _GENPD, your program is executed when one of the events listed above occurs.

If you do not include an extension with your printer driver setup program when you store its name in _GENPD, FoxPro looks for a version of the program in the following order and executes the program if found:

1	An executable (.EXE) version of the program

2	An application (.APP) version of the program

3	A compiled (.FXP) version of the program

4	The program (.PRG)

The printer driver interface program you specify in _GENPD can take virtually any form, but it must have a PARAMETERS statement as its first line.  FoxPro passes two parameters to the program, a numeric value and name of the printer driver setup.

The first parameter is one of the following numeric values:

FoxPro passes 0 to the program if you execute the program by choosing the Printer Driver Setup check box in the Printer Setup dialog, issue SET PDSETUP, or store a printer driver setup name in _PDSETUP.

FoxPro passes 2 to the program if you choose the Set Printer Driver check box in the Report Writer's Layout dialog or in the Label Designer's Label Environment dialog.

To prevent recursion, it is a good idea to test the numeric parameter passed to the printer driver setup program.  For example, you could store a printer driver program name in _PDRIVER that automatically executes the PDONLOAD procedure in the printer driver program.  Your PDONLOAD procedure executes your printer setup interface application and passes it a value of 1.

The printer setup interface application tests the numeric value.  If the value is 1, a printer driver program name should not be stored in _PDRIVER in the program.  If, in this case, a printer driver program name is stored in _PDRIVER, PDONLOAD is automatically executed again and your printer driver setup program is executed again in an infinite loop.

The second parameter FoxPro passes to the printer driver setup program is the name of the printer driver setup specified in SET PDSETUP or stored to _PDSETUP.  If you execute the printer driver setup program by choosing the Printer Driver Setup check box in the Printer Setup dialog, FoxPro passes a question mark (?) as the second parameter to the program specified in _GENPD.


See Also

_PDRIVER System Memory Variable

_PDSETUP System Memory Variable

SET PDSETUP Command

SET PRINTER Commands


_GENSCRN System Memory Variable

See Also

Specifies a screen generation program.

Syntax

_GENSCRN = <program name>

Remarks

_GENSCRN lets you specify the program that FoxPro uses to generate screen code from an .SCX file.  By default, _GENSCRN uses GENSCRN.PRG.

You can include a path with the screen generation program name.


See Also

CREATE SCREEN Command

_GENMENU System Memory Variable


_GENXTAB System Memory Variable

See Also

Specifies the program used to output RQBE results in cross tabular format.

Syntax

_GENXTAB = <program name>

Remarks

With _GENXTAB you can specify the program that FoxPro uses to output RQBE results to Microsoft Graph in FoxPro for Windows and FoxPro for Macintosh, FoxGraph in FoxPro for MS-DOS, a report form, or a table in cross tabular format.

By default, _GENXTAB uses the program GENXTAB.PRG.


See Also

CREATE QUERY Command

_GENGRAPH System Memory Variable

SELECT Command - SQL


_INDENT System Memory Variable

See Also

Indents first line of each paragraph.

Syntax

_INDENT = <expN>

Remarks

_INDENT is included for backward compatibility.  Use the Report Writer instead.

_INDENT contains a numeric value that instructs the ? command to indent (or outdent) the first line of each paragraph a specified number of characters from the left margin.

_INDENT is active only when _WRAP is set to .T.


See Also

_LMARGIN System Memory Variable

_PLOFFSET System Memory Variable

_RMARGIN System Memory Variable

SET MARGIN Command

_WRAP System Memory Variable


_LMARGIN System Memory Variable

See Also

Sets the left margin.

Syntax

_LMARGIN = <expN>

Remarks

_LMARGIN is included for backward compatibility.  Use the Report Writer instead.

_LMARGIN contains a numeric value that determines the position of the left margin for output generated with the ? command.  Valid _LMARGIN values range from 0 to 254.

When you send output to the printer, the _LMARGIN value represents the number of additional spaces between the current page off-set and the text.  The page offset is determined by _PLOFFSET or  SET MARGIN.

_LMARGIN is active only when _WRAP is set to .T.


See Also

?|?? Commands

_INDENT System Memory Variable

_PLOFFSET System Memory Variable

_RMARGIN System Memory Variable

SET MARGIN Command

_WRAP System Memory Variable


_MAC System Memory Variable

See Also

Contains true (.T.) if you are using FoxPro for Macintosh.

Syntax

_MAC = <expL>

Remarks

_MAC contains a logical true (.T.) if you are using FoxPro for Macintosh.  _MAC contains a logical false (.F.) if you are using a different FoxPro version (FoxPro for MS-DOS, FoxPro for UNIX or FoxPro for Windows).

The value contained in _MAC cannot be changed with STORE or =.


See Also

_DOS System Memory Variable

_UNIX System Memory Variable

VERSION( ) Function

_WINDOWS System Memory Variable


_MLINE System Memory Variable

See Also

Sets the memo field offset for the MLINE( ) function.

Syntax

_MLINE=<expN>

Remarks

MLINE( ) returns one line of text from a memo field.  MLINE( ) stores the location of its memo field offset to the _MLINE system memory variable.  Use _MLINE as the second numeric argument in the MLINE( ) function to increase the performance of MLINE( ).

The startup default value for _MLINE is 0.  Be sure to reset _MLINE to 0 before using _MLINE again with the MLINE( ) function.

For more information about the use of _MLINE and an example of its use, see the MLINE( ) Function.


See Also

MEMLINES( ) Function

MLINE( ) Function

SET MEMOWIDTH Command


_PADVANCE System Memory Variable

See Also

Sets the page advance method.

Syntax

_PADVANCE = <expC>

Remarks

_PADVANCE is included for backward compatibility.  Use the Report Writer instead.

_PADVANCE contains a character value that determines whether FoxPro advances to the top of a page by using a form feed character or by using line feeds.

<expC> must evaluate to one of the following:

FORMFEED   Sends a form feed character when the page advances.  FORMFEED is the default.  This option uses the printer's internal top-of-form controls.

LINEFEEDS   Sends a calculated number of line feeds when the page advances.  This option positions the printer at the top of the next page by internally calculating how many line feeds are needed and then sending that number of continuous line feeds.

When calculating how many line feeds to send, FoxPro uses the formula (_PLENGTH - _PLINENO) in the following situations:

When you issue EJECT PAGE without an ON PAGE handler

When you issue EJECT PAGE with an ON PAGE handler and the line position is greater than the ON PAGE line value

When PRINTJOB or ENDPRINTJOB cause _PEJECT to send a page eject to the printer

FoxPro uses the formula (_PLENGTH - MOD(PROW( ), _PLENGTH)) when you issue:

EJECT

SET DEVICE TO PRINTER and force an eject with a subsequent @ ... SAY

Despite the setting of _PADVANCE, you can always send a form feed character to the printer by outputting CHR(12).


See Also

EJECT Command

_PEJECT System Memory Variable

_PLENGTH System Memory Variable

_PLINENO System Memory Variable

PROW( ) Function


_PAGENO System Memory Variable

See Also

Returns or sets current page number.

Syntax

_PAGENO = <expN>

Remarks

_PAGENO contains a numeric value that determines the current page number.  The startup default is 1.  _PAGENO allows you to print page numbers in streaming output without defining, initializing and incrementing a memory variable for that purpose.

<expN> can be a value from 1 to 32,767, inclusive.  _PAGENO, _PBPAGE and _PEPAGE work in unison.  If _PAGENO is set (or incremented) such that it falls outside the range of _PBPAGE to _PEPAGE, FoxPro doesn't print any pages.


See Also

ON PAGE Command

_PBPAGE System Memory Variable

_PEPAGE System Memory Variable

_PLENGTH System Memory Variable

_PLINENO System Memory Variable


_PBPAGE System Memory Variable

See Also

Returns or sets first page to print.

Syntax

_PBPAGE = <expN>

Remarks

_PBPAGE is included for backward compatibility.  Use the Report Writer instead.

_PBPAGE contains a numeric value that determines the first page to print.  When _PBPAGE is greater than _PAGENO, no pages print.  Instead, FoxPro produces pages internally and increments _PAGENO and other system memory variables.  When _PAGENO reaches the value of _PBPAGE, printing begins.

The _PBPAGE value can range from 1 to 32,767, inclusive.  The startup default is 1.  The value of _PBPAGE must be less than or equal to _PEPAGE.


See Also

_PAGENO System Memory Variable

_PEPAGE System Memory Variable

PRINTJOB ... ENDPRINTJOB Command


_PCOLNO System Memory Variable

See Also

Returns or sets current column number.

Syntax

_PCOLNO = <expN>

Remarks

_PCOLNO is included for backward compatibility.  Use the Report Writer instead.

_PCOLNO contains a numeric value that establishes the current column position.  You can use _PCOLNO to determine the next column address for output.  As FoxPro sends output to the print device, it automatically increments the _PCOLNO value to indicate the current column position.

You can assign any integer value to _PCOLNO, from 0 to 255, in order to position output to a desired column.  Assigning a value to _PCOLNO has the same effect as using the AT clause of the ? command.


See Also

? | ?? Commands

PCOL( ) Function

_PLINENO System Memory Variable

SET PRINTER Commands


_PCOPIES System Memory Variable

See Also

Returns or sets number of copies to print.

Syntax

_PCOPIES = <expN>

Remarks

_PCOPIES is included for backward compatibility.  Use the Report Writer instead.

_PCOPIES contains a numeric value that determines how many copies of the output print.  <expN> can be a value from 1 to 32,767, inclusive.  The startup default is 1.

_PCOPIES has an effect only when you use it with PRINTJOB ... ENDPRINTJOB, and therefore has an effect only in FoxPro programs.  Place the _PCOPIES assignment statement before the PRINTJOB to set the number of copies to print.


See Also

PRINTJOB ... ENDPRINTJOB Command


_PDRIVER System Memory Variable

See Also

Specifies a printer driver program for character-based reports.

Syntax

_PDRIVER = <expC>

Remarks

You can specify a printer driver program for character-based reports by storing the name of the program to _PDRIVER. Character-based reports are created in FoxPro for MS-DOS and can be run in FoxPro for Windows and FoxPro for Macintosh. In FoxPro for Macintosh, a printer driver program isn't necessary to print character-based reports created in

Storing the name of a printer driver program to _PDRIVER unloads the current printer driver program if one is loaded.  When you store a printer driver program name in _PDRIVER, the PDONUNLOAD procedure in the currently loaded printer driver program executes (if it has a PDONUNLOAD procedure).  The printer driver you store to _PDRIVER then loads, and its PDONLOAD procedure executes (if it has a PDONLOAD procedure).

When you store a printer driver program to _PDRIVER, the message "Printer driver installed" appears.  To suppress this message, issue SET NOTIFY OFF before you store a printer driver program name to _PDRIVER.


See Also

??? Command

SET PDSETUP Command


_PDSETUP System Memory Variable

See Also

Loads or clears a printer driver setup for character-based reports.

Syntax

_PDSETUP = <expC>

Remarks

_PDSETUP loads a printer driver setup or clears the current printer driver setup.  A printer driver setup is a combination of settings that includes the printer driver program and printing information, such as page orientation, default font size and style, margins and so on.  A printer driver setup is used in FoxPro for Windows when printing character-based reports created in FoxPro for MS-DOS. In FoxPro for Macintosh, a printer driver setup isn't necessary to print character-based reports created in FoxPro for MS-DOS.

Printer driver setups are stored in your FOXUSER.DBF resource file and you can interactively create them and assign them names in the Printer Setup Editing dialog.

You can also load or clear a printer driver setup with SET PDSETUP.  To load a printer driver setup, store the name of the setup in _PDSETUP.  You can clear the current printer driver setup by storing the null string in _PDSETUP.  Storing the null string in _PDSETUP also clears the _PDPARMS array from memory.

If the printer driver setup name you store in _PDSETUP does not exist in your resource file, the current printer setup interface application executes.  If you are using GENPD.APP, the default printer setup interface application included with FoxPro, the Printer Setup Editing dialog appears so you can create a setup with the name you specified.

When the printer driver setup name you include in <expC> does not exist in your resource file, you can prevent the printer driver setup application from executing by preceding the setup name with a dash (-).

To load a default printer driver setup when you start FoxPro for MS-DOS, include the following line in your CONFIG.FP file.

PDSETUP = '<setup name>' WITH <parm list>

Be sure to enclose the setup name in quotation marks.


See Also

_GENPD System Memory Variable

_PDRIVER System Memory Variable

SET PDSETUP Command

SET PRINTER Commands


_PECODE System Memory Variable

See Also

Sets ending print codes.

Syntax

_PECODE = <expC>

Remarks

_PECODE is included for backward compatibility.  Use the Report Writer instead.

_PECODE contains a character value that is output when ENDPRINTJOB is executed.  <expC> can contain any collection of print codes up to a maximum of 255 characters.  The default _PECODE is the null string.  Valid codes range from 0 to 255.

Consult your printer manual for complete information on the effects of specific control code sequences.


See Also

??? Command

PRINTJOB ... ENDPRINTJOB Command

_PSCODE System Memory Variable


_PEJECT System Memory Variable

See Also

Sets occurrence of page eject.

Syntax

_PEJECT = <expC>

Remarks

_PEJECT is included for backward compatibility.  Use the Report Writer instead.

_PEJECT contains a character value that determines when FoxPro sends a page eject during output.

<expC> must evaluate to one of the following:

BEFORE	Sends a page eject before starting output.

AFTER	Sends a page eject after output is complete.

BOTH	Sends a page eject before and after print output.

NONE	Sends no page eject before or after print output.

If <expC> is a literal character string, it must be enclosed in quotation marks.

You can set _PEJECT in the Command window or during program execution, but it only has an effect within the PRINTJOB ... ENDPRINTJOB command structure.


See Also

EJECT Command

EJECT PAGE Command

_PADVANCE System Memory Variable

_PECODE System Memory Variable

PRINTJOB ... ENDPRINTJOB Command

_PSCODE System Memory Variable


_PEPAGE System Memory Variable

See Also

Returns or sets ending page number.

Syntax

_PEPAGE = <expN>

Remarks

_PEPAGE is included for backward compatibility.  Use the Report Writer instead.

_PEPAGE contains a numeric value that determines the last page to print.  When _PAGENO reaches a value that is greater than the value stored in _PEPAGE, FoxPro halts the output of data.

The _PEPAGE value can range from 1 to 32,767, inclusive.  The value of _PEPAGE cannot be less than _PBPAGE.  The startup default is 32,767.  Use _PEPAGE in conjunction with _PBPAGE to print a range of pages.  If, for example, you want to print only one page of a long report, you can store the page number in _PBPAGE and _PEPAGE and only the specified page prints.


See Also

_PAGENO System Memory Variable

_PBPAGE System Memory Variable

PRINTJOB ... ENDPRINTJOB Command


_PLENGTH System Memory Variable

See Also

Returns or sets length of page.

Syntax

_PLENGTH = <expN>

Remarks

_PLENGTH is included for backward compatibility.  Use the Report Writer instead.

_PLENGTH contains a numeric value that determines the number of output lines per page.  The _PLENGTH value can range from 1 to 32,767, inclusive.  The default is 66.  Use _PLENGTH in conjunction with _PLINENO to determine when a page eject is needed.


See Also

EJECT Command

EJECT PAGE Command

ON PAGE Command

_PADVANCE System Memory Variable

_PLINENO System Memory Variable


_PLINENO System Memory Variable

See Also

Returns or sets current line number.

Syntax

_PLINENO = <expN>

Remarks

_PLINENO is included for backward compatibility.  Use the Report Writer instead.

_PLINENO contains a numeric value that establishes the current line position.  Use _PLINENO to determine the next line for output.  As FoxPro sends output to the current print device, it increments _PLINENO to indicate the current position.  <expN> can be a value ranging from 0 to (_PLENGTH - 1).

Unlike the PROW( ) function, which returns the current position of the printhead and is not incremented when SET PRINTER is OFF, FoxPro increments _PLINENO whenever output goes to a printer, the screen or a file.  SET PRINTER has no effect on _PLINENO.


See Also

_PCOLNO System Memory Variable

PCOL( ) Function

_PLENGTH System Memory Variable

PROW( ) Function


_PLOFFSET System Memory Variable

See Also

Sets page offset.

Syntax

_PLOFFSET = <expN>

Remarks

_PLOFFSET is included for backward compatibility.  Use the Report Writer instead.

_PLOFFSET contains a numeric value that determines the number of printer columns (the offset) from the left edge of the paper to the left edge of the text in all printed output.  Output sent to the screen is not affected by _PLOFFSET.  Additional _LMARGIN space is calculated from the _PLOFFSET.

_PLOFFSET can contain a value from 0 to 254.  _PLOFFSET is equivalent to SET MARGIN.  Adjusting either one automatically changes the other.

The setting of _PLOFFSET does not affect reports created with the Report Writer and run with REPORT FORM.  Although _PLOFFSET is adjusted as a report created with the Report Writer runs, it returns to its original value after the report is run.  The Printer Indent setting in the Page Layout dialog of the Report Writer determines the offset from the left edge of the paper.


See Also

_LMARGIN System Memory Variable

SET MARGIN Command


_PPITCH System Memory Variable

See Also

Sets printer pitch.

Syntax

_PPITCH = <expC>

Remarks

_PPITCH is included for backward compatibility.  Use the Report Writer instead.

The GENPD.APP printer driver application provided with FoxPro for MS-DOS does not use _PPITCH.  Any value stored to the _PPITCH system memory value has no effect upon printed output.

_PPITCH is available for your use in a printer driver application that you create.


See Also

_PDRIVER System Memory Variable


_PQUALITY System Memory Variable

See Also

Sets print quality.

Syntax

_PQUALITY = <expL>

Remarks

_PQUALITY is included for backward compatibility.  Use the Report Writer instead.

The GENPD.APP printer driver application provided with FoxPro for MS-DOS does not use _PQUALITY.  Any value stored to the _PQUALITY system memory value has no effect upon printed output.

_PQUALITY is available for your use in a printer driver application that you create.


See Also

_PDRIVER System Memory Variable


_PRETEXT System Memory Variable

See Also

Specifies a character expression to preface text merge lines.

Syntax

_PRETEXT = <expC>

Remarks

With SET TEXTMERGE you can merge text within a program.  You can output lines of text, the contents of memory variables and the results of expressions and functions to the screen, a window, a printer, a text file, or a low-level file.

If you store a character expression to _PRETEXT, the character expression is added to the beginning of the output text line.  To facilitate program indentation, you can store a tab or tabs to _PRETEXT.


See Also

 \ | \\ Commands

SET TEXTMERGE Command

_TEXT System Memory Variable


_PSCODE System Memory Variable

See Also

Sets starting print codes.

Syntax

_PSCODE = <expC>

Remarks

_PSCODE is included for backward compatibility.  Use the Report Writer instead.

_PSCODE contains a character value that is output when PRINTJOB executes.  <expC> can contain any collection of print codes up to 255 characters; the default is the null string.  Valid codes range from 0 to 255.

Consult your printer manual for complete information on the effect of specific control code sequences.


See Also

? | ?? Commands

_PECODE System Memory Variable

PRINTJOB ... ENDPRINTJOB Command


_PSPACING System Memory Variable

See Also

Sets printer line spacing.

Syntax

_PSPACING = <expN>

Remarks

_PSPACING is included for backward compatibility.  Use the Report Writer instead.

_PSPACING contains a numeric value that determines if output is single-, double-, or triple-spaced.  The default is single-spacing (1).  <expN> must be a value from 1 to 3.

You can set _PSPACING from the Command window to alter output from commands such as DISPLAY and LIST.  _PSPACING also controls the height of boxes defined with DEFINE BOX.  A box defined with a height of 5 will have a height of 15 if _PSPACING is set to 3.


See Also

? | ?? Commands

_BOX System Memory Variable

DEFINE BOX Command

_PSCODE System Memory Variable


_PWAIT System Memory Variable

See Also

Sets pause between pages of output.

Syntax

_PWAIT = <expL>

Remarks

_PWAIT is included for backward compatibility.  Use the Report Writer instead.

_PWAIT contains a logical value that determines whether or not the printer pauses between pages of output.  _PWAIT allows printing on single sheets of paper, as opposed to continuous-feed (fan-fold) forms.  When a page is ejected from the printer with EJECT or when _PLINENO exceeds _PLENGTH, FoxPro suspends output to the printer so you can manually insert another sheet of paper.


See Also

EJECT Command

EJECT PAGE Command

_PLENGTH System Memory Variable

_PLINENO System Memory Variable


_RMARGIN System Memory Variable

See Also

Sets right margin.

Syntax

_RMARGIN = <expN>

Remarks

_RMARGIN is included for backward compatibility.  Use the Report Writer instead.

_RMARGIN contains a numeric value that determines the position of the right margin for output generated with the ? command.  The minimum _RMARGIN value is the greater of _LMARGIN + 1 or _LMARGIN + _INDENT + 1.  The maximum _RMARGIN value is 255.  The startup default is 80.

_RMARGIN is active only when _WRAP is set to .T.


See Also

_INDENT System Memory Variable

_LMARGIN System Memory Variable

_PLOFFSET System Memory Variable

SET MARGIN Command

_WRAP System Memory Variable


_SHELL System Memory Variable

See Also

Specifies a program shell.

Syntax

_SHELL = <command>

Remarks

The _SHELL system memory variable is used to prevent access to the Command window while a program is running in the Development version of FoxPro. The DO command with the name of a program to execute is usually stored to _SHELL.

The following example demonstrates how _SHELL is typically used.

A startup program (MYSTART.PRG) is used to launch another program (MYAPP.PRG). MYSTART.PRG stores the command to run MYAPP.PRG to _SHELL, starting MYAPP.PRG. Before FoxPro displays the Command window, _SHELL is checked for a command. If _SHELL contains a command, it is executed and FoxPro then stores the null string to _SHELL.

After the initialization code in MYAPP.PRG is successfully executed, the command to launch MYAPP.PRG is stored again to _SHELL. FoxPro does not execute the command or store the null string to _SHELL, and access to the Command window is prevented. (The Command window cannot be accessed when _SHELL contains anything but the null string).

Before MYAPP.PRG finishes execution, it stores the null string to _SHELL to restore access to the Command window.

*** MYSTART.PRG ***

...

_SHELL = "DO MYAPP.PRG"

*** MYAPP.PRG ***

*** Initialization Code ***

...

*** Initialization Code successfully completed? ***

_SHELL = "DO MYAPP.PRG" && Prevents access to Command window

...

*** Clean up Code ***

_SHELL = ""

You can also specify a command to execute when FoxPro is started by placing the SHELL configuration item in your FoxPro configuration file.


See Also

DO Command

_STARTUP System Memory Variable


_STARTUP System Memory Variable

See Also

Specifies a start up application.

Syntax

_STARTUP = <program name>

Remarks

The system memory variable _STARTUP contains the name of the application that executes when you start FoxPro.  By default, this application is FOXSTART.APP, an application supplied with FoxPro that adds the Run menu to the main menu bar.  If FOXSTART.APP is not in the directory where FoxPro executable files reside, _STARTUP contains the null string.

To execute your own application when FoxPro starts, save a copy of the original FOXSTART.APP under a different name or in a different directory.  Then, change the name of your application to FOXSTART.APP.

You can also specify a command or program to execute when FoxPro starts by including one of the following in your configuration file:

COMMAND = <command>

or

COMMAND = DO <program>

A startup application always executes before a command or program specified in your configuration file.  For additional information on configuring FoxPro, see the Customizing FoxPro chapter in the FoxPro Installation and Configuration manual.


See Also

Configuring FoxPro for Macintosh


_TABS System Memory Variable
_TABS

See Also

Specifies tab settings.

Syntax

_TABS = <expC>

Remarks

_TABS is included for backward compatibility.  Use the Report Writer instead.

_TABS contains a character value that determines where tab stops appear in printed output.  <expC> represents a tab list which is a series of comma-delimited numbers in ascending order.  By default, _TABS contains the null string, which sets the _TABS spacing at eight character intervals (8,16,24,32,40, and so on).

When _WRAP is set to .T., FoxPro ignores any _TABS values greater than or equal to _RMARGIN.  The TABS statement that you include in your configuration file is equivalent to _TABS, and specifying a TABS value automatically sets the value in _TABS.


See Also

_INDENT System Memory Variable

_WRAP System Memory Variable


_TALLY System Memory Variable

See Also	Example

Returns number of records processed by the most recently executed table command.

Syntax

_TALLY = <expN>

Remarks

Certain table processing commands return information about their status ("talk") while they execute.  When such a command finishes executing, it displays the number of records it processed (if you have SET TALK ON), and stores this number to the _TALLY system memory variable.

The following commands return status information:

APPEND FROM	PACK

AVERAGE	REINDEX

CALCULATE	REPLACE

COPY TO	SELECT - SQL

COUNT	SORT

DELETE	SUM

INDEX	TOTAL

JOIN	UPDATE

When you start FoxPro, _TALLY is set to zero.  Executing one of the commands above replaces the _TALLY value with the number of records the command processed.


_TALLY  Example

This example uses SELECT to return the number of customers in California.  The result is automatically stored to _TALLY.  The _TALLY value is displayed.

SELECT * FROM customer ;
WHERE state = 'CA' ;
INTO CURSOR temp

? _TALLY


See Also

SET ODOMETER Command

SET TALK Command


_TEXT System Memory Variable

See Also	Example

Directs output from the \ | \\ and TEXT ... ENDTEXT text merge commands to a low-level file.

Syntax

_TEXT = <expN>

Remarks

\ | \\ and TEXT ... ENDTEXT facilitate the merging of text with the contents of table files, memory variables and the results of functions and expressions.  Output generated by these text merge commands can be directed to the screen or a window or to a low-level file.  The _TEXT system memory variable lets you direct text merge output from these commands to a low-level file.

To send output from the \ and \\ and TEXT ... ENDTEXT text merge commands to a low-level file, include the TO <file> clause in SET TEXTMERGE.  The file handle of <file> is stored to _TEXT.  If the file handle of another low-level file was previously stored in _TEXT, that low-level file is closed.

FCREATE( ) creates and opens low-level files and FOPEN( ) opens existing files.  These functions return a positive file handle if the file is successfully created or opened.  Storing this file handle to _TEXT directs any subsequent output from the \, \\ and TEXT ... ENDTEXT text merge commands to the file.  Use STORE or = to store a file handle to _TEXT.  You must open a low-level file with write privileges in order for it to accept output from the text merge commands.

You can close low-level files with FCLOSE( ) or CLOSE ALL.  You can also use SET TEXTMERGE TO without a file name to close the low-level file whose handle is stored in _TEXT.

The startup default value of _TEXT is -1.  If you are directing text merge output to a file whose file handle is stored in _TEXT, you can turn off the output to that file without closing the file by storing -1 to _TEXT.  By storing different file handles and -1 to _TEXT, you can direct text merge output to alternate files.


_TEXT  Example

The following program demonstrates how to direct text merge output to alternate files:

SET TALK OFF
SET TEXTMERGE ON NOSHOW	&& Enable text merge, no output to screen
SET TEXTMERGE DELIMITERS TO	&& Default text merge delimiters <<,>>

SET TEXTMERGE TO date.txt	&& Create and send output to date.txt
STORE _TEXT TO mdatehandl	&& Save date.txt's file handle
STORE -1 TO _TEXT	&& Output off to date.txt; keep it open

SET TEXTMERGE TO time.txt	&& Create and send output to time.txt
STORE _TEXT TO mtimehandl	&& Save time.txt's file handle

*** Send the following text to time.txt ***

\The time is:

STORE mdatehandl TO _TEXT 	&& Now direct output to date.txt

*** Send the following text to date.txt ***

\Today's date is:

STORE mtimehandl TO _TEXT	&& Now direct output to time.txt

*** Output the time on the same line ***

\\ <<TIME( )>>
STORE mdatehandl TO _TEXT	&& Now direct output to date.txt

*** Output the date on the same line ***

\\ <<DATE( )>>

CLOSE ALL	&& Close all files
TYPE date.txt	&& See what's in this file...
WAIT WINDOW	&& Pause
TYPE time.txt	&& ...and what's in this file
ERASE date.txt
ERASE time.txt


See Also

\ | \\ Commands

FOPEN( ) Function

FCLOSE( ) Function

FCREATE( ) Function

_PRETEXT System Memory Variable

SET TEXTMERGE Command

SET TEXTMERGE DELIMITERS Command


_THROTTLE System Memory Variable

See Also

Specifies the execution speed of programs when the Trace window is open.

Syntax

_THROTTLE = <expN>

Remarks

The Trace window, one of the debugging tools available in FoxPro, displays a program's source code as the program executes.  The Trace window highlights each line in the program when the line executes.  The numeric value of _THROTTLE determines the delay between execution of each program line when the Trace window is open.  The Trace Between Breaks option on the Trace window's Program menu must be on for a delay to occur between execution of program lines. In FoxPro for MS-DOS a diamond appears, and in FoxPro for Windows and FoxPro for Macintosh, a check mark appears beside the Trace Between Breaks option when it is on.

The value of _THROTTLE is the delay in seconds between execution of each program line.  The startup default for _THROTTLE is 0, with no pause between execution of program lines.  _THROTTLE can range from 0 to 5.5 seconds.  For example, if _THROTTLE is set to 0.5 seconds, a 1/2 second delay occurs between execution of each program line.

You can also adjust the program execution delay by selecting the Throttle... option from the Trace window's Program menu.


See Also

SET DEBUG Command

SET STEP Command


_TRANSPORT System Memory Variable

See Also

Specifies the program to transport FoxPro 2.0 screens, labels and reports across different FoxPro platforms and versions.

Syntax

_TRANSPORT = <program name>

Remarks

By default, _TRANSPORT contains TRANSPRT.PRG, the screen, label and menu conversion program installed in your FoxPro directory or folder.

The program you specify with _TRANSPORT runs when you attempt to open a FoxPro 2.0 screen, label or report created in an earlier FoxPro version or on a different FoxPro platform. To specify a program other than TRANSPRT.PRG to transport your screens, labels and reports, store the program's name in _TRANSPORT.  If your conversion program is in a directory other than the current default directory, include the path with the program name.

If you rename TRANSPRT.PRG or move it to another directory, store the new file name and/or its directory in _TRANSPORT.

You can also specify a conversion program in your FoxPro configuration file by including the following line:

_TRANSPORT = <file name>

<file name> specifies the name of your conversion program and can include a path.

If you write your own transporter, it must accept one parameter [image] the name of the report, label or screen form to transport.  Your transporter must return one parameter.  The parameter can be one of the following values:

Return Code	Meaning

1	Successfully transported.

2	Opened without transporting.

3	Transportation canceled.

For more information about transporting screens, labels and reports, refer to the "Transporting Files Platforms" chapter in the FoxPro Developer's Guide.


See Also

CREATE LABEL Command

CREATE REPORT Command

CREATE SCREEN Command


_UNIX System Memory Variable

See Also

Contains a logical true (.T.) if you are using FoxPro for UNIX.

Syntax

_UNIX = <expL>

Remarks

The _UNIX  system memory variable contains a logical true (.T.) if you are using FoxPro for _UNIX.  _UNIX contains a logical false (.F.) if you are using a different FoxPro version (FoxPro for MS-DOS, FoxPro for Macintosh or FoxPro for Windows).

The value contained in _UNIX cannot be changed with STORE or =.


See Also

_DOS System Memory Variable

_MAC System Memory Variable

VERSION( ) Function

_WINDOWS System Memory Variable


_WINDOWS System Memory Variable

See Also

Contains true (.T.) if you are using FoxPro for Windows.

Syntax

_WINDOWS = <expL>

Remarks

The _WINDOWS system memory variable contains a logical true (.T.) if you are using FoxPro for Windows.  _WINDOWS contains a logical false (.F.) if you are using a different FoxPro version (FoxPro for MS-DOS, FoxPro for Macintosh or FoxPro for UNIX).

The value contained in _WINDOWS cannot be changed with STORE or =.


See Also

_DOS System Memory Variable

_MAC System Memory Variable

_UNIX System Memory Variable

VERSION( ) Function


_WRAP System Memory Variable

See Also

Sets word wrap.

Syntax

_WRAP = <expL>

Remarks

_WRAP is included for backward compatibility.  Use the Report Writer instead.

_WRAP contains a logical value that determines whether or not output automatically word wraps.  By default, _WRAP is set to .F.

When _WRAP is set to .T., output from the ? command that would extend beyond the right margin (_RMARGIN) automatically wraps to the left margin (_LMARGIN).  _WRAP must be set to .T. before _ALIGNMENT, _INDENT, _LMARGIN and _RMARGIN have any effect on output.


See Also

_ALIGNMENT System Memory Variable

_INDENT System Memory Variable

_LMARGIN System Memory Variable

_RMARGIN System Memory Variable


Controls Overview

See Also

Controls supply or request information and can designate, confirm or cancel actions.  They can appear on the desktop in FoxPro for MS-DOS, in the main FoxPro window and in user-defined windows and dialogs.  Check boxes, radio buttons and popups are examples of commonly used controls.

If you use the Screen Builder to create your data entry screens, you may not have to use the commands to create controls at all.  The Screen Builder automatically generates the commands that create the controls.

Most controls are created with different variations of @ ... GET.  Text editing regions are created with @ ... EDIT.  Issue READ or READ CYCLE to activate controls.

The FoxPro interface uses controls extensively.  The FoxPro User's Guide and the FoxPro Getting Started manuals describe controls and their operation.

Control Summary

Here is a summary of each FoxPro control and its use.  FoxPro controls include check boxes, invisible buttons, list, popups, push buttons, radio buttons, spinners and text editing regions.

Check Boxes

On the screen, a check box is a box with descriptive text to the right.

In FoxPro for Windows and FoxPro for Macintosh, a picture file can be used as a check box.

Invisible Buttons

Invisible buttons are rectangular regions in the main FoxPro window or a user-defined window that you can select and choose.  Characters and pictures (in FoxPro for Windows and FoxPro for Macintosh) are often placed over the "hot" invisible button regions, allowing you to create custom designed buttons.

Use @ ... SAY to place characters and pictures over the invisible buttons.

Lists

A list is a vertical list of options inside a box, often with a scroll bar to the right.  Lists are often used to display the directories, files or fields from which you can choose.

Popups

A popup is a rectangle containing a set of options.  When you select a popup, FoxPro displays a list of options, only one of which you can choose.

Push Buttons

In FoxPro for MS-DOS, a push button is descriptive text that you can choose.

In FoxPro for Windows and FoxPro for Macintosh, a push button is a raised rectangle with text on top, and pictures can be used as push buttons.

Typically, a push button is used to trigger an action.

Radio Buttons

As their name suggests, radio buttons are similar to the buttons of a car radio.  Choosing a button makes your choice current and releases your previous choice.  A bullet in a button indicates that it is the current choice.

Radio buttons are typically used to display several options, of which you can choose only one.

In FoxPro for Windows and FoxPro for Macintosh, pictures can be used as radio buttons.

Spinners

A spinner is a control that lets you "spin" through a set of numeric values displayed in a text box.  Clicking on the Up and Down Arrows changes the numeric value.  You can also enter a value directly into the spinner's text box.  The value in the spinner is stored to a memory variable, an array element or a field.

Spinners are available only in FoxPro for Windows and FoxPro for Macintosh.

Text-Editing Regions

A text editing region is a rectangular region in which you can modify or enter text.  The text you enter is stored to a memory variable, an array element or a field.

All standard FoxPro editing features, such as cutting, copying and pasting, are available in a text editing region.  Unlike other FoxPro controls, this command uses EDIT in its syntax instead of GET.

Text editing regions are typically used to update and modify memo fields and long character fields.

How They Work

The @ ... GET command creates most controls  (@ ... EDIT creates text editing regions).  The FUNCTION and PICTURE clauses of @ ... GET determine which type of control is created.  The FUNCTION and PICTURE clauses also contain the prompts associated with most kinds of controls.

Many controls trigger an action.  The action to be taken is specified by the VALID clause.

Controls are activated by READ or READ CYCLE.  Depending on the options you specify, READ or READ CYCLE can either terminate or continue when a control is chosen.

Hot Keys

You can define hot keys for check boxes, popups, push buttons and radio buttons.  Hot keys provide a shortcut method of choosing a button or option.  A hot key is a key that you can press to immediately choose the desired item.  The hot key usually corresponds to first letter in a prompt or option; the letter is highlighted (FoxPro for MS-DOS) or underlined (FoxPro for Windows).

A hot key is created by placing a back slash and a less than sign (\<) before the hot key character.  Place any other special characters (\!, \?, ...) before the \< hot key designator.  For example:

\!\<Hot key

Disabled Controls

To make a control (or part of it) unavailable for use, you can disable it.  Disabled controls, buttons and options appear in disabled colors and cannot be selected or chosen.

Syntax Summary

A table summarizing the different syntax, options, and defaults for the various controls is available in the Controls topic in the FoxPro Language Reference.


Controls SeeAlso
See Also

@ ... GET - Check Boxes Command

@ ... GET - Invisible Buttons Command

@ ... GET - Lists Command

@ ... GET - Popups Command

@ ... GET - Push Buttons Command

@ ... GET - Radio Buttons Command

@ ... GET - Spinners Command

@ ... EDIT - Text Edit Regions Command


RGBSCHEME( ) Function

See Also	Example

Returns an RGB color pair or an RGB color pair list from a specified color scheme.

Syntax

RGBSCHEME(<expN1>[, <expN2>])

Returns

Character

Remarks

Use SCHEME( ) to return a traditional color pair or a color pair list from a color scheme.  RGB color pairs use numeric values to specify colors, traditional color pairs use letters to specify colors.

Parameters

<expN1>

<expN1> is the number of the color scheme for which you want a complete RGB color listing.  10 RGB color pairs are returned.

<expN2>

Include <expN2> to return a single RGB color pair from a color scheme.  The position of the RGB color pair in the color scheme is specified with <expN2>.  For example, if <expN2> is 4, the fourth RGB color pair is returned.


RGBSCHEME( ) Example

The following command returns the third RGB color pair from color scheme number 4:

? RGBSCHEME(4,3)


RGBSCHEME() SeeAlso
See Also

SCHEME( ) Function

SET COLOR Commands Overview


SET COLOR Commands Overview

See Also

FoxPro offers a sophisticated set of commands for full control of colors.

In FoxPro for MS-DOS, you can define the colors of elements of the FoxPro system interface (the system menu bar, windows, alerts, dialogs, and so on) and user-defined objects (controls, menus, windows, and so on).  You can set colors directly with the SET COLOR commands or interactively with the Color Picker dialog, which is available by choosing Color... from the Window menu.  The Color Picker dialog provides the fastest way to set colors and allows you to save color sets for later use.  See the FoxPro User's Guide for more information on setting colors with the Color Picker dialog see the "Window Menu" chapter in the FoxPro for MS-DOSUser's Guide.

By default, FoxPro for Windows and FoxPro for Macintosh take their colors from the Control Panel settings. The Control Panel colors are mapped to the FoxPro color schemes.  The colors can be overwritten using the FoxPro SET COLOR commands described in this section.

In FoxPro for Windows and FoxPro for Macintosh, you can set colors directly with the SET COLOR commands or interactively in the Control Panel.  Refer to your Windows or Macintosh documentation for more information about setting colors with the Control Panel.

Certain commands, like DEFINE WINDOW, support optional COLOR and COLOR SCHEME clauses that let you specify colors of user-defined objects directly.  The following terms are used in the descriptions of the SET COLOR commands.

Color Pair

A color pair consists of codes that specify the foreground and background colors.  The following table lists the colors that are available and their codes:

Color	Code

Black	N

Blank	X

Blue	B

Brown	GR

Cyan	BG

Green	G

Inverse	I

Magenta	RB

Red	R

White	W

Yellow	GR+

Underlined	U

An asterisk (*) can be used to denote blinking or bright (depending on your video hardware and the BLINK setting) for the background color.  In FoxPro for Windows, including an asterisk always makes the background bright.  A plus sign (+) denotes high intensity for the foreground color.

On monochrome monitors, only four colors are available: white (W), black (N), underlined (U) and inverse video (I).  The blank (X) color is useful for entering passwords.

A color pair can also be specified with a set of 6 RGB (Red Green Blue) color values separated by commas.  The first 3 color values specify the foreground color and the second 3 color values specify the background color.  The color values can range from 0 through 255.

The R/W color pair in the example above can also be specified with this RGB color pair:

RGB(255,0,0,255,255,255)

Color Pair List

A color pair list consists of one to ten color pairs separated by commas.  For example, in FoxPro for MS-DOS:

W+/B, W+/BG, GR+/B, GR+/B, R+/B, W+/GR, GR+/RB, N+/N, GR+/B, R+/B

A color pair list for a monochrome monitor might look like this:

W/N, N+/W, W+/N, W+/N, W/N, U+/N, W+/N, -, W+/N, W/N

Color pair lists for monochrome monitors may have a dash (-) in the eighth color pair location to indicate that a shadow isn't present.

Color pairs can also be specified as a set of RGB (red, green and blue) values. A set of RGB color values looks like this:

RGB(0,255,0,255,0,0), RGB(127,255,0,0,0,0), ...

Color Scheme

A color scheme is a set of 10 color pairs.  In FoxPro for MS-DOS, color schemes control the colors of interface elements such as system windows, user-defined windows, menus, etc.  Each color pair corresponds to an item in a color scheme.  Use SCHEME( ) to return the color pairs for a color scheme.

When FoxPro for MS-DOS is first started, a default set of color schemes is loaded.  You can specify you own startup color schemes in your FoxPro configuration file.  Include the following line for each color scheme you want to change.

COLOR OF SCHEME <expN> = <color pair list>

When FoxPro for Windows and FoxPro for Macintosh are started, the Control Panel color settings are loaded into the FoxPro color schemes.  You can specify you own colors.  Not all FoxPro for Windows and FoxPro for Macintosh interface elements can be controlled by color schemes.  FoxPro for Windows and FoxPro for Macintosh system windows (View and Command Windows, the system menu bar, etc.) are always controlled by the Windows Control Panel color settings.

Color Set

A color set consists of 24 color schemes.  You can save the complete color environment in a color set.  Color sets, like keyboard macros and memory variables, can be saved for later use.  You can assign to a color set a name up to 10 characters long.  Color sets are stored in the FOXUSER.DBF resource file.

You can load a color set with SET COLOR SET TO.  In FoxPro for MS-DOS, you can also load a color set with the Color Picker dialog.

When FoxPro is first started, a default color set is loaded unless a different color set is specified in your FoxPro configuration file.  To specify a startup color set in your configuration file, include the following line:

COLOR SET = <colorsetname>


SET COLOR Commands SeeAlso
See Also

CREATE COLOR SET Command

SET COLOR OF SCHEME Command

SET COLOR SET Command

SET COLOR TO Command

Colors


_SPELLCHK System Memory Variable

See Also

Specifies a spelling check program.

Syntax

_SPELLCHK = <program name>

Remarks

_SPELLCHK is supported in FoxPro for Windows and FoxPro for Macintosh only.

_SPELLCHK lets you specify the program or application that FoxPro uses to check the spelling of text in the FoxPro text editor.  By default, _SPELLCHK uses the application supplied with FoxPro, SPELLCHK.APP.

To specify a different spelling check program, store the program's name in _SPELLCHK.  If your spelling check program is in a directory other than the current default directory, include a path with the program name.

If you rename SPELLCHK.APP or move it to another directory, store the new spelling check program name and its path in _SPELLCHK.

You can also specify a spelling check program in your FoxPro for Windows CONFIG.FPW configuration file.  Include the line:

_SPELLCHK = <program name>

The name of your spelling check program is specified with <program name> and can include a path to the spelling check program.

Ordinarily you won't need to use _SPELLCHK.  If you write a different version of a spelling check program, you can have FoxPro run your spelling check program by storing its name in _SPELLCHK.


_SPELLCHECK SeeAlso
See Also

MODIFY COMMAND / MODIFY FILE Commands

MODIFY MEMO Command


ON SHUTDOWN Command

See Also

Specifies a command that executes when you try to exit FoxPro for Windows, FoxPro for Macintosh, Microsoft Windows or the Macintosh.

Syntax

ON SHUTDOWN
[<command>]

Remarks

ON SHUTDOWN is supported in FoxPro for Windows and FoxPro for Macintosh.

The command you specify in ON SHUTDOWN is executed if you try to exit FoxPro for Windows by double-clicking the FoxPro Control-menu box, choosing Exit from the FoxPro Control menu or issuing QUIT in the Command window or in a program.

If you try to exit Microsoft Windows from the Windows Program Manager while FoxPro for Windows is open, control is returned to FoxPro for Windows and the command you specify in ON SHUTDOWN is executed.

The command you specify in ON SHUTDOWN is executed if you try to exit FoxPro for Macintosh by choosing Quit from the File menu or issuing QUIT in the Command window or in a program.

If you try to shut down your Macintosh from the Finder while FoxPro for Macintosh is open, control is returned to FoxPro for Macintosh and the command you specify in ON SHUTDOWN is executed.

The ON SHUTDOWN command is typically a DO command that executes a routine to display a dialog.  The dialog asks if you are sure you want to exit the current application and FoxPro for Windows.  If you want to exit the application, the routine can close open files, clean up the FoxPro environment and then execute QUIT.  If you don't want to exit the current application, the routine can return control back to the application.

Clause

<command>

The command specified with ON SHUTDOWN executes when you try to exit FoxPro for Windows, FoxPro for Macintosh, Microsoft Windows or the Macintosh.

Issue ON SHUTDOWN without <command> to release the current ON SHUTDOWN command.


ON SHUTDOWN SeeAlso
See Also

QUIT Command


CPCONVERT( ) Function

See Also

Converts the character expression <expC> from one code page (<expN1>) to another (<expN2>).

Syntax

CPCONVERT(<expN1>, <expN2>, <expC>)

Remarks

If the variable x contains a character that on the Macintosh (in code page 10000) would look like ä, then this command will return a character that will look like ä when viewed under the ANSI character set (code page 1252) in Microsoft Windows.

CPCONVERT(10000, 1252, x)

CPCONVERT( ) is commonly used to translate character or memo fields or character expressions to the current code page. Use CPCURRENT( ) to determine the current code page. Note that CPCONVERT( ) isn't required for normal cross-platform functioning of the product. It is strictly used to access the underlying translation facilities of FoxPro.

CPCONVERT( ) is new to FoxPro 2.5A.


CPCONVERT( ) Function See Also
See Also

CPCURRENT( ) Function

CPDBF( ) Function

International Settings

International and Cross-Platform Features

MODIFY COMMAND / MODIFY FILE Commands

SET NOCPTRANS Command


CPCURRENT( ) Function

See Also

Returns the code page setting (if any) in your configuration file, or returns the current operating system code page.

Syntax

CPCURRENT([1 | 2])

Remarks

CPCURRENT( ) returns one of the following:

0 if the CODEPAGE configuration item isn't included in your configuration file.

The code page number specified in the CODEPAGE configuration item. For example, CPCURRENT( ) returns 852 if the following line is included in your configuration file:

CODEPAGE = 852

The current operating system code page if you have included the following line in your configuration file:

CODEPAGE = AUTO

In FoxPro for Windows, CPCURRENT(1) returns the Windows code page, regardless of your configuration CODEPAGE setting. In other FoxPro versions, CPCURRENT(1) returns the current operating system code page, regardless of your configuration CODEPAGE setting.

CPCURRENT(2) always returns the current operating system code page, regardless of your configuration CODEPAGE setting.

CPCURRENT( ) is new to FoxPro 2.5A.


CPCURRENT( ) Function See Also
See Also

CPCONVERT( ) Function

CPDBF( ) Function

International Settings

International and Cross-Platform Features

MODIFY COMMAND / MODIFY FILE Commands

SET NOCPTRANS Command


CPDBF( ) Function

See Also

Returns the code page with which an open table has been marked.

Syntax

CPDBF([<expC> | <expN>])

Remarks

Include <expC> or <expN> if the table you specify is open in a work area other than the current work area. <expN> is the work area number and <expC> is the table alias. CPDBF( ) returns 0 if a table isn't open in the work area you specify. If a table doesn't have the alias you specify with <expC>, the message "Alias not found" is displayed.

DISPLAY STRUCTURE also displays the code page with which an open table has been marked.

CPDBF( ) is new to FoxPro 2.5A.


CPDBF( ) Function See Also
See Also

CPCONVERT( ) Function

CPCURRENT( ) Function

International Settings

International and Cross-Platform Features

MODIFY COMMAND / MODIFY FILE Commands

SET NOCPTRANS Command


IDXCOLLATE( ) Function

See Also

Returns the collation sequence for an index or index tag.

Syntax

IDXCOLLATE([<.cdx file>,] <expN1> [, <expN2> | <expC>])

Remarks

This function allows you to completely delete an index file and rebuild it correctly, using a series of SET COLLATE and INDEX commands.

Note that this function isn't required for the proper functioning of REINDEX, because the collation sequence information is present in existing indexes and index tags.

Parameters

<.cdx file>

IDXCOLLATE( ) can be used to return the collation sequence for each tag in multiple-entry compound index files.  Specify the name of the compound index file with <.cdx file>.  The compound index file you specify can be the structural compound index file automatically opened with the table or an independent compound index file.

<expN1>

The numeric expression <expN1> specifies which index or index tag the collation sequence is returned for.  IDXCOLLATE( ) returns the collation sequence for indexes and index tags in the following order:

1	Collation sequences for single-entry .IDX index files (if any are open) are returned first.  The order in which the single-entry index files are included in USE or SET INDEX determines how the collation sequences are returned.

2	The collation sequences for tags in the structural compound index (if one is present) are returned next.  The collation sequences are returned for the tags in the order in which the tags are created in the structural compound index.

3	Collation sequences for tags in any open independent compound indexes are returned last.  The collation sequences are returned for the tags in the order in which the tags are created in the independent compound indexes.

The null string is returned if <expN1> is greater than the total number of open single-entry .IDX files and structural compound and independent compound index tags.

<expN2> | <expC>

If you omit the work area and alias, collation sequences are returned from index files open for the table in the current work area.  To return collation sequences from index files open in a specific work area, include the work area number <expN2> or the table alias <expC>.  If no table has the alias you specify, FoxPro displays the message "Alias not found."

IDXCOLLATE( ) is new to FoxPro 2.5A.


IDXCOLLATE( ) Function See Also
See Also

International Settings

International and Cross-Platform Features

SET COLLATE Command


SET COLLATE Command

See Also

Specifies a collation sequence for character fields in subsequent indexing and sorting operations.

Syntax

SET COLLATE TO <expC>

Remarks

SET COLLATE enables you order tables containing accented characters for any of the supported languages. Changing the setting of SET COLLATE doesn't affect the collating sequence of previously opened indexes. FoxPro automatically maintains existing indexes, providing the flexibility to create many different types of indexes, even for the same field.

For example, if an index is created with COLLATE set to GENERAL, and COLLATE is later changed to SPANISH, the index retains the GENERAL collation sequence.

Clause

<expC>

You can specify a collation sequence with <expC>. The following collating sequences are available.

Options	Language

DUTCH	Dutch

GENERAL	English, French, German, Modern Spanish, Portuguese and other Western European languages

ICELAND	Icelandic

MACHINE	Machine (the default collation sequence for earlier FoxPro versions)

NORDAN	Norwegian, Danish

SPANISH	Traditional Spanish

SWEFIN	Swedish, Finnish

Note   When you specify the SPANISH option, "ch" is a single letter that sorts between "c" and "d", and "ll" sorts between "l" and "m".

If you specify a collation sequence option as a literal character string, be sure to enclose the option in quotation marks:

SET COLLATE TO "SWEFIN"

MACHINE is the default collation sequence and is the collating sequence Xbase users are familiar with. Characters are ordered as they appear in the current code page.

GENERAL may be preferable for U.S. and Western European users. Characters are ordered as they appear in the current code page. In previous FoxPro versions, you may have used UPPER( ) or LOWER( ) on character fields when creating indexes. In FoxPro you can instead specify the GENERAL collation sequence and omit the UPPER( ) conversion.

Note that if you specify a collation sequence other than MACHINE and you create an .IDX index, a compact .IDX is always created.

Use SET("COLLATE") to return the current collating sequence.

A collation sequence can be specified when FoxPro is started by including this line in your FoxPro configuration file:

COLLATE = <expC>

This is identical to issuing this command:

SET COLLATE TO <expC>


SET COLLATE Command See Also
See Also

Configuring FoxPro

IDXCOLLATE( ) Function

International Settings

International and Cross-Platform Features


SET NOCPTRANS Command

See Also

Prevents translation for selected fields in an open table.

Syntax

SET NOCPTRANS TO
[<field1> [, <field2> ...]]

Remarks

Because FoxPro 2.5a can be configured to automatically translate character and memo fields, the SET NOCPTRANS command is available to prevent the automatic translation of fields containing binary data. For example, a memo field may contain a Microsoft Word document. When you access the Word document, you would like the document in its original, untranslated form. Use SET NOCPTRANS to specify that the memo field not be translated when it is accessed.

You don't need to use SET NOCPTRANS to access binary data if the character or memo field containing the binary data has not been translated. You can ensure that character and memo fields are not translated by omitting the CODEPAGE configuration item from your FoxPro configuration file.

Issue SET NOCPTRANS TO without a set of fields to return to the default translation (established by the CODEPAGE configuration item) for all character and memo fields in a table. Use SET("NOCPTRANS") to return the fields specified in the last SET NOCPTRANS command you issued. Use the CHR( ) function to ensure that an individual character doesn't get translated.

SET NOCPTRANS is new to FoxPro 2.5A.


SET NOCPTRANS Command See Also
See Also

CPCONVERT( ) Function

CPCURRENT( ) Function

CPDBF( ) Function

International Settings

International and Cross-Platform Features

MODIFY COMMAND / MODIFY FILE Commands


ANSITOOEM( ) Function

See Also

Converts each character of a character expression to the corresponding character in the MS-DOS (OEM) character set.

Syntax

ANSITOOEM(<expC>)

Returns

Character

Remarks

ANSITOOEM( ) is supported in FoxPro for Windows and FoxPro for Macintosh.

Use ANSITOOEM( ) to move data from FoxPro for Windows and FoxPro for Macintosh to FoxPro for MS-DOS.  ANSITOOEM( ) converts each character in <expC> to the corresponding character in the MS-DOS (OEM) character set.  The character expression <expC> should contain characters from the ANSI character set.

Parameter

If a character in <expC> doesn't have an MS-DOS equivalent, the character is converted to a similar MS-DOS character.


ANSITOOEM() SeeAlso
See Also

CHRTRAN( ) Function

OEMTOANSI( ) Function


AFONT( ) Function

See Also

Places information about available fonts into an array.

Syntax

AFONT(<array>[, <expC>[, <expN>]])

Returns

Logical

Remarks

AFONT( ) is supported in FoxPro for Windows and FoxPro for Macintosh.

AFONT( ) places the names of available fonts into an array.  AFONT( ) can also be used to determine available font sizes or if a font is scalable.  Use GETFONT( ) to display a dialog containing available fonts, font sizes and styles.

Parameters

<array>

The names of available fonts are placed into the memory variable array specified in <array>.  If the array is not large enough to contain all the fonts, the size of the array is automatically increased.  If you specify an existing two-dimensional array, the array is redimensioned to a one-dimensional array.

If the array is successfully created, AFONT( ) returns true (.T.); otherwise AFONT( ) returns false (.F.).

<expC>

Include <expC> to create an array that contains the available font sizes for a specific font.

If the font you specify in <expC> supports only discrete font sizes (8-point, 10-point, ...), the font sizes are stored to the array and AFONT( ) returns true (.T.).  If the font you specify in <expC> is scalable (supports fractional font size values), the array has a single element containing -1 and AFONT( ) returns true (.T.).

If the font you specify in <expC> is not available, the font isn't created and AFONT( ) returns false (.F.).

<expN>

Include <expN> to determine if a specific font size is available for a font.

If the font size <expN> is available for the font specified in <expC>, the array has a single element containing a logical true (.T.) and AFONT( ) returns true (.T.).  If the font size is not available for the specified font, the array isn't created and AFONT( ) returns false (.F.).


AFONT() SeeAlso
See Also

GETFONT( ) Function

FONTMETRIC( ) Function

TXTWIDTH( ) Function

SYSMETRIC( ) Function

WFONT( ) Function


AINS( ) Function

See Also	Example

Inserts an element into a one-dimensional array, or a row or column into a two-dimensional array.

Syntax

AINS(<array>, <expN>[, 2])

Returns

Numeric

Remarks

Inserting an element, row or column into an array doesn't change the size of the array. The trailing elements, rows or columns are shifted toward the end of the array and the last element, row or column in the array is dropped from the array.  The newly inserted element, row or column is initialized to a logical false (.F.).

AINS( ) returns 1 if the element, row or column is successfully inserted.

Parameters

<array>, <expN>

To insert an element into a one-dimensional array, include the array name <array> and the number of the element <expN> where the insertion occurs.  The new element is inserted just before element <expN>.  To insert a row into a two-dimensional array, include the array name <array> and the number of the row <expN> where the insertion occurs.  The new row is inserted just before row <expN>.

Note   You can refer to an element in a two-dimensional array in one of two ways.  The first method uses two subscripts to specify the row and column position of the element in the array; the second method uses a single element number.  AINS( ) requires an element number (<expN>).  You can use AELEMENT( ) to return the element number from a two-dimensional array's row and column subscripts.

For more information on referencing an array element by its subscripts, see DIMENSION.

2

To insert a column into a two-dimensional array, include the array name, the column number <expN> where the insertion occurs and the argument 2.  The new column is inserted just before the column specified with <expN>.


AINS( ) Example

The following example creates and fills an array, scans it for a company name, and if the company name isn't found, inserts it.

CLOSE DATABASES
SELECT company FROM customer ;
WHERE state = 'GA' ;
INTO ARRAY companies
m.count = _TALLY
m.name = 'AAA Incorporated'

IF ASCAN(companies, m.name) = 0  && Search for company

*** Company not found-add it ***

DIMENSION companies[m.count+1,1]
= AINS(companies, m.count+1)
companies[m.count+1] = m.name
ENDIF

DISPLAY MEMORY LIKE companies


AINS() SeeAlso
See Also

ACOPY( ) Function

ADEL( ) Function

ADIR( ) Function

AELEMENT( ) Function

AFIELDS( ) Function

ALEN( ) Function

ASCAN( ) Function

ASORT( ) Function

ASUBSCRIPT( ) Function

DIMENSION Command


ALEN( ) Function

See Also	Examples

Returns the number of elements, rows or columns in an array.

Syntax

ALEN(<array>[, <expN>])

Returns

Numeric

Parameters

<array>

If you include only the array name <array>, ALEN( ) returns the number of elements in the array.

<expN>

<expN> can be 0, 1 or 2.  Omitting <expN> is identical to specifying 0 as <expN>:  ALEN( ) returns the number of elements in the array.

If you specify 1 as <expN>, ALEN( ) returns the number of rows in the array.  If the array is a one-dimensional array, ALEN( ) returns a single subscript.  If the array is a two-dimensional array, ALEN( ) returns the first of the two subscripts.

If 2 is specified, ALEN( ) returns the number of columns in the array.  If the array is a one-dimensional array, ALEN( ) returns 0 (no columns).  If the array is a two-dimensional array, ALEN( ) returns the second of the two subscripts.


ALEN( ) Example
ALEN( ) Examples

DIMENSION x(5)
DIMENSION y(3,7)

? ALEN(x)

? ALEN(x,0)

? ALEN(x,1)

? ALEN(x,2)

? ALEN(y)

? ALEN(y,1)

? ALEN(y,2)

SELECT DISTINCT state FROM customers INTO ARRAY states
? ALEN(states)

The following example copies OFFICES.DBF to the memory variable array OFF, then displays the contents of two of the fields from the array.

CLOSE DATABASES
SELECT * FROM offices ;
INTO ARRAY off
FOR i = 1 to ALEN(off,1)
? 'Office: ',off[i,6], 'Sales: ',off[i,2]
ENDFOR


ALEN() SeeAlso
See Also

ADEL( ) Function

ADIR( ) Function

AELEMENT( ) Function

AFIELDS( ) Function

AINS( ) Function

ASCAN( ) Function

ASORT( ) Function

ASUBSCRIPT( ) Function

DIMENSION Command

STORE Command


ALIAS( ) Function

See Also	Example

Returns the alias of the current or specified work area.

Syntax

ALIAS([<expN> | <expC>])

Returns

Character

Parameters

<expN> | <expC>

ALIAS( ) returns the table alias for the work area specified by the numeric expression <expN> or table alias <expC>.

If <expN> or <expC> are omitted, ALIAS( ) returns the alias of the table open in the current work area.  If a table isn't open in the current or specified work area, the null string is returned.


ALIAS( ) Example

The following example opens tables and displays the alias of each.

CLOSE DATABASES
SELECT A
USE salesman
SELECT B
USE customer ALIAS cust

? ALIAS( )

? ALIAS('salesman')


ALIAS() SeeAlso
See Also

DBF( ) Function

SELECT( ) Function


ALLTRIM( ) Function

See Also	Example

Returns the specified character expression with leading and trailing blanks removed.

Syntax

ALLTRIM(<expC>)

Returns

Character

Remarks

ALLTRIM( ) removes leading and trailing blanks from the specified character expression and returns the trimmed expression as a character string. This function can be used to ensure that blanks are removed from data entered by a user.

Parameter

<expC>

Leading and trailing blanks are removed from the character expression <expC>.


ALLTRIM( ) Example

In this example, if extra spaces are included before the name of the contact person (here the name Gene Smith is entered), ALLTRIM( ) removes the spaces.  Removing the leading spaces ensures that LOCATE can find the name.

CLOSE DATABASES
USE customer
@ 5,0 SAY 'Name of Contact person: ' GET person ;
DEFAULT 'Gene Smith'
READ
LOCATE FOR contact = ALLTRIM(person)

? RECNO( )

DISPLAY contact, company


ALLTRIM() SeeAlso
See Also

LTRIM( ) Function

RTRIM( ) Function

TRIM( ) Function


APPEND Command

See Also

Enables you to add records to the end of the current table.

Syntax

APPEND
[BLANK]
[NOMENU]

Remarks

APPEND enables you to add one or more new records to the end of the current table.  The Open dialog appears when you issue APPEND or APPEND BLANK and a table isn't open in the current work area.  Choose a table to append records to.

APPEND opens an editing window so you can enter data into new records.  Any indexes that are open when APPEND is executed are updated when the record is added.

Clause

BLANK

APPEND BLANK adds one blank record to the end of the current table.  An editing window isn't opened when you issue APPEND BLANK.  The faster INSERT [image] SQL command is preferable.

You can edit the new record with BROWSE, CHANGE or EDIT.

When a blank record is appended, each field in the record is initially empty unless CARRY is SET ON.

NOMENU

Including NOMENU prevents access to the Browse menu and its options by removing the Browse menu pad from the system menu bar.


APPEND SeeAlso
See Also

APPEND FROM ARRAY Command

BROWSE Command

CHANGE Command

EDIT Command

INSERT Command - SQL

REPLACE Command

SET CARRY Command


APPEND FROM Command

See Also	Example

Adds records to the end of the current table from another file.

Syntax

APPEND FROM <file> | ?
[FIELDS <field list>]
[FOR <expL>]
[[TYPE] 	[DELIMITED [WITH TAB | WITH <delimiter> | WITH BLANK]
| DIF | FW2 | MOD | PDOX | RPD | SDF | SYLK | WK1 | WK3 | WKS
| WR1 | WRK | XLS]]

Remarks

The file you are appending from is assumed to be a FoxPro table with a .DBF extension.  If the file you want to append from is a FoxPro table and doesn't have a .DBF extension, you must specify its extension.  If the file is a not a FoxPro table, you must specify the type of file you append from.

Before you can append from a table created in dBASE IV that contains a memo field, you must first open the table in FoxPro with USE.  You are prompted with "Convert MEMO file to FoxPro Format?"  Choose Yes.

If you append from a FoxPro table, the table you append from can be open in another work area.  You can also append from a table that isn't open but is available on disk and a shared table opened when SET EXCLUSIVE is OFF.  When the table you append from contains records marked for deletion, the records are not marked for deletion after they are appended.

If you include the ? clause instead of including a table name, the Open dialog appears so you can choose a table to append from.

In FoxPro for Macintosh, you can interactively append records from files created in 4th Dimension version 3.0 and greater and Filemaker Pro version 2.1. To append records interactively, open the FoxPro table to which you'll append the records. Choose the Database menu, and then choose the Append From... option. In the Append From dialog, choose the File Type: popup.

Clauses

<file>

Specify the name of the file to append from with <file>.  If you don't include a file name extension, the default extension .DBF is assumed.

FIELDS <field list>

APPEND FROM supports an optional <field list>.  Data is only appended to the fields specified in the field list.

FOR <expL>

The entire source file is appended to the table unless you include the FOR clause.  If the FOR clause is included, a new record is appended for each record in the file source for which <expL> evaluates to a logical true (.T.).  Records are appended until the end of the file is reached.

TYPE

If the file you are appending from isn't a FoxPro table, you must specify the file TYPE.  Although you must specify the file type, you need not include the key word TYPE.  You can append from a wide variety of different file types including DELIMITED ASCII text files in which you can specify a field delimiter.

If the file you are appending from doesn't have the usual default file extension for that type of file, the source file name must include the file's extension.  For example, Microsoft Excel spreadsheets normally have an .XLS file name extension.  If the spreadsheet you are appending from has an extension other than the expected .XLS, be sure to specify the extension.

Note   When appending from a spreadsheet, the data in the spreadsheet must be stored in a row major order rather than a column major order.  This allows the appended spreadsheet data to match the table structure.

DELIMITED [WITH TAB | WITH <delimiter> | WITH BLANK]

A DELIMITED file is an ASCII text file in which each record ends with a carriage return and line feed.  Field contents are by default assumed to be separated from each other by commas, and character field values to be additionally delimited by double quotation marks.  For example:

"Smith", 9999999, "TELEPHONE"

The DELIMITED WITH TAB option can be used to specify files which contain fields separated from each other by tabs rather than commas.  The DELIMITED WITH <delimiter> option can be used to indicate that character fields are delimited by a character other than the quotation mark.  The DELIMITED WITH BLANK option can be used to specify files which contain fields separated by spaces instead of commas.  The file extension is assumed to be .TXT for all delimited files.

You can import dates from delimited files if the dates are in proper date format.  The date format defaults to 'mm/dd/yy'.  Including the century portion of a date is optional. FoxPro will import a date that includes the century.  If the century isn't included in a date (for example '12/25/92'), the Twentieth century is assumed.  Date delimiters can be any non-numeric character except the delimiter that separates the fields in the delimited file.

Dates in other formats can be imported if their format matches a date format available in SET DATE.  To import dates that are not in the default format, issue SET DATE with the proper date format before using APPEND FROM.  To test if a date format can be successfully imported, use it with CTOD( ).  If the date is acceptable to CTOD( ), the date will import properly.

DIF

In a DIF (VisiCalc Data Interchange Format) file, vectors (columns) become fields and tuples (rows) become records.  DIF file names are assumed to have a .DIF extension.

FW2

FW2 files are created by Framework II.  FW2 file names are assumed to have a .FW2 extension.

MOD

MOD files are created by Microsoft Multiplan version 4.01.  MOD files are assumed to have a .MOD extension.

PDOX

Database files in Paradox versions 3.5 and 4.0 can be appended to a FoxPro table by including the PDOX option.  Paradox file names are assumed to have a .DB extension.

RPD

RPD files are created by RapidFile version 1.2.  RPD file names are assumed to have an RPD extension.

SDF

An SDF (System Data Format) file is an ASCII text file in which records have a fixed length and end with a carriage return and a line feed.  Fields are not delimited.  The file name extension is assumed to be .TXT for SDF files.

SYLK

An SYLK file is in a Symbolic Link interchange format (used in Microsoft Multiplan) in which columns become fields and rows become records.  SYLK file names have no extension by default.

WK1

Data from a Lotus 1-2-3 spreadsheet can be appended to a FoxPro table with this option.  Each column from the spreadsheet becomes a field in the table; each spreadsheet row becomes a record in the table.  A .WK1 file name extension is assigned to a spreadsheet created in Lotus 1-2-3 revision 2.x.

WK3

Data from a Lotus 1-2-3 spreadsheet.  Each column from the spreadsheet becomes a field in the table; each spreadsheet row becomes a record in the table.  A .WK3 file name extension is assigned to a spreadsheet created in Lotus 1-2-3 revision 3.x.

WKS

Data from a Lotus 1-2-3 spreadsheet. Each column from the spreadsheet becomes a field in the table and each spreadsheet row becomes a record in the table.  A .WKS file name extension is assigned to a spreadsheet created in Lotus 1-2-3 revision 1-A.

WR1

Data from a Lotus Symphony spreadsheet.  Each column from the spreadsheet becomes a field in the table and each spreadsheet row becomes a record in the table.  A .WR1 file name extension is assigned to a spreadsheet created in Symphony versions 1.1 or 1.2.

WRK

Data from a Lotus Symphony spreadsheet.  Each column from the spreadsheet becomes a field in the table and each spreadsheet row becomes a record in the table.  A .WRK file name extension is assigned to a spreadsheet created in Symphony version 1.0.

XLS

The data in Microsoft Excel versions 2.0, 3.0 and 4.0 spreadsheets can be appended to a FoxPro table by including the XLS option.  Each column from the spreadsheet becomes a field in the table and each spreadsheet row becomes a record in the table.  Spreadsheet files created in Microsoft Excel are given an .XLS file name extension.


APPEND FROM Example

In this example, the CUSTOMER table is opened, its structure is copied to a table called BACKUP and BACKUP is opened.  FoxPro then appends all records from the CUSTOMER table from the state of Ohio (OH).  These records are then copied to a new delimited file called TEMP.TXT.

CLOSE DATABASES
USE customer
COPY STRUCTURE TO backup
USE backup
APPEND FROM customer FOR state = 'OH'
COPY TO temp TYPE DELIMITED
MODIFY FILE temp.txt
USE
DELETE FILE backup.dbf
DELETE FILE temp.txt


APPEND FROM SeeAlso
See Also

COPY FILE Command

COPY TO Command

IMPORT Command

EXPORT Command


APPEND FROM ARRAY Command

See Also	Example

Adds one record to the currently selected table for each row in an array and fills each record with data from the corresponding array row.

Syntax

APPEND FROM ARRAY <array>
[FOR <expL>]
[FIELDS <field list> | FIELDS LIKE <skel> | FIELDS EXCEPT <skel>]

Remarks

Memo and general fields are ignored in APPEND FROM ARRAY.  When a table is open for shared use, APPEND FROM ARRAY locks the table header while records are being added.

Clauses

<array>

Include the name of the array that contains the data to be copied to the new records.  New records are added to the table until all rows in the array are appended.

One-dimensional Arrays

If the array is one-dimensional, APPEND FROM ARRAY adds one record to the table. The contents of the first array element fill the first field of the newly added record, the contents of the second element of the array fill the second field of the record and so on.

If the one-dimensional array has more elements than the table has fields, the additional elements are ignored.  If the table has more fields than the array has elements, the additional fields are initialized to the default empty value.  Here are the default empty values for each field type:

Field Type	Default Value
Character	Spaces
Numeric	0
Date	Null (/ /)
Logical	False (.F.)
Two-dimensional Arrays

When appending from a two-dimensional array, a new record is appended to the table for each row in the array.  For example, if the array has four rows, four new records are appended to the table.

The contents of the first array column fills the first field of the newly added records, the second array column fills the second field of the new records and so on.  For example, if the array has four rows and three columns, elements from the first array column fill the first field in each of the four new records appended to the table.

If the two-dimensional array has more columns than the table has fields, the additional columns are ignored.  If the table has more fields than the array has columns, the additional fields are initialized to empty values.

FOR <expL>

If you include the FOR clause, you can conditionally append records from the array.  <expL> must contain the name of a target field in its conditional expression.

Before a row of the array is appended to a record in the table, the array element corresponding to the target field specified in <expL> is checked to see if that array element meets the condition in <expL>.  If the array element satisfies the condition, a record is appended.

If the array element doesn't satisfy the condition, the array row isn't appended and the next row in the array is checked to see if it meets the condition.

FIELDS <field list>

If FIELDS <field list> is included, only the fields specified in the list are updated from the array.  The first field in the list is updated with the contents of the first element in the array, the second field is updated from the second element and so on.

FIELDS LIKE <skel> | FIELDS EXCEPT <skel>

You can selectively update fields by including the LIKE or EXCEPT clause or both. If you include LIKE <skel>, FoxPro updates the fields that match <skel>. If you include EXCEPT <skel>, FoxPro updates all fields except those that match <skel>.

The skeleton <skel> supports wildcard characters.  For example, to update all fields that begin with the letters A and P, use:

APPEND FROM ARRAY myarray FIELDS LIKE A*,P*

The LIKE clause can be combined with the EXCEPT clause:

APPEND FROM ARRAY myarray FIELDS LIKE A*,P* EXCEPT PARTNO*

Data Type Mismatches

APPEND FROM ARRAY can fill a field even if the data type of the corresponding array element doesn't match the data type of the field, provided the array element data is compatible with the data type of the corresponding field.  If the data isn't compatible, the field is initialized to an empty value.  See the default value table above for the empty values for each field type.

For more information on data type mismatches, see the APPEND FROM ARRAY topic in the FoxPro for Windows Language Reference.


APPEND FROM ARRAY Example

This example illustrates how you can add a record to a table.  The CUSTOMER table is opened and SCATTER creates an array named CUSTARRAY with a blank element for each field in the table.  A FOR ... ENDFOR loop displays each field.  The READ activates the @ ...  GETs.

If Escape isn't pressed to stop the editing, APPEND FROM ARRAY appends a new record to the table.  The data in the CUSTARRAY memory variable array then replaces each field.

SET TALK OFF
CLEAR
CLOSE DATABASES
USE customer
SCATTER TO custarray BLANK	&& Create an blank array

FOR count = 1 TO ALEN(custarray)	&& Number of rows in array
@ count, 2 SAY FIELD(count) ;
GET custarray(count)	&& Display fields and get info
ENDFOR

READ
IF READKEY( ) != 12	&& If Esc isn't pressed
APPEND FROM ARRAY custarray	&& Append a record, fill from array
GOTO BOTTOM
BROWSE
DELETE
PACK
ENDIF
USE
CLEAR


APPEND FROM ARRAY SeeAlso
See Also

APPEND Command

COPY TO ARRAY Command

DIMENSION Command

GATHER Command

REPLACE FROM ARRAY Command

SCATTER Command


APPEND GENERAL Command

See Also	Example

Imports an OLE object from a file and places it into a general field.

Syntax

APPEND GENERAL <general field> FROM <file> | FROM MEMO <picture field>
[LINK]
[CLASS <ole class>]

Remarks

APPEND GENERAL is supported in FoxPro for Windows and FoxPro for Macintosh.

If an OLE object already exists in the general field, it is replaced with the OLE object from the file.

For additional information about OLE objects in FoxPro for Windows and FoxPro for Macintosh, see the "Object Linking and Embedding (OLE)" chapter in the FoxPro Developer's Guide.

Clauses

<general field>

Include <general field> to specify the name of the general field the OLE object is placed in.  You can specify a general field in a table open in a noncurrent work area by including the table alias with the field name.

FROM MEMO <picture field>

In FoxPro for Macintosh, you can include FROM MEMO <picture field> to import PICT type pictures from a FoxBASE+ for Macintosh table containing a picture field.

The FoxPro for Macintosh table containing the general field must be open in the currently selected work area. The FoxBASE+ for Macintosh table containing the picture field must be open in another work area, and you must include the alias of the FoxBASE+ for Macintosh table before the name of the picture field. Separate the alias from the picture field name with a period.

For example, the following command imports a PICT type picture from a picture field named PICTFIELD in a FoxBASE+ for Macintosh table named PICTTBLE into a general field named GENFIELD:

APPEND GENERAL genfield FROM MEMO picttble.pictfield

APPEND GENERAL with this clause operates on the current records for both tables. To ensure that the PICT type pictures are imported into the proper records in the general field, you may have to use SET RELATION to establish a relation between the two tables or manually move the record pointers in both tables.

<file>

Include <file> to specify the file containing the OLE object.  You must include the entire file name, including its extension.  If the file is located in a directory or folder other than the current default directory or folder, include the path with the file name.

In FoxPro for Macintosh you cannot import a picture file of PICT type or a .BMP bitmap file into a general field. To import a picture, copy the picture to the Clipboard and paste it into the general field.

LINK

If LINK is included, a link is created between the OLE object and the file that contains the object.  The OLE object appears in the general field but the object's definition remains in the file.  If LINK is omitted, the OLE object is embedded in the general field.

CLASS <ole class>

Include the CLASS clause to specify an OLE class for an OLE object other than the default class.

Tip   In FoxPro for Windows, you can determine the class for an OLE object by running REGEDIT and double-clicking the OLE object.  The class name is listed under Identifier.

You can specify a class name when the file extension for the file containing the OLE object is different than the default extension and you want to force the behavior for the class.  If the default extension can be used by multiple OLE servers, include the class to specify a particular server.


APPEND GENERAL Example

The following example imports a Microsoft Excel chart file in the default FoxPro directory or folder to a general field named CHART.

APPEND GENERAL chart FROM CHART1.XLC" CLASS EXCELCHART


APPEND GENERAL SeeAlso
See Also

@ ... SAY - Pictures & OLE Objects

MODIFY GENERAL Command


APPEND MEMO Command

See Also	Example

Copies the contents of a file to a memo field.

Syntax

APPEND MEMO <memo field> FROM <file>
[OVERWRITE]

Remarks

The entire contents of the file are appended to the contents of the specified memo field in the current record.

Clauses

<memo field>

The memo field to be updated.

FROM <file>

The file from which the memo field is to be appended.  You must include the entire file name, including its extension.

OVERWRITE

If the optional key word OVERWRITE is included, the current contents of the memo field are replaced with the contents of the file.


APPEND MEMO Example

In this example, the contents of the memo field NOTES are copied to a file called TEST.TXT.  The contents of TEST.TXT is then appended to the contents of the memo field.  Finally, the contents of TEST.TXT replace the current contents of the memo field.

CLOSE DATABASES
USE salesman
WAIT WINDOW 'salesman.notes - press Esc' NOWAIT
MODIFY MEMO notes
COPY MEMO notes TO test.txt
WAIT WINDOW 'test.txt - press Esc' NOWAIT
MODIFY FILE test.txt
WAIT WINDOW 'salesman.notes now appended to - press Esc' NOWAIT
APPEND MEMO notes FROM test.txt
MODIFY MEMO notes
WAIT WINDOW 'salesman.notes append overwrite - press Esc' NOWAIT
APPEND MEMO notes FROM test.txt OVERWRITE
MODIFY MEMO notes
DELETE FILE test.txt


APPEND MEMO SeeAlso
See Also

COPY MEMO Command


What's New Since FoxPro 2.5

See Also

FoxPro enables you to convert your existing dBASE programs and applications. To make the process seamless, FoxPro version 2.6 includes:

A Catalog Manager interface that provides convenient access to database files and functions.

A collection of wizards that simplify common database tasks.

Language additions that provide dBASE IV language compatibility.

For more information, see the Catalog Manager, Using Wizards, Switching from dBASE and Supported dBASE IV Commands and Functions Help topics.

FoxPro 2.6 Professional Edition

FoxPro 2.6 is available in two editions, Standard and Professional. The Professional edition includes all the features of the Standard edition, plus:

Client-Server Query Wizard

Connectivity Kit

Distribution Kit

Library Construction Kit

These additional features allow you to connect to remote data, distribute your applications to others, and build sharable libraries of functions.


See Also

Using the Catalog Manager

Using Wizards

Switching From dBASE

FoxPro Enhancements to the Xbase Language


Changes to Documentation Since Printing

Since the manuals were printed, the following changes have been made to the documentation.  Whenever possible, the changes have been incorporated in this Help file.

FoxPro 2.6 Additions

FoxPro version 2.6 is an upgrade that includes the existing documentation from version 2.5, as well as significant updates to the Help file that describe new 2.6 features.

Major features that support dBASE compatibility and ease of use, such as wizards and the Catalog Manager interface, are listed in the What's New Since FoxPro 2.5 Help topic. Language additions are listed in the Supported dBASE IV Commands and Functions Help topic. In addition, some existing language features have been enhanced for better Xbase compatibility:

APPEND

The NOMENU clause was added. For more information, see APPEND.

BROWSE

The NOINIT clause was added. For more information, see BROWSE.

KEYBOARD

A CLEAR option was added. For more information, see KEYBOARD.

LIKE and EXCEPT clauses

These clauses were added to several commands: BLANK, REPLACE FROM ARRAY, SET FIELDS.

SQL-SELECT

A discussion of outer joins was added to the UNION clause. For more information, see SQL-SELECT.

SET COMPATIBLE

A clause, PROMPT | NOPROMPT, was added. For more information, see SET COMPATIBLE.

SET FIELDS

The SET FIELDS command now allows you to specify fields in other work areas.  Two new clauses, LOCAL and GLOBAL, were added. For more information, see SET FIELDS.

SET FORMAT

The SET FORMAT command has been enhanced to allow initialization and clean-up code in a format file. For more information, see SET FORMAT.

SET LIBRARY

You can now specify procedure files as well as external libraries. For more information, see SET LIBRARY.

SET( )

The SET( ) function now returns the current display mode when you issue SET('DISPLAY'). For more information, see SET().

FoxPro 2.5 Changes

Installation and Configuration

To save hard disk space, the files in the GOODIES subdirectory are installed in a compressed format.  To unpack these files, open File Manager and double-click on ALLUNPAK.BAT in the FOXPROW\GOODIES directory.  If you want more information about unpacking these compressed files, see README.TXT in the FOXPROW\GOODIES directory.

Page 2-14,16.  In Special Config Items, TMPFILES will allow the drive and directory to be specified instead of just the drive.

BELL.  You can include a custom sound as a default for the bell by including the following line in your CONFIG.FPW:

BELL =	"<wav>"

<wav> is the path and file name of a .WAV file, for example:

BELL = "C:\WINDOWS\CHIMES.WAV"

MEMLIMIT

You can include the MEMLIMIT statement in the CONFIG.FPW file to control the amount of memory that FoxPro for Windows consumes.  The more memory you make available to FoxPro, the faster it will perform queries, sort files, and build indexes.  However, the more memory you provide to FoxPro, the less that is available for other Windows applications.  The syntax for setting the MEMLIMIT is

MEMLIMIT =	<% of available memory>, [<Minimum memory (K)>]
[<Maximum memory (K)>]

You allocate memory by specifying the percentage of available memory that you want FoxPro to use.  In addition, you have the option of specifying the minimum and/or maximum amount of memory in kilobytes that you want allocated to FoxPro.

For example, specifying MEMLIMIT = 80, 1024, 4096 allocates 80 percent of your system's available memory to FoxPro with a minimum allocation of 1024K and a maximum of 4096K.

User's Guide

The Auto Lock Current Record check box in the Generate Screen dialog has been changed to READ NOLOCK.

The New Label dialog now displays the Avery Label number for each layout in addition to its height, width and number of columns per page.

The appearance of the Screen Picture dialog and the Report Picture dialog has been updated since the documents were printed, but the names of the options and their functions are as described in the documents.

Ruler lines are not displayed by default in the Screen Builder or Report Writer, but can be activated by choosing the Yes radio button in the Ruler Lines area of the Ruler/Grid dialog.

General type fields are ignored by Quick Screen and Quick Report.  You can add a general field the same way you include any table field or you can click the picture tool, drag to size in the Screen Design window or the Report Layout window, and choose Field... in the dialog that opens.

A new generator directive, #INSERT, can be included in Screen Builder and Menu Builder code snippets.  #INSERT inserts the contents of a text file into the generated code.  For more information about #INSERT, see Generator Directives.

New shortcuts available in Open file dialogs:

Move to a different drive and/or directory and display files of a specific type by typing the drive letter, path and file extension for the type of file you want to open in the File Name text box (for example, c:\foxprow\sample\organize\*.app).  When you press Enter,  FoxPro moves you to that directory and displays files with the extension you specified.

Move up one directory by typing '..' in the File Name text box and pressing Enter.

Move to an immediate subdirectory by typing the name of the subdirectory in the File Name text box.

Use the Font..., Enlarge font and Reduce font options on the Control menu for the Debug window to change the font in the Debug window.

Certain macro keys which can be used in FoxPro for MS-DOS are not recognized in FoxPro for Windows.  These are: Shift+Ctrl+\, Ctrl+-, Ctrl+^, Shift+Ctrl+Enter.

Developer's Guide

Transporter Directives

#DOSOBJ

#MACOBJ

#UNIXOBJ

#WINOBJ

You can use these directives to tranport objects created in the Screen Builder and Report Writer to specific FoxPro platforms.  For additional information about these transporter directives, see the Transporting Files topic in this online help facility.

Page A-5: The maximum # of open Browse windows allowed in FoxPro for Windows should read 225 instead of 255.

Pages A-20 to A-24: Include the following section.

FoxPro File Structures

The file structures of tables and indexes have changed from earlier FoxPro versions.

Tables

Byte 29 in table headers was formerly reserved.  It now contains the code page identifier.

Code Page	Code Page Identifier  Hexadecimal

437	0x01

737	0x6A

620	0x69

850	0x02

852	0x64

861	0x67

865	0x66

866	0x65

895	0x68

1250	0xC8

1251	0xC9

1252	0x03

1253	0xCA

10000	0x04

10006	0x98

10007	0x96

10029	0x97

Compact .IDX Indexes

Bytes 494 through 501 in compact .IDX index headers were formerly reserved.  These bytes now contains the collation sequence identifier; the collation sequence identifier can be up to eight characters long.

Page D2-49: An additional Window Type is available.  If you choose DESKTOP, your screen elements are displayed in the main FoxPro window rather than in a separate window.

Page D2-38: The following generator directives have been added:

Additional Generator Directives

#INSERT	This generator directive can be included in Screen Builder and Menu Builder code snippets.  #INSERT inserts the contents of a text file into the generated code.
#NAME <snippet name>	This screen and menu generator directive names a snippet produced by clauses such as SHOW, WHEN and VALID, whether the snippet is produced at the object or READ level.
#NOREAD	Include the #NOREAD screen generator directive in a screen setup snippet to prevent the generation of the READ command.
#NOREAD PLAIN	This screen generator directive works much the same way that #NOREAD does except that it suppresses everything except @ ... SAY, @ ... GET and @ ... EDIT, comments and #REGION statements.
For more information about these and other generator directives, see Generator Directives.

APPEND GENERAL

The second example on page D13-24 of the Developer's Guide isn't correct and will cause an error. Microsoft Word doesn't support linking.

Page D2-41

The location of the UDF LOCATEDB() is incorrect. LOCATEDB() is in UTILITY.PRG, not MAIN.PRG.

Language Reference

Many changes were made to FoxPro for MS-DOS to provide greater compatibility with FoxPro for Windows.  Many clauses which are noted as FoxPro for Windows only can be included in programs you run in FoxPro for MS-DOS; some of these clauses are supported in FoxPro for MS-DOS and others are ignored.  The following sections list the commands and clauses that are ignored in FoxPro for MS-DOS.

RGB Color Pairs

RGB color pairs are supported in FoxPro for MS-DOS.  RGB color pairs can be included in the following commands:

@ ... EDIT - Text Edit Regions

@ ... FILL

@ ... GET

@ ... GET - Check boxes

@ ... GET - Invisible buttons

@ ... GET - Lists

@ ... GET - Popups

@ ... GET - Push Buttons

@ ... GET - Radio Buttons

@ ... SAY

@ ... TO

BROWSE

CHANGE

DEFINE BAR

DEFINE MENU

DEFINE PAD

DEFINE POPUP

DEFINE WINDOW

EDIT

SHOW GET

SHOW OBJECT

FONT and STYLE clauses

FONT and STYLE clauses are not supported in FoxPro for MS-DOS and are ignored if included.  FONT and STYLE clauses are supported in the following commands in FoxPro for Windows:

? | ??

@ ... GET

@ ... GET - Check boxes

@ ... GET - Invisible buttons

@ ... GET - Lists

@ ... GET - Popups

@ ... GET - Push Buttons

@ ... GET - Radio Buttons

@ ... SAY

BROWSE

CHANGE

DEFINE WINDOW

PROMPT clauses

PROMPT clauses are not supported in FoxPro for MS-DOS and are ignored if included.  PROMPT clauses are supported in the following commands in FoxPro for Windows:

DIR | DIRECTORY

DISPLAY

LABEL

LIST

REPORT

SELECT - SQL

SET DEVICE

SET PRINTER

TYPE

@ ... TO

The PATTERN, PEN and STYLE clauses are not supported in FoxPro for MS-DOS and are ignored if included.

DEFINE WINDOW

The FILL FILE, HALFHEIGHT, ICON FILE, MDI and NOMDI clauses are not supported in FoxPro for MS-DOS and are ignored if included.  If IN DESKTOP is included, the user-defined window is placed on the FoxPro desktop.  IN DESKTOP is identical to IN SCREEN in FoxPro for MS-DOS.

SET CLOCK

The STATUS clause is not supported in FoxPro for MS-DOS and is ignored if included.

SET STATUS

The TIMEOUT clause is not supported in FoxPro for MS-DOS and is ignored if included.

Row and Column Coordinates

Fractional row and column coordinates are supported in FoxPro for Windows.  In FoxPro for MS-DOS, fractional coordinates are rounded to the nearest integer value.

Page L3-27 - @ ... SAY for BMPs and OLE Objects

A STYLE clause is supported in @ ... SAY for BMPs and OLE objects.  Include the STYLE clause to specify an opaque or transparent BMP.

A NOWAIT clause is supported in @ ... SAY for BMPs and OLE objects.  Including NOWAIT continues program execution after the command is issued.

For additional information, see @ ... SAY - BMPs & OLE Objects in this online help facility.

Page L3-363 - DDEExecute( )

The syntax for DDEExecute( ) is incorrect. The correct syntax is:

DDEExecute(<expN>, <expC1>[, <expC2>])

The <expC2> parameter is the name of a user-defined function (UDF). There is no format parameter in this function. For more information, see DDEExecute( ).

Page L3-544 - GETBAR( )

Purpose should be "gets the number of a bar on a popup" rather than "gets the number of bars on a popup."

Page L3-611 - LIST

The PROMPT clause is supported in each LIST command.  For more information about the PROMPT clause, see the corresponding DISPLAY command.

Page L3-728 - OS( )

OS( ) supports an argument of 1.  Including 1 in OS( ) (OS(1)) returns the Windows version in FoxPro for Windows.

Page L3-880 - SET BELL

SET BELL supports waveform files in FoxPro for Windows.  For more information, see SET BELL.

Page L3-942 - SET INTENSITY

SET INTENSITY does affect colors in FoxPro for Windows.  For more information, see SET INTENSITY.

Page L3-943 - SET KEYCOMP

When you use the command SET KEYCOMP TO DOS, a field is not selected upon entry into the field.  However, when you use the command SET KEYCOMP TO WINDOWS, a field is automatically selected upon entry into the field.

Page L3-1020 - SHOW GET

The PROMPT clause can be used to specify BMPs that appear on picture check boxes, push buttons and radio buttons.  For more information, see SHOW GET.

Page L3-1071 - SYS(15)

Describes an additional .MEM file called EUROANSI.MEM, included for use in FoxPro for Windows.

Page L3-1071 - _STARTUP

The name of the default start up application is FOXSTART.APP, not STARTUP.APP as described in the FoxPro Language Reference.

Page L3-1097 - TXTWIDTH( )

The description has changed and a new example has been added.  See TXTWIDTH( ).

Additions

Several new commands and functions have been added for international compatibility. These are:

CPCONVERT( )
CPCURRENT( )
CPDBF( )
IDXCOLLATE( )
SET COLLATE
SET CPCOMPILE
SET CPDIALOG
SET NOCPTRANS

Detailed information about these commands and functions is provided in this on-line help file.

A new command, ON SHUTDOWN, has been added to FoxPro for Windows.  ON SHUTDOWN specifies a command that executes when you try to exit FoxPro for Windows or Microsoft Windows.  For more information, see ON SHUTDOWN.

A new function, RGBSCHEME( ), has been added.  RGBSCHEME( ) returns an RGB color pair or an RGB color pair list from a specified color scheme.  For more information, see RGBSCHEME( ).

A new command, SET READBORDER, has been added in FoxPro for Windows.  SET READBORDER determines if borders are placed around editing regions created with @ ... GET.  For more information, see SET READBORDER.

A new system memory variable, _SPELLCHK, has been added in FoxPro for Windows.  _SPELLCHK specifies a spelling check program.  For more information, see _SPELLCHK


Catalog Manager Print Dialog

See Also

This dialog allows you to print reports and labels from within the Catalog Manager, and has the following options:

File... button and text box

Choose this button to specify the file you want to print. If you have already selected the report or label you want to print, the path to that file appears in the text box.

Destination area

Page Preview radio button

Choose this button to preview the report or label you have specified.

Printer radio button

Choose this button to print the report or label you have specified.

Prompt check box

Choose this box if you have the Printer radio button selected and you want the Windows Print dialog to appear before you print.


See Also

File Menu


File Description Dialog

See Also

The File Description dialog allows you to enter or change the file description that appears in the description area of Catalog Manager.  The dialog contains the following options:

File label

Displays the name of the selected file.

Type label

Displays the type of the selected file.

Description edit box

You can type a description here for the selected file. The description you type will appear in the description area of the Catalog Manager when you select the file.


See Also

File Menu


Create Report Dialog

See Also

This Catalog Manager dialog allows you to create a report using either a report wizard or the Report Writer power tool. If you are unfamiliar with the Report Writer, you may want to use the report wizards instead. This dialog has the following options:

Select a Table or Query popup

Select a table or query for use in the creating your report.

Report Wizard button

Choose this button to create a report using one of three report wizards, Group/Total Report Wizard, Multi-Column Report Wizard, or Report Wizard.

New Report button

Choose this button to start the Report Writer.


See Also

Group/Total Report Wizard

Multi-Column Report Wizard

Report Wizard

Report Writer


Exit Catalog Dialog

This dialog allows you to close the Catalog Manager or exit FoxPro.

Switch to Command Window button

Choose this button to close the Catalog Manager and activate the Command window.

Quit FoxPro button

Choose this button to close the Catalog Manager and FoxPro.

Return to Catalog Manager button

Choose this button to close the Exit Catalog dialog and return to the Catalog Manager.


Order Table Dialog

See Also

This Catalog Manager dialog displays the name of the current table and the active tag or index, and allows you to order the active table with the following options:

Table text box

Shows the path of the selected table

Active Tag/Index text box

Shows the active index tag.

Available Tags/Indexes area

List box

When you choose an item in the list, the Key Expression area displays the index expression.

Ascending radio button

Choose this button to specify an ascending order for the selected index tag.

Descending radio button

Choose this button to specify a descending order for the selected index tag.

Set Order button

Choose this button to specify an index and order for the active table.

No Order button

Choose this button to remove the ordering for the active table.

Key Expression area

This area displays the index expression of the index highlighted in the Available Tags/Indexes list box.


See Also

Data Menu

Set Order( )

SET ORDER TO


Create Screen Dialog

See Also

This Catalog Manager dialog allows you to make changes to a screen using either the Screen Wizard or the Screen Builder power tool. If you are unfamiliar with the Screen Builder, you may want to use the Screen Wizard instead. This dialog has the following options:

Select a Table or Query popup

Select a table or query for use in the creating your screen.

Screen Wizard button

Choose this button to start the Screen Wizard.

New Screen button

Choose this button to start the Screen Design Window.


See Also

Screen Design Window

Screen Wizard


Export Data Dialog

See Also

The Export Data dialog allows you to export data from a table or query in the Catalog Manager. This dialog has the following options:

File Type drop-down list

Use this list to select another supported file type.

File text box

This box shows the path of the currently selected table or query.

Save As... button

Choose this button to display the Save As dialog so you can specify a name for the exported file.

Criteria area

Scope... button

Choose this button to display the Scope dialog to specify another export parameter.

For... button

Choose this button to display the Expression Builder to specify a FOR condition.

While... button

Choose this button to display the Expression Builder to specify a WHILE condition.

Export button

Choose this button to confirm your selections and export the file.


See Also

Data Menu

EXPORT Command

Expression Builder

Save As Dialog

Scope Dialog


Import Data Dialog

See Also

This Catalog Manager dialog allows you to import data from other applications and has the following options:

File Type popup

Use this list to select a supported file type.

File... button

Choose this button to access the Open dialog so you can specify a file to import.

Save As... button

Choose this button to open the Save As dialog so you can specify where to save the imported file.

Import button

Choose this button to confirm your selections and import the file.


See Also

Data Menu

Open Dialog

Save As Dialog


Create Table Dialog

See Also

This Catalog Manager dialog allows you to create a new table using either the Table Wizard or the Table Structure dialog. If you are unfamiliar with the Table Structure dialog, you may want to use the Table Wizard instead. This dialog provides the following options:

Table Wizard button

Choose this button to create a table with the Table Wizard.

New Table button

Choose this button to create a table manually in the Table Structure dialog.


See Also

Table Structure Dialog

Table Wizard


Create Label Dialog

See Also

This Catalog Manager dialog allows you to create a new label using either the Label Wizard or the Report Writer power tool. If you are unfamiliar with the Report Writer, you may want to use the Label Wizard instead.  This dialog provides the following options:

Select a Table or Query popup

Select a table or query for use in the creating your label.

Label Wizard button

Choose this button to start the Label Wizard.

New Label button

Choose this button to start the Report Writer.


See Also

Label Wizard

Report Writer


Create Program Dialog

See Also

This Catalog Manager dialog allows you to create new programs using either the Application Generator or the Text Editor.  If you are unfamiliar with the text editor, you may want to use the Application Generator instead.  This dialog provides the following options:

Application Generator button

Choose this button to create a program with the FoxPro Application Generator. FoxApp.

New Program button

Choose this button to create a program with the Text Editor. The Save As dialog allows you to specify a name for your file.


See Also

Text Editing

FoxApp


Data Menu

See Also

The Data menu options enable you to use files from other applications and save FoxPro files in formats recognized by other applications.  The Data menu contains the following options:

Add/Modify Index... displays the Add/Modify Index dialog so you can add an index to a table or modify an existing index in the active table or query.  This menu option is enabled only when a table is selected.

Order Table... displays the Order Table dialog so you can order a table in the active table query.

Import... displays the Import Data dialog so you can access files from other applications.

Export... displays the Export Data dialog so you can save files in any format supported by FoxPro.


See Also

Add/Modify Index dialog

Export Data dialog

Import Data dialog

Order Table dialog


Tools Menu

See Also

The Tools menu provides tools to simplify common operations on the highlighted file.

AutoScreen starts the AutoScreen feature. This tool creates and runs a new screen that displays fields and records from the selected table. By default, each field appears on a separate line with a label to its left. Screens created with the AutoScreen option can be modified with either the Screen Wizard or the Screen Design tool.

AutoReport starts the AutoReport feature. This tool creates a new report using fields and records from the selected table. By default, each field appears on a separate line with a label to its left. Reports created with the AutoReport option can be modified with either the Report Wizard or the Report Writer.

Mail Merge opens the Mail Merge Wizard. Use this option to create text files that contain data from the files open in Catalog Manager.

Settings... displays the Catalog Manager Settings so you can change FoxPro settings.

Beautify... displays the Beautification Options dialog so you can make cosmetic changes to your program.

Macros... displays the Macro Key Definition dialog so you can define and name a macro.

Filer starts the Filer Desk Accessory so you can maintain files and directories.


See Also

Catalog Manager Settings

Filer Desk Accessory

Macro Editing

Macro Key Definition Dialog

Mail Merge Wizard

Restore Macros Dialog

Stop Recording Macro Dialog


Catalog Manager Settings Dialog

See Also

The Catalog Manager Settings dialog provides a way of changing FoxPro system values from within the Catalog Manager. These values include:

Environment area

Bell check box

Check this box to toggle the computer bell on or off.

Carry check box

Check this box to determine whether data is retained between entries in APPEND or INSERT operations.

Century check box

Check this box to specify full display of the century in dates.

Confirm check box

Check this box to specify whether you must confirm data entry by pressing the Enter or Tab keys.

Deleted check box

Check this box to specify whether records that are marked for deletion appear during data processing.

Exact check box

Check this box to toggle between matching rules for string expressions.

Exclusive check box

Check this box to specify whether you can open a table for exclusive use or shared use on a network.

Safety check box

Check this box to determine whether FoxPro warns you before overwriting an existing file.

Clock check box and popup

Check this box to turn the clock display between on and off.

From the popup, specify twelve or twenty-four hour display format.

Margin spinner

Choose the spinner to specify the size of the left margin on printer output.

Memowidth spinner

Choose the spinner to specify the line width of memo fields and character expressions.

Decimal Places spinner

Choose the spinner to specify the number of decimal places displayed in numeric expressions.


See Also

Tools Menu


Create Query Dialog

See Also

This Catalog Manager dialog allows you to create a new query using either a query wizard or the Relational Query By Example (RQBE) power tool. If you are unfamiliar with RQBE, you may want to use the query wizards instead. This dialog provides the following options:

Query Wizard button

Choose this button to create a query with the one of three query wizards, Client-Server Query Wizard, SQL Query Wizard, or the Updatable Query Wizard.

New Query button

Choose this button to create a query with the RQBE power tool.


See Also

Client-Server Query Wizard

RQBE

SQL Query Wizard

Updatable Query Wizard


Remove File Dialog

This Catalog Manager dialog allows you to remove a file from the catalog and optionally delete the file from the disk. To remove a table from the Catalog Manager you must first remove all related screens, reports, and labels. This dialog has the following options:

File label

Shows the path of the file selected to be removed from the Catalog Manager

Delete File from Disk check box

Check this box if you want to delete the selected file from disk as well as remove the file from the catalog.

Remove button

Choose this button to confirm your selections and remove the file.


Add/Modify Index Dialog

See Also

This dialog displays the name of the current table and enables you to create and maintain indexes from within the Catalog Manager. The dialog has the following options:

Indexes area

New... button

Choose this button to display the Create Index dialog so you can create a new index on the active table in the current catalog.

Add... button

Choose this button to display the Open dialog so you can add an index to the current catalog. You can add either a compound (.CDX) or single entry index (.IDX) using this dialog.

Modify button

Choose this button to display the Change Index dialog so you can modify the current index.

Remove button

Choose this button to remove an index from the current catalog.


See Also

Data Menu

Index Dialog

Open Dialog

Order Table Dialog


View Menu

See Also

The View menu options provide an alternate way of opening the tabs in Catalog Manager.  The View menu contains the following options:

Table switches to the Table tab of Catalog Manager so you can access tables in the active catalog.

Query switches to the Query tab of Catalog Manager so you can access queries in the active catalog.

Screen switches to the Screen tab of Catalog Manager so you can access screens in the active catalog.

Report switches to the Report tab of Catalog Manager so you can access reports in the active catalog.

Label switches to the Label tab of Catalog Manager so you can access labels in the active catalog.

Program switches to the Program tab of Catalog Manager so you can access programs in the active catalog.


See Also

Catalog Manager


Change Screen Dialog

See Also

This Catalog Manager dialog allows you to modify a screen using either the Screen Wizard or the Screen Builder power tool.  If you are unfamiliar with the Screen Builder, you may want to use the Screen Wizard instead. This dialog has the following options:

Screen Wizard button

Choose this button to start the Screen Wizard.

Screen Builder button

Choose this button to start the Screen Design Window.


See Also

Screen Design Window

Screen Wizard


Change Report Dialog

See Also

This Catalog Manager dialog allows you to modify a report using either a Report Wizard or the Report Writer power tool. If you are unfamiliar with the Report Writer, you may want to use the Report Wizard instead. This dialog has the following options:

Report Wizard button

Choose this button to start the Report Wizard used to create the selected report.

Report Writer button

Choose this button to start the Report Writer.


See Also

Report Wizard

Group/Total Report Wizard

Multi-Column Report Wizard

Report Writer


Change Label Dialog

See Also

This Catalog Manager dialog allows you to modify a label using either the Label Wizard or the Report Writer power tool. If you are unfamiliar with the Label Writer, you may want to use the Label Wizard instead. This dialog provides the following options:

Label Wizard button

Choose this button to start the Label Wizard.

Report Writer button

Choose this button to start the Label Writer.


See Also

Label Wizard

Label Writer


Change Query Dialog

See Also

This Catalog Manager dialog allows you to modify a query using either a Query Wizard or the Relational Query By Example (RQBE) power tool. If you are unfamiliar with the RQBE power tool, you may want to use the Query Wizard instead. This dialog provides the following options:

Query Wizard button

Choose this button to start the Query Wizard used to create the selected query.

Query Tool button

Choose this button to modify a query with the RQBE power tool.


See Also

Client-Server Query Wizard

RQBE

SQL Query Wizard

Updatable Query Wizard


Create Index Dialog

See Also

This Catalog Manager dialog allows you to create new indexes for the selected table. You can create only compound index files (.CDX) in the Catalog Manager. The dialog contains the following options:

Available Fields list box

Double-click on a field to move it to the Index Keys list.

Index Keys list box

Double-click on a field to remove it from the Index Keys list.

Add button

Moves selected fields from the Available Files list to the Index Keys list.

Remove button

Removes selected fields from the Index Keys list.

Expression area

Add... button

Displays the Create Expression dialog so you can add a new expression to your index.

Edit... button

Displays the Create Expression dialog so you can edit a previously created expression.

Tag Name text box

Displays the tag name of the selected index.


See Also

Create Expression Dialog


Change Index Dialog

See Also

This dialog allows you to change indexes previously created in the Catalog Manager. You can change only compound index files (.CDX). A compound index file is an index file that contains any number of separate index entries or tags. Because the number of tags in a compound index file is limited only by disk space, you can have as many tags in the file as disk space permits.  All tags in a compound index are available when the file is opened. The dialog contains the following options:

Available Fields list box

Double-click on a field to move it to the Index Keys list.

Index Keys list box

Double-click on a field to remove it from the Index Keys list.

Add button

Moves selected fields from the Available Files list to the Index Keys list.

Remove button

Removes selected fields from the Index Keys list.

Expression area

Add... button

Displays the Create Expression dialog so you can add a new expression to your index.

Edit... button

Displays the Create Expression dialog so you can edit a previously created expression.

Tag Name text box

Displays the tag name of the selected index.


See Also

Create Expression Dialog


Create Expression Dialog

See Also

This dialog allows you to create or modify an expression for the selected index tag. This dialog contains the following options:

Tag Name text box

Displays the tag name for the currently selected index. If you are creating a new index you can enter a new index tag name.

Expression... button

Select this button to build an expression using the Expression Builder.


See Also

Expression Builder


AppleScript and Apple Events

See Also

AppleScript is a scripting language built on Apple's Open Scripting Architecture (OSA), an interapplication scripting standard.

Using the AppleScript Script Editor, you can create a script that contains a set of instructions. The Script Editor sends these instructions to the AppleScript extension, which then interprets the instructions and sends Apple events to the specified application. Apple events control the workflow among scriptable Macintosh applications by allowing the applications to share data and commands.

FoxPro for Macintosh supports the required suite of Apple events (Open Application, Open Document, Print Document, and Quit Application), as well as the Do Script event, which allows you to run FoxPro commands from an AppleScript.


AppleScript and Apple Events See Also
See Also

Creating AppleScripts

Running AppleScripts

Sample AppleScript

The Do Script Event

The Open Document Event

The Print Document Event

The Quit Application Event


Creating AppleScripts

You can create and compile scripts in the AppleScript Script Editor. To write a script, you need to know how to use statements in the AppleScript scripting language and which Apple events the specified application supports. The Script Editor can check the syntax and standardize the format of your script. For specific information about the AppleScript language and the AppleScript Script Editor, see the AppleScript Developer's Toolkit documentation available from Apple.

Apple Events Supported by FoxPro

FoxPro for Macintosh supports the required suite of Apple events and the Do Script event. The following Apple events can be sent by commands included in your AppleScript script:

Do Script

Open Application

Open Document

Print Document

Quit Application

Other Macintosh applications can run AppleScripts to access FoxPro functionality, using the Apple events that FoxPro for Macintosh supports.


The Open Application Event

Generated by the Tell Application scripting language command, as shown in the examples.


The Do Script Event

Do Script is not the same as the FoxPro DO command. However, you can include the FoxPro DO command in a Do Script as a FoxPro command.

The Do Script event has three elements: the Do Script command, an optional NOWAIT clause, and a text string that evaluates to a FoxPro command. The script command syntax is:

Do Script "[NOWAIT] <FoxPro command>"

The optional NOWAIT clause, which must precede the FoxPro command, causes the Do Script command to function asynchronously. Typically, you want to finish one FoxPro event before you begin the next one. There may be times, however, when you do not want to wait (for example, when running a complex query). Including the NOWAIT clause returns control to the next statement in the script without waiting for the previous command to complete.

The following script opens the LASER table in a Browse window and brings FoxPro to the front:

tell application "Microsoft FoxPro"

Do Script "SET DEFAULT TO ':samples:laser:data'"

Do Script "USE laser"

Do Script "BROWSE"

activate

end tell

The following line in a script issues a command to FoxPro to run the TEST.PRG program:

Do Script "DO TEST.PRG"


The Open Document Event

The Open Document event opens the requested file. The script command syntax is:

Open "<file>"

When FoxPro receives the Open Document event, FoxPro determines the file type by looking at the file extension (or the creator type if there is no file extension), then internally issues the equivalent FoxPro command(s).

Requested File Type	Command Equivalent	Action
Table (.DBF)	USE <file> AGAIN BROWSE LAST	Opens table in a Browse window.
Application (.APP)
Executable
Compiled program (.FXP)
Menu program (.MPR)
Compiled menu program (.MPX)
Compiled query (.QPX)
Screen program (.SPR)
Compiled screen program (.SPX)	SET DEFAULT TO <folder> DO <file>	Runs specified program.
Program file (.PRG)	MODIFY COMMAND <file>	Opens program in text-editing window.
Report file (.FRX)	MODIFY REPORT <file>	Opens report in Report Layout window.
Label file (.LBX)	MODIFY LABEL <file>	Opens label in Report Layout window.
Menu file (.MNX)	MODIFY MENU <file>	Opens menu in Menu Design window.
Project file (.PJX)	MODIFY PROJECT <file>	Opens project in Project window.
Query file (.QPR)	MODIFY QUERY <file>	Opens query in RQBE window.
Screen file (.SCX)	MODIFY SCREEN <file>	Opens screen in Screen Design window.
Text file (.TXT)	MODIFY FILE <file>	Opens file in text-editing window.


The Print Document Event

The Print Document event prints reports, labels, programs, and text files. The script command syntax is:

Print "<file>"

When FoxPro receives the Print Document event, FoxPro determines the file type by looking at the file extension (and looking at the creator type if there is no file extension), then internally issues the equivalent FoxPro command to print the file.

If the Print Document event specifies a report, FoxPro uses the REPORT FORM command to print the file. The command syntax is:

REPORT FORM <file> ENVIRONMENT TO PRINT

If the Print Document event specifies a label, FoxPro uses the LABEL FORM command to print the file. The command syntax is:

LABEL FORM <file> ENVIRONMENT TO PRINT

If the Print Document event specifies a program or text file, FoxPro uses the TYPE command to print the file. The command syntax is:

TYPE <file> TO PRINT PROMPT


The Quit Application Event

The Quit Application event quits FoxPro for Macintosh and returns control to the calling application or AppleScript. The script command syntax is:

Quit


Running AppleScripts

Once you've created and compiled a script, you can run the script in one of the following ways:

Click the Run button in the Script Editor window.

Double-click the script application icon (if you've saved it as an application).

From within FoxPro for Macintosh, issue the RUNSCRIPT command with the following syntax:

RUNSCRIPT <AppleScript>

For example, if you want to open an existing Microsoft Excel file, you could create an AppleScript that contained the following instructions:

tell application "Microsoft Excel"

open "Macintosh HD:budget.xls"

activate

end tell

This example AppleScript is named XLS_SCRIPT, and opens the Microsoft Excel file BUDGET.XLS. To run the XLS_SCRIPT from within FoxPro, type the following line in the Command window:

RUNSCRIPT xls_script


Sample AppleScript

This sample AppleScript exports data from the LASER database file into a Microsoft Excel worksheet. The first tell statement instructs FoxPro to export the data from the LASER database file to a worksheet called MOVIES.XLS. The second tell statement activates Microsoft Excel and opens the new spreadsheet on top. To run this AppleScript on your system, copy and paste this code into the AppleScript Script Editor and adjust the path names for your particular system.

tell application "Microsoft FoxPro"

activate application "Microsoft FoxPro"

Do Script "SET DEFAULT TO ':samples:laser:data'"

Do Script "USE laser"

Do Script "SET ORDER TO TAG acquired OF 'Macintosh HD:FoxPro:samples:laser:data:laser.cdx'"

Do Script "COPY TO 'Macintosh HD:movies.xls' FIELDS catno, title, rating, acquired NEXT 20 TYPE XLS"

Quit

end tell

tell application "Microsoft Excel"

activate application "Microsoft Excel"

open "Macintosh HD:movies.xls"

end tell


Colors

See Also

FoxPro offers a sophisticated set of commands for full control of colors.

By default, FoxPro for Windows and FoxPro for Macintosh take their colors from the Control Panel settings. The Control Panel colors are mapped to the FoxPro color schemes.  The colors can be overwritten using the FoxPro SET COLOR commands described in this section.

In FoxPro for Windows and FoxPro for Macintosh, you can set colors directly with the SET COLOR commands or interactively in the Control Panel.  Refer to your Windows or Macintosh documentation for more information about setting colors with the Control Panel.

In FoxPro for MS-DOS, you can define the colors of elements of the FoxPro system interface (the system menu bar, windows, alerts, dialogs, and so on) and user-defined objects (controls, menus, windows, and so on).  You can set colors directly with the SET COLOR commands or interactively with the Color Picker dialog, which is available by choosing Color... from the Window menu.  The Color Picker dialog provides the fastest way to set colors and allows you to save color sets for later use.  See the FoxPro User's Guide for more information on setting colors with the Color Picker dialog see the "Window Menu" chapter in the FoxPro for MS-DOSUser's Guide.

Certain commands, like DEFINE WINDOW, support optional COLOR and COLOR SCHEME clauses that let you specify colors of user-defined objects directly.

We recommend that you let Windows handle all coloring issues.  Refer to the Microsoft Windows manuals for more information on setting colors through the Color dialog.

If you prefer to set a different default set of colors when FoxPro is started, you can programmatically create and save your own custom default color set using the CREATE COLOR SET DEFAULT command.  Use this default color set by specifying it in the FoxPro CONFIG.FPW configuration file.

The following topics contain more information on colors:

Color Pairs

Color Schemes

Color Table by Color Pair

How Windows Colors are Mapped into FoxPro

Color Pairs

A color pair consists of a foreground and background color combination. FoxPro uses eight basic colors: red, green, blue, cyan, magenta, yellow, white and black.  Each color has two intensity levels: low intensity (dark) and high intensity (bright).

You can specify color pairs using either of two methods:

Character color codes

RGB color codes

Each method is described in detail below.

Character Code Color

FoxPro for MS-DOS uses character abbreviations (R, G, B, W, N) for color values.  Each color can have an attribute to change the intensity level.  Color codes that contain the plus sign (+) denote a bright foreground.  Similarly, color codes that contain the asterisk (*) denote a bright background.

The plus sign (+) and the asterisk (*) can be placed anywhere in the color pair.

Character Code Example

The following example shows the character color code for red on dark gray (high intensity black):

R+/N

You could also use any of the following to specify the same color code:

+R/N
R/N+
R/+N

Remember that both signs (+,*) denote high intensity (or brightness).  The plus sign (+) denotes foreground intensity, and the asterisk (*) denotes background intensity  no matter where they are located in the expression.

FoxPro for Windows supports the character codes for color.  These codes, however, are internally converted to the RGB system when program code is generated and compiled.

RGB Color Pairs

You can also specify colors the RGB color values.  These values range from 0 (lowest intensity or no color) to 255 (high intensity or bright color).  Each foreground and background requires three values, one for red, one for green, and one for blue.  A color pair, therefore, requires six values, three for the foreground and three for the background.

RGB Example

The following example shows the RGB color code for red on dark gray (high intensity black):

RGB(255,0,0,128,128,128)

The first three values in the RGB expression above set the foreground color to red and the second three values set the background color to dark gray (see the table below).

FoxPro uses a different color representation for the Windows version than it does for the MS-DOS version.  Both FoxPro for MS-DOS and FoxPro for Windows accept the RGB and character color codes.  Each of the color representations are described in sections that follow.

The following is a table of the colors that are available in FoxPro for MS-DOS, including the character codes and the corresponding RGB codes for FoxPro for Windows.

Color	RGB	Foreground	Background
White	255,255,255	W+	W*
Black	0,0,0	N	N
Gray	192,192,192	W	W
Dark Gray	128,128,128	N+	N*
Red	255,0,0	R+	R*
Dark Red	128,0,0	R	R
Yellow	255,255,0	GR+	GR*
Dark Yellow	128,128,0	GR	GR
Green	0,255,0	G+	G*
Dark Green	0,128,0	G	G
Cyan	0,255,255	BG+	BG*
Dark Cyan	0,128,128	BG	BG
Blue	0,0,255	B+	B*
Dark Blue	0,0,128	B	B
Magenta	255,0,255	RB+	RB*
Dark Magenta	128,0,128	RB	RB
Blank	N/A	X	X
When you use custom colors, the following rules apply for converting RGB values into character codes:

When ALL of the three color values (R, G or B) are below 32, the character code is N.

When ALL of the three color values (R, G or B) are between 32 and 64, the character code is N+.

When ALL of the three color values (R, G or B) are between 65 and 191, the character code is W.

When ANY of the three color values (R, G or B) are above 191 the character code is high intensity (+ or *).

Examples

R	G	B	Character
100	80	175	W
100	200	175	W+/*
33	56	45	N+/*
33	56	175	B
33	56	245	B+/*
100	100	3	GR
Color Pair List

A color pair list consists of one to ten color pairs separated by commas.  A color scheme is composed of ten color pairs.  For example,  W+/B, W+/BG, GR+/B, GR+/B, R+/B, W+/GR, GR+/RB, N+/N, GR+/B, R+/B.  A monochrome color pair list might look like W/N, N+/W, W+/N, W+/N, W/N, U+/N, W+/N, -, W+/N, W/N.

Color Schemes

A color scheme is a set of ten color pairs.  Each color pair in a color pair list corresponds to an item in a color scheme.  The color pair list for a color scheme can be returned with SCHEME( ) or RGBSCHEME( ).

A user-defined object (GET, check box, list, push button) takes on the color scheme of the window it is drawn in.  A user-defined menu takes on the colors of scheme 2.  You can override the default scheme of a user defined object by including the color scheme clause with the command.  The following commands support the color scheme clause:

@ ... EDIT - Text Edit Regions

@ ... FILL

@ ... GET

@ ... GET - Check boxes

@ ... GET - Invisible buttons

@ ... GET - Lists

@ ... GET - Popups

@ ... GET - Push Buttons

@ ... GET - Radio Buttons

@ ... SAY

@ ... TO

BROWSE

CHANGE

DEFINE BAR

DEFINE MENU

DEFINE PAD

DEFINE POPUP

DEFINE WINDOW

EDIT

SHOW GET

SHOW OBJECT

Color Set

A color set consists of 24 color schemes.  The complete color environment can be saved in a color set.  Color sets, like keyboard macros and memory variables, can be saved for later use.  A color set can be assigned a name of up to ten characters and saved.  Color sets are stored in the FOXUSER.DBF resource file.  You can load a color set with SET COLOR SET.

Commands and functions you can use to manipulate color schemes include:

RGBSCHEME( ) Function

SCHEME( ) Function

SET COLOR OF SCHEME Command

SET COLOR SET Command

How Windows Colors are Mapped into FoxPro

User Defined Windows (Scheme 1)

User Defined Menus (Scheme 2)

Menu Bar (Scheme 3)

Menu Popups (Scheme 4)

Dialogs (Scheme 5)

Dialog Popups (Scheme 6)

Alert (Scheme 7)

Window (Scheme 8)

Window Popups (Scheme 9)

Browse (Scheme 10)

Report (Scheme 11)

Alert Popups (Scheme 12)

User Defined Windows (Scheme 1)

Color Pair	Windows Element
1	Window text/Window background
2	Window text/Application Workspace
3	Window Frame/Window Background
4	Active title bar text/Active title bar
5	Inactive title bar text/Inactive title bar
5	For Windows 3.0: Active title bar text/Inactive title bar
6	Highlighted text/Highlight
7	Highlighted text/Highlight
8	No mapping
9	Window text/Window background
10	Disabled text/Window background
User Defined Menus (Scheme 2)

Color Pair	Windows Element
1	Menu text/Menu bar
2	Window text/Menu bar
3	Window Frame/Menu bar
4	Active title bar text/Active title bar
5	Inactive title bar text/Inactive title bar
5	For Windows 3.0: Active title bar text/Inactive title bar
6	Highlighted text/Highlight
7	Highlighted text/Highlight
8	No mapping
9	Menu text/Menu bar
10	Disabled text/Menu bar
Menu Bar (Scheme 3)

Color Pair	Windows Element
1	Menu text/Menu bar
2	Window text/Menu bar
3	Window Frame/Menu bar
4	Active title bar text/Active title bar
5	Inactive title bar text/Inactive title bar
5	For Windows 3.0: Active title bar text/Inactive title bar
6	Highlighted text/Highlight
7	Highlighted text/Highlight
8	No mapping
9	Menu text/Menu bar
10	Disabled text/Menu bar
Menu Popups (Scheme 4)

Color Pair	Windows Element
1	Menu text/Menu bar
2	Window text/Menu bar
3	Window Frame/Menu bar
4	Active title bar text/Active title bar
5	Inactive title bar text/Inactive title bar
5	For Windows 3.0: Active title bar text/Inactive title bar
6	Highlighted text/Highlight
7	Highlighted text/Highlight
8	No mapping
9	Menu text/Menu bar
10	Disabled text/Menu bar
Dialogs (Scheme 5)

Color Pair	Windows Element
1	Window text/Window background
2	Window text/Window background
3	Window Frame/Window Background
4	Active title bar text/Active title bar
5	Inactive title bar text/Inactive title bar
5	For Windows 3.0: Active title bar text/Inactive title bar
6	Highlighted text/Highlight
7	Highlighted text/Highlight
8	No mapping
9	Window text/Window background
10	Disabled text/Window background
Dialog Popups (Scheme 6)

Color Pair	Windows Element
1	Window text/Window background
2	Window text/Window background
3	Window Frame/Window Background
4	Active title bar text/Active title bar
5	Inactive title bar text/Inactive title bar
5	For Windows 3.0: Active title bar text/Inactive title bar
6	Highlighted text/Highlight
7	Highlighted text/Highlight
8	No mapping
9	Window text/Window background
10	Disabled text/Window background
Alert (Scheme 7)

Color Pair	Windows Element
1	Window text/Window background
2	Window text/Application Workspace
3	Window Frame/Window Background
4	Active title bar text/Active title bar
5	Inactive title bar text/Inactive title bar
5	For Windows 3.0: Active title bar text/Inactive title bar
6	Highlighted text/Highlight
7	Highlighted text/Highlight
8	No mapping
9	Window text/Window background
10	Disabled text/Window background
Window (Scheme 8)

Color Pair	Windows Element
1	Window text/Window background
2	Window text/Application Workspace
3	Window Frame/Window Background
4	Active title bar text/Active title bar
5	Inactive title bar text/Inactive title bar
5	For Windows 3.0: Active title bar text/Inactive title bar
6	Highlighted text/Highlight
7	Highlighted text/Highlight
8	No mapping
9	Window text/Window background
10	Disabled text/Window background
Window Popups (Scheme 9)

Color Pair	Windows Element
1	Menu text/Menu bar
2	Window text/Menu bar
3	Window Frame/Menu bar
4	Active title bar text/Active title bar
5	Inactive title bar text/Inactive title bar
5	For Windows 3.0: Active title bar text/Inactive title bar
6	Highlighted text/Highlight
7	Highlighted text/Highlight
8	No mapping
9	Menu text/Menu bar
10	Disabled text/Menu bar
Browse (Scheme 10)

Color Pair	Windows Element
1	Window text/Window background
2	Window text/Application Workspace
3	Window Frame/Window Background
4	Active title bar text/Active title bar
5	Inactive title bar text/Inactive title bar
5	For Windows 3.0: Active title bar text/Inactive title bar
6	Highlighted text/Highlight
7	Highlighted text/Highlight
8	No mapping
9	Window text/Window background
10	Disabled text/Window background
Report (Scheme 11)

Color Pair	Windows Element
1	Window text/Window background
2	Window text/Window background
3	Window Frame/Window Background
4	Active title bar text/Active title bar
5	Inactive title bar text/Inactive title bar
5	For Windows 3.0: Active title bar text/Inactive title bar
6	Highlighted text/Highlight
7	Highlighted text/Highlight
8	No mapping
9	Window text/Window background
10	Disabled text/Window background
Alert Popups (Scheme 12)

Color Pair	Windows Element
1	Window text/Window background
2	Window text/Window background
3	Window Frame/Window Background
4	Active title bar text/Active title bar
5	Inactive title bar text/Inactive title bar
5	For Windows 3.0: Active title bar text/Inactive title bar
6	Highlighted text/Highlight
7	Highlighted text/Highlight
8	No mapping
9	Window text/Window background
10	Disabled text/Window background
Color Table by Color Pair

Color	Code

Black	N

Blank	X

Blue	B

Brown	GR

Cyan	BG

Green	G

Magenta	RB

Red	R

White	W

Yellow	GR+

On monochrome monitors, only four "colors" are available:  white (W), black (N), underlined (U) and inverse video (I).

An asterisk (*) can be added to make the background color bright.  A plus sign (+) denotes high intensity for the foreground color.

Color pairs can also be specified with a set of 6 RGB (Red Green Blue) color values separated by commas.  The first three color values specify the foreground color and the second three color values specify the background color.  The color values can range from 0 through 255.

For example, the color pair R/W can also be specified with this RGB color pair:

RGB(255,0,0,255,255,255)

In FoxPro for Windows, you can set colors directly with the SET COLOR commands or interactively in the Windows Control Panel.  For more information about colors in FoxPro for Windows, see Colors.


Colors SeeAlso
See Also

CREATE COLOR SET Command

RGBSCHEME( ) Function

SCHEME( ) Function

SET COLOR Commands Overview

SET COLOR OF SCHEME Command

SET COLOR SET Command

SET COLOR TO Command


Command Continuation

To facilitate editing and viewing of a long command in the Command window, you may want to continue the command on additional line(s).  To continue a command on additional lines, place a semicolon between key words or clauses then press Enter and type the remainder of the command on the next line.  Note that lines in programs may also be split in the same manner.

When a command is continued on multiple lines and you want to use && and include comments with the command, the comments cannot be placed after a semicolon.  Instead, they must appear on the last line of the command.

Following is an example of a long SELECT command properly broken onto multiple lines:

SELECT customer.cno, ;
customer.contact, ;
customer.city, ;
customer.state, ;
customer.zip ;
FROM customer ;
ORDER BY customer.state, ;
customer.zip

When you are ready to execute a command split onto multiple lines, place the cursor on any line of the command and press Enter.  To insert a new line into a split command, press Ctrl+Enter.

Indentation greatly improves the readability of commands split onto multiple lines in the Command window.  To indent a command in the Command window, press Tab before typing the command.  You may press Tab repeatedly for additional indentation.  Once a line is indented in the Command window, following lines may be automatically indented the same amount by pressing Ctrl+Enter to move the cursor to the next line.

The maximum number of characters per command line is 2,048.  If macro substitution is used, the maximum number of characters in any single macro is 2,048 (after the macro is expanded).  Multiple macro substitutions can be combined on one command line, up to a maximum of 2,048 characters.


Commonly Used Commands
Commonly Used Commands and Functions

This topic provides new users with an overview of FoxPro commands and functions for accomplishing basic tasks.  These commands and functions represent the most powerful and frequently used commands and functions in the FoxPro language.  Once you understand these commands and functions, you'll be ready to create FoxPro programs.  While there are many other commands and functions you will want to learn about, this list provides a good starting point.

Command	Description
? | ??	Evaluates expressions and outputs the results.
@ ... SAY	Displays and formats a specified expression, field, memory variable or array element.  If you use the Screen Builder to create your data entry screens, you may not have to use @ ... SAY.
@ ... GET	Creates an editing region or a control.  If you use the Screen Builder to create your data entry screens, you may not have to use @ ... GET.
ACTIVATE WINDOW	Displays and activates a window created with DEFINE WINDOW.
ALLTRIM( )	Returns a character expression with leading and trailing blanks removed.
APPEND FROMFROM	Adds records to the end of the current table/.DBF from another file.
AT( )	Returns the beginning numeric position of the first occurrence of a character expression or memo field within another character expression or memo field, counting from the leftmost character.
BOF( )	Determines if the record pointer is positioned at the beginning of a  table.table/.DBF.
BROWSE	Opens the Browse window, in which you can view and/or edit table/.DBF records.
CANCEL	Cancels execution of the current program file.
COPY TO	Copies the contents of the current table/.DBF to a new file.
COUNT	Counts table/.DBF records.
CREATE	Creates a new table/.DBF.
DEFINE WINDOW	Creates a window.
DELETE	Marks records in a table/.DBF for deletion.
DELETED( )	Returns true if the current record is marked for deletion.
DISPLAY	Displays table/.DBF records or expressions.
DISPLAY MEMORY	Displays the contents of memory variables and arrays.
DISPLAY STATUS	Displays the status of the FoxPro environment.
DISPLAY STRUCTURE	Displays the structure of a  table.table/.DBF.
DO	Executes a FoxPro program.
DO CASE ... ENDCASE	Executes a set of commands based on a logical condition.
DO WHILE ... ENDDO	Executes commands inside a loop while a logical condition remains true.
EMPTY( )	Determines if an expression is blank.
EOF( )	Returns true if the record pointer is positioned at the end of a table/.DBF.
FLOCK( )	Attempts to lock a table/.DBF and returns true if successful.
FOR ... ENDFOR	Executes statements in a loop a specified number of times.
FOUND( )	Returns true if CONTINUE, FIND, LOCATE or SEEK is successful.
GATHER	Copies the contents of memory variables or array elements to fields.
IF ... ENDIF	Conditionally processes commands.
INDEX	Creates an index file to order a  table.table/.DBF.
INSERT - SQL	Appends a record to an existing  table.table/.DBF.
LABEL	Creates labels from a table/.DBF and a label file.
LOCATE	Locates a table/.DBF record.
LOCK( )	Attempts to lock a table/.DBF record or records.
LOWER( )	Returns a lower-case character string from a character expression.
MODIFY COMMAND/ MODIFY FILE	Opens a text editing window for a FoxPro program or a text file.
MODIFY LABEL	Opens the Label Design window in FoxPro for MS-DOS or the Report Layout Window in FoxPro for Windows.
MODIFY MENU	Opens a Menu Design window.
MODIFY PROJECT	Opens a Project window.
MODIFY QUERY	Opens an RQBE window.
MODIFY REPORT	Opens the Report Layout window.
MODIFY SCREEN	Opens the Screen Design Window.
MODIFY STRUCTURE	Modifies the structure of a  table.table/.DBF.
ON ERROR	Specifies a command that executes when an error occurs.
PACK	Removes all records marked for deletion, and reduces the size of a memo file.
PARAMETERS	Assigns data passed from a calling program to local memory variables.
PRIVATE	Hides specified memory variables or arrays that were defined in a calling program from the current program.
PROCEDURE	Identifies the beginning of a procedure in a program file.
QUIT	Exits FoxPro.
READ	Activates objects created with @ ... GETs and @ ... EDITs.
REPLACE	Updates table/.DBF records.
REPORT	Produces a report.
SCAN ... ENDSCAN	Moves the record pointer through the current table/.DBF and executes a block of commands for each record.
SEEK	Searches the current indexed table/.DBF.
SELECT	Activates the specified work area.
SELECT - SQL	Retrieves data from one or more  tables.tables/.DBFs.
SET INDEX	Opens one or more index files for use with the current  table.table/.DBF.
SET ORDER	Designates a controlling master index file or master tag.
SET RELATION	Creates a relationship between two or more tables.
SET SKIP	Creates one-to-many relationships between  tables.tables/.DBFs.
SET TALK	Determines whether or not FoxPro displays command results.
SHOW GETS	Redisplays all objects.
SKIP	Moves the record pointer.
SORT	Sorts a table/.DBF.
STORE	Stores data to a memory variable or a memory variable array.
UPPER( )	Returns an upper-case character string from a character expression.


Compatibility

See Also

This topic discusses the compatibility of FoxPro 2.6 with FoxPro 2.0, FoxBASE+, and other Xbase languages including dBASE III Plus and dBASE IV:

Compatibility Between FoxPro 2.0 and 2.6

FoxBASE+ Compatibility

Emulating FoxBASE+ Keystroke Assignments

FoxBASE+ Incompatibilities with FoxPro

dBASE Compatibility

Commands and Functions Affected by SET COMPATIBLE

International and Cross-Platform Compatibility

Compatibility Between FoxPro 2.0 and 2.6

Most FoxPro 2.0 files are completely compatible with FoxPro 2.6 and can be used without change.  However, several file types require conversion.  These files include:

File Type	Extension(s)
Screens	.SCX, .SCT
Reports	.FRX, .FRT
Labels	.LBX, .LBT
Menus	.MNX, .MNT
Projects	.PJX, .PJT
Applications	.APP
When you first open files of these types, FoxPro 2.6, with your permission, converts them to FoxPro 2.6 formats.  Applications (.APPs) must be rebuilt with the Project Manager.

Libraries (.PLBs) created with the FoxPro 2.0 Library Construction Kit cannot be used with FoxPro 2.5 or FoxPro 2.6.

For more information about converting these files to FoxPro 2.6 formats, see Transporting Files and the Using Files from Other Platforms chapter in the FoxPro Developer's Guide.

FoxBASE+ Compatibility

Compatibility with FoxBASE+ and other Xbase languages is controlled by the SET COMPATIBLE command.

SET COMPATIBLE FOXPLUS

In this mode (the default), programs written in FoxBASE+ (and dBASE III PLUS) run without change.  Try to run with SET COMPATIBLE FOXPLUS.  SET COMPATIBLE FOXPLUS may be used interchangeably with SET COMPATIBLE OFF.  New applications should always be written in FOXPLUS mode.

FoxPro recognizes the following FoxBASE+ file types:

Source programs (.PRGs) [image] These are automatically compiled to FoxPro compatible object programs (.FXPs).  See the section that follows about .FOX program files.

Database files (.DBFs).

Memo files (.DBTs) [image] While FoxPro recognizes .DBT-style memo files, it only converts them to FoxPro compatible memo files, with an extension of .FPT, when a new file is created from the old structure.  FoxPro can read and write to .DBT memo files without converting them to the new format, and it does not automatically replace the original .DBT files.

Index files (.IDXs) [image] See the section that follows about .NDX files.

Memory variable save files (.MEM files).

Screen format files (.FMT files) [image] FoxPro automatically compiles .FMT files into .PRX files whenever you execute the SET FORMAT TO command.

Report form files (.FRM files) [image] While the FoxPro Report Writer creates report form files in a different format than the FoxBASE+ format, FoxPro can print reports using the old .FRM format.  The Report Writer can also read .FRM type reports for modification, although it cannot save report files in the old .FRM format.

Label definition files (.LBL files).

The file types listed above require no modification before using them with FoxPro.  FoxPro handles all file conversion for you.

.NDX Index Files [image] As in previous Fox products, the indexes used to access FoxPro databases are different in format and usually much smaller than comparable dBASE III PLUS indexes.  This is due to the state-of-the-art indexing technique used by FoxPro.

If you're running applications that contain dBASE III PLUS .NDX index files, you don't have to worry about converting your index files to FoxPro format.  FoxPro takes care of it for you.

When you run a dBASE III PLUS application in FoxPro and use a dBASE III PLUS-style index file, FoxPro immediately and automatically reindexes the database, creating a FoxPro index file.

By default, these new index files are created with an extension of .IDX.  Some applications, however, may be written to require that index files have an .NDX extension.  If that's the case, add the following line to the CONFIG.FPW file:

INDEX = NDX

This causes FoxPro to use the .NDX extension with all index files it creates.  Of course, using this option will cause the original DB3 indexes to be destroyed during the automatic reindexing process.

.DBT Memo Files [image] FoxPro memo files (.FPTs) are slightly different than those used by FoxBASE+, dBASE III PLUS and dBASE IV (.DBTs) in that you can store any type of data in them.  The old style .DBT files only hold ASCII text data.  FoxPro, however, can read and write to .DBT memo files without converting them to the new format.

FoxPro creates a new .FPT type memo file from an existing .DBT file in two situations:

Whenever you create a new database structure from an existing database that contains a memo field and has an existing memo file.  The COPY TO command is an example.

Whenever you modify the structure of a database that has an associated memo file.  When the structure changes are saved, the .DBT file is converted to a new .FPT file.

To create a copy of a FoxPro database file that contains a memo field in the form that FoxBASE+ can understand, issue the following command:

COPY TO <filename> TYPE FOXPLUS

You should do this when your memo fields contain only characters which can be processed by FoxBASE+.  The forbidden characters, such as Ctrl+Z (CHR(26)) and Null (CHR(0)), should not be included.

FOX Program Files [image] FoxPro handles program compilation and management somewhat differently than in previous versions.

If you have existing FoxBASE+ programs that you'd like to execute, take note that FoxPro does not recognize or execute .FOX compiled programs.  Existing source files need to be compiled into .FXPs before they can be executed.  FoxPro automatically compiles any source .PRG file for which it cannot find a compiled  .FXP object file with the same name.  You can also use one of the manual compile options.*

A few other details, as described next, must be handled to insure complete FoxBASE+ compatibility.

CONFIG.FOX

To make it as simple as possible, we've provided a special CONFIG file that configures FoxPro to be completely FoxBASE+ compatible.  It's in the FOXPROW\GOODIES\MISC directory and is called CONFIG.FOX.  Simply rename it to be CONFIG.FPW or incorporate its contents into your own CONFIG.FPW.

Recompile Your Programs

Programs written in FoxBASE+ must be recompiled in FoxPro.  FoxPro will automatically compile a FoxBASE+ program when it is first run, but you may also want to compile your FoxBASE+ programs before running them in FoxPro.

Emulating FoxBASE+ Keystroke Assignments

FoxPro's default keystrokes are very similar to those of FoxBASE+ for Macintosh and are also similar to those of IBM's SAA (System Application Architecture) specification.

Therefore, if your programs rely on the exact keystrokes used to operate FoxBASE+ (and the READKEY( ) codes they generate), you will also need to utilize FOXPLUS.FKY, a special set of keyboard macros which reproduce FoxBASE+ keystrokes.  FOXPLUS.FKY is in the FOXPROW\GOODIES\MISC directory.

These macros are activated by this command:

RESTORE MACROS FROM FOXPLUS.FKY

SET Options Required for Complete FoxBASE+ Emulation

SET BRSTATUS ON

SET HEADING OFF

SET MACKEY TO

SET NOTIFY OFF

SET SCOREBOARD ON

SET STATUS ON

Some of the above settings, while required for complete compatibility, are not really desirable in the context of FoxPro.  A good example is SET STATUS ON, which activates the old-style status bar.  This is not really useful in native FoxPro mode [image] it's just for backward compatibility.

FoxBASE+ Incompatibilities with FoxPro

Certain FoxBASE+ features behave differently or cannot be supported in FoxPro.  Here is a list of known incompatibilities:

1	Arrays or user-defined functions created in FoxBASE+ may have been assigned the same names as new FoxPro functions.  These arrays or user-defined functions must be given new names.

2	The SET DEFAULT command performs a full DOS CHDIR (change directory) command in FoxPro.  FoxBASE+ does not perform a full DOS CHDIR command.  In FoxBASE+ you may only specify a DEFAULT drive; you may not include a directory specification as in FoxPro.

3	FoxPro .VUE files save the index order of the database.  In FoxBASE+ the index order is not saved.

4	FoxPro detects a few error conditions that FoxBASE+ ignores.  If your FoxBASE+ programs contain these errors, they will not run under FoxPro as they do under FoxBASE+, but instead will generate error messages.

5	Any program statements that have been written to rely on the fact that null characters cannot be placed in a string will not operate under FoxPro as under FoxBASE+.  For example, if a FoxBASE+ program initializes a string to the null string (containing no characters) with the command

mystring = CHR(0)

as opposed to the FoxPro technique of

mystring = ""

the program won't work under FoxPro as it did in FoxBASE+.  In the first case, FoxPro (which permits the null character to be stored in strings) would create a string that contains one character, the null character.

6	Because FoxPro's interface and interactive facilities (like BROWSE, CHANGE and EDIT) look entirely different from those of FoxBASE+, programs that rely on the precise physical appearance of the facilities in FoxBASE+ will not operate identically in FoxPro.

7	Issuing the command SET COLOR TO in FoxBASE+ will reset the screen to the default colors of black and white.  Issuing the same command in FoxPro has no effect.

8	A FILES statement in the FoxPro CONFIG.FPW configuration file will be ignored.

9	In FoxBASE+ you can use the COPY FILE command to make copies of a file that is open.  In FoxPro the file must be closed before it can be copied with COPY FILE.

10	FoxPro inserts a formfeed, the path and name of the file and the date at the beginning of output from the TYPE command when HEADING is SET ON.  FoxBASE+ does not insert this extra information, nor does FoxPro if HEADING is SET OFF.

dBASE Compatibility

Both dBASE III and dBASE IV files can be used in FoxPro.

Sharing files between dBASE and FoxPro

Although you can share files between dBASE and FoxPro, it is not recommended. FoxPro and dBASE have incompatible file locking mechanisms. In addition, because of the necessity of recreating index and memo field files for each application, tables are difficult to maintain.

dBASE III

FoxPro is a superset of dBASE III. Your dBASE III programs can run unchanged in FoxPro. See the discussion on FoxBASE+ compatibility for details.

dBASE IV

The only significant areas of incompatibility with dBASE IV are security, network functions, and the more rarely used SQL and transaction processing functions.  Most SQL programs (.PRS files) will need to be rewritten in FoxPro.  Also, FoxPro doesn't offer native support for security or transaction processing.  Many software vendors offer extensive libraries of security and network functions, providing an even richer alternative to the set of functions supported in dBASE.

Enhancing Compatibility with dBASE IV

You can maximize compatibility by issuing the command

SET COMPATIBLE DB4

This command changes the way FoxPro executes certain commands and functions to match the behavior of dBASE.  Setting COMPATIBLE DB4 is a great way to get your application up and running.  Eventually, as you add FoxPro features, you might find it easier to move away from using the compatibility feature.

When you are operating in the Catalog Manager, SET COMPATIBLE DB4 is the default.

Commands and Functions Affected by SET COMPATIBLE

@ ... GET with a RANGE clause	PLAY MACRO
@ ... SAY with CHR(7)	READ with an @ ... GET VALID clause
@ ... SAY scrolling	READ [image] Nested READs
@ ... SAY when STATUS is ON	RUN | !
ACTIVATE SCREEN	SET COLOR TO
ACTIVATE WINDOW	SET("BORDER")
APPEND MEMO	SET FIELDS
DECLARE	SET MESSAGE
DIMENSION	SET MEMOWIDTH
GO | GOTO with SET TALK ON	SET PRINT TO <file>
FSIZE( )	STORE
INKEY( )	SUM
LASTKEY( )	TRANSFORM( ) with a numeric PICTURE clause
LIKE( )	SELECT( )
MENU and POPUP commands	SYS(2001, "COLOR")
All file processing commands with a drive reference (for example, SET DEFAULT TO c:\foxprow\tutorial)

For a full description of how each of these commands is affected, see SET COMPATIBLE in the FoxPro Language Reference.

Template Programming

The dBASE IV template language is different from and independent of dBASE, so dBASE template programs cannot be used in FoxPro and will have to be rewritten. However, you don't have to learn another template language. FoxPro supports template programming natively. FoxPro commands that can be used in template programming include:

\ | \\

SET TEXTMERGE DELIMITERS

SET TEXTMERGE

_TEXT

_PRETEXT

TEXT ... ENDTEXT

For more information on template programming in FoxPro, see chapter 11, "Text Merge," in the FoxPro Developer's Guide.

Other Issues in dBASE IV Compatibility

In addition to the few language and syntax differences, the following differences between FoxPro and dBASE should be noted.

Parameter passing

In dBASE IV, parameters are passed by reference to both procedures and functions.  In FoxPro, parameters are passed by reference to procedures and by value to functions.

To pass parameters by reference to functions, add the command SET UDFPARMS TO REFERENCE to your program.

Changing Work Areas in a UDF

In FoxPro, if you change the selected work area in a UDF, the newly selected work area remains selected when the UDF returns control to the calling program. Upon return from a UDF, dBASE IV reselects the work area that had been selected before the function was called.

SET MULTILOCKS

SET MULTILOCKS ON is implicit in dBASE IV. You must explicitly set multilocks on in FoxPro.

Reading keystrokes

dBASE IV and FoxPro use different keyboard shortcut keys in the interactive environment.  If a dBASE IV application uses the READKEY or LASTKEY functions to check the user's last action and respond appropriately, errors might result.

FoxPro reads the key assignments from a macro file with the extension .FKY.  Modify the FOXPLUS.FKY macro file included with FoxPro 2.6 so keystrokes are mapped to dBASE keystrokes.  Then issue the command  RESTORE MACROS FROM FOXPLUS.FKY from your program.

Hard-coded file extensions

If you have hard-coded file extensions in your dBASE programs, you'll need to change some of the extensions. The following table shows FoxPro equivalent extensions for each type of dBASE file that a program might use. This table assumes that AutoConvert has converted all associated dBASE files.

dBASE File	FoxPro File
.DBF	No change needed
.DBT	.FPT
.FMT	.FPX
.FRG	No change needed
.FRM	.FPX
.LBG	No change needed
.LBL	.FPX
.MDX	.CDX
.NDX	.IDX
.PRG	No change needed
.QBE	No change needed
International and Cross-Platform Compatibility

This section describes what you can do to allow tables, indexes and programs you've created in earlier versions of FoxPro to take advantage of the international and cross-platform features.

Migrating from Earlier FoxPro Versions

To store the code page for the current FoxPro platform in the header of a table created in an earlier FoxPro version, open the table with the USE command.  If you have included the CODEPAGE configuration item in your FoxPro configuration file, a dialog asks if you'd like to mark the table's header with the current code page.  Once a table is marked with a code page, FoxPro can automatically translate character and memo fields in the table.  Because screens, menus, reports, labels and projects are saved as FoxPro tables, you must also open them with USE.

You must rebuild indexes created in earlier FoxPro versions if you'd like the index to use a collation sequence other than MACHINE.  Earlier FoxPro indexes are created in MACHINE order.  To use a different collation sequence, you must build a new index.  You cannot use REINDEX to build a new index -- REINDEX rebuilds an index and leaves the collation sequence unchanged.  The KEY( ) function and INDEX commands can be used to build new indexes from earlier indexes.

In order for a program created in an earlier FoxPro version to take advantage of automatic translation, you must recompile the program.  Recompiling the program marks the .FXP as "native" to the current platform.  When the .FXP is marked, you can run it on other FoxPro platforms and accented characters in the program are automatically translated.

Marking Tables with the Code Page

Follow these steps to mark tables, screens, menus, reports, labels and projects created in an earlier FoxPro version with a code page, allowing them to take advantage of the FoxPro automatic translation facilities:

1	Make sure that your FoxPro configuration (CONFIG.FPW) file contains this line:

CODEPAGE = AUTO

If your configuration file doesn't contain this line, add the line to the file and restart FoxPro.

2	With the USE command, open the table you'd like to convert.  If you're converting a screen, menu, report, label or project, open it as a table with USE.  Be sure to include the proper file extension.

3	In the dialog that appears, choose Yes to mark the table, screen, menu, report, label or project with the current code page.  If you choose No, the table, screen, menu, report, label or project is opened but is not marked with the current code page.

Specifying a Collation Sequence and Rebuilding Indexes

Follow these steps to let an index created in an earlier FoxPro version take advantage of the collation sequences available in FoxPro:

1	Make sure that your FoxPro configuration file contains this line:

CODEPAGE = AUTO

If your configuration file doesn't contain this line, add the line to the file and restart FoxPro.

2	Make sure that you've specified the collation sequence you'd like for the new index you'll create.  Use the SET COLLATE command or the International panel of the View window to specify a collation sequence.

3	Use the KEY( ) function to return the index expressions from the original index, and then use the index expressions in the INDEX command to create a new index.

Recompiling Programs to Enable Automatic Translation

Follow these steps to recompile programs and applications created in earlier FoxPro versions, allowing them to take advantage of the FoxPro automatic translation facilities:

1	Make sure that your FoxPro configuration file contains this line:

CODEPAGE = AUTO

If your configuration file doesn't contain this line, add the line to the file and restart FoxPro.

2	Recompile your programs (.PRGs) with the Compile... option on the Program menu or the COMPILE command.

Note that you must compile the program on a platform on which it was created.  To run the program on different platform, you must first translate the accented characters in the program.  See the Saving and Translating Programs and Text Files section for additional information.

3	To recompile programs in an application (.APP), open it in the Project Manager and then choose Build.  Choose the Rebuild All radio button and then choose OK.


Compatibility SeeAlso
See Also

SET COMPATIBLE Command


Configuring FoxPro

When you install FoxPro, it is configured to work the way most users will prefer.  Many of FoxPro's settings can be adjusted to fit your needs or to improve FoxPro's performance.

Command Line Switches

Startup Files

SET Commands

Starting the Catalog Manager

Special CONFIG.FPW Settings

Additional Special Settings

Function Keys and Macros

FOXUSER Resource File

Configuring FoxPro for International and Cross-Platform Features

Most of the configuration information included in this topic applies to FoxPro for Windows and FoxPro for Macintosh. For Macintosh-specific configuration tips, see the Configuring FoxPro for Macintosh topic.

Command Line Switches

When FoxPro is started, you can include a number of command line switches that will control how FoxPro operates.  A command line switch consists of a hyphen, followed by an upper- or lower-case letter, optionally followed by any additional information that may be needed (such as file or path name).  No embedded spaces are allowed.  These switches will override the environment variable FOXPROSWX that configures the same FoxPro operation.

To start FoxPro for Windows using command line switches

1	Select the FoxPro icon in the Program Manager window.

2	Choose Properties... from the File menu.

3	Add the appropriate switch code (see below), to the end of the file name in the Command Line text box.

4	Choose OK.

You may want to create a separate icon for each switch by choosing New... from the File menu in the Program Manager window.  Choosing Program Item displays the Program Item Properties dialog so that you can fill in the information as needed.

Command line switches can also be specified using the MS-DOS environment variable FOXPROSWX, discussed later in this section.

Specifying a Configuration File

You can specify the name of the configuration file (CONFIG.FPW) to be used, with the -C startup switch:

-C<pathname>\<file>

If you do not include the <file>, you must include a "\" after the <pathname> for FoxPro to look for an existing CONFIG.FPW.

This is equivalent to setting the environment variable FOXPROWCFG.  However, if the environment variable exists, this switch overrides the variable's effect.

You can suppress the use of a configuration file by specifying -C with no path or file name.  This can improve your startup speed as well.

Suppress the FoxPro Sign-On Screen

You can prevent the display of the sign-on screen by including the optional -T switch.

Specifying Switches with FOXPROSWX

Switches can be specified in a MS-DOS environment variable named FOXPROSWX.  You can create this MS-DOS environment variable with the MS-DOS SET command.

You can include the name of a FoxPro program to execute after FoxPro is running.  Switches can be specified using both FOXPROSWX and command line arguments.  If a conflict exists, the command line arguments prevail.

An example SET variable command is shown below.  The command should be placed in your AUTOEXEC.BAT file.

SET FOXPROSWX= -T

Do not include spaces between FOXPROSWX and the equal sign.  For more information on creating an MS-DOS environment variable with SET, refer to your MS-DOS manual.

Startup Files

One easy way to establish FoxPro's working environment automatically is through the startup configuration files:

FOXPRO.INI

CONFIG.SYS

CONFIG.FPW

FOXPRO.INI

The FOXPRO.INI file stores the default font information as well as the size and shape of the desktop window.  Although you can change these settings by editing the FOXPRO.INI file, FoxPro always updates the settings in the file when you exit from FoxPro.  The file is optional, which means you can delete it at any time.  However, FoxPro recreates the file and restores the settings in the file when you exit FoxPro.

CONFIG.SYS

The system configuration file, CONFIG.SYS, contains certain commands which are checked and executed when you start up your computer.  These commands change your computer's default configuration.  For example, you can increase or decrease the amount of memory that's set aside to hold data when reading or writing from disk, or you can add a device driver that allows extended memory to be used as expanded memory (EMS).

CONFIG.SYS is not a FoxPro file.  It's a file that your computer's operating system uses to establish the working environment.  Because FoxPro interacts with this environment, you must be sure that certain settings are properly established.  Two of the CONFIG.SYS statements are of immediate importance to FoxPro:

BUFFERS =
FILES =

For the best performance of BUFFERS and FILES, refer to the Optimizing Your System chapter in the FoxPro Installation and Configuration Manual.

Every file that you open in FoxPro uses a file handle.  When you close the file it "gives" the file handle back.  If you open 10 table files and five of the table files have memo files associated with them, 15 file handles will be in use.  If seven of the files have two indexes each, an additional 14 file handles will be used for a total of 29.  If your resource (FOXUSER) file and help file are in use an additional four file handles will be used (FOXUSER.DBF, FOXUSER.FPT, FOXHELP.DBF and FOXHELP.FPT).  .CDX files use one file handle each regardless of the number of tags contained in each.

Two editing sessions will take two file handles each.  Editing sessions take a file handle for the file itself and one for the temporary file that is opened for each editing session.  The temporary file is closed at the end of the editing session when the file being edited is closed.

See the reference material that accompanied your computer's operating system for complete details on CONFIG.SYS and the various statements it can contain.

Two MS-DOS environment variables can also be set in AUTOEXEC.BAT.  These are FOXPROSWX and FOXPROWCFG, described in the section Startup Switches earlier in this help topic.

CONFIG.FPW

FoxPro allows you to modify file storage locations and initial SET command defaults with a configuration file named CONFIG.FPW.

When FoxPro is started, it automatically searches the current working directory for a CONFIG.FPW file.  If one isn't found, FoxPro then searches the FoxPro directory and finally the MS-DOS path for CONFIG.FPW.  (Your MS-DOS manual provides a description of how to set a MS-DOS PATH.)  If no CONFIG.FPW file is found, FoxPro's default settings are used.

When you start FoxPro, you can include an optional switch to specify the name of the configuration file to be used (for information about how to set this up in your Properties dialog, refer to the startup switch section):

FOXPRO -C<pathname>\<file>

Alternately, you can include the following line in the AUTOEXEC.BAT file to specify a configuration file:

SET FOXPROWCFG=<pathname>\<file>

For quicker startup speed, refer to the Optimizing Your System chapter in the FoxPro Installation and Configuration manual.

Examples

To use CONFIG.FPW in the FOXFILES directory on the C: drive:

FOXPROW.EXE -CC:\FOXFILES\CONFIG.FPW

To use the CONFIG.FPW file in the TESTFILE directory on the D: drive:

FOXPROW.EXE -CD:\TESTFILE\CONFIG.FPW

If you do not include the <file>, you must include a "\" after the <pathname> for FoxPro to recognize an existing CONFIG.FPW.  To use the CONFIG.FPW file in the FOXFILES directory on the C: drive:

FOXPROW.EXE -CC:\FOXFILES\

The command line switch takes precedence over the SET command from the configuration file.

Starting the Catalog Manager

The CATMAN configuration item is used to specify whether the FoxPro Introductory Screen is displayed and the Catalog Manager launched when you start FoxPro.

Include the following line in your FoxPro CONFIG.FPW configuration file to suppress the FoxPro Introductory Screen and launch the Catalog Manager when FoxPro is started:

CATMAN = ON

Include the following line to suppress the FoxPro Introductory Screen and the Catalog Manager when FoxPro is started:

CATMAN = OFF

If your CONFIG.FPW doesn't contain the CATMAN configuration item, the FoxPro Introductory Screen is displayed when you start FoxPro.

Specifying Colors in the Configuration File

You can customize your FoxPro environment, including colors, with the CONFIG.FPW (CONFIG.FPM in FoxPro for Macintosh) configuration file.  In the configuration file, you can specify a default color set that is loaded when you start FoxPro, or the colors for individual color schemes.

We recommend that you do not specify colors in the configuration file.  Instead, let FoxPro read the colors from the environment's Control Panel.

To specify a default color set for use when FoxPro starts, include the following line in your configuration file:

COLOR SET = <mycolorset>

where <mycolorset> is the name of the color set you would like to use when starting FoxPro.  You use the SET COLOR command to create color sets.

The default color set you specify in your configuration file must be present in the FOXUSER.DBF file and FoxPro must be able to locate the resource file.  If FoxPro cannot find the color set you specify in FOXUSER.DBF or cannot locate FOXUSER.DBF, FoxPro's default colors are used.

To specify startup colors for an individual color scheme, you can include the following line in your configuration file:

COLOR OF SCHEME <expN> = <ColorPairList>

where <expN> is the number of the color scheme (1 through 24) you would like to define, and <ColorPairList> is a set of color pairs.  You can include a line in the configuration file for each color scheme.  The <ColorPairList> is a set of 1 to 10 color pairs.

If you include lines to designate a color set and color schemes in your configuration file, the color set takes precedence over the color schemes.

If you only designate color schemes in your configuration file and you have a default color set in your resource file, the designated color schemes take precedence over the default color set.  FoxPro does not load your default color set; instead, the FoxPro default color set is loaded and then replaced by the color schemes you designated..

Specifying Memory Allocation in CONFIG.FPW

You can allocate a percentage of available memory to FoxPro by add the following statement to your CONFIG.FPW file:

MEMLIMIT = <% of available memory>, [<Minimum memory (K)>]
[<Maximum memory (K)>]

You allocate memory by specifying the percentage of available memory that you want FoxPro to use.  In addition, you have the option of specifying the minimum and/or maximum amount of memory in kilobytes that you want allocated to FoxPro.

For example, specifying MEMLIMIT = 80, 1024, 4096 allocates 80 percent of your system's available memory to FoxPro with a minimum allocation of 1024 K and a maximum of 4096 K.

Changing Configuration Settings

It is simple to change settings in the configuration file using any text editor, especially the built-in FoxPro editor.  The CONFIG.FPW text file contains one or more lines with the following format:

<item> = <value>

For example, your configuration file could contain these settings:

TALK = OFF
BELL = OFF
LABEL = LBL
BLOCKSIZE = 40

In the example configuration above, the interactive talk feature is turned off, the bell does not sound when fields are filled, label definition files have an extension of .LBL (the default is .LBX), and new memo files are written in block sizes of 40 bytes.

Numeric configuration options are checked to ensure that they fall within the range of permissible values for that item.  Incorrect values are automatically changed to the nearest permissible value.  FoxPro will ignore any CONFIG.FPW statements that are not supported, rather than report an error.

After your change your CONFIG.FPW file, you must exit  FoxPro and start again before any of these changes take effect.

Customizing FoxPro with SET Commands

You can customize your FoxPro working environment in a number of ways.  You can make changes automatically when FoxPro is started, or you can make temporary modifications in the middle of a FoxPro session using SET commands (for information on individual SET commands, see the list below).  Some of the SET commands act as on/off switches that activate or deactivate various features (for example, SET TALK OFF), while others establish values that are used by another command (for example, SET PATH TO).

SET commands to include in your configuration file for compatibility with FoxBASE+ are discussed in the Compatibility chapter of the FoxPro Developer's Guide.

You can change SET command settings through the View window or by typing the SET commands in the Command window. Changes made to SET commands through the View window or the Command window are temporarythey remain in effect until they are changed again or until you quit FoxPro. To establish settings that stay in effect until you change them again, change the contents of the configuration file.

With the SET commands you can modify environment settings such as the default drive, color settings, a search path, and so on.  If you type the key word SET without any parameters, the View window comes forward.  Most of the panels in the View window contain SET parameters that you can change to meet your present needs.  To display a panel, just choose one of the four push buttons.

SET Commands in the Configuration File

If you find that you frequently adjust various SET options in a certain manner, you may want to automatically designate the default SET values at startup.  The configuration file can contain startup defaults for nearly all the SET commands.

SET Commands and Values

Note   The default settings marked with an asterisk (*) in the following table are overridden by international settings in your WIN.INI file.  For further information about international settings, see International Topics.)

Command	Values	Default	For More Information, See...
ALTERNATE	<file>		SET ALTERNATE
ALTERNATE	OFF | ON	OFF	SET ALTERNATE
ANSI	OFF | ON	OFF	SET ANSI
AUTOSAVE	OFF | ON	OFF	SET AUTOSAVE
BELL	ON | OFF	ON	SET BELL
BELL	Frequency:  19 to 10,000 Duration: 2 to 19	512,2	SET BELL
BELL	<filename> (Include the file name and path of a .WAV file, for example, BELL = "C:\WINDOWS\CHIMES.WAV")		SET BELL
BLOCKSIZE	<expN>	64	SET BLOCKSIZE
BORDER	<attribute>	SINGLE	SET BORDER
BRSTATUS	OFF | ON	OFF	SET BRSTATUS
CARRY	OFF | ON	OFF	SET CARRY
CENTURY	OFF | ON	OFF	SET CENTURY
CLEAR	ON | OFF	ON	SET CLEAR
CLOCK	OFF | ON	OFF	SET CLOCK
CLOCK	row, column | STATUS	0, 69	SET CLOCK
COLLATE	<expC>		SET COLLATE
COLOR	<color attrib>		SET COLOR  Overview
COLOR OF SCHEME	<ColorPairList> |<ColorScheme>	Current settings	SET COLOR OF SCHEME
COLOR SET	<ColorSetName>	DEFAULT	SET COLOR SET
COMPATIBLE	OFF | ON (FOXPLUS|DB4)	OFF (FOXPLUS)	SET COMPATIBLE
CONFIRM	OFF | ON	OFF	SET CONFIRM
CONSOLE	ON | OFF	ON	SET CONSOLE
CURRENCY	<expC>	"$"	SET CURRENCY
CURRENCY	LEFT | RIGHT	LEFT	SET CURRENCY
CURSOR	ON | OFF	ON	SET CURSOR
DATE	<expC>	AMERICAN	SET DATE
DEBUG	ON | OFF	ON	SET DEBUG
DECIMALS	<0 to 18>	2	SET DECIMALS
DEFAULT	<drive> | <dir>		SET DEFAULT
DELETED	OFF | ON	OFF	SET DELETED
DELIMITERS	OFF | ON	OFF	SET DELIMITERS
DELIMITERS	<expC>|DEFAULT	":" (colon)	SET DELIMITERS
DEVELOPMENT	ON | OFF	ON	SET DEVELOPMENT
DEVICE	SCREEN | PRINT | FILE <file>	SCREEN	SET DEVICE
ECHO	OFF | ON	OFF	SET ECHO
ESCAPE	ON | OFF	ON	SET ESCAPE
EXACT	OFF | ON	OFF	SET EXACT
EXCLUSIVE	ON | OFF	ON	SET EXCLUSIVE
FULLPATH	ON | OFF	ON	SET FULLPATH
F<num>	<char str>
HEADINGS	ON | OFF	ON	SET HEADINGS
HELP	ON | OFF	ON	SET HELP
HELP	<file>	FOXHELP	SET HELP
HOURS	12 | 24	12	SET HOURS
INTENSITY	ON | OFF	ON	SET INTENSITY
KEYCOMP	DOS | MACINTOSH |WINDOWS	current platform	SET KEYCOMP
LOGERRORS	ON | OFF	ON	SET LOGERRORS
MACKEY	<expC>	SHIFT + F10	SET MACKEY
MARGIN	<0 to 254>	0	SET MARGIN
MARK	<expC>	"/"	SET MARK TO
MEMOWIDTH	<8 to 256>	50	SET MEMOWIDTH
NEAR	OFF | ON	OFF	SET NEAR
NOTIFY	OFF | ON	ON	SET NOTIFY
ODOMETER	<1 to 32,767>	100	SET ODOMETER
OPTIMIZE	OFF | ON	ON	SET OPTIMIZE
PATH	<path>		SET PATH
POINT	<expC>	"." (period)	SET POINT
PRINTER	ON | OFF	OFF	SET PRINTER
REPROCESS |	<-2 to 32,000 > AUTOMATIC	0	SET REPROCESS
RESOURCE	ON | OFF	ON	SET RESOURCE
RESOURCE	<file>	FOXUSER	SET RESOURCE
SAFETY	ON | OFF	ON	SET SAFETY
SCOREBOARD	OFF | ON	OFF	SET SCOREBOARD
SEPARATOR	<expC>	"," (comma)	SET SEPARATOR
SPACE	ON | OFF	ON	SET SPACE
STATUS	OFF | ON	OFF	SET STATUS
STATUS BAR	OFF | ON	ON	SET STATUS BAR
STEP	OFF | ON	OFF	SET STEP
SYSMENU	ON | OFF | AUTOMATIC	ON	SET SYSMENU
TALK	ON | OFF	ON	SET TALK
TEXTMERGE	OFF | ON	OFF	SET TEXTMERGE
TRBETWEEN	ON | OFF	ON	SET TRBETWEEN
TYPEAHEAD	<0 to 128>	20	SET TYPEAHEAD
UDFPARMS	VALUE | REFERENCE	VALUE	SET UDFPARMS
UNIQUE	OFF | ON	OFF	SET UNIQUE
Special CONFIG.FPW Settings

While most items that can be set or changed through the CONFIG.FPW file are options that can also be controlled with SET commands, some configuration settings can be specified only through the CONFIG.FPW file.

Explanations for each of the configurations settings follow this table.

Special Config Items

Item	Values	Default
CATMAN	ON | OFF
COMMAND	<command>
EDITWORK	<dir>	Startup directory
_BEAUTIFY	Program	BEAUTIFY.APP
_FOXDOC	Program	FOXDOC.DLL
_GENGRAPH	Program	GENGRAPH.APP
_GENMENU	Program	GENMENU.PRG
_GENPD	Program	GENPD.APP
_GENSCRN	Program	GENSCRN.PRG
_GENXTAB	Program	GENXTAB.PRG
_SPELLCHK	Program	SPELLCHK.APP
_STARTUP	Program	FOXSTART.APP
_TRANSPORT	Program	TRANSPRT.PRG
INDEX	<extension>	IDX
LABEL	<extension>	LBX
MEMLIMIT	<% of available memory> [<minimum memory (K)>] [<maximum memory (K)>] Note: Applies to Windows and MS-DOS only; ignored on Macintosh platform
MVCOUNT	128 to 3600 128 to 65,000 (32-bit FoxPro)	256
OUTSHOW	ON | OF	ON
PROGWORK	<dir>	Startup directory
REPORT	<extension>	FRX
RESOURCE	<path name> Startup directory	FOXUSER
SHELL	<command>
SORTWORK	<dir>	Startup directory
TEDIT	[/<expN>] <editor>
TMPFILES	<drive:>	Startup directory
Additional Special Settings

COMMAND

Executes a valid FoxPro command after all other configuration settings are established.  For instance, if you'd like FoxPro to clear the screen every time it starts, you could use the statement:

COMMAND = CLEAR

Or, if you'd like FoxPro to start a certain program automatically every time, you could use:

COMMAND = DO <program>

If you include a DO command like the previous one, you can bypass the named startup program by including the name of a different program when you initially start FoxPro:

FOXPRO <program>

If you include _STARTUP, COMMAND or SHELL configurations items in your FoxPro configuration file, they are executed in the following order:

{bullet.bmp}	The startup program specified in _STARTUP is executed first.

{bullet.bmp}	The command specified in COMMAND is executed next.

{bullet.bmp}	The program shell specified in SHELL is executed last.

EDITWORK

Specifies where the text editor should place its work files.  In some circumstances, the work file can become as large as the original file; for that reason, this option should only be specified if the alternate location has plenty of free space.

_GEN System Memory Variables

You can specify other program names as values for these system memory variables, using the format <_GEN variable name> = <program name>

INDEX

Specifies the extension for FoxPro index files.  The default extension is .IDX.

LABEL

Specifies the extension for FoxPro label definition files.  The default extension is .LBX.

MVCOUNT

Sets the maximum number of memory variables that FoxPro can maintain.  This value can range from 128 to 3,600 in FoxPro standard, or to 65,000; the default is 256.

OUTSHOW

Disables the Shift+Ctrl+Alt (hide all windows in front of the current output window) feature.

When several windows are open, the current output window may sometimes become hidden behind some of the other windows.  By pressing Shift+Ctrl+Alt, you can momentarily hide all windows that are in front of the current output window.  Use OUTSHOW to disable this feature.

PROGWORK

Specifies where the program cache file will be placed.  Users may wish to put this file in a RAM disk or on a local workstation drive.  FoxPro tries to keep the size of this file less than 256K, but it can grow larger if necessary.  It may be especially useful to specify PROGWORK when using FoxPro in a multi-user environment.  See the discussion of this and related commands below.

REPORT

Specifies the extension for FoxPro report definition files.  The default extension is .FRX.

RESOURCE

Specifies where FoxPro is to find the FOXUSER resource file.  <pathname> may be a directory or a fully-qualified pathname.  If <pathname> is a directory, then a file named FOXUSER.DBF is searched for.  Otherwise, a file with the specified name is searched for.  If the file does not exist it is created.

SHELL

Specifies a program shell that is executed when FoxPro is started. See _SHELL for more information about running a program within a shell.

If you include _STARTUP, COMMAND or SHELL configurations items in your FoxPro configuration file, they are executed in the following order:

{bullet.bmp}	The startup program specified in _STARTUP is executed first.

{bullet.bmp}	The command specified in COMMAND is executed next.

{bullet.bmp}	The program shell specified in SHELL is executed last.

SORTWORK

Specifies where commands such as SORT and INDEX will place their temporary work files.  SORT and INDEX can require work space up to twice the size of the file being sorted or indexed, so be sure there is enough room in this directory.  This parameter can be useful when you are operating FoxPro in a multi-user environment.  SORTWORK and related commands are discussed below.

_STARTUP

Use _STARTUP to specify the name of the application that executes when you start FoxPro.  By default, this application is FOXSTART.APP, an application supplied with FoxPro that adds the Run menu to the main menu bar.

See _STARTUP for more information about specifying a startup application.

If you include _STARTUP, COMMAND or SHELL configurations items in your FoxPro configuration file, they are executed in the following order:

{bullet.bmp}	The startup program specified in _STARTUP is executed first.

{bullet.bmp}	The command specified in COMMAND is executed next.

{bullet.bmp}	The program shell specified in SHELL is executed last.

TEDIT

Specifies the external text editor used when you edit program files with MODIFY COMMAND or MODIFY FILE.

Include the optional clause /N with TEDIT to specify a Windows text editor (for example, Microsoft Word for Windows):

TEDIT = /N <editor>

To use an MS-DOS editor, do not include the /N.

TMPFILES

Sets the drive and directory where the EDITWORK, SORTWORK and PROGWORK files are stored if they have not been specified otherwise with any of the other options.   This can be useful for optimizing performance in a multi-user environment.

The EDITWORK, PROGWORK, SORTWORK and TMPFILES special configuration items let you specify where temporary work files and frequently accessed FoxPro files will be placed.  Careful placement of these files can improve FoxPro's performance, particularly on a network.

If possible these files should be placed on the fastest drive available.  On networks the fastest drive is usually a workstation's local drive.  Be sure to provide ample disk space for the temporary work files as some can grow quite large.

Further performance information can be found in the Optimizing Your System chapter in the FoxPro Installation and Configuration manual and the Optimizing Your Application chapter in the FoxPro Developer's Guide.

Function Keys and Macros

In addition to the various configurations and hardware modifications that you can use to optimize performance, you can modify several other program options to suit your needs and tastes.

Function Keys

FoxPro comes to you with default values or actions assigned to ten of the available function keys.

Function Key Assignments:

Key	Assignment

F1	(Activate on-line help)

F2	set;

F3	list;

F4	dir;

F5	display structure;

F6	display status;

F7	display memory;

F8	display;

F9	append;

F10	(Activate/deactivate the system menu bar -- same as Alt)

The semicolon (;) at the end of each character string represents a carriage return.  With the semicolons, FoxPro outputs the string just as if you had typed it in and pressed Enter.  Without the semicolons the character strings are simply typed out for you, but do not include an Enter needed for them to execute.

FoxPro allows you to assign a different character string, up to 254 characters maximum, to F1 through F12 with the SET FUNCTION command or by including the appropriate statements in the CONFIG.FPW file.  (If your computer has F11 and F12 keys, they have no default in FoxPro but you can define them.)  You can also use the Macros... option on the Program menu to assign new meanings to function keys.

Current function key settings can be viewed in the Macros dialog, which appears when you choose Macros... from the Program menu.

Macros

FoxPro contains a powerful, time-saving macro definition feature that allows you to assign a collection of FoxPro actions to a single keystroke.  By defining and using macros you can avoid typing a series of keystrokes over and over.

The macro definition and playback feature can be used to record and play back the keystrokes that are necessary to carry out an entire task.  You can create macros that emulate the commands of your favorite word processor or text editor, store the steps that are needed to save and close a text file or assemble various collections of text that you use often.

A collection of macro definitions can be saved to a macro file (extension .FKY) and restored for later use.

FOXUSER Resource File

The FoxPro resource file FOXUSER.DBF holds a variety of resource information (for example, window positions, color sets, Browse window configurations, label definitions, etc.).  FOXUSER is a standard FoxPro table with an associated memo file (.FPT).   If the index file does not exist, it is created when the FOXUSER file is opened.

While RESOURCE is SET ON, FoxPro handles all resource management.  Users at the beginning to intermediate levels need not concern themselves with the contents and workings of this file.  However, more advanced users may wish to inspect and modify the data contained in this file in two ways:

1	Special window configurations or other window preferences, once established and saved in the resource file, can be protected from subsequent interactive changes by modifying the READONLY field for the specific resource (see the example in the Predefining Browse Window Configuration section below).

2	Resources that are no longer needed or wanted may be deleted and the resource file may be packed.

Modifying the READONLY field and/or deleting records from the resource file are the only two actions that you should perform on the FOXUSER file.  We encourage you to make a copy of the resource file before you make any modifications.

Structure of FOXUSER

The FOXUSER table has the following structure:

Field	Field Name	Type	Width Dec
1	TYPE	Character	12
2	ID	Character	12
3	NAME	Character	24
4	READONLY	Logical	1
5	CKVAL	Numeric	6
6	DATA	Memo	10
7	UPDATED	Date	8
		Total	74
TYPE

This field identifies the type of information the resource holds.

ID

This field identifies the record within the TYPE.

NAME

This field contains the name assigned to the resource, for instance the name assigned to color sets, BROWSE and system windows.

READONLY

This logical field can be set to true (.T.) to indicate that the resource data should be used for read-only access and cannot be changed.

CKVAL

This field is used by FoxPro to verify that the data (in the memo field DATA) is valid.

DATA

This is a memo field that holds the actual data for the named resource.

UPDATED

The date the current record was last changed.

The FOXUSER resource file can be made read-only by marking it at the MS-DOS level.  The MS-DOS command ATTRIB uses the <+R> setting to mark a file as read only; see your MS-DOS manual for instructions or use the FoxPro Filer located on the Help menu.  Marking a file read-only is useful in multi-user situations, because the FOXUSER file can be shared on a network.

Modifying the FOXUSER Resource File

Several SET commands are available that allow you to open and easily modify the FOXUSER file's contents, as well as use a resource file other than FOXUSER.  These commands permit you direct access to the resource table of your choice.

SET RESOURCE TO <resource file>
SET RESOURCE TO
SET RESOURCE ON
SET RESOURCE OFF

If you want to make changes to your resources, use the various dialogs in the interface to turn off access to the resource file and open it with its associated index as described below:

1	In the On/Off panel of the View window, uncheck the Resource check box.  This makes the resource file available to be opened as a table.

2	In the View panel of the View window, select an unused work area and open FOXUSER.DBF.

3	Now you can use the Browse window to modify the READONLY field or mark records for deletion.

If you prefer to work through the Command window, or you want to create a utility program to do all of this for you, use the following commands:

SET RESOURCE OFF
USE FOXUSER
BROWSE

With the resource file open, you can use CHANGE, EDIT, BROWSE, DELETE, REPLACE and other FoxPro commands to modify or delete data.  You can even use COPY TO to create a new resource table.  When you've finished modifying the resource file, pack it if you marked records for deletion, and close it.  Then, set the resource feature on through the interface dialogs or with the following commands:

USE
SET RESOURCE ON

You can open the FOXUSER file in a work area without setting resource OFF by issuing the command USE SYS(2005) AGAIN.  SYS(2005) returns the name of the current resource file.

Predefining Browse Window Configuration

One handy modification that you can make to the FOXUSER file is changing the READONLY field for predefined Browse window configurations.

First, adjust a BROWSE window to display specific fields that are sized for easy manipulation, position the window and size it, split the window into two partitions with one partition in BROWSE mode and one in CHANGE, then close the window.  When the BROWSE window is closed, its configuration is saved in the current resource file, provided the field named READONLY is not set to T and provided the window was not closed with Ctrl+Q.

Then, issue USE SYS(2005) AGAIN and edit the READONLY field, setting it to true (.T.).  To do this, look for the BROWSE window resource that has a TYPE of PREFW, an ID of WINDBROW and a NAME field with the alias of the table you just browsed.  When the READONLY field is true (.T.), the corresponding resource data will not be overwritten if the Browse window configuration is later changed interactively.

Now, whenever this table is browsed with the BROWSE LAST command, the Browse window appears in the same position with all its field, size and placement configurations the same as the last session.  No matter how much the Browse window is changed by the user, it will always return according to the data in the resource when you BROWSE LAST.

Configuring FoxPro for International and Cross-Platform Features

This topic describes how you configure FoxPro to take advantage of its international and cross-platform features, including automatic translation of accented characters (ä, é,ô and so on) across different FoxPro platforms.  In earlier versions of FoxPro, any translation of accented characters had to be performed manually. FoxPro now supports automatic translation of characters across code pages. Automatic translation of accented characters can occur in tables, programs and text files.  FoxPro also supports collation sequences, allowing you to order tables for a specific language.

A code page is a set of characters specific to a language or hardware platform.  Accented characters are not represented by the same ASCII values across platforms and code pages.  In addition, some characters available in one code page are not available in another.

Specifying a Code Page in the FoxPro Configuration File

The CODEPAGE configuration item can be included in your FoxPro configuration file (CONFIG.FP in FoxPro for MS-DOS and CONFIG.FPW in FoxPro for Windows) to specify a code page option.

Note   Automatic translation of accented characters is not enabled by default.  You must explicitly enable automatic translation by including CODEPAGE = AUTO in your FoxPro configuration file.

CODEPAGE = AUTO

The recommended CODEPAGE setting is AUTO.  When CODEPAGE is set to AUTO, accented characters are automatically translated.  The translation is performed for character and memo fields in tables and for character strings in compiled programs.

When you set CODEPAGE to AUTO, the code page for the current FoxPro platform is stored in the headers of new tables, allowing FoxPro to determine the platform on which a table was created.

When you open a table on a platform different than the platform on which the table was created, accented characters are translated if you've enabled automatic translation with CODEPAGE = AUTO on each platform.  This allows you to share tables created on different FoxPro platforms worry-free, knowing that accented characters in character and memo fields will be automatically translated from one platform to the next.

For example, if the letter ä is entered in a table created in a U.S. version of FoxPro for MS-DOS (which uses code page 437) and is then displayed in FoxPro for Windows (which uses code page 1252, the most common Windows code page), FoxPro for Windows performs the translation necessary to display the letter as ä.  When data is added to the table in FoxPro for Windows, it is automatically translated and stored in the table in the 437 code page.

Note that MODIFY STRUCTURE also marks a table with the current code page.  The PACK and ZAP commands do not change the code page a table is marked with.

Preventing Translation

In some cases, you'll want to disable automatic translation for selected character or memo fields in a table, or for all character and memo fields in the table.

For example, if you store binary data such as a Microsoft Word document or a graphic image in a memo field, you do not want FoxPro to translate the document or graphic when you access the binary data.  You may also want to share a table with someone using an earlier version of FoxPro.  In this case you'd want to disable the automatic translation of all character and memo fields in the table.

Use the SET NOCPTRANS command to disable automatic translation of a set of character or memo fields.

FoxPro disables automatic translation for all character and memo fields in a table if the CODEPAGE configuration item is not included in your configuration file.

Other Code Page Settings

The recommended code page setting is AUTO.  However, in rare cases, you may want to specify a code page even though your operating system is set to another code page.  For example, this may be desirable in locales where code pages are installed as TSR (Terminate and Stay Resident) programs.  You can set FoxPro to automatically translate to a specific code page by including this line in your FoxPro configuration file:

CODEPAGE = <expN>

The numeric expression <expN> must be a code page identifier supported by the current FoxPro platform for translation to occur.

FoxFont Considerations

FoxPro for Windows includes FoxFont, an OEM font that provides compatibility with FoxPro for MS-DOS.  We suggest that you do not use FoxFont (or other OEM fonts) in FoxPro for Windows if you share tables and applications across different FoxPro platforms.  Instead, use Windows fonts and the automatic translation facilities of FoxPro -- set CODEPAGE = AUTO on each FoxPro platform and let FoxPro do the translation.

With an international keyboard, you cannot enter accented characters in FoxFont.  Use ANSI fonts with an international keyboard.  Even if your keyboard does not directly support accented characters, you can still enter accented characters in ANSI fonts by pressing Alt+0XXX.  (XXX is the three digit sequence found in a table of ANSI characters, and must by typed on the numeric keypad.)

FoxPro Applications

FoxPro can automatically translate accented characters in applications.  Accented characters can be used in the following locations:

Table file names

Table alias names

Table field names

Index file names

File names

Memory variable and array names

Window names

Menu names

Popup names

Character string literals

Character expressions

The code page for the current FoxPro platform is automatically stored in the headers of compiled programs (.FXPs), allowing FoxPro to determine the platform on which the .FXP was compiled.

When a compiled application is run on a FoxPro platform different than the platform on which it was compiled, accented characters in the application are translated if automatic translation is enabled in your configuration file with CODEPAGE = AUTO.

Opening and Translating Programs and Text Files

If a program (.PRG) or text file (.TXT) was created on a FoxPro platform other than the platform on which you want to open the file, you can translate the accented characters when you open the file.  If you open the program or text file with the Open... option on the File menu, you can translate the file by checking the Other Code Page check box before you open the file.  In the dialog that appears after you choose Open, specify the platform on which the file was created.  The accented characters in the file are translated when displayed so they appear the same on the current platform as they did on the platform you specified.  No translation occurs if you don't check the Other Code Page check box.

If you open the program or text file with MODIFY COMMAND or MODIFY FILE, you can include the AS clause to specify the platform on which the file was created.  Include the numeric code page in the AS clause that corresponds to the FoxPro platform on which the program or text file was created.

Saving and Translating Programs and Text Files

After you've opened a program or text file, you can save the file and translate it for use on another FoxPro platform.  Choose the Save As... option on the File menu and check the Change Code Page check box.  In the dialog that appears after you choose Save, specify the desired platform.

If you're editing a program that you plan to compile on the current FoxPro platform, be sure to specify the current FoxPro platform when you save the program.

Ordering Records for a Specific Language

FoxPro supports collation sequences that allow you to order tables for a specific language.  In earlier FoxPro versions tables were always ordered in a "machine" sequence; this sequence was not correct for some languages.  A collation sequence determines the order in which records appear in an indexed or sorted table.  A collation sequence also determines the results of character expression comparisons.

Collation sequences for several languages are available, allowing you to index and sort tables so that the records in the table appear in the proper sequence for your language.

FOXPRO.INT, a file included with FoxPro, must be present in your FoxPro directory to take advantage of certain collation sequences and code pages.

Specifying a Collation Sequence

You can specify a collation sequence with COLLATE = in your FoxPro configuration file, from the International panel of the View window, or with the SET COLLATE command.  Since you'll typically specify a collation order just once, it's easiest to specify it in your configuration file.

Specifying a Collation Sequence in the Configuration File

Include the COLLATE configuration item in your FoxPro configuration file to specify a default startup collation sequence.  For example, to specify a Dutch collation sequence when FoxPro is started, include the following line in your configuration file:

COLLATE = DUTCH

If the COLLATE configuration item isn't included in your configuration file, the startup default collation sequence is MACHINE.

The following table lists the COLLATE options you can include in your configuration file.

Options	Language

DUTCH	Dutch

GENERAL	English, French, German, Modern Spanish, Portuguese and other Western European languages

ICELAND	Icelandic

MACHINE	Machine (the default collation sequence for earlier FoxPro versions)

NORDAN	Norwegian, Danish

SPANISH	Traditional Spanish

SWEFIN	Swedish, Finnish

Note   When you specify the SPANISH option, "ch" is a single letter that sorts between "c" and "d", and "ll" sorts between "l" and "m".


Configuring FoxPro for Macintosh

SeeAlso

When you install FoxPro for Macintosh, it is configured to work the way most users prefer. However, you can adjust many settings to fit your needs or to improve the performance of FoxPro.

The majority of configuration items are the same on Windows, MS-DOS, and Macintosh platforms. The cross platform configuration items are explained in the Configuring FoxPro topic. This topic covers configuration techniques that are specific to the Macintosh, and includes:

Adjusting the Macintosh Environment

Establishing the FoxPro Startup Environment

Customizing FoxPro with SET Commands

Modifying Function keys and Macros

Adjusting the Macintosh Environment

In Macintosh System 7, you can change memory settings through the Info window and adjust system attributes through control panels. Most of these settings affect FoxPro for Macintosh. For more information about control panels, see your Macintosh documentation.

The Info window provides information about the creation date and size of an application. It also enables you to adjust the amount of memory allocated to FoxPro at startup.

Each Macintosh application icon has an associated Info window that displays the name, size, location, version, and creation date of the application. The Info window also lists the suggested, minimum, and preferred memory sizes. You can edit the default memory settings for the Minimum size and the Preferred size. Increasing allocated memory in Preferred size can improve the performance of FoxPro. Decreasing the amount of memory listed in Preferred size will limit the number of open files and could prevent you from performing some operations. However, on computers with limited memory, you might need to reduce this setting to run a FoxPro application.

To change the amount of memory allocated to FoxPro

1	Before you start FoxPro for Macintosh, select the Microsoft FoxPro application icon.

2	From the Finder File menu, select Get Info (or press [image] +I).

3	In the Info window, select either the Minimum size or Preferred size value.

4	Type the new value.

5	Close the Info window.

Changes to memory settings take effect after you close the Info window.

Establishing the FoxPro Startup Environment

You can establish the FoxPro working environment automatically through the FoxPro Settings file and the FoxPro configuration file (CONFIG.FPM). The FoxPro Settings file contains information about default screen and printer fonts and the main FoxPro window. The FoxPro configuration file can contain default settings for the FoxPro environment.

The SET values in the CONFIG.FPM file take precedence over the settings in the FoxPro Settings file.

FoxPro Settings File

The FoxPro Settings file is a text file that contains information about default screen and printer fonts, and the size and location of the main FoxPro window. The FoxPro Settings file is installed in the PREFERENCES folder of the SYSTEM folder. Although you can change the FoxPro Settings file using the built-in FoxPro editor, it is best not to change the FoxPro Settings file.

When you start FoxPro, it seeks a FoxPro Settings file in the PREFERENCES folder of the SYSTEM folder. If FoxPro does not find a FoxPro Settings file in the PREFERENCES folder or the FOXPRO folder, it starts with the default settings.

FoxPro Configuration File (CONFIG.FPM)

You can override default file storage locations and initial SET command values with the FoxPro configuration file CONFIG.FPM. You can have several CONFIG.FPM files on your hard disk. FoxPro determines which CONFIG.FPM file to use at startup in the following manner:

 	If you double-click the Microsoft FoxPro icon, FoxPro looks for a CONFIG.FPM file in the same folder and uses its settings.

If you double-click a CONFIG.FPM icon, FoxPro uses these settings.

If you double-click a FoxPro application icon in a folder such as APPS, FoxPro uses the CONFIG.FPM file in the APPS folder. If none is available, FoxPro uses the CONFIG.FPM file in the folder where FoxPro is located.

Note   The SET values in the CONFIG.FPM file take precedence over the settings in the FoxPro Settings file.

Specifying Settings in CONFIG.FPM

To change settings in the configuration file, use the built-in FoxPro editor or any text editor. The CONFIG.FPM file contains one or more lines with the following format:

<item> = <value>

For example, your configuration file could contain these settings:

TALK = OFF

STATUS BAR = OFF

DEFAULT = MacHD:FOXPRO

In this example, the interactive talk feature is turned off, the status bar does not appear, and MacHD:FOXPRO is the default volume and folder.

FoxPro checks numeric configuration options and automatically changes incorrect values to the nearest permissible value. In addition, FoxPro ignores any CONFIG.FPM statements that are not supported, rather than report an error.

Note   After you change the CONFIG.FPM file, you must exit FoxPro and start again before any of these changes take effect.

Macintosh-Specific SET Command Values

The table below lists the SET command values that apply only to FoxPro for Macintosh.  For a complete list of SET command values that work cross platform, refer to the Configuring FoxPro topic.

SET Command	Values	Default	For more information, see...
APLABOUT	ENABLE | DISABLE	ENABLE	SET APLABOUT
LOGERRORS	ON | OFF	ON	SET LOGERRORS
MACHELP	ENABLE | DISABLE	ENABLE	SET MACHELP
MACDESKTOP	ON | OFF	ON	SET MACDESKTOP
VOLUME	<expC>		SET VOLUME
XCMDFILE	<filename>		SET XCMDFILE
Special CONFIG.FPM Items

While most items that can be set or changed through the CONFIG.FPM file are options that can also be controlled with SET commands (see the previous section for details), some configuration settings can be specified only through the CONFIG.FPM file.

Most special configuration settings can be used cross platform. The following table explains the items that function differently in the Macintosh environment. For a complete list of cross platform configuration items, see the Configuring FoxPro topic.

CONFIG item	Values	Default	Comments
MEMLIMIT	N/A	N/A	Not supported on FoxPro for Macintosh;  any MEMLIMIT setting in the CONFIG.FPM file is ignored
OUTSHOW	ON | OFF	ON	Disables the Shift+ [image] +Control+Option keystroke combination that hides all windows in front of the current output window.
TEDIT	N/A	N/A	Not supported on FoxPro for Macintosh;  any TEDIT setting in the CONFIG.FPM file is ignored
Modifying Function Keys and Macros

You can modify the macros assigned to the function keys on the Macintosh extended keyboard, and the macros assigned to [image] and Control key combinations on all Macintosh keyboards when FoxPro is active.

Function Keys

FoxPro supports default values or actions for 10 of the function keys on the Macintosh keyboard. The semicolon (;) at the end of each character string represents a carriage return.

Extended Keyboard Key	Standard Keyboard Key	Function
F1	+1	(Activate Help)
F2	+2	SET;
F3	+3	LIST;
F4	+4	DIR;
F5	+5	DISPLAY STRUCTURE;
F6	+6	DISPLAY STATUS;
F7	+7	DISPLAY MEMORY;
F8	+8	DISPLAY;
F9	+9	APPEND;
F10	+0	(Activate/deactivate the system menu bar.)
When you type semicolons at the end of the function string, FoxPro enters the string into the Command window just as if you had typed it and then pressed the Return key. Without the semicolons, the character strings are entered into the Command window but are not executed until you press the Return key.

In FoxPro for Macintosh, you can assign a different character string to the F1 through F15 function keys with the SET FUNCTION command, or by including the appropriate statements in the CONFIG.FPM file. Each character string can be up to 254 characters long.

Defining Macros

FoxPro contains a powerful macro definition feature that lets you assign a collection of FoxPro actions to a single keystroke. By defining and using macros, you can avoid typing a series of keystrokes over and over.

You can use the macro definition and playback feature to record and replay the keystrokes that carry out an entire task. You can create macros that emulate the commands of your word processor or text editor, that store the steps needed to save and close a text file, or that assemble collections of text you use often.

Save a collection of macro definitions to a macro file with the filename extension .FKY. You can then restore the entire collection later.

Some key combinations are reserved by Macintosh system software. Unless you want to override the FoxPro for Macintosh defaults, do not use the following combinations in macros:

Reserved Key Combinations	Action
+N	New
+O	Open
+W	Close
+S	Save
+P	Print
+Q	Quit
+Z	Undo
+X	Cut
+C	Copy
+V	Paste
A	Select All
+.	Stop an operation


Configuring FoxPro for Macintosh SeeAlso
See Also

Cross-Platform Considerations

International Considerations


Converting PICT Files to BMP Files

SeeAlso

PICT to BMP, in the GOODIES:MISC folder of FoxPro, is a simple stand-alone application shipped with FoxPro for Macintosh. This application eases the conversion of PICT images created and saved on the Macintosh to .BMP files for FoxPro for Windows.

The application displays two menu option; File and Edit.

When you open PICT to BMP, from the File Menu, select Preferences... and specify the file-saving and file safety options.  PICT to BMP automatically uses these options as soon as you select a file using the File Open dialog.  These options are not saved between sessions.  Each option always defaults to OFF.

File Menu

Open displays the File Open dialog, so you can select the PICT file you want to convert to .BMP format using the current Preferences... settings.  When you select a file, conversion proceeds immediately.

Preferences... lets you specify the way files are saved by PICT to BMP.

The Input PICT file option: check box toggles automatic file deletion on and off.  If you check this option, PICT to BMP deletes the original PICT file as soon as the conversion is complete and the .BMP file is saved.

The Convert PICT file to BMP bitmaps format option: check box toggles automatic overwrite of duplicate .BMP file names on and off.

Quit closes PICT to BMP.

You can also use the System 7 Drag-and-Drop feature to convert PICT files to .BMP format:

When you click and drag the icon for a PICT file and drop it on the PICT to BMP icon, PICT to .BMP automatically converts the PICT file to .BMP format and saves the new .BMP file to the folder in which the PICT file is located.  The original PICT file remains in its folder.  Since PICT to BMP reverts to its default Preferences, it will prompt you for a new filename if it encounters a duplicate .BMP filename in the target folder.


PictToBMP See Also
See Also

Using PICT Files

Using BMP Files


Creating Macros

See Also

Macros can greatly simplify your interactions with FoxPro and save you time during data entry. When you press a macro key combination, FoxPro executes the series of defined keystrokes just as if you had typed them. Individual macros can be combined in macro sets and stored in files. For instance, if you are accustomed to using a wordprocessor, you might want to define macros to make the FoxPro text editor operate in a similar manner to the word processor.

Macros are handy to use when editing text. For example, you could define a macro to:

Delete the line of text preceding the cursor.

Delete everything from the cursor position to the end of the text.

Insert a line of text at the top of a file, position the cursor at the bottom of the file and insert another line of text.

Macros can be created in two ways: automatically and manually.

When you create a macro automatically, you enter the key combinations that you want the macro to execute, and FoxPro automatically records your keystrokes much as a tape recorder records your voice.

Creating Macros Automatically

To automatically create a macro, choose the Record… push button in the Macros Dialog. The Macro Key Definition Dialog appears. You can also press Shift+F10 at any time in FoxPro to display this Macro Definition dialog so you can create a macro. (By default, Shift+F10 displays the Macro Definition dialog, but you can redefine this key combination.)

Creating Macros Manually

When you create a macro manually, you type the keystrokes that you want the macro to execute into a text-editing area.

To manually create a macro, choose the New… push button in the Macros Dialog. The Macro Edit Dialog appears.


Creating Macros See Also
See Also

Macros Dialog

Macro Edit Dialog

Macro Key Definition Dialog

Program Menu

Restore Macros Dialog

Stop Recording Macro Dialog

Text Editing


Creator File Types

See Also

The following list includes the creator file types used by FoxPro for Macintosh. All files have the creator FOXX.

Creator File Type	FoxPro Files	File Extension
F+DB	Table	.DBF
F+DT	FoxBASE+  and FoxPro Memo File	.DBT, .FPT
F+FM	Format File	.FMT
F+FR	Screen File	.SCX
F+IX	Single-Entry Index File	.IDX
F+LB	Label File	.LBX
F+ME	Memory Variable Save File	.MEM
F+PR	FoxPro Program	.PRG
F+RP	Report File	.FRX
F+VU	View File	.VUE
FACT	FoxDoc Action Diagram	.ACT
FAPP	Generated Application	.APP
FBAK	File Backup	.BAK
FCDX	Compound Index File	.CDX
FDOC	FoxDoc Reports	.DOC
FERR	Compilation Error File	.ERR
FEXE	Executable Program	.EXE
FFKY	Macro Files	.FKY
FFRT	Report Memo	.FRT
FFXP	Compiled FoxPro Program	.FXP
FINT	Code Page File/ Collation Sequence File	.INT
FLBT	Label Memo	.LBT
FMNT	Menu Memo	.MNT
FMNX	Menu File	.MNX
FMPR	Generated Menu Program	.MPR
FMPX	Compiled Menu Program	.MPX
FPJT	Project Memo	.PJT
FPJX	Project	.PJX
FPRX	Compiled Format	.PRX
FQPR	Generated Query Program	.QPR
FQPX	Compiled Query Program	.QPX
FSCT	Screen Memo	.SCT
FSPR	Generated Screen Program	.SPR
FSPX	Compiled Screen Program	.SPX
FTBK	Memo File Backup	.TBK
FTMP	Temporary File	.TMP
FWIN	Window Save File	.WIN
HELP	Graphical Help File	.HLP
LIBR	Macintosh Library	.MLB
TEXT	Text File	.TXT


Creator File Types See Also
See Also

File Extensions


Cross-Platform Development

See Also

When you develop cross-platform applications, keep these considerations in mind:

Use the FoxPro power tools for development speed and consistency.

Use the Transporter to move a FoxPro application to another platform.

Avoid platform-exclusive code so that applications can run unchanged on other platforms.

If you can't avoid platform-specific code, bracket it so FoxPro doesn't attempt to run it on an unsupported platform.

Use MS-DOS file naming conventions.

Use MS-DOS path conventions rather than the Macintosh convention of using a colon (:) in path names. The MS-DOS path conventions are recognized on all platforms.

If MS-DOS or Windows code contains a single-letter drive reference, such as C:, map the Macintosh volume to the letter using the SET VOLUME command.

Do not specify fully qualified filenames in your applications; use relative path names that are consistent from platform to platform.

Before you transport applications from FoxPro for Macintosh to FoxPro for Windows, copy the FoxPro for Macintosh GENSCRN.PRG file to the FoxPro for Windows directory. Otherwise, FoxPro for Windows treats the FoxPro for Macintosh screens as FoxPro for MS-DOS screens and does not transport them correctly.

Macintosh Paths, Volumes, Folders, and Files

FoxPro for Macintosh recognizes both Macintosh and MS-DOS path, volume, folder, and filename conventions. This topic describes the standard Macintosh conventions and their MS-DOS equivalents. Although FoxPro for Macintosh supports the conventions of both platforms, consider using the MS-DOS naming conventions and delimiters when developing cross-platform applications because they are recognized on all platforms.

This discussion covers Macintosh and cross-platform conventions for:

Paths

Volumes and Drives

Folders and Directories

Filenames

Paths

Following are notes about MS-DOS and Macintosh path delimiters in FoxPro:

In FoxPro for MS-DOS and FoxPro for Windows, paths are specified using a colon to delimit a volume, and a backslash (\) as a delimiter between directory names. For example:

C:\SALES\EAST

In FoxPro for Macintosh, paths are specified using colons as delimiters between volume and folder names. For example:

MacDrive:Sales:East

In FoxPro for Macintosh, if a path contains spaces, it must be enclosed in quotation marks. If you use macro substitution for a path name that contains spaces, quotes must surround the macro or its value. For example:

myfile = "MacDrive:Sales East"
USE "&myfile"

Note   FoxPro for Macintosh accepts Macintosh path conventions in programs and in the Command window. However, commands and functions that return paths or filenames use the MS-DOS convention (backslash delimiters) instead of the Macintosh convention (colon delimiters). For example, assuming the default directory in FoxPro for Macintosh is Mac:Apps:FoxPro

CURDIR()	&& Returns "\Apps\FoxPro\"

SYS(2003)	&& Returns "\Apps\FoxPro"

SYS(5)	&& Returns "Mac:"

SET('DEFAULT')	&& Returns "Mac:\Apps\FoxPro"

Volumes and Drives

Following are notes about MS-DOS drives and Macintosh volumes in FoxPro:

In FoxPro for MS-DOS and FoxPro for Windows, a disk drive is a single letter followed by a colon. For example:

C:

In FoxPro for Macintosh, the volume name is followed by a colon. For example:

MacHD:

If you develop cross-platform applications and you need to map a Macintosh volume or folder to an MS-DOS drive designator, use the SET VOLUME TO command. For example, the following line maps the Macintosh volume MacHD to the MS-DOS C drive:

SET VOLUME C: TO MacHD:

The following line maps the FolderOne folder on the MacHD FoxPro volume to the MS-DOS C drive :

SET VOLUME C: TO MacHD:FolderOne

Folders and Directories

Following are notes about MS-DOS directories and Macintosh folders in FoxPro:

In FoxPro for MS-DOS and FoxPro for Windows, a directory name is preceded by a backslash. For example:

SET DEFAULT TO \FOXPRO

In FoxPro for MS-DOS and FoxPro for Windows, you can use two periods to change to the parent directory. For example:

SET DEFAULT TO ..

In FoxPro for Macintosh, a folder name is preceded by a colon. In the following example, FoxPro and Apps are the names of folders:

SET DEFAULT TO MacHD:FoxPro:Apps

In FoxPro for Macintosh, multiple colons indicate parent folders relative to the current folder. For example, if you are currently in the FOXPRO folder which is in the APPS folder, this command makes APPS the current folder:

SET DEFAULT TO ::

Note   Do not use backslashes in folder names. Although the Macintosh accepts backslashes as valid characters in a folder name, FoxPro uses MS-DOS path delimiters and tries to interpret a folder name containing a backslash as two separate folders. For example, if a single folder is named FoxPro\Apps, FoxPro for Macintosh tries to find a folder called APPS in a folder called FOXPRO.

Filenames

Following are notes about MS-DOS and Macintosh filenames in FoxPro:

In FoxPro for MS-DOS and FoxPro for Windows, filenames can be up to 11 characters long and cannot contain spaces (8 characters, followed by a period and an extension of up to 3 characters). Following is an example of a valid filename in FoxPro for MS-DOS or FoxPro for Windows:

LASER.APP

In FoxPro for Macintosh, filenames can be up to 31 characters long and can contain spaces. If a filename does not have an extension, FoxPro for Macintosh will truncate the filename to 27 characters, then add a period and a three-letter extension based on file type. Following is an example of a valid FoxPro for Macintosh filename:

Laser_Application.app

FoxPro for Macintosh accepts long names for programs and procedures. However, once a program has been loaded into FoxPro, the significance of the filename is limited to 10 characters. This means you can have names as long as the Macintosh permits, but if the first 10 characters of two filenames match, attempts to reference the second name will be matched by the first reference.

For example, assume you name a program MyMainProcedure1.prg, and then name a second program MyMainProcedure2.prg. If you DO MyMainProcedure1.prg, and then attempt to DO MyMainProcedure2.prg, you will receive an error message that says FoxPro is already in MyMainProcedure2.prg.


Macintosh Paths, Volumes, Folders, and Files See Also
See Also

Distributing Applications

Differences in Keyboard Functionality

SET KEYCOMP

SET MACDESKTOP


Customizing the Apple Menu

See Also

When FoxPro for Macintosh is the active application, the Apple menu displays the option About FoxPro... . You can alter or disable the About FoxPro... option in FoxPro and in applications you develop using FoxPro.

SET APLABOUT enables or disables the About FoxPro... option on the Apple menu, or changes the prompt to a user defined text string.

ON APLABOUT runs a command, usually a DO program, when the user selects the About FoxPro... option on the Apple menu.


Customizing the Apple Menu See Also
See Also

Customizing the Help Menu


Customizing the Help Menu

See Also

In FoxPro for Macintosh and applications you develop in FoxPro, you can customize the Help menu with the following commands:

SET MACHELP enables or disables the Microsoft FoxPro Help... option on the Help menu, or changes the prompt to a user-defined text string.

ON MACHELP is used with the SET HELP TO and HELP commands to open a custom online Help file when the user selects the Microsoft FoxPro Help... option from the Help menu.


Customizing the Help Menu See Also
See Also

Choosing an Online Help System


Cross-Platform Differences

See Also

In general, Microsoft FoxPro for Windows, Microsoft FoxPro for MS-DOS and FoxPro for Macintosh provide the same features because they are cross platform products. However, because Microsoft FoxPro for Windows and FoxPro for Macintosh are graphical products and Microsoft FoxPro for MS-DOS is a character-mode product, you'll encounter some differences as you move applications among platforms.

For example, several commands and functions in FoxPro for Macintosh are either unique or have new or changed functionality from FoxPro for Windows and FoxPro for MS-DOS. These commands and functions are discussed in detail in the Language Reference.

This topic discusses the following cross-platform features of FoxPro:

Dynamic Data Exchange (DDE)

How FoxPro for Macintosh and FoxPro for Windows Support OLE

Online Help

Interface

Language

Power Tools

Keystroke Differences

Configuration File

Macintosh Considerations

If you use FoxPro for MS-DOS, you can refer to the What's New Since 2.5 help topic for information about new features in FoxPro 2.6 for MS-DOS.

Dynamic Data Exchange (DDE)

FoxPro for Windows supports data exchange between FoxPro and other applications both as a client and as a server. FoxPro for Macintosh does not support DDE directly, but similar functionality is available through Apple events and AppleScripts.

The following DDE (Dynamic Data Exchange) functions provide support for data exchange between FoxPro for Windows and other Microsoft Windows applications. FoxPro for Windows can act as both a server and a client to send and receive data to and from other Windows applications.

Note that these DDE functions do not adhere to standard FoxPro naming conventions. The first four characters of these functions are not unique, the function names are longer than ten characters, and the function names cannot be abbreviated.

DDE Function	Description
DDEAbortTrans( )	Aborts an asynchronous DDE transaction.
DDEAdvise( )	Creates a notify link or an automatic link used in dynamic data exchange (DDE).
DDEEnabled( )	Enables or disables dynamic data exchange (DDE) processing or returns the status of DDE processing.
DDEExecute( )	Using dynamic data exchange (DDE), sends a command to another application.
DDEInitiate( )	Establishes a dynamic data exchange (DDE) channel between FoxPro for Windows and another Microsoft Windows-based application.
DDELastError( )	Returns an error number for the last dynamic data exchange (DDE) function.
DDEPoke( )	Sends data between client and server applications in a dynamic data exchange (DDE) conversation.
DDERequest( )	Requests data from a server application in a dynamic data exchange (DDE) conversation.
DDESetOption( )	Changes or returns dynamic data exchange (DDE) settings.
DDESetService( )	Creates, releases or modifies service names and settings in FoxPro for Macintosh.
DDESetTopic( )	In a dynamic data exchange (DDE) conversation, creates or releases a topic name from a service name.
DDETerminate( )	Closes a dynamic data exchange (DDE) channel established with DDEInitiate( ).
For more information about these DDE functions, see DDE.

Object Linking and Embedding (OLE)

FoxPro for Windows and FoxPro for Macintosh support object linking and embedding, which allows you to place information such as sound, pictures and spreadsheets created in other applications into FoxPro. FoxPro for Windows and FoxPro for Macintosh support object linking and embedding as a client; that is, they can accept linked or embedded objects.

How FoxPro for Windows and FoxPro for Macintosh Support OLE

To support OLE, FoxPro for Windows and FoxPro for Macintosh include a new data type called general. When you set up a table, you can define a field of type general which is basically a memo field that can contain any type of linked or embedded information. For example, you can link or embed pictures, sound, spreadsheets, or text created in other applications that support OLE into a general field. Each general type field can hold one object. You can modify the linked or embedded objects from within FoxPro for Windows or FoxPro for Macintosh. When you double-click the object in a FoxPro table the application that created the object opens so you can make any modifications.

Interface Access to OLE

The Edit menu contains several menu options for using OLE.

Language Access to OLE Data

The following commands provide access to linked or embedded objects:

@ ... SAY - BMPs & OLE Objects

APPEND GENERAL

MODIFY GENERAL

Online Help

FoxPro for Windows and FoxPro for Macintosh support two different help styles:

graphical Help, familiar to Microsoft Windows users

.DBF-style help, familiar to FoxPro for MS-DOS users

FoxPro for MS-DOS supports .DBF-style help.

Interface

Some differences exist in the interfaces in FoxPro for Macintosh and FoxPro for MS-DOS.

Menu System

The menu system in FoxPro for Macintosh is slightly different than the menu system in FoxPro for Windows. The menu systems of both GUI versions are different from the menus of FoxPro for MS-DOS. This difference is necessary for consistency with other Microsoft Windows applications. In general, you'll notice that a few menu options appear on different menus and that the Object, Help and Text menus have been added in FoxPro for Macintosh to allow graphical control of text and objects. FoxPro for MS-DOS menu options whose functions are duplicated in Microsoft Windows have been removed.

To find out more about a menu or menu option in FoxPro for Macintosh, select the menu or menu option and read the description that is displayed in the status bar.

FoxPro for MS-DOS Menu Options That Have Been Moved or Removed in FoxPro for Windows and FoxPro for Macintosh

The Debug, Trace and Macros... menu options were moved to the Program menu in FoxPro for Windows and FoxPro for Macintosh.  The Move, Size and Zoom menu options are standard operations for any window and are available on the Control menu in each window in FoxPro for Windows.  Maximize and Minimize on the Control menu replace the Zoom options that exist in FoxPro for MS-DOS.

The System menu in FoxPro for MS-DOS does not exist in FoxPro for Windows and its help and desk accessory options have been moved to the new Help menu. The ASCII Chart, Capture and Special Characters desk accessories are not included in FoxPro for Windows because Microsoft Windows offers the same options.  Special characters that are available through the FoxPro for MS-DOS ASCII Chart and Special Characters desk accessories are available through the Character Map accessory in Microsoft Windows 3.1.  Similarly, Microsoft Windows' capability to capture screens when you press the Print Screen key can be used in place of the FoxPro for MS-DOS Capture option.

In addition, the Color... option from the Window menu in FoxPro for MS-DOS has been removed because you can define the colors of interface elements through the Color option in the Windows or Macintosh Control Panel.

New Menus

FoxPro now includes the following additional menus: Object, Help and Text. In addition, a Windows Control menu or an Apple menu appears near the left end of the main FoxPro menu bar.

When either the Report Writer or Screen Builder is in use, FoxPro adds the Object menu to the menu system . This menu contains options that allow you to specify object attributes. For more information about the Object menu and its options, see Object Menu.

The Help menu, always the last item on the menu bar, contains options to bring up the Help window, search for various help topics or get instructions on how to use the Help window. If you are using the .DBF-style help, the Search for Help on... and How to Use Help... menu options are disabled. For more information about using either Help system, refer to Help Systems.

In FoxPro for Windows, the Help menu also contains the desk accessories: the Calculator, the Calendar/Diary, the Filer and the Puzzle.

In FoxPro for Macintosh, the Help menu is in the Balloon Help menu of the Macintosh Finder, near the right end of the main FoxPro menu bar. You can enable or disable access to the Help file or open a custom Help file from this menu option.

The Text menu is available when an editing window is active. The options on this menu allow you to select text formatting attributes such as font type, style and size, and line spacing. In addition, you can change the font of text output to the main FoxPro window by pressing the Shift key, choosing Screen Font... from the Text menu, then choosing the desired font.

In FoxPro for Windows and FoxPro for Macintosh, the Run... menu has a new option, Wizards... . This option automatically creates a Quick Report or Quick Screen from a selected table and FoxPro defaults.

Shortcut keys

In FoxPro for Macintosh and FoxPro for Windows, you can move the current window by clicking on the title bar.

In FoxPro for Macintosh you can size, or close the current FoxPro window by using the Zoom and Size boxes on the right side of the window, or close a window by clicking the Close box at the upper left corner. You can close a window by using the shortcut keys: +Q for the main FoxPro window and FoxPro, [image] +W for any other window or dialog except the Command window. To hide all windows in front of the current output window, press Shift+Control+Option+

Colors

In FoxPro for Windows, you change the colors in FoxPro's interface by choosing the Color icon in the Windows Control Panel.  In FoxPro for MS-DOS, colors are controlled with the Color Picker.

You can specify colors for each Windows screen element (menu bar, window text, scroll bars, etc.) and save these colors in a Windows color scheme that you can restore at any time.  Color changes made through the Windows Control Panel are global, so all system windows and menus are affected by changes in the color scheme.  When FoxPro for Windows is started, it uses the current Windows color scheme.

On Macintosh computers, you can specify the number of available grays or colors through the MONITORS control panel in the Control Panels option of the Apple menu. In low-memory environments you may want to free as much memory as possible by reducing the number of colors to black and white or fewer than 16 colors or shades of gray.

In FoxPro for Macintosh, you change the colors of window and control shadows and the highlight color by opening the COLOR control panel in the Control Panels option in the Apple menu. Though you cannot change system default colors, you can specify colors for screen elements (window text, backgrounds, scroll bars, and so on) in a color scheme as in FoxPro for Windows.

In FoxPro for MS-DOS, colors are controlled with the Color Picker. In FoxPro for Windows, colors are controlled through the Color icon of the Control Panel in Program Manager.

ILanguage

Most commands, functions and system memory variables are available in FoxPro for Windows, FoxPro for Macintosh and FoxPro for MS-DOS. The description of each command, function and system memory variable in Help includes explanations of any differences.

Power Tools

FoxPro provides essentially the same power tool features for the Windows, Macintosh, and MS-DOS platforms. The exceptions are the Label Designer and RQBE.

Label Designer Differences

In FoxPro for Windows and FoxPro for Macintosh, labels are considered a style of report and are designed in the Report Layout window instead of in the separate Label Layout window used in FoxPro for MS-DOS.

RQBE Differences

In FoxPro for MS-DOS, you can send query results to the optional FoxGraph graphing software. In FoxPro for Macintosh, as in FoxPro for Windows, you can send query results to Microsoft Graph.

Keystroke Differences

The keystrokes you use to move through the interface differ on the three platforms. This means that macros you create on one platform may not function the same way on another platform.

In FoxPro for Windows and FoxPro for Macintosh, you can use the SET KEYCOMP command to determine the keystroke and keystroke combinations used to navigate the interface controls (buttons, lists, popups, and so on). SET KEYCOMP is ignored in FoxPro for MS-DOS.

If you are familiar with FoxPro for MS-DOS, you can issue SET KEYCOMP TO DOS to navigate using the keystrokes you are accustomed to. If you are familiar with Windows and prefer to navigate with the keystrokes Windows uses, issue SET KEYCOMP TO WINDOWS.

The effect of the SET KEYCOMP setting depends on the control For information, see SET KEYCOMP.

Other Keystroke Differences

Undo

Choosing the Undo option in the Edit menu reverses the most recent text editing action. In FoxPro for MS-DOS 2.0 and earlier FoxPro versions, Ctrl+U was the keyboard shortcut for Undo. In FoxPro for MS-DOS version 2.5 or later, and FoxPro for Windows and FoxPro for Macintosh, the keyboard shortcut for Undo is Ctrl+Z.

F11F12

The F11F12 configuration item, which control the use of the F11 and F12 keys in FoxPro for MS-DOS, is ignored in FoxPro for Windows and FoxPro for Macintosh.

Keystrokes in External Dialogs

Certain FoxPro for Windows and FoxPro for Macintosh dialogs, windows and menus are provided by the operating environment. On the Windows platform these include These include the Printer and Printer Setup dialogs, the Font dialog, Windows-style help and the Control menus for FoxPro and user-defined windows created with DEFINE WINDOW.

On the Macintosh, these include the Printer and Page Setup dialogs, the Font dialog, the Apple menu, Balloon Help and the File and parts of the Edit menus for FoxPro and user-defined windows created with DEFINE WINDOW.

In both FoxPro for Windows and FoxPro for Macintosh, these dialogs, windows and menus cannot be manipulated with keyboard macros or by stuffing the keyboard with the KEYBOARD command.

Configuration File

The FoxPro for Macintosh configuration file is named CONFIG.FPM; the FoxPro for Windows configuration file is named CONFIG.FPW, the FoxPro for MS-DOS configuration file is named CONFIG.FP.


saCrossPlatform
See Also

Object and Linking and Embedding (OLE)

AppleScript

Differences in Keyboard Functionality


Differences in Keyboard Functionality

See Also

This topic explains how FoxPro for Macintosh implements keyboard navigation and keyboard controls differently from FoxPro for MS-DOS and FoxPro for Windows.

 Key and Control Key

The [image] (Command) key and the Control key can be used interchangeably whenever the [image] key is a valid choice in FoxPro for Macintosh. However, for maximum cross-platform compatibility in your applications, use CTRL to represent the [image] key and the Control key in all commands that use key labels.

Note   If you create a system menu containing a keyboard shortcut, for example Ctrl+P, FoxPro for Macintosh automatically displays [image] +P on the menu. The same is true if you transport an application from another platform that includes a system menu with keyboard shortcuts.

Option Key

On the Macintosh, pressing the Option key with another key produces a character from the extended ASCII character set. FoxPro for Macintosh maintains this standard. Therefore, to emulate the Alt key in FoxPro for Macintosh, use Control+Option. For example, to hide all windows in front of the current output window, press Shift+ [image] +Control+Option instead of Shift+Ctrl+Alt (as in FoxPro for Windows).

ON KEY LABEL

ON KEY LABEL and the Macro Key Definition dialog accept Macintosh key labels to map FoxPro for Macintosh to MS-DOS or Windows key functionality. The following table shows the MS-DOS and Windows key labels with their Macintosh equivalents.

MS-DOS or Windows Label	Macintosh Label
ENTER	RETURN
BACKSPACE	DELETE
ALT	CTRL+OPTION
RIGHTMOUSE	CMD+OPTION+CLICK
Note   In FoxPro for Macintosh, you can use the CMD and CTRL key labels interchangeably to represent the MS-DOS and Windows Ctrl key. However, for maximum cross-platform compatibility, always use the CTRL key label.

SET KEYCOMP

The SET KEYCOMP command enables a set of default keystrokes that you can use to move through the FoxPro interface. By default, FoxPro for Macintosh supports the standard Macintosh style of navigation, so you can tab between edit regions and lists in dialogs. To access the system menu bar with the keyboard in FoxPro for Macintosh, press F10 and use the arrow keys to navigate. When you SET KEYCOMP TO MAC, which is the default for FoxPro for Macintosh, menu hot keys do not appear underlined.

If you need hot keys and MS-DOS or Windows style keyboard navigation capabilities for cross-platform compatiblity, use the SET KEYCOMP command to specify DOS or WINDOWS.


Differences in Keyboard Functionality See Also
See Also

CMD

Command Key

Control Key

CTRL

ON KEY LABEL

SET KEYCOMP


Distributing Applications

See Also

Using the Microsoft FoxPro Distribution Kit, you can package and distribute database applications and executable files. To acquire the Distribution Kit, contact your local Microsoft subsidiary.


Distributing Applications See Also
See Also

BUILD EXE


"<cursor>" must be created with SELECT ... INTO TABLE.  (1815)

Some cursors cannot be used in successive queries.


"<field>" is not related to the current work area.  (1165)

The field you have specified is not in the table in the current work area.


"<field> | <variable>" is not unique and must be qualified.  (1832)

The field or variable in the SQL SELECT command you have specified cannot be found.


"<file>" is not a FoxPro EXE file.  (1196)

The EXE file specified was not created by FoxPro.


"<file>" is not an object file.  (1309)

An attempt was made to load a compiled FoxPro program which does not have a proper header.


"<name>" is not a file variable.  (226)

A memory variable or an array variable was used where a file variable (field) is required.


"<name>" is not a memory variable.  (225)

A file variable (field) was used where a memory or array variable was required.


"<name>" is not an array.  (232)

A DIMENSION statement contains a variable declaration without the required subscript arguments.


** or ^ domain error.  (78)

Exponentiation was attempted on a negative number.


*bad date*

The date expression you used is invalid.


ACOS( ) : Out of Range.  (293)

The expression you have used with the arc cosine function has a value that is out of the range of -1.0 to +1.0.


ALIAS name already in use.  (24)

An attempt was made to USE a table with an ALIAS that is associated with another table already in USE.


ALIAS ["<alias>"] not found.  (13)

An attempt was made to either SELECT a work area not in the range A through J, or 11 through 25 or 225, or to specify an ALIAS that has not been defined.


All work areas in use.  (1721)

A table is open in all 25 or 225 work areas.


API function _UserError( ) was called. (1098)

An error message has been generated by the API.  The text of this message is determined in the API.


API library not found.  (1726)

SET LIBRARY TO or RELEASE LIBRARY was issued but the specified library cannot be found.


API library revision mismatch.  Rebuild library.  (1711)

The API library you are using does not match your version of FoxPro.


Application file "<file>" not closed.  (1178)

An attempt has been made to build an application while a file in the application is not closed.


Area cannot contain handle.  (1011)

If this error occurs, see the Troubleshooting section, then call Microsoft Product Support.  FoxPro is exited after closing all open files.


Area size exceeded during compaction.  (1010)

If this error occurs, see the Troubleshooting section, then call Microsoft Product Support.  FoxPro is exited after closing all open files.


ASIN( ) : Out of Range.  (291)

The expression you have used with the arc sine function has a value that is out of the range of -1.0 to +1.0.


Attempt to move file to different device.  (1153)

A file may not be renamed to a different device.


Attempt to use FoxPro function as an array.  (1652)

FoxPro encountered a function when it was expecting an array name.  To correct this, replace the function with a valid array name.


Bad array dimensions.  (230)

Either an illegal value (such as zero) has been entered during the declaration of an array, or an array has been declared that exceeds 65,000 elements.


Bad drive specifier.  (1907)

An invalid drive name was specified in a DIR command.


Bad .LIB file.  (1191)

One of the files in the Microsoft FoxPro 2.5 Distribution Kit has become corrupted.  Try reinstalling.


Bad width or decimal place argument.  (1908)

Either the length or decimal argument was invalid in the STR( ) function.


Bar position must be a positive number.  (167)

An attempt has been made to define bars of a menu or a popup using a negative number.


Beginning of file encountered.  (38)

The record pointer was positioned before the first record in the file.


Beyond string.  (62)

An attempt was made to access characters beyond the last byte of a string memory variable or table field.


Browse table closed.  (1163)

A Browse window's table was closed by a Browse validation routine.


Browse structure changed.  (1164)

The structure of a Browse window was changed by a Browse validation routine.


CANCEL/SUSPEND is not allowed.  (1651)

The dBASE IV report or label file you are running calls upon a SUSPEND.


Cannot activate OLE server.  (1421)

The OLE object you are trying to modify was created on another machine and the server is not installed on this machine, the server cannot be found because the server is not on the DOS PATH or there is insufficient Windows memory to launch the server application.


Cannot access selected table.  (1152)

An attempt was made to select a table outside the range 1 to 25 or 225, or a reference was made to a file variable in a table that is not open.


Cannot allocate screen map.

There was not enough memory to run FoxPro.


Cannot append from password protected file.  (1672)

The file you are attempting to append is encrypted.


Cannot arrange an untransported screen.  (1795)

When you move screens between different FoxPro platforms, you must transport the screens with the Transporter before they can be arranged.


Cannot build APP/EXE while suspended.  (1719)

A program specified in the project is suspended.  Cancel execution of the program to be able to build APP/EXE.


Cannot build APP/EXE without a main program.  (1689)

The main program in the specified project cannot be found.


Cannot clear menu in use.  (176)

An attempt was made to clear an active menu with the CLEAR MENU or RELEASE MENU command.


Cannot clear popup in use.  (177)

An attempt was made to clear an active menu popup with the CLEAR POPUP or RELEASE POPUP command.


Cannot convert Memo file for a read-only table file.  (1659)

This message appears when you try to perform a read-only operation on a dBASE IV style memo because FoxPro cannot convert a memo in a read-only operation.


Cannot create file.  (1102)

The operating system has returned an error to FoxPro indicating that the new file cannot be created.  The inability to create a new file is usually the result of a full disk or directory, entry of an invalid file name, or not having the proper requirements needed to access the directory which is to contain the file.


Cannot create file "<file>".  (102)

The operating system has returned an error to FoxPro indicating that the new file cannot be created.  The inability to create a new file is usually the result of a full disk or directory, entry of an invalid file name, or not having the proper requirements needed to access the directory which is to contain the file.


Cannot create program workspace.

FoxPro was not able to create enough workspace upon startup.  This may be due to insufficient rights to the directory or not enough disk space.


Cannot find screen/menu generation program.  (1693)

The GENSCRN or GENMENU programs that create menus and screens cannot be located.


Cannot GROUP by aggregate field.  (1846)

There has been an attempt to GROUP by one of the aggregate functions MIN( ), MAX( ), SUM( ), AVG( ), COUNT( ), NPV( ), STD( ) or VAR( ).


Cannot import from password protected file.  (1671)

The file you are attempting to format is encrypted.


Cannot initialize Shared Library Manager.  (1729)

The Shared Library Manager could not be initialized, probably because it was not installed correctly.


Cannot locate COMSPEC environment variable.  (1412)

An environment variable needed by FoxPro cannot be found.  This error usually occurs when you try to run FoxPro from within another program and the other program doesn't properly pass MS-DOS environment variables.


Cannot open file "<file>".  (1101)

FoxPro cannot open the file you requested.  The file may be locked by another user on a network.


Cannot open configuration file.

FoxPro found a configuration file but did not have the proper rights to open it.


Cannot print to file with selected printer driver.  (1730)

Before you try to print a graphical report to file, you need to select the LaserWriter driver.


Cannot redefine menu in use.  (174)

An attempt was made to issue a DEFINE MENU command while there was an active menu in memory.  You must first issue a DEACTIVATE MENU command.


Cannot redefine popup in use.  (175)

An attempt was made to issue a DEFINE POPUP command while there was an active popup in memory.  You must first issue a DEACTIVATE POPUP command.


Cannot rename current directory.  (1253)

The directory you have flagged in the Filer could not be renamed.


Cannot run on MS-DOS before version 3.0.

Loaders and compact EXE files cannot run under MS-DOS version 3.0 or earlier.


Cannot SET FORMAT while in a READ with a FORMAT file.  (1720)

The format file you have specified calls upon a format file.


Cannot update file.  (1157)

This error appears only if a critical problem occurs when writing to disk, such as space exhausted, total disk failure, etc.


Cannot write to a read-only file.  (111)

An attempt was made to write to a file that was created or accessed for read-only purposes.


COLORSET resource not found.  (1642)

An attempt has been made to SET COLOR SET TO a color set not found in the resource file.


Column number must be between 0 and 255.  (223)

The printer column number specified is off of the page.


Column number must be between 0 and right margin.  (1657)

There was an attempt to set _PCOLNO to an invalid number.


COLUMN/FORM/ALIAS/NOOVERWRITE/WIDTH allowed only with FROM clause.  (1695)

These options are only available when you create a Quick Report with the FROM clause.


COLUMN/ROW/ALIAS/NOOVERWRITE/SIZE/SCREEN allowed only with FROM clause.  (1698)

These options are only available when you create a Quick Screen with the FROM clause.


Compiled code for this line too long.  (1252)

The object code produced for this statement exceeded the size of the FoxPro internal code buffer.  This line contains too many long expressions and must be subdivided into multiple statements.


Constant is already #defined.  (1725)

The constant has already been defined with #DEFINE but not yet undefined with #UNDEF.


CONTINUE without LOCATE.  (42)

An attempt was made to execute a CONTINUE command without first executing a LOCATE command.


Cyclic relation.  (44)

A circular relationship was attempted by defining a sequence of relations that eventually points back to a table that is already related.


Data type mismatch.  (9)

An expression was considered to be invalid by FoxPro because it is composed of data types that cannot be evaluated together.  Either the appropriate data type required by a FoxPro statement was not used, or the two fields specified in an operation between two tables did not have the same data type (e.g., UPDATE, REPLACE, SET RELATION).


Table is not ordered.  (26)

One of the following has occurred.  An index for the table file was not selected when an UPDATE command, using the RANDOM option, was encountered.  A FIND/SEEK was attempted against an unindexed table or while SET ORDER TO 0 was in effect.  An attempt was made to SET RELATION with a non-numeric relational expression to an unindexed table or while SET ORDER TO 0 was in effect.


Table/DBF operation invalid while indexing.  (1690)

There has been an attempt to do a table operation inside of an index UDF.


Descending not permitted on IDX files.  (1706)

IDX index files do not support a DESCENDING clause.


Display mode not available.  (216)

An attempt was made to select an unavailable display mode.


Division by 0.  (1307)

Zero was specified as the second argument in the MOD function.


DO nesting too deep.  (103)

The maximum DO program nesting levels of 32 has been exceeded.


Duplicate field names.  (1156)

In the FIELDS option for SORT and COPY, you have specified a duplicate name in the list of fields.  Correct your program or command and try again.


End of file encountered.  (4)

The record pointer was positioned past the last record in the file.


Endtext without text.  (1214)

An ENDTEXT statement is missing a corresponding TEXT statement.


Error copying OLE object to clipboard.  (1424)

There is not enough available Windows memory.


Error creating OLE object.  (1423)

There is not enough available Windows memory or FoxPro can't find the server application.


Error in label field definition.  (1245)

An invalid expression was encountered in a LABEL file (.LBX).


Error initializing OLE.  (1508)

OLE could not be initialized, probably because it was not installed correctly.


Error reading resource.  (1296)

This indicates an internal FoxPro error.  If this error occurs, see the Troubleshooting section, then call Microsoft Product Support.


Error saving OLE object.  (1422)

There is not enough available disk space or Windows memory to save the object.


Exclusive open of file is required.  (110)

An attempt was made to perform an operation which requires exclusive use of the table.


Expression evaluator fault.  (67)

This is an internal consistency check failure in the FoxPro expression evaluator.  This may be caused by a damaged FoxPro object code file.  Recompile the program that caused the error.


Fatal error <expN> reporting error <expN>.

If this error occurs, see the Troubleshooting section, then call Microsoft Product Support.  No error number is returned.  FoxPro is exited after closing all open files.


Feature not available.  (1001)

The FoxPro feature which you have attempted to use is not supported under the version of FoxPro being used.


Feature not available when FoxPro is not the active application.  (1919)

The PUTFILE or GETFILE dialogs cannot be displayed unless FoxPro is the active application.


Field must be a General field.  (1913)

An attempt has been made to enter a field name with APPEND/MODIFY GENERAL that is not a general field, or a field has been entered in the Screen Picture or Report Picture dialog that is not a general field.


Field must be a Memo field.  (350)

An attempt has been made to enter a field name with the APPEND/COPY MEMO command that is not a memo field type.


"Field" phrase not found.  (1130)

The field specified in PROMPT <field> was not found.


File access denied.  (1705)

An attempt was made to write to a file which is write protected by the MS-DOS ATTRIB command.


File already exists.  (7)

The file name to which you are attempting to rename a file already exists.  This error is usually generated by the RENAME command.


File cannot be locked.  (1503)

FoxPro cannot lock the requested file.  It may already be locked by another user on the network.


File close error.  (1112)

An error was returned by the operating system while FoxPro was attempting to close a file.


File ["<file>"] does not exist.  (1)

The file you have specified does not exist.


File internal consistency error.  (1462)

If this error occurs, see the Troubleshooting section, then call Microsoft Product Support.  FoxPro is exited after closing all open files.


File is in use by another.  (108)

An attempt was made to USE, DELETE or RENAME a file which is being used by another user on a network.


File is in use.  (3)

An attempt was made to USE, DELETE or RENAME a file which is currently open.


File is open in another work area.  (1708)

Commands that require exclusive use of a table (PACK, MODIFY STRUCTURE, ZAP, etc. ) cannot be performed on a table that has been opened in multiple work areas with the USE AGAIN command.


File is read only.  (1718)

An attempt was made to write to a read only file.


File is the wrong version.  (1338)

An attempt has been made to open a screen or a report file that is not a FoxPro version 2.5 file.


File must be opened exclusively to convert Memo file.  (1637)

The table file you are using must be opened exclusively to be able to convert the memo file.


File name too long.  (1918)

The specified filename exceeded the maximum allowable length of 255 characters.


File not open.  (1113)

An attempt was made to read from or write to a file which is not currently open.


File read error.  (1104)

An error was returned by the operating system while FoxPro was attempting to read a file.


File was not LOADed.  (91)

An error occurred when attempting to CALL or RELEASE a module which was not loaded.


File write error.  (1105)

An error was returned by the operating system while FoxPro was attempting to write to a file.  Most often, this error is the result of an attempt to write to a write-protected diskette.


FILTER expression too long.  (1140)

An attempt was made to SET FILTER TO an expression that is longer than the maximum allowable size of 160 characters.


FILTER requires a logical expression.  (37)

An attempt was made to SET FILTER TO an expression that is not a logical expression.


For/while need logical expressions.  (1127)

A FOR or WHILE clause within a command does not contain a logical expression.


Foreign node found during compaction.  (1008)

If this error occurs, see the Troubleshooting section, then call Microsoft Product Support.  FoxPro is exited after closing all open files.


FOXUSER file is invalid.  (1294)

Your FOXUSER file has been corrupted.  Reinstall the FOXUSER file.


Free handle not found.  (1003)

If this error occurs, see the Troubleshooting section, then call Microsoft Product Support.  FoxPro is exited after closing all open files.


Function not implemented.  (1999)

You have attempted to call a function that is not supported in the current version of FoxPro.


If/else/endif mismatch.  (1211)

An ELSE or ENDIF statement does not have a corresponding IF statement.


Illegal operation for General field.  (1912)

An attempt has been made to perform an invalid operation, such as calculation, indexing, and so on, on a GENERAL field.


Illegal operation for MEMO field.  (34)

An INDEX command cannot specify a MEMO field as its key expression.


Illegal printer driver recursion.  (1910)

Your printer driver program calls upon the printer driver.


Illegal seek offset.  (1103)

If this error occurs, see the Troubleshooting section, then call Microsoft Product Support.


Illegal value.  (46)

An expression specified by SET MEMOWIDTH, BROWSE, or an @ ... TO command evaluated to an illegal value.


Import only Worksheet A for Lotus 1-2-3 version 3.0 files.  (1679)

Worksheets B and C cannot be imported into FoxPro because a table is two-dimensional.


Improper data type in field expression.  (1647)

A picture data type was encountered by REPORT for a field expression.


Improper data type in group expression.  (1241)

A picture data type was encountered by REPORT for the group expression.


Incorrect handle found during compaction.  (1009)

If this error occurs, see the Troubleshooting section, then call Microsoft Product Support.  FoxPro is exited after closing all open files.


Index does not match table file.  Recreate Index.  (114)

A damaged structure within an index file has been detected.


Index expression is too big.  (23)

The index expression for this index exceeds the maximum length of 220 bytes.


Index file does not match table.  (19)

The index expression for the current index uses variables which are not contained within the current table.


Index tag not found.  (1683)

The tag you have specified could not be found in the index.


Index tag or file name must be specified.  (1684)

You have attempted to exit the Index dialog without specifying a tag name.


Insufficient memory.  (43)

There was not enough memory for FoxPro to complete an operation.


Insufficient stack space.  (1308)

One of the following situations can cause this error message:

Your program is too recursive.

Your program is too complex and is nested too deeply.

An error in FoxPro.


Internal consistency error.  (1000)

If this error occurs, see the Troubleshooting section, then call Microsoft Product Support.  FoxPro is exited after closing all open files.


Internal error: Too many characters in report.  (1243)

The total size of all the headings and expressions defined for the report in CREATE/MODIFY REPORT is too large to be contained in the standard report file.


Internal .LIB undefined symbol error.  (1192)

The library file is corrupted or the library version does not match the FoxPro version.


Invalid buffdirty call.  (1155)

If this error occurs, see the Troubleshooting section, then call Microsoft Product Support.  No error number is returned.  FoxPro is exited after closing all open files.


Invalid buffpoint call.  (1154)

If this error occurs, see the Troubleshooting section, then call Microsoft Product Support.  No error number is returned.  FoxPro is exited after closing all open files.


Invalid box dimensions.  (227)

Row 2, column 2 must be larger than row 1, column 1 when using the @ ... BOX command.


Invalid character in command.  (1220)

The source line contains an invalid character.  This is probably caused by control characters embedded in the source line by an external editor.


Invalid compact EXE file.  Rebuild EXE.

Your EXE file has become corrupt.  Rebuild the file.


Invalid table number.  (17)

Attempt to select a table number not in the range from 1 to 225.


Invalid DIF file header.  (115)

The DIF file header of the file you're attempting to import is incorrect.


Invalid DIF type indicator.  (117)

The DIF file you're attempting to import has an invalid data type indicator.


Invalid DIF vector [image] DBF field mismatch.  (116)

The DIF file you are attempting to import has an internal conflict between its header and its data.


Invalid Excel version 2.0 file format.  (1661)

The Excel file you are attempting to import is either not version 2.0 or has been corrupted.


Invalid field width or number of decimal places.  (1713)

The field width or number of decimal places you have specified is not valid.  For a list of the requirements, see the System Capacities topic or the FoxPro Developers Guide .


Invalid file descriptor.  (1111)

FoxPro is unable to open a file.  If this error occurs, see the Troubleshooting section, then call Microsoft Product Support.


Invalid function argument value, type or count.  (11)

A value passed to a function is either not of the expected data type, or the value of the argument is out of range for this function.  This may also be caused by passing too many arguments to a function.


Unrecognized index file revision.  Please recreate index.  (1141)

The index file is in a format that is not compatible with this version of FoxPro.  Recreate the index.


Invalid keyboard macro file format.  (356)

An attempt has been made to use a macro file with invalid data.


Invalid key length.  (112)

An invalid index key length has been specified.  The length of a key for an .IDX index must be between 1 and 100 characters.  The length of a key for a .CDX index must be between 1 and 254 characters.


Invalid .LIB signature.  (1190)

Library file used to construct .EXE was corrupted.


Invalid Lotus 1-2-3 version 1.0 file format.  (1662)

The Lotus 1-2-3 file you are attempting to import is either not version 1.0 or has been corrupted.


Invalid Lotus 1-2-3 version 2.0 file format.  (297)

The Lotus 1-2-3 file you are attempting to import is not version 2.0.  Use the Lotus conversion utility to convert the file to version 2.0 before attempting to import it.


Invalid Lotus 1-2-3 version 3.0 file format.  (1678)

The Lotus 1-2-3 file you are attempting to import is either not version 3.0 or has been corrupted.


Invalid Multiplan version 4.0 file format.  (1670)

The Multiplan file you are attempting to import is either not version 4.0 or has been corrupted.


Invalid or corrupted OLE object.  (1420)

The data stored in a general field for an OLE object cannot be validated.


Invalid or duplicate field name.  (1712)

You have attempted to create a field in a table that already has that name or have used the characters ., ", /, \, [, ], :, |, <, >, +, =, ;, *, or ? or a blank or a space in a field name.


Invalid or missing EXE file.

The EXE file you have specified either is corrupted or there is not sufficient rights to use it.


Invalid operation for CURSOR.  (1115)

An attempt was made to PACK a cursor.


Invalid Paradox version 3.5 file format.  (1688)

The Paradox file you are attempting to import is either not version 3.5 or has been corrupted.


Invalid path or file name.  (202)

You've attempted to execute a FoxPro command that contains an invalid path or file name.


Invalid preprocessor expression.  (1722)

Only simple expressions (evaluation, concatenation and math) are allowed in preprocessor (#IF and so on) commands.


Invalid printer redirection.  (124)

Either a path to a printer is not established or the print device cannot be shared.


Invalid SET expression.  (231)

An invalid argument has been used with the SET function.


Invalid Symphony version 1.0 file format.  (1673)

The Symphony file you are attempting to import is either not version 1.0 or has been corrupted.


Invalid Symphony version 1.1 file format.  (1674)

The Symphony file you are attempting to import is either not version 1.1 or has been corrupted.


Invalid subscript reference.  (31)

A subscript was used that is outside of the valid range of array subscripts defined in the DIMENSION statement.  This may also be caused by using two subscripts with a one-dimensional array.


Invalid SYLK file dimension bounds.  (120)

The file attempting to be imported is indicating invalid rows or columns [image] it is out of bounds.


Invalid SYLK file format.  (121)

The file you are attempting to import is not in a valid SYLK file format.


Invalid SYLK file header.  (119)

The file header of the file you are attempting to import has an incorrect SYLK file header.


Invalid variable reference.  (1223)

A function was used where a memory variable was expected.  This is caused by using a valid function name or abbreviation as an array name.


Invalid WINDOW file format.  (1632)

The window save file (.WIN) being restored contains invalid data.


I/O operation failure.  (1002)

MS-DOS is unable to perform a file or hardware operation.


Key label ["<label>"] is invalid.  (1255)

The key label you have used is not supported.  See ON KEY LABEL for a list of supported key labels.


Key string too long.  (1257)

The character expression included with KEYBOARD is too long.  Reduce its length.


Key too big.  (1124)

The compiled version of the index expression has exceeded 150 bytes.


Label file invalid.  (54)

An attempt was made to modify or print labels using a label file that was not created with CREATE/MODIFY LABEL.


Label nesting error.  (1653)

A user-defined function in a label form has called LABEL FORM.


Left margin plus indent must be less than right margin.  (221)

The sum of the specified left margin and paragraph indent exceeds the right margin.


Library file is invalid.  (1691)

FoxPro cannot use the library file you've specified.  Rebuild the library.


Line number must be less than page length.  (222)

The line number used falls beyond the page length memory variable.


Line too long.  (18)

The maximum length for a command line (2048 bytes) has been exceeded.  Macro substitution may have caused the line to expand beyond the 2048 byte limit.


Link command failed.  (1194)

A compilation error occurred and an .EXE was not created on the disk.


Localized product required for this environment.

There was an attempt to use a US version of FoxPro with a non-US system.


LOG( ) : Zero or negative.  (58)

A zero or a negative number has been used as the argument of the natural log function.


LOG10( ) : Zero or negative.  (292)

A zero or a negative number has been used as the argument for a base-10 logarithm.


Logical expression required.

The expression provided in the Expression Builder must be of logical type in this instance.


Macro not defined.  (355)

An attempt has been made to play a macro that does not exist.


Maximum allowable menu items (128) exceeded.  (1607)

The maximum number of items that may be contained in a menu (128) was exceeded.


Maximum allowable menus (25) exceeded.  (1608)

The maximum number of menus that may be defined (25) was exceeded.


Maximum record length exceeded in import file.  (392)

The file you are attempting to import has a record length greater than 4,001 bytes.


Meaningless use of expression.  (1148)

The expression in SET FILTER TO has been re-entered while the filter is executing.  The can happen with complex setups involving SET RELATION or SET FILTER, or during the use of FoxPro functions or user-defined functions which reference other work areas, such as LOOKUP( ) or SEEK( ).


MEMO file is missing/invalid.  (41)

An attempt was made to use a table file whose associated memo file (.DBT or .FPT) has been deleted, removed or cannot be found.


Memory Variable file is invalid.  (55)

An attempt was made to RESTORE FROM a file that is not a valid memory (.MEM) file.


Menu file invalid.  (1687)

The menu file you have specified has become corrupted.


MENU has not been activated.  (178)

An attempt has been made to select from a menu before it has been activated.


MENU has not been defined.  (168)

An attempt has been made to activate a menu that has not been defined.


MENU is already in use.  (181)

An attempt has been made to activate a menu that is already active.


Menu item cannot be defined.  (169)

An attempt was made to add a menu bar to a prompt that was defined with files or structure.


Menu item cannot be released.  (170)

An attempt was made to release a prompt that was defined with files or structure.


Menu items/titles must be type CHARACTER. (1611)

A menu item or menu title was encountered which was defined with a data type other than character.


Menu/Popup was not pushed.  (279)

An attempt has been made to pop a menu or popup that was not pushed.


Mismatched #IF/#ELSIF/#ELSE/#ENDIF.  (1723)

An incomplete or incorrect #IF preprocessor command has been included.


Mismatched braces in key label.  (1256)

A left or right brace is missing from a key label.


Mismatched case structure.  (1213)

A CASE, ENDCASE, or OTHERWISE statement does not have a corresponding DO CASE statement.


Missing #ENDIF.  (1724)

An #IF command has been issued without a matching #ENDIF.


Missing (  (1304)

A function name is missing a left parenthesis.


Missing )  (1300)

A function name is missing a right parenthesis.  Either the current line contains a left parenthesis which has not been matched, or the function contains too many arguments and thus the right parenthesis is going undetected.


Missing ,  (1306)

FoxPro was expecting a comma and one was not found.  This is usually caused through failure to include the proper number of arguments with a function.


Missing expression.  (152)

A valid expression was expected, but not found.


Missing operand.  (1231)

An operator that requires two operands was used without the second operand, such as ? (13+4)/.


Missing .RTT section.  (1193)

The Microsoft FoxPro 2.5 Distribution Kit was not properly installed.


MULTISELECT/MOVERS not supported for PROMPT style popup.  (1710)

Commands which have the clauses PROMPT FIELD, PROMPT FILE or PROMPT STRUCTURE do not allow the clauses MULTISELECT or MOVER.


Must be an array definition.  (1232)

A DIMENSION statement contains a variable declaration without the required subscript arguments.


Must be a character, date or numeric key field.  (1145)

The key field used to UPDATE ON must be character, date or numeric.


Must be a file variable.  (1226)

A file variable (field) was used where a memory or array variable was required.


Must be a memory variable.  (1225)

A memory variable or an array variable was used where a file variable (field) is required.


Nested aggregation not allowed.  (1844)

Nesting of the aggregate functions MIN( ), MAX( ), SUM( ), AVG( ), COUNT( ), NPV( ), STD( ) or VAR( ) is not allowed in FoxPro 2.5.


Nesting error.  (96)

One of these situations has been encountered:

A DO is present without a matching ENDDO or vice versa

A SCAN is present without a matching ENDSCAN or vice versa

A FOR is present without a matching ENDFOR or vice versa

A LOOP or EXIT clause is present outside of the DO WHILE ... ENDDO, FOR ... ENDFOR or SCAN ... ENDSCAN commands.


Nested key labels are invalid.  (1254)

You cannot nest key labels.


No bars have been defined for this popup.  (166)

You must define bars for each popup.


No table is in USE.  (52)

A table was not in use at the time FoxPro attempted to execute a table command.


No fields to process.  (47)

No fields can be found, usually because a SET FIELDS TO was in effect.


No fields were found to copy.  (138)

During an attempt to COPY to a file, no visible fields were found.


No memory for buffer.  (1149)

It has proven impossible to allocate memory for a buffer.  This message is very unusual and will occur only in situations where available memory is extremely limited.  You should consider adding memory or removing some memory resident programs to give FoxPro more working memory.


No memory for file map.  (1150)

It has proven impossible to allocate memory for a FoxPro internal resource.  This message is very unusual and will occur only in situations where available memory is extremely limited.  You should consider adding memory or removing some memory resident programs to give FoxPro more working memory.


No memory for file name.  (1151)

It has proven impossible to allocate memory for a FoxPro internal resource.  This message is very unusual and will occur only in situations where available memory is extremely limited.  You should consider adding memory or removing some memory resident programs to give FoxPro more working memory.


No menu bar defined.  (1604)

An attempt has been made to READ a menu bar that has not been defined.


No pads defined for this menu.  (1621)

An attempt has been made to activate a menu that has no pads.


No PARAMETER statement found.  (1238)

After doing a program with a parameter list, the called program must begin with a PARAMETER statement.


No popup menu defined.  (1605)

An attempt has been made to activate a light-bar menu before defining a light-bar.


No previous printjob to match this command.  (1649)

An ENDPRINTJOB command was encountered without a matching PRINTJOB command preceding it.


No such menu/item is defined. (1612)

The value(s) passed to a READ MENU TO or READ MENU BAR TO command does not correspond to a defined menu or menu item.


Not a character expression.  (45)

An attempt was made to CALL a module with an expression whose value is not of the type character.


Not a table/DBF file.  (15)

The file that FoxPro is attempting to use as a table contains an improper header.


Not a numeric expression.  (27)

An attempt was made to use the SUM command on a non-numeric field.


Not a user-defined window.  (1682)

You have attempted to perform a command containing a WINDOW clause on window that was not created by a user, for example, the Command window.


Not a valid Framework II database/spreadsheet.  (256)

The file you are attempting to import is not a valid Framework II file format.


Not a valid RapidFile database.  (255)

The file you are attempting to import is not a valid RapidFile file format.


Not enough disk space for "<file name>".  (56)

The operating system has returned an error to FoxPro indicating that there is no room on the disk to contain the data from the latest WRITE command.  This is also erroneously returned under certain versions of Novell when you try to extend a file that has no owner.


Not enough memory to USE table.  (1600)

There was not enough memory to open an additional table.


Not suspended.  (101)

A RESUME command was used without first suspending a program.


NOWAIT/SAVE/NOENVIRONMENT/IN/WINDOW clauses not allowed with FROM.  (1696)

These clauses cannot be included when you create a quick report with the FROM clause.


Numeric overflow (data was lost).  (39)

A mathematical operation resulted in a number that was too large to be stored in the field or variable in which it was placed.


Object file "<file>" is the wrong version.  (1195)

The object file is out of date and the source code cannot be located.


Operator/operand type mismatch.  (107)

An arithmetic, string, or logical operator or function is being used with an invalid data type.  This error would occur, for example, if you were to attempt to add two logical values.


OS memory error.  (1012)

There is a problem with your MS-DOS free memory chain.


PAD has not been defined.  (164)

A reference has been made to a pad that does not exist.


Picture error in GET statement.  (1217)

The PICTURE clause within an @  ... SAY ... GET statement contains a picture which cannot include the value to be formatted.  This error may be occurring because the picture is in error or because the value to be formatted does not match the picture.


Picture too big, corrupt, or wrong format.  (1108)

There was an attempted use of an invalid picture file.


POPUP has not been activated.  (179)

An attempt has been made to select a pad from a popup before the popup has been activated.


POPUP has not been defined.  (165)

An attempt has been made to activate a popup before it has been defined.


POPUP is already in use.  (182)

An attempt has been made to activate a POPUP that is already activated.


POPUP is too small.  (287)

The popup window is too small to display selection bars.  You'll have to define a larger popup.


Popup too big, first <expN> entries shown.

You have specified too many items to be shown in the popup.


Position is off the screen.  (30)

A row or column number specified in an @ command is larger than the number of rows or columns on the screen, window or printer.


PREVIEW clause not allowed with OFF/NOCONSOLE or TO PRINT/FILE.  (1681)

Page Preview is not allowed when the console is not on or when printing to the printer or a file.


Printer driver is corrupted.  (1643)

An attempt has been made to load a printer driver that is corrupted.


Printer driver not found.  (1644)

The specified printer driver could not be located.


Printer not ready.  (125)

The printer device specified is currently not accessible or the printer is timing out.  The TIME parameter in your FoxPro configuration file may need to be increased.


Printjobs cannot be nested.  (1337)

After encountering a PRINTJOB command, an ENDPRINTJOB command was not found before another PRINTJOB command was encountered.


Procedure "<procedure>" not found.  (1162)

The procedure specified with the IN clause of the DO command could not be located.


Product has not been properly installed.

Please reinstall your copy of FoxPro.


Program too large.  (1202)

The program which FoxPro is attempting to load will not fit into memory.  The largest program or individual procedure FoxPro can load is one containing 65,000 bytes.


Project file is invalid.  (1685)

The project file specified has become corrupted.


Queue "<queue>" not found.  (1716)

The queue specified in the SET PRINTER TO command cannot be found.


Record is in use by another.  (109)

An attempt has been made to write to a record that is locked by another user.


Record is in use:  Cannot write.  (1502)

FoxPro could not write to the selected record because it is in use.


Record is not in index.  (20)

A key field of the table in use has been modified without the index having been active.  To correct this, REINDEX the table file.


Record is not locked.  (130)

An attempt was made to BROWSE, CHANGE, EDIT, DELETE, GATHER, MODIFY MEMO, READ, RECALL or REPLACE a record that was not locked.


Record is out of range.  (5)

The record number which you are attempting to access is beyond the actual number of records contained in the current table.  Check to see if you are using the demonstration activation key.  If so, reinstall FoxPro with the live key.  It is also possible that the index is out of date.  REINDEX if this is the case.


Record too long.  (1126)

While attempting to create a table file, the maximum length for the data portion of a record (65,500 bytes) was exceeded.  The length of the data portion of a record is equal to the sum of the lengths of the individual record fields.


Recursive macro definition.  (1206)

The maximum number of macro substitutions (256 in any one statement) has been performed in the current line.  The probable cause of this error is that a macro references itself.


Report file invalid.  (50)

A report description contains an error.


Report nesting error.  (1645)

A user-defined function in a report form has called REPORT FORM.


Required clause not present in command.  (1221)

A command was used without a clause that was required by the FoxPro syntax.


RUN/! command failed.  (1405)

The operating system has returned an error to FoxPro indicating that it cannot create a process to execute a RUN command.  Most often, this error is the result of the inability to find the shell program to be executed, or insufficient free memory to load the shell program into memory.  Make sure the COMMAND.COM is accessible via the MS-DOS environment variable COMSPEC.


RUN/! command string too long.  (1411)

The command string included with the RUN command is too long.  The maximum length allowed is approximately 240 characters.


RUNSCRIPT command failed.  (1921)

The operating system has returned an error to FoxPro indicating that it cannot execute a RUNSCRIPT command.


Screen code too large for memory.  (1507)

The screen object you are trying to copy has a code snippet larger than 64K.


Screen file invalid.  (1686)

The screen file specified has become corrupted.


Script error: "<error>"  (1917)

AppleScript has returned an error message to FoxPro.


SELECTs are not UNION compatible.  (1851)

Data types or sizes of fields being projected in each SELECT are not identical.


Server "<server>" not found.  (1715)

The server specified with the SET PRINTER TO command could not be found.


Source code not found.

The file you have specified cannot be located in the directory specified.


Source code out of date.

The date source code you have specified does not match the compiled (.FXP) file.


SQL aggregate on non-numeric expression.  (1811)

There was an attempt to perform an average, sum, standard deviation or variance on a non-numeric field.


SQL canceled operation.  (1839)

There was an attempt to SELECT into a table when SAFETY was ON and the user chose not to overwrite the table.


SQL column "<field> | <variable>" not found.  (1806)

The field or variable you have specified cannot be found.


SQL could not locate table.  (1802)

The table specified could not be found.


SQL err building temporary index.  (1831)

A temporary index could not be built, possibly due to insufficient disk space.


SQL Error Correlating Fields.  (1801)

An outer-reference can only be in syntax similar to the following:

X = Y

Syntax such as X = Y + 1 or X = 5 will produce this error.


SQL expression too complex.  (1845)

FoxPro ran out of memory when it tried to expand the SELECT statement to analyze it.


SQL illegal GROUP BY in subquery.  (1828)

When using one of the six operators +, -, *, /, < and >, there can only be one row of output.


SQL index not found.  (1830)

FoxPro could not find the existing index.


SQL Internal Error.  (1800)

An internal error has occurred.  If this error occurs, see the Troubleshooting section, then call Microsoft Product Support.


SQL invalid * in SELECT.  (1820)

There was an attempt to use * in one of the aggregate functions of MAX( ), MIN( ), AVG( ), or SUM( ).


SQL invalid aggregate field.  (1822)

There has been an attempt to do aggregation on a memo field.


SQL invalid DISTINCT.  (1819)

There must only be one distinct used per level.


SQL invalid GROUP BY.  (1807)

There is an error in the GROUP BY clause.


SQL Invalid HAVING.  (1803)

There is an error in HAVING clause, for example the clause does not contain a logical expression.


SQL invalid ORDER BY.  (1808)

One of the fields chosen for the order by is not in the SELECT list.  This only occurs when using numeric indexing, for example

SELECT a,b,c FROM table ORDER BY 4

The number chosen exceeds the number of fields selected.


SQL invalid SELECT statement.  (1804)

There is an error in the projection list.


SQL invalid SELECT.  (1826)

There has been an attempt to select more than one field in a subquery.


SQL invalid subquery.  (1825)

Something in the subquery is erroneous.


SQL invalid WHERE clause.  (1833)

There is an error in the WHERE clause.


SQL Invalid use of subquery.  (1810)

A subquery was used in a place where it wasn't expected.


SQL Invalid use of union in subquery.  (1813)

UNION is not supported in subqueries in FoxPro 2.5.


SQL no FROM clause.  (1818)

There must be a FROM clause in the SELECT command.


SQL out of memory.  (1809)

FoxPro has run out of memory while trying to process your SELECT command.


SQL queries of this type are not supported at present.  (1814)

There was an attempt to perform a query that is not supported by FoxPro 2.5.


SQL statement too long.  (1812)

The object code is too long to be compiled.


SQL subqueries nested too deep.  (1842)

FoxPro 2.5 does not support nested subqueries.


SQL too many columns referenced.  (1841)

There must be no more than 256 columns total referenced in any SELECT command.


SQL Too many subqueries.  (1805)

The number of subqueries allowed in FoxPro 2.5 is two per SELECT.


SQL Too many UNIONs.  (1834)

The maximum number of UNIONs (10) has been exceeded.


SQRT domain error.  (61)

The SQRT argument must not be negative.


Statement not allowed in interactive mode.  (95)

The commands IF, ELSE, ENDIF, TEXT, ENDTEXT, EXIT, RETRY, RETURN, SUSPEND, DO WHILE, ENDDO, DO CASE, ENDCASE, SCAN, ENDSCAN, FOR and ENDFOR are not allowed in the interactive mode.


String memory variable area overflow.  (21)

The combined length of all memory variable strings has exceeded the amount of memory.


String too long to fit.  (1903)

The allowable string length was exceeded.


Structural CDX file not found.  (1707)

The structural index file associated with a table file could not be found.


Structure invalid.  (1235)

In CREATE FROM, a table was specified whose structure does not match the STRUCTURE EXTENDED format.


Structure nesting too deep.  (1212)

The maximum structured programming command nesting of 64 levels has been exceeded.


Subscript out of bounds.  (1234)

An attempt was made to reference an array element with a subscript that is outside of the range defined in the DIMENSION statement.


Subquery returned more than one record.  (1860)

Subqueries linked with the six normal operators <>, =, <=, >=, < or >, excluding ALL or ANY, can only produce a one row result.


Syntax error.  (10)

A command which is syntactically incorrect has been issued.  A syntax error may be caused by a misspelled command or variable name, or by use of a clause which is not valid in the current context.


Syntax error in field expression.  (1242)

An invalid expression involving a field has been issued.


Tab stops must be in ascending order.  (228)

The tab stops defined for the system variable _TAB must be in ascending order.


Target is already engaged in relation.  (1147)

A situation has occurred where there is more than one relationship between the currently selected table file and one of its targets.


Too few arguments.  (1229)

A function call contains less than the required number of arguments.


Too many arguments.  (1230)

A function call contains more than the permitted number of arguments.


Too many extensions specified.  (1694)

Too many file extensions have been included in a GETFILE( ), LOCFILE( ) or PUTFILE( ) function.  The maximum number of file extensions you may include is 30.


Too many files open.  (6)

FoxPro has attempted to open more than its internal limit of files.  This may possibly be caused by the CONFIG.SYS file setting not being set high enough.


Too many memory variables.  (22)

The maximum number of memory variables which may be created has been exceeded.


Too many PICTURE characters specified.  (1310)

The amount of characters permitted in a PICTURE clause is limited by memory.


Too many PROCEDURES.  (1250)

The number of procedures is limited to the amount of memory you have.


Too many READs in effect.  (1249)

The maximum nesting level for READs (5) in effect has been exceeded.


Too many names used.  (1201)

As a program was being loaded or a table was being opened, FoxPro's name table was overflowed.  To correct this, divide the program into smaller modules.


Too many record to BROWSE/EDIT in demo version.  (1161)

The maximum number of records you can BROWSE or EDIT in the demo version of FoxPro is 120.


Total field type must be numeric.  (1646)

A report expression that includes a total specification is not numeric type.


Total label width exceeds maximum allowable size.  (1246)

The LABEL command detected a condition where the sum of the individual label widths plus separating spaces is greater than the maximum width allowed.


Transaction in progress.  (1106)

A table, index or memo file cannot be accessed because another user has started a transaction that is not yet complete.  FLOCK( ) and RLOCK( ) normally do not prevent other users from reading the locked information.  This message, which scrolls from left to right to indicate that FoxPro is still active, was added for compatibility with Novell's transaction tracking system (TTS).


Transgressed node found during compaction.  (1007)

If this error occurs, see the Troubleshooting section, then call Microsoft Product Support.  FoxPro is exited after closing all open files.


Unable to create temporary work file(s).  (1410)

A SORT or INDEX command which requires temporary work files was not permitted by the operating system to create them.  This is caused by a full directory or a permissions problem concerning access to the temporary files directory.


Unable to locate desired version of FoxPro.

The version of FoxPro requested is not on the designated path.


Unable to process error.

If this error occurs, see the Troubleshooting section, then call Microsoft Product Support.  No error number is returned.  FoxPro is exited after closing all open files.


Unknown error code <expN>.

If this error occurs, see the Troubleshooting section, then call Microsoft Product Support.  No error number is returned.  FoxPro is exited after closing all open files.


Unknown function key.  (104)

An attempt was made to SET FUNCTION to a function key that does not match the name or number of an existing function key.


Unrecognized command verb.  (16)

A word was used at the beginning of the command line which is not a valid FoxPro command.


Unrecognized phrase/keyword in command.  (36)

A phrase beginning with an invalid keyword was used in a command line.


Unresolvable REGIONAL name conflict.  (1692)

FoxPro has attempted to create a REGIONAL variable name that already exists.


Use of invalid handle.  (1004)

If this error occurs, see the Troubleshooting section, then call Microsoft Product Support.  FoxPro is exited after closing all open files.


Use of unallocated handle.  (1005)

If this error occurs, see the Troubleshooting section, then call Microsoft Product Support.  FoxPro is exited after closing all open files.


Use of transgressed handle.  (1006)

If this error occurs, see the Troubleshooting section, then call Microsoft Product Support.  FoxPro is exited after closing all open files.


Variable must be in selected table.  (1134)

You can only use fields from the currently selected table in quick screens.


Variable ["<variable>"] not found.  (12)

The specified variable could not be found.


View file invalid.  (127)

An attempt has been made to open a view file with invalid data.


WINDOW coordinates are invalid.  (332)

An attempt was made to define a window's coordinates outside the allowable range.


WINDOW has not been activated.  (215)

An attempt was made to use a window which has not been activated.


WINDOW ["<window name>"] has not been defined.  (214)

An attempt has been made to activate a window that has not been defined.


Worksheet A for Lotus 1-2-3 version 3.0 file is hidden.  (1680)

FoxPro cannot import a worksheet that has been hidden.


Wrong length key.  (1117)

The key field length does not match for an UPDATE or SET RELATION TO operation between two files.


Wrong number of parameters.  (94)

The number of parameters specified in a DO ... WITH statement is greater than the number of parameters defined by the PARAMETER statement in the called program.


A .DBF style help file is required.  (1727)

SET HELPFILTER works only with a .DBF-style help file.


Cannot find spell check program.

The spelling check program specified in _SPELLCHK cannot be located.


Word files must be embedded.  (1425)

An attempt was made to link to a Microsoft Word document using APPEND GENERAL.  Microsoft Word version 2.0 does not support linking via the APPEND GENERAL command.  Instead, use the Copy option in Microsoft Word then choose Paste Special... from the Edit menu in FoxPro and choose Paste Link.


XCMD/XFCN resource not found.  (1920)

FoxPro was unable to find the specificd external command or function.


Error Message Parameters

Certain error messages return the file, field or variable name in as a parameter in the error message.  With the function SYS(2018), you can return the error message parameter for the following error messages:

"<cursor>" must be created with SELECT ... INTO TABLE.  (1815)

"<field>" is not related to the current work area.  (1165)

"<field> | <variable>" is not unique and must be qualified.  (1832)

"<file>" is not a FoxPro EXE file.  (1196)

"<file>" is not an object file.  (1309)

"<name>" is not a file variable.  (226)

"<name>" is not a file variable.  (226)

"<name>" is not a memory variable.  (225)

"<name>" is not an array.  (232)

ALIAS ["<alias>"] not found.  (13)

Application file "<file>" not closed.  (1178)

Cannot create file "<file>".  (102)

Cannot open file "<file>".  (1101)

File ["<file>"] does not exist.  (1)

Key label ["<label>"] is invalid.  (1255)

Not enough disk space for "<file name>".  (56)

Object file "<file>" is the wrong version.  (1195)

Procedure "<procedure>" not found.  (1162)

Queue "<queue>" not found.  (1716)

Script error: "<error>"  (1917)

Server "<server>" not found.  (1715)

SQL column "<field> | <variable>" not found.  (1806)

Variable ["<variable>"] not found.  (12)

WINDOW ["<window name>"] has not been defined.  (214)

Error messages that have optional error message parameters may not always return a parameter through SYS(2018).


File Extensions

Following is a list of the extensions assigned to files used by FoxPro. In the "FoxPro Platform" column; "All" indicates three platforms, FoxPro for MS-DOS, Windows and Macintosh.

File Extension	FoxPro Files	FoxPro Platform
.ACT	FoxDoc Action Diagram	All
.APP	Generated Application	All
.BAK	File Backup	All
.CDX	Compound Index File	All
.DBF	Table/Database	All
.DBT	FoxBASE+ Memo File	All
.DLL	Dynamic Link Library	Windows
.DOC	FoxDoc Reports	All
.ERR	Compilation Error File	All
.EXE	Executable Program	MS-DOS and Macintosh
.FCT	FoxPro Catalog Memo File	All
.FPC	FoxPro Catalog	All
.FPQ	Wizard-generated Updatable Query	All
.FKY	Macro Save File	All
.FLL	FoxPro for Windows Library	Windows
.FMT	Format File	All
.FPT	Table/Database Memo File	All
.FRT	Report Memo File	All
.FRX	Report File	All
.FXD	FoxDoc Supporting File	All
.FXP	Compiled FoxPro Program	All
.HLP	Graphical Help File	Windows and Macintosh
.IDX	Single-Entry Index File	All
.INT	Code Page File	All
.INT	Collation Sequence File	All
.LBT	Label Memo	All
.LBX	Label File	All
.MEM	Memory Variable Save File	All
.MLB	Macintosh Library	Macintosh
.MNT	Menu Memo	All
.MNX	Menu File	All
.MPR	Generated Menu Program	All
.MPX	Compiled Menu Program	All
.MSG	FoxDoc Message File	All
.PJT	Project Memo	All
.PJX	Project File	All
.PLB	FoxPro for MS-DOS Library	MS-DOS
.PRG	FoxPro Program	All
.PRX	Compiled Format	All
.QPR	Generated Query Program	All
.QPX	Compiled Query Program	All
.SCT	Screen Memo	All
.SCX	Screen File	All
.SPR	Generated Screen Program	All
.SPX	Compiled Screen Program	All
.TBK	Memo File Backup	All
.TMP	Temporary File	All
.TXT	Text File	All
.VUE	View File	All
.WIN	Window Save File	All
File Name and Extension	File Description	FoxPro Platform
CONFIG.FP	Configuration FIle	MS-DOS
CONFIG.FPW	Configuration FIle	Windows
CONFIG.FPM	Configuration FIle	Macintosh
FOXHELP.DBF FOXHELP.FPT	.DBF-style Help	All
FOXHELP.HLP	Graphical Help File	Windows and Macintosh
FOXUSER.DBF	Resource File	All


Fonts

See Also

FoxPro can use the fonts you have installed.  Fonts determine the appearance of displayed or printed text.  In addition, fonts determine the position and size of controls in FoxPro.  Controls include output from @ ... SAY, @ ... GET input fields, check boxes, invisible buttons, lists, popups, push buttons, radio buttons, spinners and text editing regions.

Control Size

Control Position

Font Substitution

Font Functions

Control Size

If you include a FONT clause when you create a control, the size of the font you specify in the FONT clause determines the size of the control.  If the FONT clause is omitted, the size of the control is determined by the font of the control's parent.  A control's parent is the main FoxPro window if the control is placed in the main FoxPro window.  If the control is placed in a user-defined window, that window is the control's parent.

To determine or change the font for the main FoxPro window, press Shift while you display the Text menu, then choose the Screen Font... option.  The font for a user-defined window can be specified by including the FONT clause when you create the window with DEFINE WINDOW.

Control Position

The position of a control is also determined by the font of the control's parent.  A control's parent is the main FoxPro window if the control is placed in the main FoxPro window.  If the control is placed in a user-defined window, that window is the control's parent.  A row corresponds to the height of the current font; a column corresponds to the average width of a letter in the current font.  To facilitate precise positioning of output in the main FoxPro window or in a user-defined window, you can use decimal fractions for row and column coordinates in FoxPro.

Font Substitution

In FoxPro for Windows, if you specify a font that is not available, Windows substitutes a font with similar font characteristics.  Windows considers the point size, serif characteristics and the pitch of the font you request.  A True Type font is typically substituted.  A raster or vector font is only substituted when the characteristics of the font you request closely match those of the raster or vector font.

In FoxPro for Macintosh, if you specify a font that is not available, the Chicago font with the same point size is substituted. If you specify a font size that doesn't exist, the Macintosh synthesizes the font size you specify.

Font Functions

Several functions can be used to return information about fonts and text in a specific font.  These functions include:

AFONT( )	Places information about available fonts into an array.
FONTMETRIC( )	Returns font attributes for installed fonts.
GETFONT( )	Displays the Font dialog and returns the name of the font you choose.
SYSMETRIC( )	Returns the size of a display element.
SCOLS( )	Returns the number of columns available in the main FoxPro window.  Useful when centering text or controls in the main FoxPro window.
SROWS( )	Returns the number of rows available in the main FoxPro window. Useful when centering text or controls in the main FoxPro window.
WCOLS( )	Returns the number of columns within the specified window. Useful when centering text or controls in a user-defined window.
WFONT( )	Returns the name, size or style of the current font for a window.
WROWS( )	Returns the number of columns within the specified window. Useful when centering text or controls in a user-defined window.


Fonts SeeAlso
See Also

AFONT( ) Function

FONTMETRIC( ) Function

GETFONT( ) Function

SYSMETRIC( ) Function

SCOLS( ) Function

SROWS( ) Function

WCOLS( ) Function

WFONT( ) Function

WROWS( ) Function


FoxApp - Build Applications

See Also

FoxApp is a sample application that takes one or more tables and a screen and creates an application that allows you to manage your table(s) more efficiently.  Applications are simply a series of FoxPro commands that have been entered into a file.  With FoxApp, you get a host of added functionality without having to write a single word of code.

When you use FoxApp to generate your application, it automatically adds:

An input screen so that you can see and modify each record in the table.

A control screen to move from record to record in the table.

A menu system that provides capabilities such as searching for records, deleting records, indexing, querying and generating reports.  Included are shortened versions of FoxPro's File, Edit, and Help menus, as well as Applications and Utilities menus that allow you to access and modify information in your table.

To use FoxApp:

Step 1:  Create or Modify a Table

Step 2:  Create or Modify a Screen

Step 3:  Generate an Application

Project Generation Options

Resource File Options

Generated Menu System

Step 1:  Create or Modify a Table

Table Name text region

Type the name of the table in this text area and press Enter.  If the table does not exist, the Create push button is enabled.  If it does exist, the Modify button is enabled.

Create push button

To create a new table that you've named in the table name text area, choose Create.

Modify push button

To modify an existing table that you've named in the table name text area, choose Modify.

From File... push button

To display the Open dialog so you can choose an existing table, choose From File...

Related... push button

If you want related tables to be used in your applications, choose Related... to display the Related Tables dialog containing these options:

Add push button

Displays the Open dialog so that you can choose the table file to relate.  Another dialog appears so that you can choose a common field that will connect the tables.

Delete push button

Removes the selected table from the Related Tables list.

Show As Tree/Hide Tree push button

To see a tree diagram of the related table files, choose Show As Tree.  To remove the tree diagram window, choose Hide Tree.

Step 2:  Create or Modify a Screen

By default, FoxApp assigns the screen the same name as the table.

Screen Name text region

Make adjustments to the screen name in this text area, if necessary, and press Enter.

Create push button

To create a new screen that you've named in the Screen name text area, choose Create.

Modify push button

To modify an existing screen that you've named in the Screen name text area, choose Modify.

From File push button

To display the Open dialog so you can choose an existing screen, choose the From File... push button.

Arrange push button

Displays the input and control screens so that you can adjust their locations.  Once you're satisfied with the screen arrangement, choose Save Arrangement! from the menu bar.  To cancel, choose Cancel! from the menu bar.

Step 3:  Generate an Application

Choose Generate and name the application (by default, the name of your screen with an .APP extension).  Once the application is generated, press any key to run it.

Before you generate your application, you may want to specify additional advanced options by choosing Advanced.

Advanced push button

Displays the Advanced Options dialog so you can specify a project generation method and resource file options.

Project Generation Options

Abbreviated radio button

Generating an abbreviated project is approximately three times faster than generating a full project.  However, it is harder to modify an abbreviated project.  Use this option only if you don't plan to modify the generated project.

Full radio button

Full projects are easier to modify but take longer to generate.  Use this option if you plan to use FoxApp as a starting point for a project.

Resource File Options

Store Relations check box

When Store relations is checked, FoxApp stores all the relations that you set up with your tables in the resource file.  If you regenerate your application and make any relation changes, this option overwrites the previously stored information.

Retrieve Relations check box

When you have relations stored in the resource file and you need to regenerate using those relations, you can retrieve them automatically by choosing the Retrieve relations options.

Browse Resources push button

Displays a Browse window so you can see what resources are defined and delete resources if desired.

Generate push button

Displays the Save As dialog so you can name the application, then generates the application.  When the generation process is complete, you can press any key to start your application.

Generated Menu System

File Menu

The File menu is a subset of the FoxPro File menu.  It includes the Quit option so you can exit the generated application.

Edit Menu

The Edit menu is a subset of the FoxPro Edit menu.  Its options include:  Cut, Copy, Paste, Clear, Select All and Preferences.

Help Menu

The Help menu is a subset of the FoxPro Help menu.  Its options include:  Help, Macros, Calculator, Calendar/Diary, Puzzle and About.

Application Menu

The Application menu can be used to navigate through your table(s), add and delete records, browse and search with filters and orders, create queries and reports.  Some of these functions are also available on the control panel.  Following is a list of the menu options with a brief description of each:

Top

Moves you to the first record in the main table.

Bottom

Moves you to the last record in the main table.

Next

Displays the next record in the main table.

Prior

Moves you to the previous record in the main table.

Cycle

Activates the next window.

Add Record

To add a record to the main table, make sure the main table window is active, then choose Add Record.  You can now enter information in the new record.

To add a corresponding record to a related table, make the related table window active then choose Add Record.  Next, make the main table window active, then make the same related table window active.  A new record is added with the key related field containing the same data as in the main table.

Copy Record

Creates an exact duplicate of the current record in the active table and adds it as a new record.

Delete Record

Removes the current record from the table.  If you are deleting from the main table, the record is removed immediately.  If you are deleting from a related table, the record is marked and removed when the window is refreshed or reactivated.  The mark shows up as a black rectangle to the left of the record.

Browse

Displays the main table in a Browse window.

Search...

Displays a dialog so you can search the indicated field for the text string you specify.

Filter...

Displays the Expression Builder dialog so that you can create a logical expression to filter out the records that you want to browse.  For instance, you can create a filter to display only records with a STATE field equal to Ohio:

CUSTOMER.STATE = "OH"

Order...

Displays the Index Order dialog so that you can select the indexed field to order the main table.

Pick List

Displays a list so that you can replace the current field with another entry.  Pick List only works with a field that is related to another table (this option is disabled if you're working with a single table).  If you select a key field, a read-only pick list is displayed.

Query...

Displays a dialog so you can create a query.

Report...

Displays a dialog so you can create, modify or print a report.

Utilities Menu

The Utilities menu contains the following options for your table and screen:

Refresh Screen

Refreshes all windows.  For example, if some table entries are marked for deletion, Refresh Screen will remove these entries from the window.

Construct Index

Reindexes all previously constructed indexes.

Pack

Physically removes records from a table that are marked for deletion.  The Delete Record option only prevents a record from being displayed and used.  The record remains in the table until you choose Pack.

Browse Menu

The Browse menu is a subset of the FoxPro Browse menu and is only added to the menu bar when the active window is a Browse window.  Its options include:  Change, Grid, Link Partitions, Change Partition, Font..., Size Field, Move Field, Resize Partitions, Goto... and Seek.


FoxApp - Build Applications SeeAlso
See Also

Run Menu


How FoxPro Finds Its Components
How FoxPro Finds Components

This topic explains where FoxPro looks for its components on startup.  In this discussion, the "FoxPro directory" is the directory or folder where you installed FoxPro.

Searched components are as follows:

Configuration File: CONFIG.FPW or CONFIG.FPM

Resource File: FOXUSER.DBF

All Other Components

Configuration File: CONFIG.FPW

CONFIG.FPW, the FoxPro for Windows configuration file, is searched for in the following locations in this order:

1	The startup .APP or .EXE, if any.  The configuration file included in the startup .APP or .EXE must be named CONFIG.FPW.

2	The directory specified with the -C <path> startup switch.  If just a directory is specified in <path>, FoxPro looks for a file named CONFIG.FPW in the specified directory.  If CONFIG.FPW cannot be found in the specified directory, FoxPro stops searching for a configuration file and uses its default settings.

If <path> contains a file name, the specified file is used for the FoxPro configuration file.  If the file doesn't exist, FoxPro stops searching for a configuration file and uses its default settings.

3	The directory specified with the FOXPROWCFG MS-DOS environment variable.  If only a directory is specified in FOXPROWCFG, FoxPro looks for a file named CONFIG.FPW in the specified directory.  If CONFIG.FPW cannot be found in the specified directory, FoxPro stops searching for a configuration file and uses its default settings.

If FOXPROWCFG contains a file name, the specified file is used for the FoxPro configuration file.  If the file doesn't exist, FoxPro stops searching for a configuration file and uses its default settings.

4	The FoxPro directory.

5	Along the MS-DOS path.  The first CONFIG.FPW found along the MS-DOS path is used.

6	If CONFIG.FPW cannot be found in any of the above locations, FoxPro uses its default settings.

Configuration File: CONFIG.FPM

CONFIG.FPM, the FoxPro for Macintosh configuration file, is searched for in the following manner and locations:

1	If you double-click on an application or executable file created by FoxPro, and you marked a CONFIG.FPM as included in the project when you built the file, FoxPro uses that included CONFIG.FPM. The file must be named CONFIG.FPM.

2	If you double-click on a program, application, or executable file created by FoxPro, and this program, application, or executable file does not include a CONFIG.FPM file, FoxPro looks in the folder containing the file you double-clicked on.

Note   If you have an alias for a program, application, or executable file and you double-click on the alias, FoxPro looks for CONFIG.FPM in the folder containing the source file.

3	If none of these conditions apply, FoxPro looks in the FoxPro folder.

If CONFIG.FPM cannot be found in the above locations, FoxPro uses its default settings.

Resource File: FOXUSER.DBF

FOXUSER.DBF, the FoxPro resource file, is searched for in the following locations in this order:

1	The location specified with RESOURCE = in the FoxPro configuration file.

a	If a fully qualified directory or folder with a file name is specified with RESOURCE and the file exists in the that location, FoxPro uses the file.

b	If a fully qualified directory or folder with a file name is specified with RESOURCE and the file doesn't exist in that location, FoxPro creates a new FOXUSER resource file there and uses it.

c	If only a fully qualified directory or folder is specified in RESOURCE and a FOXUSER exists there, FoxPro uses the FOXUSER found there.

d	If a relative path is specified with RESOURCE, the default directory, the MS-DOS path and then the FoxPro path are searched for a FOXUSER file.  If one is located, FoxPro uses it.  (Use SYS(5) and SYS(2003) to determine the FoxPro default directory.)

e	If a relative path is specified with RESOURCE, and a FOXUSER file doesn't exist in the default directory, along the MS-DOS path or the FoxPro path, a new FOXUSER resource file is created in the FoxPro default directory.

2	The FoxPro directory.

3	In FoxPro for Windows, along the MS-DOS path.

4	In FoxPro for Windows, along the FoxPro path.

5	If a resource file cannot be found after searching the above locations, a new FOXUSER resource file is created in the FoxPro directory.

All Other Components

All other FoxPro components (BEAUTIFY, FOXHELP, GENMENU, GENSCRN, GENGRAPH, GENXTAB and FOXDOC) are automatically sought only in the FoxPro directory.  If components are located elsewhere, you must explicitly identify the path to those components in your configuration file.  For example:

_FOXDOC = C:\DOCUMENT\FOXDOC.EXE

_GENGRAPH = MacVOLUME:GRAPHIC:GENGRAPH.APP

_GENSCRN = C:\DEV\MYTEMPL.PRG

Surround the path with quotes if it contains spaces. For example:

_GENSCRN = "MacVOLUME:DEV ONE:MYTEMPL.PRG"

If you don't use some of these components, you can speed startup by storing the null string to the corresponding system memory variable in your configuration file.  For example:

_FOXDOC = ""
_FOXGRAPH = ""


Embedding vs. Linking

See Also

Use embedded OLE objects if you want to work on all the objects in your FoxPro application in one place. Use linked OLE objects if you want to share data between applications.

Embedding

Embedded OLE objects enable you to work on all the objects in your FoxPro application in one place. Embedded objects are stored in your FoxPro application; you can edit and display them directly from the screens and reports in your application.

When you embed an OLE object in a table, all the data for this object is stored in a general field in the table. Often you have already created a file (for example, a Microsoft Excel spreadsheet), but once it's embedded you have two copies: the file and the copy that is stored in the general field. Depending on your application, it might be appropriate to delete the original file so that the only place you can view or edit the data is in the FoxPro application. (You can always make it a file again by choosing Save As… from the File menu in the server when you're editing the object. This creates a new copy of the file, but does not affect the embedded object.)

Some advantages of embedding are:

You can change the object without those changes being reflected in copies of the object in other applications or in the same application. For example, suppose you have a Microsoft Excel spreadsheet that shows the sales figures for your sales regions. You want to put a portion of that spreadsheet into each regional report and add totals. You could embed the spreadsheet object in a different general field for each report, and make the appropriate edits to customize the object.

By deleting any original copies of the file containing the OLE object, you can control who has access to the data in the object. The only way to view and edit the embedded object is through FoxPro.

You always know where to find the file, because it's in the FoxPro application. The data for an embedded object remains in the FoxPro table (unless you open this table and cut or delete the OLE object). This is not true for linked objects. If you link an OLE object, then move, rename, or delete the source file, the link is "broken" and must be fixed before you can edit or update the OLE object in your FoxPro application again.

Linking

Use linked OLE objects if you want to share data between applications. You can edit a linked OLE object in one application, and the changes will be reflected in any other linked copies of this object.

When you link an OLE object, a reference to the OLE object is stored in the general field. This reference typically includes a filename and certain other information, such as the ClassName of the application that created the object. Sometimes additional information is also included in the general field, such as specifying a subrange within the OLE object document or file (for example, a range of cells within a larger spreadsheet).

Some advantages of linking are:

You can update the data in several copies of the object from one source. For example, you might have a Microsoft Excel spreadsheet on a network server that contains sales data for each month. You could insert a linked copy of the cells of this spreadsheet showing monthly sales totals into a general field in a table that is displayed in several different reports. When the data is updated each month in the spreadsheet, you can open and update the object from FoxPro and each report will reflect the changed totals. One copy of the object file can be used by more than one client. For example, one "master" Microsoft Excel spreadsheet might be linked to a FoxPro table and another application that supports OLE on the Macintosh.

You can save space on your computer, since one version will use less space than if all client applications embedded their own copy.

You can insert an embedded or linked object into each general field in a table, and you can create as many general fields as you want. You can then use these general fields to display embedded and linked OLE objects in the screens and reports that are part of your FoxPro application. Whether you choose embedding or linking depends mostly on your particular application.


Embedding Vs. Linking See Also
See Also

Object Linking and Embedding (OLE)

Inserting OLE Objects

Edit Link Dialog

Edit Menu

Insert Object Dialog

Insert Object From File Dialog

QuickTime


Importing and Exporting Files

See Also

You can import records into FoxPro by using the Append From… option on the Database Menu, which brings up the Append From dialog; or by using the APPEND FROM and IMPORT commands in the Command window. You can export records from FoxPro to other applications using the EXPORT command.


Importing and Exporting Files See Also
See Also

APPEND FROM

Append From... Dialog

COPY TO

EXPORT

IMPORT


Inserting OLE Objects

See Also

You can store and display OLE objects only in general fields. If you want to embed or link an OLE object in a FoxPro table, you must create a general field in your table, then use this field to store the OLE object. Once you have created a general field to store the object, you can use the field to display and edit the object in screens and reports. You can also display and edit the OLE object in the table.

You can create an empty general field, then insert an OLE object in the field. When a general field in a table is empty, "gen" appears in the field when you browse the table. When an OLE object has been inserted in the field, this changes to "Gen".


Inserting OLE Objects See Also
See Also

Object Linking and Embedding (OLE)

Embedding vs. Linking

Edit Link Dialog

Edit Menu

Insert Object Dialog

Insert Object From File Dialog

QuickTime


International Settings

See Also

This sections discusses how you can configure FoxPro with international settings and is divided into the following topics:

Configuring FoxPro for International Use

How FoxPro for Windows Reads International Settings

Configuring FoxPro for International Use

Setting the Date Format

The SET DATE command allows you to choose from a number of international date formats.  By default, dates in FoxPro are displayed and entered in American format (mm/dd/yy).  The complete list of date formats (with synonyms shown separated by vertical bars) is:

Name	Format
AMERICAN | MDY	mm/dd/yy
ANSI	yy.mm.dd
BRITISH | FRENCH | DMY	dd/mm/yy
GERMAN	dd.mm.yy
ITALIAN	dd-mm-yy
JAPAN | YMD	yy/mm/dd
USA	mm-dd-yy
To display only the last two digits of the year (the "19" is implied), use SET CENTURY OFF.  This is the default FoxPro setting.  To display all four digits for the year, use SET CENTURY ON.  For even more flexibility, you can change the separator from the default for that date setting to any arbitrary single character with SET MARK TO.

Setting the Time Format for the Clock

Some international locales use a 12-hour time format; many others prefer a 24-hour format.  SET HOURS TO 12 and SET HOURS TO 24 change the FoxPro clock (displayed when you issue SET CLOCK ON) to reflect these preferences.  Note that the value returned by the TIME( ) function is always in a 24-hour format.

Setting the Currency Symbol and Position

FoxPro allows you to set both the character string used to represent currency and the position relative to the numeric currency value.  By default, the currency symbol is '$', and the position is to the left of the currency value.  But, for example, the following commands are appropriate for Finland, where the abbreviation for the mark ka appears to the right of the amount:

SET CURRENCY TO 'mk'
SET CURRENCY RIGHT

Setting the Decimal Separator

Use SET POINT to change the appearance of the decimal point to any single character.  The two most common separators are '.' and ','.  In Portugal, though, currency is often displayed with a '$' for a decimal point, then the abbreviation 'Esc.' after the entire value.

Portuguese users can achieve this format with these FoxPro commands:

SET POINT TO '$'
SET CURRENCY TO 'Esc.'
SET CURRENCY RIGHT

See SET SEPARATOR for specifying the thousands separator in PICTURE clauses.

Setting the Number of Decimal Places Displayed

Most currencies throughout the world are expressed with two digits after the decimal point, but FoxPro allows you to set the number of decimal places to any number from 0 to 18.  For instance, SET DECIMALS TO 3 would be appropriate in a country with a currency displayed to three decimal places.

How FoxPro for Windows Reads International Settings

FoxPro for Windows uses the Microsoft Windows international settings on start up, overriding the FoxPro default settings.

When Windows is started, the initial international settings are determined by values in the international [intl] section in your WIN.INI Windows initialization file.  The WIN.INI international section contains settings like iDate, sShortDate, iTime and so on that specify the formats for the date, the time and other items that vary from country to country.  These settings can be changed after Windows is started by choosing the International icon in the Windows Control Panel.

For additional information about international settings and your Windows WIN.INI initialization file, see the Microsoft Windows User's Guide and the Microsoft Windows Resource Kit.

At start up, FoxPro for Windows reads the current international settings and changes the values of the following SET commands from the default settings as necessary.

SET DATE

FoxPro for Windows reads the value of iDate and sets the date format to MDY, DMY or YMD.  FoxPro for Windows then reads the value of iCountry and resets the date format to AMERICAN, BRITISH, etc. if a match is found with one of the SET DATE formats.

SET MARK TO

After the SET DATE format is specified, sShortDate is read.  If the date delimiter is different than the delimiter used in the SET DATE format, the sShortDate delimiter is specified for SET MARK.

SET CENTURY

sShortDate is read again to determine if CENTURY is set ON or OFF.

SET HOURS

iTime is read to determine if HOURS is set to 12 or 24.

SET CURRENCY

sCurrency is read to determine the currency symbol.  The currency symbol is placed to the left of the monetary value (SET CURRENCY LEFT) if iCurrency is 0 or 2 and to the right of the monetary value (SET CURRENCY RIGHT) if iCurrency is 1 or 3.

SET DECIMALS

iDigits is read to determine the number of digits to display after the decimal point.

SET POINT

sDecimal is read to determine the decimal point.

SET SEPARATOR

sThousand is read to determine the character that separates each group of three digits to the left of the decimal point.

You can override the Windows international start up settings in your FoxPro for Windows CONFIG.FPW configuration file.  For example, to override the Windows currency symbol position setting and place the currency symbol to the right of the monetary value, include the following line in your FoxPro for Windows configuration file:

CURRENCY = RIGHT


International Topics SeeAlso
See Also

ANSITOOEM( ) Function

CONFIGURING FOXPRO Command

OEMTOANSI( ) Function

SET CENTURY Command

SET CLOCK Command

SET COLLATE Command

SET CURRENCY Command

SET DATE Command

SET DECIMALS Command

SET HOURS Command

SET MARK TO Command

SET POINT Command

SET SEPARATOR Command

TIME( ) Function


Control Key Shortcuts

Control Key Shortcuts

Control key shortcuts enable you to choose certain menu options without displaying the menu. All you need to do is press the Control key combination that is listed next to the desired option on the menu. In most cases, these Control key shortcuts choose menu options that affect the frontmost window.

Windows & MS-DOS Key	Mac Key	Action
Ctrl+A	A	Select All
Ctrl+C	C	Copy
Ctrl+D	D	Do
Ctrl+E	L	Replace and Find Again
Ctrl+F	F	Find
Ctrl+G	G	Find Again
Ctrl+K	K	Continue
Ctrl+M	M	Resume
	N	New
	O	Open...
	P	Print...
Ctrl+Q	Q	Same as Escape (in FoxPro for Macintosh, Quit)
Ctrl+R	R	Redo
	S	Save
Ctrl+V	V	Paste
Ctrl+W	W	Exit current edit and save any modifications (in FoxPro for Macintosh, Close)
Ctrl+X	X	Cut
Ctrl+Z	Z	Undo
	.	Stop the operation
Ctrl+F1	F1	Cycle windows
Ctrl+F2	F2	Display Command window
Ctrl+F4		Close window (Windows only)
Ctrl+F5		Restore window to original size (Windows only)
Ctrl+F6		Next window (Windows only)
Ctrl+F7		Move window
Ctrl+F8		Size window
Ctrl+F9		Minimize window (Windows only)
Ctrl+F10		In FoxPro for Windows, maximize window. In FoxPro for MS-DOS, zoom window.
Escape	Esc	Exit current edit without saving modifications; exit dialog without taking action


Function Keys

The default values assigned by FoxPro to the function keys F1 through F10 are listed below.

Key	Function
F1	(Activate online help)
F2	Set (displays the View window)
F3	List
F4	Dir(ectory)
F5	Display Structure
F6	Display Status
F7	Display Memory
F8	Display
F9	Append
F10	(Activate/deactivate the system menu bar  same as Alt)
You can assign new values to F1 through F10 by choosing Macros… from the Program menu or with the SET FUNCTION command.


Macintosh Aliases

See Also

A Macintosh alias is a way to represent a file in any folder without making a separate copy of it. By using one or more aliases you can open FoxPro for Macintosh or a FoxPro file from any location on a Macintosh volume without stepping through nested folders. An alias points to the original file that it represents, so that when you open an alias, you're actually opening the original file. If you select an alias from a menu or dialog, FoxPro recognizes the alias and opens the original file.

Macintosh aliases can make it easier to access applications and files from the Macintosh desktop or from the Microsoft FoxPro folder. You can create an alias of any program file and leave the original file in its project folder while placing its alias on the desktop or in a higher level folder. When you double-click on the alias, System 7 opens FoxPro and then the original object; program files will run, others will open in an edit or browse mode.

Note   A FoxPro alias is different from a Macintosh alias. A FoxPro alias is an alternate name assigned to a table and work area that enables you to access a particular table and work area by specifying its alias rather than its filename.


Macintosh Aliases See Also
See Also

Tips and Tricks

Alias


Memory Considerations

See Also

FoxPro for Macintosh can take advantage of large amounts of computer memory. A correctly configured Macintosh containing extra memory can enhance the performance of FoxPro even further. To adjust the allocation of memory for FoxPro, use the Minimum size and the Preferred size settings in the Info window before you start FoxPro.

Devoting more memory to FoxPro means that less memory is available to other applications that are running. FoxPro takes advantage of all the memory allocated to it. Therefore, you must maintain the balance of memory allocated to FoxPro, to other applications you intend to run, and to System 7 itself.

Configuring Memory for Best Performance

This section explains how to configure your computer for best performance, depending on the amount of available memory.

For the best performance on a machine with 4 MB of RAM:

Set virtual memory on. For more information about virtual memory, see the next section, "Enabling Virtual Memory."

Consider running FoxPro for Macintosh with 16 or fewer colors rather than 256 colors.

Do not run any other Macintosh applications while FoxPro is running.

Use only those system extensions (INITs) and control panel devices (CDEVs) needed for operation.

Remove unnecessary fonts and sound files from the SYSTEM folder.

Use a disk cache no larger than 128K.

For the best performance on a machine with more than 4 MB of RAM:

Set virtual memory off. For more information about virtual memory, see the next section, "Enabling Virtual Memory."

Do not run any other Macintosh applications while FoxPro is running.

Do not use a RAM disk.

Consider running FoxPro for Macintosh with 16 or fewer colors rather than 256 colors.

Use only those system extensions (INITs) and control panel devices (CDEVs) needed for operation.

Use a disk cache no larger than 128K.

Increase the amount of memory allocated to FoxPro for Macintosh in the Preferred size area of the Info window. (Note that the Preferred size area is available in System 7.1 and greater.)

Enabling Virtual Memory

Virtual memory allows you to run more applications simultaneously or to access larger amounts of data. Enabling virtual memory allows FoxPro to manage data larger than the amount of RAM in your computer.

Note   Though virtual memory increases the apparent amount of RAM available for data and applications, virtual memory is not a high-performance solution. Hard disk space is not a substitute for more RAM.

To enable virtual memory:

1	From the Apple menu, choose Control Panels.

2	Double-click the Memory control panel.

3	Click the Virtual Memory On radio button.

The amount of virtual memory available depends on the amount of unused RAM plus the amount of unused hard disk space on the active volume, minus the RAM disk size (if you create one). For more information about virtual memory, see your Apple documentation.


Memory ConsiderationsSee Also
See Also

SYS(1001)

SYS(1016)


Migrating to FoxPro for Macintosh

See Also

This topic contains information for those who are upgrading to FoxPro for Macintosh version 2.6 from earlier versions of FoxPro® or FoxBASE+®.

Topics covered include:

Migrating FoxBASE+ for Macintosh Applications

FoxBASE+ for MS-DOS Compatibility

The following table lists versions and products and indicates how you can use files from these versions in FoxPro for Macintosh.

Original Product	Recommended Method
FoxBASE+ for Macintosh	Use FB+MIGRATE.APP
FoxBASE+ for MS-DOS FoxPro 1.0 FoxPro 2.0	Most programs should run without modification. To insure full compatibility, convert files to FoxPro 2.5 and transport to FoxPro for Macintosh.
FoxPro 2.5 for MS-DOS FoxPro 2.5 for Windows	Most programs run without modification. To modify existing screens, reports, and labels, transport them to FoxPro for Macintosh.
Migrating FoxBASE+ for Macintosh Applications

While FoxBASE+ for Macintosh and FoxPro for Macintosh share some similarities, many commands, functions, and file types work differently in the new product. If you are one of the many developers who have invested time in creating database programs using FoxBASE+ for Macintosh version 2.01, you want to protect this investment when you upgrade to FoxPro for Macintosh.

FoxPro provides a migration application, FB+MIGRATE.APP, to make it as easy as possible to upgrade programs written in FoxBASE+ for Macintosh version 2.01 or later.  With this migration application you can migrate all your FoxBASE+ databases, screens, reports, files, and programs to FoxPro for Macintosh.

Located in the GOODIES folder, FB+MIGRATE.APP consists of two utilities, the File Converter and the Code Analyzer:

File Converter

The File Converter converts screens (.SCX files), reports (.FRX files) and memos (.DBT files) from tab-delimited ASCII files to native FoxPro format. Whenever the File Converter encounters FoxBASE+ elements for which there is not an exact match in FoxPro, it will map that element to an equivalent.

Code Analyzer

The Code Analyzer parses through the existing FoxBASE+ for Macintosh programs (.PRG files), identifies the lines in the program that have incompatible code, and suggests possible replacements. You can change the existing FoxBASE+ code manually through an edit region or accept the replacement the Code Analyzer supplies through a Replace button.

You access the File Converter and Code Analyzer utilities through two buttons on the migration application screen.

The Migration Process

To migrate FoxBASE+ for Macintosh programs to FoxPro for Macintosh:

1	Create backup copies of all your files. Do not work on original files!

2	Bring FoxBASE+ databases into FoxPro by opening and saving them in new locations.

3	Start the Migration Application:

Run FoxPro.

Choose Do... from the Program menu.The Do Program File dialog box appears.

Locate the FOXPRO:GOODIES:FB+MIGRATE folder.

Double-click on FB+MIGRATE.APP.

4	Use the File Converter to convert all FoxBASE+ screens, reports, and label files. FB+MIGRATE.HLP contains detailed information about FB+MIGRATE.APP. To open this help file, double-click on FB+MIGRATE.HLP in Finder.

5	Resolve any outstanding problems with PICT resources in FoxBASE+ .SCX files.

6	Use the Code Analyzer in FB+MIGRATE.APP to find and resolve areas of potential incompatibility in the program.

7	Make any manual changes required to finish the conversion and to take advantage of the added functionality in FoxPro.

8	Run FoxDoc, the automatic application system documenter for FoxPro programs, to help clean up the code.

9	Compile the converted program in FoxPro.

FoxPro can use the native file format from FoxBASE+ databases, so you can use your data right away, without converting it.

For more information on the conversion process and how to use the Migration Application, click the Help button on any of the Migration Application's screens

Incompatible Commands and Functions

The following commands and functions work differently in FoxPro for Macintosh than they did in FoxBASE+ for Macintosh, or they are no longer supported in FoxPro for Macintosh:

@...CLEAR	MENU ON1	SYS(1023)1
@...GETCheck Box	ON MENU1	SYS(1024)1
@...GETPicture Buttons	PCOL()	SYS(1025)
@...GETPopups	PROW()	SYS(1026)
@...GETRadio Buttons	READ	SYS(1027)
@...GETScrollable Lists	ROW()	SYS(1028)
@...GETText Buttons	SCREEN	SYS(1029)
@...GETText Edit Region	SCROLL1	SYS(1030,<expC>)
@...SAY/GET	SET COLOR1	SYS(1031)1
@...TO...	SET FRAME1	SYS(1032)1
ALERT	SET HISTORY1	SYS(1033,<filename>)
APPEND	SET MARGIN1	SYS(1034)1
APPEND FROM	SET PRINTER	SYS(1035)1
BROWSE	SET RESOURCE	SYS(1036)1
CHANGE	SET SCREEN1	SYS(1038)1
COL()	SET STRICT	SYS(1039)1
EDIT	SYS(0)	SYS(1040)1
FOXCODE1	SYS(5)	SYS(1041)1
GENERATE1	SYS(1020)1	SYS(1042)1
GETFILE()	SYS(1021)1	SYS(1043)1
MENU1	SYS(1022)1	WAIT
MENU()1
1There is no automatic replacement that Code Analyzer uses for this command or function.

For information about specific issues and steps for resolution, double-click on FoxPro:GOODIES:FB+MIGRATE.HLP in Finder.

FoxBASE+ for MS-DOS Compatibility

FoxPro for Macintosh runs most FoxBASE+ for MS-DOS programs without change. When compatibility with FoxBASE+ for MS-DOS is needed, you should inform FoxPro of the desired compatibility by using the statement:

SET COMPATIBLE FOXPLUS

Areas of Concern in FoxBASE+ for MS-DOS Compatibility

Conflict between FoxBASE+ for MS-DOS programs and FoxPro could occur in the following areas.  Some of the issues related to these conflicts are discussed in FoxPro for Macintosh Help under these headings:

Color Commands

SET DEFAULT

Cross-Platform Considerations

The following topics are discussed in the Migration Application Help under the listed headings.

Topic	Heading
Data and Program Files	ISSUE3
.VUE Files	GETFILE( )


Compatibility SeeAlso
See Also

SET COMPATIBLE


Name Expressions

Certain FoxPro commands and functions require you to supply a name.  Some examples of names used in FoxPro are:

Table/.DBF names

Table/.DBF alias names

Table/.DBF field names

Index file names

File names

Memory variable and array names

Window names

Menu and menu pad names

Popup names

Although a name cannot be a memory variable or an array element, you can create a name expression that substitutes the value of a character type memory variable or an array element as the name.  Name expressions provide flexibility in FoxPro commands and functions.

Store the name to the memory variable (or an array element).  The name can then be substituted into a command or function by enclosing the memory variable in parentheses.

For example, the REPLACE command requires a field name.  You can store a field name to a memory variable and use a name expression in REPLACE where the field name occurs:

STORE 'city' TO mvarcity
REPLACE (mvarcity) WITH 'Redmond'

Here the field name CITY is stored to the memory variable MVARCITY.  The name expression (mvarcity) replaces the field name in REPLACE.

Here are some places where name expressions are especially useful and more examples of how they are used:

File Names

USE (name_expr1) INDEX (name_expr2) ...
SET VIEW TO (name_expr)
REPORT FORM (name_expr) TO PRINT ...
DO (name_expr)

Window Names

DEFINE WINDOW (name_expr) FROM 1,1 TO 10,10 ...
ACTIVATE WINDOW (name_expr)

Menu and Popup Names

DEFINE MENU (name_expr) ...
ACTIVATE MENU (name_expr)

Project Names

BUILD PROJECT (name_expr) FROM ...

Color Set Names

SET COLOR SET TO (name_expr)

A similar process called macro substitution allows memory variables to replace names.  Macro substitution places an ampersand (&) before the memory variable to tell FoxPro to use the value of the memory variable as a name.

Note that a command or function containing a name expression executes faster than one containing macro substitution.  Whenever possible, use a name expression instead of macro substitution.


Object Linking and Embedding (OLE)

See Also

Object linking and embedding (OLE) is a set of features supported by the Microsoft Windows and Macintosh operating systems that allows you to embed or link text data, spreadsheet data, video and pictures from one Windows or Macintosh application, the server, into another application, the client. Use embedded OLE objects if you want to work on all the objects in your FoxPro application in one place. Use linked OLE objects if you want to share data between applications.

To embed or link OLE objects in your FoxPro application, your FoxPro application (the client) must have a dialog with a server application. Some applications, such as Microsoft Graph, can be used only as servers, not as clients. Others, such as Microsoft Excel, can be either servers or clients (you can embed or link objects from other applications in them, or embed or link objects from them into other applications).

FoxPro can be used only as a client application; that is, you can embed or link objects from other applications in a FoxPro application, but FoxPro objects can't be embedded or linked into other applications. The FoxPro user interface provides a number of menu options and other features that allow you to embed or link OLE objects, and then access the server to display, edit, play, or run these OLE objects in your FoxPro applications.


Object Linking and Embedding See Also
See Also

Inserting OLE Objects

Embedding vs. Linking

Edit Link Dialog

Edit Menu

Insert Object Dialog

Insert Object From File Dialog

QuickTime


QuickTime

See Also

Using the QuickTime extension of Macintosh System 7.1, you can access and control time-based data such as video and audio recordings in files accessible on equipment such as hard disks, CD-ROMs, and audio/video equipment connected to a Macintosh.

QuickTime objects are OLE objects you can store in the general field of a .DBF file.  When you double-click on a QuickTime object, the QuickTime software displays a control bar that indicates a new, untitled, empty movie.  Use this control bar to adjust the sound and to play, fast-forward, step backward or forward, or stop the QuickTime playback.  You can also use the size box to adjust the size of the QuickTime image.

Use the FoxPro Edit menu Insert Object... option to place a QuickTime object in a general field.  When you select QuickTime Object from the Insert Object dialog, FoxPro opens the QuickTime server.

Open the general field using [image] +Page Down or double-click the field to place a QuickTime object in a FoxPro for Macintosh table, then use either of two methods:

To automatically paste the QuickTime movie into the open general field

1	From the Edit menu, choose Insert Object...

2	Click the File... button in the Insert Object dialog.

3	Select QuickTime Movie  in the Type: popup, then choose a QuickTime file.

To open the QuickTime server so you can select and manipulate a QuickTime object

1	From the Edit menu, choose Insert Object...

2	Click QuickTime Object in the Insert Object dialog.

3	From the QuickTime server Edit menu, choose Paste From...

4	Use the QuickTime File Open dialog to preview and select a QuickTime file.

Once the file is in the QuickTime server, you can play, edit, or save it to the general field of the open FoxPro record.

To create a preview image, select any frame in the QuickTime object by, first, sliding the control bar marker to view the frame, then choosing Make This Frame The Poster from the Movie menu or press [image] +M .

Make the QuickTime movie endlessly repeat by choosing Enable Looping from the Movie menu or press [image] +L .  Looping is available only within the QuickTime server.

The QuickTime server shipped with FoxPro is also a stand-alone application that allows you to play or edit QuickTime movies and to place them as OLE objects in FoxPro tables.  You can create new movies from pieces of existing movies.

The QT OLE Server menu contains three menu pads: File, Edit, and Movie.

File Menu

The File menu options create, open and save QuickTime objects from inside FoxPro for Macintosh or QuickTime files from the stand-alone application.

New creates a new, empty movie file, named "Untitled <#>" where <#> refers to the number of created or new movies.  You can open several new movies at the same time and copy and paste between them.

Open displays the QuickTime File Open dialog, which allows you to see the movie preview.  If no preview exists, or if the file has been opened and saved in a previous QuickTime session, the server enables the CREATE - UPDATE button.  The QuickTime File Open dialog displays a preview only if a frame has been made into a poster (see Movie Menu).  The scrolling list displays only files of type 'MooV'.

The movie opens in its own window.

Close closes the active window.  If the active window is an OLE document, this will break the connection, and if launched from FoxPro, the QTOleServer application quits and returns to FoxPro.

Save saves the movie.
From inside FoxPro, this menu item changes to Update Object FoxPro[ <FoxProDocName>].

Save As ... saves the movie to a different file.
From inside FoxPro, this menu option changes to Save Copy As... .  Files are saved with a creator type of 'QSrv', and a file type of 'MooV'.  The Save As dialog gives you the option of making the movie "self-contained": all data is moved into the movie file, instead of containing references to other movies.  This option also duplicates the movie in the data fork, which improves cross-platform use of movies.

Quit closes the application.
From inside FoxPro, this menu option changes to Quit & Return To FoxPro[<FoxProDocName>].

Edit Menu

The Edit Menu option allows you to manipulate a QuickTime object or QuickTime file.

Cut and Copy  place several different types of data on the clipboard, including 'MooV' data of a QuickTime movie or Movie frame and 'PICT' data of the Poster Frame.

Clear is available when there is a movie in the active window.  When Clear is enabled, the Delete key clears the current selection (which may be the current frame or the entire movie)

Paste places 'MooV' data at the position of the control bar slider.

Paste From ... displays the QuickTime File Open dialog.  The movie contents of the selected file are pasted into the current application at the slider location.  This is the menu option to use to place a QuickTime movie in a general field.

Movie Menu

The Movie Menu controls two attributes of QuickTime movies: looping and the preview image.

Enable/Disable Looping controls the continuous playing of a movie.  The menu option toggles depending on the setting for the movie.

Set Poster Frame specifies the current frame as the "poster frame."  The poster frame represents the movie in FoxPro, and as the preview image in the QuickTime File Open dialog.


QuickTime See Also
See Also

Object Linking and Embedding

@ ... SAY - BMPs & OLE Objects


International/Cross Platform
International and Cross-Platform Features

See Also

Overview

This topic describes FoxPro international and cross-platform features, including automatic translation of accented characters (ä, é ,ô, and so on) across different FoxPro platforms.  Automatic translation of accented characters can occur in tables, programs and text files.  FoxPro also supports collation sequences, allowing you to order tables for a specific language.

This topic describes:

Quick Start

Translating Accented Characters

Preventing Translation

Ordering Records for a Specific Language

Migrating from Earlier FoxPro Versions

Configuring FoxPro for International Use

This topic makes use of the terms code page and character set.  If you are not familiar with these terms, read the Fundamentals of Code Pages and Character Sets topic before proceeding.

Quick Start

To immediately take advantage of the FoxPro international and cross-platform features, include this line in your FoxPro configuration file:

CODEPAGE = AUTO

This is the recommended setting and enables automatic translation of accented characters across platforms.

To specify a collation sequence for new indexes and tables created with the SORT command, include this line in your FoxPro configuration file:

COLLATE = <collation sequence>

where <collation sequence> is one of the language-specific collation sequences supported by FoxPro.  For example, you can specify the SPANISH collation sequence to order tables in a manner familiar to those who speak traditional Spanish.  See the SET COLLATE command for a list of available collation sequences.

Including the CODEPAGE and COLLATE items in your FoxPro configuration file allows you to take advantage of the FoxPro international and cross-platform features.  Once these are set, you may never have to change them.

More information about translation and collation sequences is available in this topic.

Translating Accented Characters

FoxPro now supports automatic translation of characters across code pages.  In earlier versions of FoxPro, any translation of accented characters had to be performed manually.

A code page is a set of characters specific to a language or hardware platform.  Accented characters are not represented by the same ASCII values across platforms and code pages.  In addition, some characters available in one code page are not available in another.

The following table lists the code pages supported by FoxPro.

Code Page	Platform	Code Page Identifier
Code	Platform
437	U.S. MS-DOS	x01
620*	Mazovia (Polish) MS-DOS	x69
737*	Greek MS-DOS (437G)	x6A
850	International MS-DOS	x02
852	Eastern European MS-DOS	x64
861	Icelandic MS-DOS	x67
865	Nordic MS-DOS	x66
866	Russian MS-DOS	x65
895*	Kamenicky (Czech) MS-DOS	x68
1250	Eastern European Windows	xC8
857	Turkish MS-DOS	x6B
1251	Russian Windows	xC9
1252	Windows ANSI	x03
1253	Greek Windows	xCB
1254	Turkish Windows	xCA
10000	Standard Macintosh	x04
10006	Greek Macintosh	x98
10007*	Russian Macintosh	x96
10029	Macintosh EE	x97
* Not detected when you include CODEPAGE=AUTO in your configuration file.

For additional explanations of code pages, see the Fundamentals of Code Pages and Character Sets topic.

Specifying a Code Page in the FoxPro Configuration File

The CODEPAGE configuration item can be included in your FoxPro configuration file (CONFIG.FP in FoxPro for MS-DOS, CONFIG.FPW in FoxPro for Windows and CONFIG.FPM in FoxPro for Macintosh) to specify a code page option.

Automatic translation isn't enabled by default.  You must explicitly enable automatic translation by including CODEPAGE = AUTO in your FoxPro configuration file.

CODEPAGE = AUTO

The recommended CODEPAGE setting is AUTO.  When CODEPAGE is set to AUTO, accented characters are automatically translated.  The translation is performed for character and memo fields in tables and for character strings in compiled programs.

When you set CODEPAGE to AUTO, the code page for the current FoxPro platform is stored in the headers of new tables, allowing FoxPro to determine the platform on which a table was created.

When you open a table on a platform different than the platform on which the table was created, accented characters are translated if you've enabled automatic translation with CODEPAGE = AUTO on each platform.  This allows you to share tables created on different FoxPro platforms worry-free, knowing that accented characters in character and memo fields will be automatically translated from one platform to the next.

For example, if the letter ä is entered in a table created in a U.S. version of FoxPro for MS-DOS (which uses code page 437) and is then displayed in FoxPro for Macintosh (which uses code page 10000), FoxPro for Macintosh performs the translation necessary to display the letter as ä.  When data is added to the table in FoxPro for Windows, it is automatically translated and stored in the table in the 437 code page.

Note that MODIFY STRUCTURE also marks a table with the current code page.  The PACK and ZAP commands do not change the code page a table is marked with.

Preventing Translation

In some cases, you'll want to disable automatic translation for selected character or memo fields in a table, or for all character and memo fields in the table.

For example, if you store binary data such as a Microsoft Word document or a graphic image in a memo field, you do not want FoxPro to translate the document or graphic when you access the binary data.  You may also want to share a table with someone using an earlier version of FoxPro.  In this case you'd want to disable the automatic translation of all character and memo fields in the table.

Use the SET NOCPTRANS command to disable automatic translation of a set of character or memo fields.

FoxPro disables automatic translation for all character and memo fields in a table if the CODEPAGE configuration item is not included in your configuration file.

Other Code Page Settings

The recommended code page setting is AUTO.  However, in rare cases, you may want to specify a code page even though your operating system is set to another code page.  For example, this may be desirable in locales where code pages are installed as TSR (Terminate and Stay Resident) programs.  You can set FoxPro to automatically translate to a specific code page by including this line in your FoxPro configuration file:

CODEPAGE = <expN>

The numeric expression <expN> must be a code page identifier supported by the current FoxPro platform for translation to occur.

CPZERO Program

If you accidentally specify the wrong code page when you open a table that isn't marked with a code page, run CPZERO.PRG to reset the table's code page to zero. CPZERO is a FoxPro program that is automatically installed in the FoxPro:Goodies:Misc folder. Before you run CPZERO, make sure that the table whose code page you'll reset isn't open. When you run CPZERO, you are prompted for the name of the table to modify.

FoxFont Considerations

FoxPro includes FoxFont, an OEM font that provides compatibility with FoxPro for MS-DOS.  We suggest that you do not use FoxFont (or other OEM fonts) in FoxPro if you share tables and applications across different FoxPro platforms.  Instead, use system fonts and the automatic translation facilities of FoxPro -- set CODEPAGE = AUTO on each FoxPro platform and let FoxPro do the translation.

With an international keyboard, you cannot enter accented characters in FoxFont.  Use ANSI fonts with an international keyboard.  Even if your keyboard does not directly support accented characters, you can still enter accented characters in ANSI fonts by pressing Alt+0XXX.  (XXX is the three digit sequence found in a table of ANSI characters, and must by typed on the numeric keypad.)

FoxPro Applications

FoxPro can automatically translate accented characters in applications.  Accented characters can be used in the following locations:

Table file names

Table alias names

Table field names

Index file names

File names

Memory variable and array names

Window names

Menu names

Popup names

Character string literals

Character expressions

The code page for the current FoxPro platform is automatically stored in the headers of compiled programs (.FXPs), allowing FoxPro to determine the platform on which the .FXP was compiled.

When a compiled application is run on a FoxPro platform different than the platform on which it was compiled, accented characters in the application are translated if automatic translation is enabled in your configuration file with CODEPAGE = AUTO.

Opening and Translating Programs and Text Files

If a program (.PRG) or text file (.TXT) was created on a FoxPro platform other than the platform on which you want to open the file, you can translate the accented characters when you open the file.  If you open the program or text file with the Open... option on the File menu, you can translate the file by checking the Other Code Page check box before you open the file.  In the dialog that appears, specify the platform on which the file was created.  The accented characters in the file are translated when displayed so they appear the same on the current platform as they did on the platform you specified.  No translation occurs if you don't check the Other Code Page check box.

If you open the program or text file with MODIFY COMMAND or MODIFY FILE, you can include the AS clause to specify the platform on which the file was created.  Include the numeric code page in the AS clause that corresponds to the FoxPro platform on which the program or text file was created.

Saving and Translating Programs and Text Files

After you've opened a program or text file, you can save the file and translate it for use on another FoxPro platform.  Choose the Save As... option on the File menu and check the Change Code Page check box.  In the dialog that appears after you choose Save, specify the desired platform.

If you're editing a program that you plan to compile on the current FoxPro platform, be sure to specify the current FoxPro platform when you save the program.

Ordering Records for a Specific Language

FoxPro supports collation sequences that allow you to order tables for a specific language. In earlier FoxPro versions tables were always ordered in a "machine" sequence; this sequence was not correct for some languages. A collation sequence determines the order in which records appear in an indexed or sorted table. A collation sequence also determines the results of character expression comparisons.

Collation sequences for several languages are available, allowing you to index and sort tables so that the records in the table appear in the proper sequence for your language.

Note   FOXPRO.INT, a file included with FoxPro, must be present in your FoxPro directory to take advantage of certain collation sequences and code pages.

Note that with a MACHINE collation sequence, which earlier FoxPro versions use (and to which FoxPro 2.5 still defaults), each character in the code page, whether it's a Roman character, an accented character, or a line-drawing character, has a unique "sort weight" determined by its position in the code page. In a majority of code pages, all accented characters appear after the unaccented characters. In this situation an ä sorts after z, which isn't correct in most languages (although it is true in Swedish, for instance).

Furthermore, in most languages, accented characters sort after their unaccented counterparts, but only if the unaccented versions of all characters being compared are the same. For example, in German, ä sorts after the unaccented a, but the string äa sorts before the string ab because the second character a is less than the second character b. In this way, characters are interleaved in many cultures.

The language-specific sequences take into account all the complex rules of the language (including two-to-one, three-to-one and one-to-two mappings).

Case-Sensitive Collation Sequences

Though most collation sequences are case-insensitive, two case-sensitive collation sequences are available in FoxPro: the familiar MACHINE sequence, the default sequence described above, and the sequence named UNIQWT. UNIQWT is a "unique weight" sort in which each accented character sorts strictly after its unaccented counterpart (unlike the interleaving of accented characters described above).

While the collation sequence with UNIQWT isn't strictly culturally correct as with GENERAL, it might aid developers in migrating their applications from earlier FoxPro versions. One reason is that uppercase and lowercase letters are treated distinctly as they were in earlier FoxPro versions. Another reason is described in the next section.

For the best performance when using a collation sequence other than MACHINE or UNIQWT, be sure that the current collation sequence is the same as the collation sequence of any indexes you are using.

Collation Sequences and SEEK and SKIP

The SEEK command accepts an expression. FoxPro transforms that expression into a sort key that it compares to keys in the master index or tag. SEEK then positions the record pointer at the first index entry that's greater than or equal to ( >= ) the supplied key.

With a machine sort, SEEK finds a match if there is one. But when FoxPro uses the other language-specific collation sequences to create indexes, and the search key length is not the same as the index key length, only the alphabetic part of the key is considered and any diacritical marks are ignored. In other words, even if you SEEK "äbc", you might find "abc".

FoxPro behaves this way for the following three reasons:

1	Performance.

2	Consistency with the SKIP command.

3	Consistency with the SET NEAR command.

Note that SEEK and SKIP use the collation sequence of the master index or tag, and ignore the current collation sequence. SEEK can't be used unless there is an active index.

Alternatives to SEEK and SKIP

If you use accented characters, use one of the following methods to search a table:

1	Construct a loop with SCAN FOR … ENDSCAN.

2	Use LOCATE FOR … CONTINUE.

LOCATE and SCAN use an index if one is active, and they have two very significant advantages over SEEK when data contains accented characters.

First, both LOCATE and SCAN remember the condition with which they were invoked, so they can be used for looping on a condition. SEEK, on the other hand, simply positions you somewhere in the index, and SKIP continues down the index from that point. With international data, this might not give you the results you want.

Second, LOCATE and SCAN are diacritically sensitive, whereas SEEK isn't. In addition, both LOCATE and SCAN can be fully optimized by Rushmore if the current collation sequence is MACHINE or UNIQWT; otherwise, partial optimization will occur.

Note that the ORDER BY clause of the SQL SELECT command uses the current collating sequence, which is returned by SET("COLLATE").

Specifying a Collation Sequence

You can specify a collation sequence with COLLATE = in your FoxPro configuration file, from the International panel of the View window, or with the SET COLLATE command. Since you'll typically specify a collation order just once, it's easiest to specify it in your configuration file.

Specifying a Collation Sequence in the Configuration File

Include the COLLATE configuration item in your FoxPro configuration file to specify a default startup collation sequence. For example, to specify a Dutch collation sequence when FoxPro is started, include the following line in your configuration file:

COLLATE = DUTCH

If the COLLATE configuration item isn't included in your configuration file, the startup default collation sequence is MACHINE.

The following table lists the COLLATE options you can include in your configuration file. The code pages for which these collation sequences are defined are also included.

Options	Language(s)	Code Pages
CZECH	Czech	852, 895, 1250, 10029
DUTCH	Dutch	437, 850, 1252, 10000
GENERAL	English, French, German, Modern Spanish, Portuguese and other Western European languages	437, 620, 850, 852, 857, 861, 865, 895, 1250, 1252, 1254, 10000, 10029
GREEK	Greek	737, 1253, 10006
HUNGARY	Hungarian	852, 1250
ICELAND	Icelandic	437, 850, 861, 1252,
MACHINE	Machine (the default collation sequence for earlier FoxPro versions)	All
NORDAN	Norwegian, Danish	437, 850, 865, 1252, 10000
POLISH	Polish	620, 852, 1250, 10029
RUSSIAN	Russian	866, 1251, 10007
SLOVAK	Slovak	852, 895, 1250, 10029
SPANISH	*Traditional Spanish	437, 850, 1252, 10000
SWEFIN	Swedish, Finnish	437, 850, 865, 1252, 10000
TURKISH	Turkish	857, 1254
UNIQWT	Unique Weight	437, 850, 1252, 10000
* When you specify the SPANISH option, "ch" is a single letter that sorts between "c" and "d", and "ll" sorts between "l" and "m".

Specifying a Collation Sequence in the View Window

You can specify the collation sequence interactively in the View window. Open the View window by choosing View from the Window menu and then choose the International button. The International panel contains a variety of international settings that you can adjust.

The collation sequence is specified with the Collating Sequence popup. The current collation sequence is displayed on the face of the popup. To change the collation sequence, choose a collation sequence from the Collating Sequence popup. The popup is disabled (cannot be chosen) if the CODEPAGE configuration item is not included in your FoxPro configuration file.

Specifying a Collation Sequence with SET COLLATE

Use the SET COLLATE command to specify the collation sequence in the Command window or a FoxPro program.

Important   The MACHINE collation sequence is used to order tables that are not marked with a code page. In this case, even if you have specified a collation sequence such as DUTCH, the MACHINE collation sequence is used when you create an index or a new table with the SORT command. When you open an unmarked table, a dialog appears asking if you'd like to mark the table with the current code page. Choose Yes if you'd like use a collation sequence other than MACHINE with the table. See the Marking Tables with the Code Page section in this topic for information on how to mark a table with a code page.

Comparisons and Collation Sequences

The current collation sequence determine the results of character expression comparisons.

For example, if the collation sequence is set to GENERAL, the following is true:

ä < b

If the collation sequence is set to NORDAN, the following is true:

ä > z

A ligature is a single character that acts as a combination of two characters. Some examples of ligatures are ß,æ,Æ, and so on. In German, the character ß is identical to the pair "ss". For example, if the current collation sequence is GENERAL, both of these return true (.T.):

"Straße" = "Strasse"

and

"Straße" == "Strasse"

Character Functions

UPPER( ) and LOWER( ) return values that preserve the length of ligatures. For example, if the current collation sequence is GENERAL, the following returns ß:

? UPPER("ß")

dBASE Indexes

Any dBASE indexes you use are automatically converted to compact .IDX indexes. The indexes are then maintained in MACHINE collation order, regardless of the current collation setting. You must rebuild the index to take advantage of the FoxPro collation sequences.

Index Length

The maximum size of an index key for .CDX and compact .IDX files is 240 bytes. Note that unaccented characters require one byte; accented characters and ligatures require two bytes.

Rushmore Optimization and Collation Sequences

Rushmore can only take advantage of indexes whose collation sequence match the current collation sequence. If you are building indexes in several languages, make sure the current collation sequence matches the collation sequences for the active indexes and index tags.

Use IDXCOLLATE( ) to return the collation sequence for an index or index tags; use SET("COLLATE") to return the current collation sequence.

Migrating from Earlier FoxPro Versions

This section describes what you can do to allow tables, indexes and programs you've created in earlier versions of FoxPro to take advantage of the international and cross-platform features.

To store the code page for the current FoxPro platform in the header of a table created in an earlier FoxPro version, open the table with the USE command. If you have included the CODEPAGE configuration item in your FoxPro configuration file, a dialog asks if you'd like to mark the table's header with the current code page. Once a table is marked with a code page, FoxPro can automatically translate character and memo fields in the table. Because screens, menus, reports, labels and projects are saved as FoxPro tables, you must also open them with USE.

You must rebuild indexes created in earlier FoxPro versions if you'd like the index to use a collation sequence other than MACHINE. Earlier FoxPro indexes are created in MACHINE order. To use a different collation sequence, you must build a new index. You can't use REINDEX to build a new index -- REINDEX rebuilds an index and leaves the collation sequence unchanged. The KEY( ) function and INDEX commands can be used to build new indexes from earlier indexes.

In order for a program created in an earlier FoxPro version to take advantage of automatic translation, you must recompile the program. Recompiling the program marks the .FXP as "native" to the current platform. When the .FXP is marked, you can run it on other FoxPro platforms and accented characters in the program are automatically translated.

Important   Be sure to recompile on the same platform when upgrading from an earlier version.

Marking Tables with the Code Page

Follow these steps to mark tables, screens, menus, reports, labels and projects created in an earlier FoxPro version with a code page, allowing them to take advantage of the FoxPro automatic translation facilities:

Make sure that your FoxPro configuration (CONFIG.FP, CONFIG.FPW or CONFIG.FPM) file contains this line:

CODEPAGE = AUTO

If your configuration file doesn't contain this line, add the line to the file and restart FoxPro.

With the USE command, open the table you'd like to convert. If you're converting a screen, menu, report, label or project, open it as a table with USE. Be sure to include the proper file extension.

In the dialog that appears, choose Yes to mark the table, screen, menu, report, label or project with the current code page. If you choose No, the table, screen, menu, report, label or project is opened but is not marked with the current code page.

Specifying a Collation Sequence and Rebuilding Indexes

Follow these steps to let an index created in an earlier FoxPro version take advantage of the collation sequences available in FoxPro:

Make sure that your FoxPro configuration file contains this line:

CODEPAGE = AUTO

If your configuration file doesn't contain this line, add the line to the file and restart FoxPro.

Make sure that you've specified the collation sequence you'd like for the new index you'll create. Use the SET COLLATE command or the International panel of the View window to specify a collation sequence.

Use the KEY( ) function to return the index expressions from the original index, and then use the index expressions in the INDEX command to create a new index.

Recompiling Programs to Enable Automatic Translation

Follow these steps to recompile programs and applications created in earlier FoxPro versions, allowing them to take advantage of the FoxPro automatic translation facilities:

Make sure that your FoxPro configuration file contains this line:

CODEPAGE = AUTO

If your configuration file doesn't contain this line, add the line to the file and restart FoxPro.

Recompile your programs (.PRGs) with the Compile... option on the Program menu or the COMPILE command.

Note that you must compile the program on a platform on which it was created. To run the program on different platform, you must first translate the accented characters in the program. See the Saving and Translating Programs and Text Files section for additional information.

To recompile programs in an application (.APP), open it in the Project Manager and then choose Build. Choose the Rebuild All radio button and then choose OK.

Configuring FoxPro for International Use

This section discusses how you can configure FoxPro for Macintosh with international settings through selected SET commands.

Setting the Date Format

The SET DATE command allows you to choose from a number of international date formats. By default, dates in FoxPro are displayed and entered in American format (mm/dd/yy). The complete list of date formats (with synonyms shown separated by vertical bars) is:

Name	Format
AMERICAN | MDY	mm/dd/yy
ANSI	yy.mm.dd
BRITISH | FRENCH | DMY	dd/mm/yy
GERMAN	dd.mm.yy
ITALIAN	dd-mm-yy
JAPAN | YMD	yy/mm/dd
USA	mm-dd-yy

To display only the last two digits of the year (the "19" is implied), use SET CENTURY OFF. This is the default FoxPro setting. To display all four digits for the year, use SET CENTURY ON. For even more flexibility, you can change the separator from the default for that date setting to any arbitrary single character with SET MARK TO.

Setting the Time Format for the Clock

Some international locales use a 12-hour time format; many others prefer a 24-hour format. SET HOURS TO 12 and SET HOURS TO 24 change the FoxPro clock (displayed when you issue SET CLOCK ON) to reflect these preferences. Note that the value returned by the TIME( ) function is always in a 24-hour format.

Setting the Currency Symbol and Position

FoxPro allows you to set both the character string used to represent currency and the position relative to the numeric currency value. By default, the currency symbol is '$', and the position is to the left of the currency value. But, for example, the following commands are appropriate for Finland, where the abbreviation for the markka appears to the right of the amount:

SET CURRENCY TO 'mk'
SET CURRENCY RIGHT

Setting the Decimal Separator

Use SET POINT to change the appearance of the decimal point to any single character. The two most common separators are '.' and ','. In Portugal, though, currency is often displayed with a '$' for a decimal point, then the abbreviation 'Esc.' after the entire value.

Portuguese users can achieve this format with these FoxPro commands:

SET POINT TO '$'
SET CURRENCY TO 'Esc.'
SET CURRENCY RIGHT

See SET SEPARATOR for specifying the thousands separator in PICTURE clauses.

Setting the Number of Decimal Places Displayed

Most currencies throughout the world are expressed with two digits after the decimal point, but FoxPro allows you to set the number of decimal places to any number from 0 to 18. For instance, SET DECIMALS TO 3 would be appropriate in a country with a currency displayed to three decimal places.

Fundamentals of Code Pages and Character Sets

This section provides information about character sets and code pages and their differences on different platforms.

A Character Is Really a Number

Every character you enter into FoxPro - indeed, every character represented by any computer program - is stored internally as a number.  For example, in every version of FoxPro available today, the letter C is represented in memory and on the hard disk as a 67.  Conversely, when a 67 is to be displayed as a character, it is displayed as a C.  There is nothing about the letter C that dictates this; it's simply a standard across most modern operating systems.

The term character set can be defined in many ways, but for our purposes we will think of it as the collection of all possible characters we could enter, together with their numeric representation inside the computer.

Limitations of the ASCII Character Set

The foundation of many modern character sets is an American standard known as ASCII.  The ASCII standard clearly specifies how all the unaccented Roman characters and all the Arabic numerals will be stored numerically.  All the ASCII characters can be represented in 7 bits (in other words, they are stored as numbers less than 128).  An important characteristic of the ASCII set is that upper-case A through Z correspond, in alphabetical order, to the numbers 65 through 90, and the lower-case letters a through z correspond to the numbers 97 through 122.  There are no unused numbers.

A number of punctuation symbols are also specified in the ASCII standard.  For instance, the American dollar sign is represented as 36.  But, to take another example, the American cent sign is not specified in the set of characters defined by ASCII.

The ASCII standard has a much more serious shortcoming than a missing cent sign, though.  It does not include any characters with accents or any other "diacritical marks."  Perfectly ordinary letters for a French, German or Portuguese speaker have no representation under the ASCII standard.  That meant it was up to individual vendors to provide their own solutions.

MS-DOS Character Set

MS-DOS, like other OEM operating systems such as PC-DOS and OS-2, make use of interchangeable "code pages" to describe the numeric representation of various characters.  For our purposes, we can think of these code pages as being equivalent to character sets.

IBM documents more than 50 different OEM code pages, but in MS-DOS, only a few are in common use.  English-speaking users almost invariably use code page 437, Western Europeans use either 437 or 850, Eastern Europeans use 852 and so on.

The MS-DOS version of FoxPro makes use of whichever code page has been made active by the operating system.  Each character entered into FoxPro will be represented in memory and in all disk files as the number corresponding to that character in the active code page.  Most code pages have, as a subset, the entire ASCII character set (the characters less than 128), so, for example, the letter C continues to be represented as 67.  The different OEM code pages vary considerably, however, in the values above 128.

An American user, using the default code page 437, who enters the character value ASCII 182 by pressing Alt+182 in MS-DOS will see a graphic character with a double vertical line meeting a single horizontal line.  A European user, using either code page 850 or 852, who presses Alt+182 will see an upper-case A with a circumflex.  Similarly, users entering that numeric sequence in FoxPro will see whatever their active code page dictates, but 182 will still be used internally by FoxPro, and 182 will be stored in the table.

ANSI - Microsoft Windows Character Set

Several standards groups have endorsed a new character set, which allows the use of 8 bits (that is, numbers up to 256) for representing characters.  This standard has several names, including ISO-8859, but we will refer to it as the ANSI character set.  The ANSI character set includes, as a subset, the entire ASCII set, plus enough characters to represent most modern Western European languages.  It does not address all Eastern European languages, and certainly does not describe Asian language characters (which are too numerous to be represented in 8 bits).

To continue our examples from previous sections, the letter C will still be stored as a 67 by Windows applications, but a user who enters a 182 from the keyboard will now see a paragraph symbol, which is not equivalent to any of the common OEM code pages.

The ANSI character set is the default character set for Microsoft Windows.  That is to say, while the underlying DOS OEM code page is still available to applications, most fonts in Microsoft Windows are ANSI fonts.

Macintosh Character Set

The Macintosh implemented a number of interchangeable character sets ("Standard", Portuguese, Turkish, and so on) to address different international markets.  Again, the ASCII characters are included as a subset of most of these sets (except Farsi), but accented characters (those above 128) have entirely different numeric values - different from the OEM code pages and different from the ANSI character set.

So, to continue our example, the letter C is still represented as 67, but character 182 is different from either ANSI or any of the OEM code pages (in the standard Macintosh character set, it resembles the lower-case Greek delta).


International/Cross Platform See Also
See Also

CPCURRENT( ) Function

CPDBF( ) Function

CPCONVERT( ) Function

SET NOCPTRANS Command

MODIFY COMMAND/FILE Command

SET COLLATE Command

IDXCOLLATE( ) Function


Report Tips

This topic contains a variety of Report Writer tips.

Run Existing Reports Without Changes

Your character reports (reports designed in FoxPro for MS-DOS) can be run, previewed and printed in FoxPro for Windows or FoxPro for Macintosh exactly as they were in MS-DOS, without any modification.  If you want, you can transport your character mode reports into Windows or the Macintosh to take advantage of the graphical environment by opening them in FoxPro for Windows or FoxPro for Macintosh.

Auto-Floating Fields

In FoxPro for MS-DOS, making fields stretch to accommodate data and float to maintain their relative position below other stretching fields are two separate operations.  In FoxPro for Windows or FoxPro for Macintosh, fields automatically float when they are set to stretch.  You can give a field the capability to stretch by choosing the Top -- Field Can Stretch radio button in the Position Relative To area of the Report Expression dialog.

Field Size

If you have a field that is smaller than the number of digits to be printed, FoxPro prints a series of asterisks to alert you that the complete number could not be printed.  Fractions are rounded to fit the space you have allowed the field or expression. In FoxPro for Windows or FoxPro for Macintosh, changing the size of fields and graphic objects is as simple as clicking on an object handle (one of the small squares around the object when it is selected) and dragging.

Indicating Details "Continued" Over Page or Column Breaks

If you have stretching fields in a detail band, the detail band could extend over page or column breaks.  You can include text to indicate when detail bands are continued on a new page or in a new column:

1	Click on the text tool and type "continued" in the detail band.

2	Double-click the "continued" text object to open the Text dialog.

3	Choose the Print When... check box to open the Print When dialog.

4	In the Print When dialog, choose No in the Print Once Per Band area.

5	Choose the When Detail Overflows to New Page/Column check box.

6	Choose OK until you are returned to the Report Layout window.

When the detail band is continued on another page or in another column, "continued" is printed.  Otherwise, "continued" is not printed.

Using the Grid

When Snap to Grid on the Report menu is checked, objects are positioned according to an invisible alignment grid.  You can change the size of this grid by changing the number in the horizontal (H) and vertical (V) spinners in the Grid area of the Ruler/Grid dialog (opened from the Report menu).  The minimum grid size is one pixel and the maximum grid size is 48 pixels.

The alignment grid can be especially helpful in object arrangement because it is sensitive to object sizes and positions.  Text objects to the left of a field, even if they are different sizes, are aligned with the field rather than with the grid.  Fields placed on top of each other are aligned with no overlap and no intervening space.

If you want to override the grid setting when creating, moving or sizing individual objects or groups of objects, hold the Ctrl key down and click on the object.

Fine-Tuning Object Position in Reports

Pressing an arrow key moves selected objects one pixel at a time, regardless of the setting of Snap to Grid.  Holding Shift while pressing an arrow key resizes the selected object one pixel at a time, regardless of the setting of Snap to Grid.

Choosing Show Position from the Report menu displays the horizontal and vertical coordinates of the mouse pointer on the status bar when no objects are selected.  When an object is selected, the top, left, bottom and right coordinates are displayed on the status bar, as well as the height and width of the object in the unit of measurement you have selected in the Ruler/Grid dialog.  This information can help you to fine-tune the position of objects in your report.

Graphic Elements

Rectangles, rounded-rectangles and vertical lines can extend across several bands, for example, from the page header band to the page footer band or from a group header band to a group footer band.  These graphic elements within a detail band can be made to stretch with the band by double-clicking on them and choosing Stretch with Band in the Rectangle/Line dialog.

Fonts in Page Preview

With some fonts, if you have a fairly small font size (8 or 10 point), you may not be able to see much difference between bold and regular type in the Page Preview dialog due to screen graphics.  In the printed report, though, bold and regular type are clearly distinguished.

Remove Line If Blank

In FoxPro for MS-DOS, Suppress Blank Lines, once checked, applies to all objects in a report's detail band.  In FoxPro for Windows or FoxPro for Macintosh, Remove Line If Blank performs the same function object by object in any band in the report.  Remove Line If Blank must be checked for each object in a horizontal span across the detail band in order for blank lines to be removed.

Report Variables

Report variables allow you to do calculations that can be used in subsequent calculations.  For example, if you wanted to make a time sheet report, if you have these numeric fields in a table (hour_in, min_in, hour_out, min_out), you could define a variable ARRIVE with the following expression:

HOUR_IN + (MIN_IN / 60)

Another variable, LEAVE, would contain a similar expression:

HOUR_OUT + (MIN_OUT / 60)

A third variable, DAYTOTAL, could hold the total amount of hours worked during the day.  Assign it the following expression:

LEAVE - ARRIVE

This third variable, could be used in a variety of other calculations to determine the number of hours worked in a week, a month, a year, the average number of hours worked each day, and so on.

Report Variable Hints

When setting up report variables, remember the following:

The order in which the variables are initialized is important.  If var1 is used to define the value of var2, var1 must be precede var2 in the list in the Report Variables dialog so that var1 will be evaluated first.  In the time sheet example, ARRIVE and LEAVE would have to precede DAYTOTAL in the list of variables.

When the variable is reset is important.  By default, variables are reset at the end of the report.  If your calculations are dependent upon data grouping, make sure that you select the proper group from the Reset popup.

Report variables can be used to calculate selected information from a table.  For example, if you wanted to count all the companies in a certain state in your report (California in this example), you could create a variable with an expression similar to the following and then choose Sum in the Variable Definition dialog:  IIF(state="CA",1,0)

Utilizing Page Space

Objects can be positioned partially underneath band separator bars to allow for maximum utilization of space on each page of your report.

Whole Page versus Printable Page

In the Page Layout dialog, you have the option to choose a print area of Printable Page or Whole Page.  If you choose Printable Page, FoxPro sets the margins of the report according to the specifications of your default printer.  Information will not be cut off along the edges of the page.  A left margin of 0.0 causes text to print at the edge of the printable area on the page.  Fields or text flush with the margins in the Report Layout window will not be cut off in the printed report.

If you expect your report to be run on a variety of printers, choosing Whole Page allows you to more closely control how the report will appear, no matter what printer is used.  When you choose Whole Page, a left margin of 0.0 causes text to print right up to the edge of the paper.  You may need to leave blank areas along margins in the Report Layout window so that a variety of printers will be able to print all the data in the report.

In either case, Page Preview displays the way a particular report would be printed on the current printer.

Summary Reports

In FoxPro for MS-DOS, you can save a report as a summary report.  In FoxPro for Windows or FoxPro for Macintosh, you can print a report as a summary report by choosing More >> in the Report dialog and checking Summary Information Only, or by typing REPORT FORM <report name> TO PRINTER SUMMARY in the Command window and pressing Enter or Return.  (See REPORT Command for other clauses that can be included with the command.)

Stretching Group Footers

In FoxPro for Windows or FoxPro for Macintosh, group footers can stretch to accommodate lengthy data.  If a group footer will not fit completely on a page, it is printed in its entirety on the next page of the report.  You need to make sure that your group footers aren't too long to fit on a single page.


Rushmore Technology

See Also

Rushmore technology is a data access technique that permits sets of records to be accessed very efficiently, at speeds comparable to single-record indexed access.  This section is divided into the following topics:

Rushmore Technology Overview

Indexes and Rushmore

Rushmore with Multiple Tables

Rushmore with Single Tables

Basic Optimizable Expressions

Combining Basic Optimizable Expressions

Combining Complex Expressions

Rushmore Optimization and Collation Sequences

When Rushmore Is Not Available

Disabling Rushmore

Rushmore Technology Overview

Rushmore utilizes standard FoxPro B-tree indexes and does not require any new type of file or index.  It may be utilized with any FoxPro index:  standard (.IDX) indexes as utilized in FoxPro versions 1.xx, compact (.IDX) indexes, or compound (.CDX) indexes.

In particular, Rushmore does not depend on the new compact index format.  Compact indexes, both (.CDX) and (.IDX) format, utilize a compression technique that produces indexes as small as 1/6th the size of comparable old-format indexes.  Compact indexes can be processed faster solely because they are physically smaller.  This means that fewer disk accesses are required to process them and larger portions of the index can be retained in FoxPro's memory buffers.

Although Rushmore benefits from the smaller size of compact indexes, as does all file access, it also functions very well with old format indexes.

Indexes and Rushmore

When Rushmore looks for indexes that can assist in query optimization, it ignores the logical NOT operator (NOT or !).  This way, more types of expressions can be optimized from the same expression.  For example,

* Indexed on state
COUNT FOR state = 'OH'	&& optimizable
COUNT FOR NOT (state = 'OH')	&& also optimizable

* Indexed on DELETED()
COUNT FOR DELETED()	&& optimizable
COUNT FOR !DELETED()	&& also optimizable

Rushmore does not use indexes that contain NOT or ! in their index expressions.

When very large tables are being processed, Rushmore may not have sufficient memory to operate on smaller machines.  In this circumstance, a warning message appears ("Not enough memory for optimization") and execution proceeds as in earlier versions of FoxPro.  Although no data will be lost and your program will function correctly, the query will not benefit from Rushmore.

Therefore, if you are processing large tables, we suggest that you use the FoxPro Extended version (provided at no additional charge with the standard package).

A good rule of thumb is to use the FoxPro Extended version if your tables have, in aggregate, more than 500,000 records.

In its simplest form, Rushmore speeds up single-table commands utilizing FOR clauses that specify sets of records in terms of existing indexes.  Also, Rushmore can speed the operation of certain commands when SET FILTER is in effect and the filtering condition is specified in terms of existing indexes.

To take advantage of Rushmore with multiple tables, you must use the SQL SELECT command.  FoxPro's SQL facility makes use of Rushmore as a basic tool in multi-database query optimization, utilizing Rushmore with existing indexes and even creating new ad-hoc indexes to speed queries.

Rushmore with Multiple Tables

To take advantage of Rushmore's optimization when you are retrieving data from more than one table, you must use the SQL SELECT command.  SQL uses Rushmore as a basic technology to optimize its queries.

When you use SELECT, all rules that you must normally follow to benefit from Rushmore are no longer in effect.  SQL decides what is needed to optimize a query and does the work for you.  You don't need to open tables or indexes.  If SQL decides it needs indexes, it creates temporary indexes for its own use.

Rushmore with Single Tables

With single tables, you can take advantage of Rushmore anywhere that a FOR clause appears.  Rushmore is designed so that its speed is proportional to the number of records retrieved.

The following list contains potentially optimizable commands with FOR clauses:

AVERAGE	INDEX
BROWSE	LABEL
CALCULATE	LIST
CHANGE	LOCATE
COUNT	RECALL
COPY TO	REPLACE
COPY TO ARRAY	REPORT
COUNT	SCAN
DELETE	SORT
DISPLAY	SUM
EDIT	TOTAL
EXPORT
In addition to an optimizable FOR clause expression, the commands in the table above must have a scope clause of ALL or NEXT to take advantage of Rushmore.  Rushmore also works when you allow the scope to default to ALL.

When optimizing, Rushmore can utilize any open indexes except for filtered and unique indexes.

For optimal performance, don't set the order of the table. You can use SET ORDER TO to be sure that no order is set.  Also, you can improve Rushmore's performance by setting DELETED to OFF, especially on queries that return a large number of records.

If you create indexes or tags, remember that this automatically sets the order.  If you want to take maximum advantage of Rushmore with a large data set and you require the data in a specific order, issue SET ORDER TO to turn off index control, then use the SORT command.

Basic Optimizable Expressions

Rushmore technology depends on the presence of a basic optimizable expression in a FOR clause.  A basic optimizable expression can form an entire expression or can appear as part of an expression.  The rules for combining basic optimizable expressions appear in the section titled Combining Basic Optimizable Expressions.

A basic optimizable expression takes one of the following forms:

<index expression> <relational operator> <constant expression>

or

<constant expression> <relational operator> <index expression>

In a basic optimizable expression:

<index expression> must exactly match the expression on which an index is constructed and <index expression> must not contain aliases.

<relational operator> must be one of the following:  <, >, =, < =, > =, < >, #, !=.

<constant expression> may be any expression, including memory variables and fields from other unrelated tables.

For example, if you have indexes on the following expressions:

FIRSTNAME

CUSTNO

UPPER(LASTNAME)

HIREDATE

ADDR

then the following are basic optimizable expressions:

FIRSTNAME = 'Fred'

CUSTNO >= 1000

UPPER(LASTNAME) = 'SMITH'

HIREDATE < 12/30/90

If you issue the command STORE 'WASHINGTON AVENUE' TO X then the following are also basic optimizable expressions:

ADDR = X

ADDR = SUBSTR(X,8,3)

Combining Basic Optimizable Expressions

Rushmore's data retrieval optimization is dependent on the FOR clause expression.  With a simple or complex FOR clause expression, data retrieval speeds can be enhanced if the FOR expression is optimizable.  This section explains the rules for combining basic expressions to create a FOR expression.

Basic expressions may be optimizable.  Basic expressions can be combined with the AND, OR and NOT logical operators to form a complex FOR clause expression that may also be optimizable.

An expression created with a combination of optimizable basic expressions is fully optimizable.  If one or more of the basic expressions are not optimizable, the complex expression may be partially optimizable or not optimizable.

A set of rules determines if an expression composed of basic optimizable or non-optimizable expressions is fully optimizable, partially optimizable or not optimizable.

Rules and Examples for Combining Basic Expressions

The following are the rules used for determining query optimization.  An example is provided for each rule.

Tip   You can also use parentheses to group combinations of basic expressions.  The rules below also apply to combinations of expressions grouped with parentheses.

Basic Expr	Optimizable

Operator	AND

Basic Expr	Optimizable

Query Result	Fully Optimizable

Example	FIRSTNAME = 'FRED' AND HIREDATE < 12/30/89

Expr Types	Optimizable AND Optimizable

Operator	=

Result	Fully Optimizable

Basic Expr	Optimizable

Operator	OR

Basic Expr	Optimizable

Query Result	Fully Optimizable

Example	FIRSTNAME = 'FRED' OR HIREDATE < 12/30/89

Expr Types	Optimizable OR Optimizable

Operator	=

Result	Fully Optimizable

Basic Expr	Optimizable

Operator	AND

Basic Expr	Not Optimizable

Query Result	Partially Optimizable

Example	FIRSTNAME = 'FRED' AND 'S' $ LASTNAME

Expr Types	Optimizable AND Not Optimizable

Operator	=

Result	Partially Optimizable

Basic Expr	Optimizable

Operator	OR

Basic Expr	Not Optimizable

Query Result	Not Optimizable

Example	FIRSTNAME = 'FRED' OR 'S' $ LASTNAME

Expr Types	Optimizable OR Not Optimizable

Operator	=

Result	Not Optimizable

Basic Expr	Not Optimizable

Operator	AND

Basic Expr	Not Optimizable

Query Result	Not Optimizable

Example	'FRED' $ FIRSTNAME AND 'S' $ LASTNAME

Expr Types	Not Optimizable AND Not Optimizable

Operator	=

Result	Not Optimizable

Basic Expr	Not Optimizable

Operator	OR

Basic Expr	Not Optimizable

Query Result	Not Optimizable

Example	'FRED' $ FIRSTNAME OR 'S' $ LASTNAME

Expr Types	Not Optimizable OR Not Optimizable

Operator	=

Result	Not Optimizable

Basic Expr	--

Operator	NOT

Basic Expr	Optimizable

Query Result	Fully Optimizable

Example	NOT FIRSTNAME = 'FRED'

Expr Types	The NOT Operator with Optimizable

Operator	=

Result	Fully Optimizable

Basic Expr	--

Operator	NOT

Basic Expr	Not Optimizable

Query Result	Not Optimizable

Example	NOT 'FRED' $ FIRSTNAME

Expr Types	The NOT Operator with Not Optimizable

Operator	=

Result	Not Optimizable

Combining Complex Expressions

You can combine complex expressions to create a more complex expression that is fully optimizable, partially optimizable or not optimizable, as shown in the table above.  These more complex expressions can, in turn, be combined to create expressions that again may be fully or partially optimizable, or not optimizable at all.  The results of combining these more complex expressions are shown in the following table.  These rules also apply to expressions grouped with parentheses.

Expr	Fully Optimizable

Operator	AND

Expr	Fully Optimizable

Result	Fully Optimizable

Expr	Fully Optimizable

Operator	OR

Expr	Fully Optimizable

Result	Fully Optimizable

Expr	Fully Optimizable

Operator	AND

Expr	Partially Optimizable

Result	Partially Optimizable

Expr	Fully Optimizable

Operator	OR

Expr	Partially Optimizable

Result	Partially Optimizable

Expr	Fully Optimizable

Operator	AND

Expr	Not Optimizable

Result	Partially Optimizable

Expr	Fully Optimizable

Operator	OR

Expr	Not Optimizable

Result	Not Optimizable

Expr	--

Operator	NOT

Expr	Fully Optimizable

Result	Fully Optimizable

Expr	Partially Optimizable

Operator	AND

Expr	Partially Optimizable

Result	Partially Optimizable

Expr	Partially Optimizable

Operator	OR

Expr	Partially Optimizable

Result	Partially Optimizable

Expr	Partially Optimizable

Operator	AND

Expr	Not Optimizable

Result	Partially Optimizable

Expr	Partially Optimizable

Operator	OR

Expr	Not Optimizable

Result	Not Optimizable

Expr	--

Operator	NOT

Expr	Partially Optimizable

Result	Partially Optimizable

Expr	Not Optimizable

Operator	AND

Expr	Not Optimizable

Result	Not Optimizable

Expr	Not Optimizable

Operator	OR

Expr	Not Optimizable

Result	Not Optimizable

Expr	--

Operator	NOT

Expr	Not Optimizable

Result	Not Optimizable

The table below gives examples of how complex expressions may be combined and the extent to which the result is optimized.

Example	(FIRSTNAME = 'FRED' AND HIREDATE <12/30/89) OR (LASTNAME = '' AND HIREDATE > 12/30/88)

Expr Types	Fully Optimizable OR Fully Optimizable

Operator	=

Result	Fully Optimizable

Example	(FIRSTNAME = 'FRED' AND HIREDATE < 12/30/89) AND 'S' $ LASTNAME

Expr Types	Fully Optimizable AND Not Optimizable

Operator	=

Result	Partially Optimizable

Example	(FIRSTNAME = 'FRED' AND 'S' $ LASTNAME) OR (FIRSTNAME = 'DAVE' AND 'T' $ LASTNAME)

Expr Types	Partially Optimizable OR Partially Optimizable

Operator	=

Result	Partially Optimizable

Example	('FRED' $ FIRSTNAME OR 'S' $ LASTNAME) OR ('MAIN' $ STREET OR 'AVE' $ STREET)

Expr Types	Not Optimizable OR Not Optimizable

Operator	=

Result	Not Optimizable

When Rushmore Is Not Available

In rare cases, Rushmore may not be available to enhance data retrieval operations.  In these cases, execution proceeds as in earlier versions of FoxPro.

Rushmore is disabled whenever it cannot optimize the FOR clause expression in a potentially optimizable command.  See the earlier section, Combining Basic Optimizable Expressions, for guidelines on creating an optimizable FOR expression.

Rushmore is also disabled whenever a WHILE clause is included in a command that benefits from Rushmore.

In the standard version of FoxPro, FoxPro may disable Rushmore when the total number of records in all open tables exceeds 500,000 records.  However, the FoxPro Extended version can use Rushmore to enhance performance with table record totals of more than 500,000 records, as well as with table record totals less than 500,000.

In low memory situations, Rushmore cannot optimize data retrieval.  However, data retrieval performance will be on par with earlier versions of FoxPro.

Rushmore Optimization and Collation Sequences

FoxPro supports collation sequences that allow you to order tables for a specific language.  In earlier FoxPro versions tables were always ordered in a "machine" sequence; this sequence was not correct for some languages.  A collation sequence determines the order in which records appear in an indexed or sorted table.  A collation sequence also determines the results of character expression comparisons.

Collation sequences for several languages are available, allowing you to index and sort tables so that the records in the table appear in the proper sequence for your language.

Rushmore can only take advantage of indexes whose collation sequence match the current collation sequence.  If you are building indexes in several languages, make sure the current collation sequence matches the collation sequences for the active indexes and index tags.

Use IDXCOLLATE( ) to return the collation sequence for an index or index tags; use SET("COLLATE") to return the current collation sequence.

Disabling Rushmore

In rare cases, you should disable Rushmore.  When you issue a command that utilizes Rushmore, Rushmore immediately determines which records match the FOR clause expression.  These records are then manipulated by the command.

If a potentially optimizable command modifies the index key in the FOR clause, Rushmore's record set can become outdated.  In a case like this, you can disable Rushmore to ensure that you have the most current information from the table.

To disable Rushmore for an individual command, include the NOOPTIMIZE keyword with the command.  To globally disable (or enable) Rushmore for all commands that benefit from Rushmore, use SET OPTIMIZE.  The command SET OPTIMIZE OFF disables Rushmore and SET OPTIMIZE ON enables Rushmore.  The default setting is ON.


Rushmore Technology SeeAlso
See Also

SET OPTIMIZE Command

IDXCOLLATE ( ) Function

SET Command


Sample Files for Windows

The following sample files are included with FoxPro for Windows.  The files in the \GOODIES directory are installed in a compressed form to save you hard disk space.  To unpack these files, open File Manager and double-click on ALLUNPAK.BAT in the FOXPROW\GOODIES directory. ALLUNPAK.BAT also creates a FOXTOOLS subdirectory that contains FOXTOOLS.WRI, the documentation for the FoxTools library, and sample programs that utilize the FoxTools library.

Note  You may use the bitmaps in GOODIES\BITMAPS or modified versions of them in your applications. However, you cannot make and sell copies of the bitmaps or any portion of the bitmaps contained in the GOODIES\BITMAPS subdirectory.

If you want more information about unpacking these compressed files, see README.TXT in the FOXPROW\GOODIES directory.

Directory Path	Directory Contents
\GOODIES\BITMAPS	Sample bitmaps to use in applications
\GOODIES\DOS	Replacement menus to emulate the MS-DOS menus
\GOODIES\FNDATION	Sample application using foundation read
\GOODIES\FOXDATA	FoxPro DDE server, with source code
\GOODIES\FOXTOOLS	Example applications that use FOXTOOLS.FLL
\GOODIES\MISC	An application to restore labels without reinstalling FoxPro if your FOXUSER file is deleted, and files to configure FoxPro for Windows like FoxBASE+
\GOODIES\PDRIVERS	Printer drivers for MS-DOS compatibility
\LANGUAGE	Table/.DBF and index files for Language Reference examples
\SAMPLE\CATALOG	Sample catalog containing tables, queries, screens, reports, labels, and programs
\SAMPLE\DDE	Examples from the DDE chapter of the Developer's Guide
\SAMPLE\HELPTREE	Sample application that demonstrates help filtering
\SAMPLE\LASER	Laserdisk library sample application
\SAMPLE\OLE	Examples from the OLE chapter of the Developer's Guide
\SAMPLE\ORGANIZE	Organizer sample application
\TUTORIAL	Examples from Getting Started


Sample Files for Macintosh

The following sample files are included with FoxPro for Macintosh.

Folder	Folder Contents
:FoxApp	Contains the FoxApp files. FoxApp is a utility for quickly creating applications.
:Goodies:FB+Migrate	Contains the files for the Migration kit, used to move applications written in FoxBASE+ for Macintosh to FoxPro for Macintosh.
:Goodies:Fndation	Contains sample applications demonstrating the use of Foundation READs.
:Goodies:Misc	Contains an application to restore labels without reinstalling FoxPro if your FOXUSER file is deleted; an application to convert Picts to BMPs; and an application to import data from 4D and Filemaker Pro. Also contains Readme files for the Pict to BMP utility, Foxtools and the QuickTime OLE server.
:Goodies:Picts	Contains sample picture files to use in applications.
:Language	Contains the table and index files used in the Language Reference examples.
:Sample:Laser	Contains the Laserdisk library sample application.
:Sample:Organize	Contains the Organizer sample application.
:Tutorial	Contains the examples from Getting Started.
:Wizards	Contains the Wizard application and related files.


Generator Directives

Generator directives are available in FoxPro to allow you to include code in a generated menu or screen program that would not otherwise be available through the Menu Builder or the Screen Builder.

Generator directives are commands that communicate solely with GENSCRN and GENMENU, the FoxPro screen and menu program code generators.  Generator directives do not appear in generated screen or menu program code.

Most generator directives must be placed in the Setup code for a screen.  Only one directive of each type can be included in the code.

All generator directives are available for screens.  #INSERT and #NAME are the only generator directives also available for menus.

#INSERT <file>

#ITSEXPRESSION <char>

#NAME <snippet name>

#NOREAD

#READCLAUSES <clauses>

#SECTION 1 | 2

#WCLAUSES <clauses>

#WNAME <string>

#INSERT <file>

The #INSERT menu and screen generator directive inserts the contents of <file> into generated menu or screen code.

Use #INSERT to include a file in a generated menu or screen program.  For example, use #INSERT to place #DEFINE ... #UNDEF statements from a file in the beginning of a generated menu or screen program.

This directive can appear in any snippet; it does not have to be in a particular snippet, such as the setup code snippet.  Additionally, the directive can appear anywhere in a snippet.

<file>

This must be a text file.  The generator searches for the file in the current directory, in the FoxPro directory and subdirectories and along the MS-DOS path.  If the file cannot be found, the screen generator comments your code - indicating that the file could not be found - and then continues the generation process.

Note that this file cannot include other screen generator directives.

#ITSEXPRESSION <char>

This screen generator directive allows you to specify a single character that can be used to indicate that picture clauses, window titles and window footers are expressions instead of literal strings.

#ITSEXPRESSION ~
#SECTION1
varname = "Fred"
* A window title can be defined
* as ~<varname>.  When the
* window is displayed, Fred
* appears as the window title.

The #SECTION1 generator directive is included in this example because the windows are defined before Setup Code -- Section 2 is executed.  #ITSEXPRESSION is applicable only to windows defined in the Screen Layout dialog in the Screen Builder.

#NAME <snippet name>

This screen and menu generator directive names a snippet produced by clauses such as SHOW, WHEN and VALID, whether the snippet is produced at the object or READ level.  The #NAME directive must appear at the top of a snippet, before any code statements.  Blank lines or comments can precede the #NAME directive.

<snippet name>

This is the name assigned to the snippet.  The <snippet name> must conform to the rules for naming procedures and functions.

Note that FoxPro does not check for duplicate names.

#NOREAD

Include the #NOREAD screen generator directive in a screen setup snippet to prevent the generation of the READ command.

When #NOREAD is included in a screen setup snippet, controls are displayed but are not activated when you execute the screen code.

#NOREAD PLAIN

This screen generator directive works much the same way that #NOREAD does except that it suppresses everything except @ ... SAY, @ ... GET and @ ... EDIT, comments and #REGION statements.

#READCLAUSES <clauses>

This screen generator directive allows you to specify clauses to be placed at the end of a READ command that are not available through the Screen Builder.  Typical clauses to include are TIMEOUT, SAVE, OBJECT, NOMOUSE and COLOR.

*****  #READCLAUSE *****

#READCLAUSE TIMEOUT SAVE OBJECT COLOR

* These READ clauses must be
* placed on one line in the
* setup code.

#REDEFINE

By default, GENSCRN generates screen code to check for the existence of a window before defining it.  This screen generator directive allows you to suppress the generation of commands that check for the existence of a window and automatically redefine the window.

#SECTION 1 | 2

These screen generator directives allow you to split the setup code for a screen into two sections.

Section 1 is generated at the beginning of the .SPR program.  Place the #SECTION 1 generator directive before the commands to insert in section 1 of setup code.  Any commands placed before #SECTION 1 are ignored and do not appear in the generated .SPR program.

Section 2 is generated after the DEFINE WINDOW commands and before the Screen Layout commands.  You can split the setup code to include a PARAMETER statement or ON ERROR in the screen program.

#SECTION 1
PARAMETER x, y, z
<other commands>
#SECTION 2
<other commands>

#WCLAUSES <clauses>

The #WCLAUSES screen generator directive lets you add DEFINE WINDOW clauses.

The #WCLAUSES directive must be in the screen setup snippet of the screen whose window definition you want to modify.  #WCLAUSES has no effect if you do not check the Define Windows check box in the Generate Screen dialog.

Note that the setup snippet can contain only one #WCLAUSES directive.  If more than one #WCLAUSES directive is included in the screen setup snippet, FoxPro uses only the first one.

#WNAME <string>

This screen generator directive allows you to substitute a generated window name for <string> wherever it occurs in the screen code.  This allows you to create generic code.

The following statement is defined in the setup code for a screen:

#WNAME fred

The following statements are defined in the ACTIVATE clause for the window:

IF WONTOP('fred')
<statements>
ELSE
<statements>
ENDIF

A unique name for the current window is substituted for "fred".  It isn't necessary to know the actual window name. With the above example, the following code appears in the generated screen code:

IF WONTOP('_PV60NIAGH')	&& A unique window name
<statements>
ELSE
<statements>
ENDIF


SQL Cursors

See Also

The following rules apply to cursors created with SQL SELECT.  They do not apply to cursors created with CREATE CURSOR.

Cursors are NOT tables.  In fact, they may or may not have any disk presence whatsoever, i.e., there may or may not be an associated temporary file.  If there is a temporary file, it resides in the SORTWORK directory or folder.

Sometimes cursors will be entirely memory resident, especially within queries.  Sometimes cursors are merely filtered presentations of some or all of the fields in the table used to create the cursor  (presented via internal use of Rushmore and the USE AGAIN mechanism).

Cursors are always read-only.

Cursors may be accessed only by selecting their ALIAS name.  After they are selected, all normal read-only database operations are allowed.

When closed, cursors vanish.

Since cursors cease to exist when closed, you can't USE them.

When a cursor is created, its cursor name becomes the alias of some work area for which there is no associated DBF.

Make no assumptions regarding which work area will contain a cursor.  The actual work area utilized depends entirely on the course of action undertaken by the query optimizer.

In general, cursors can be created more quickly than tables/.DBFs.

If you want values selected to be permanent or even semi-permanent, SELECT into a TABLE and not into a cursor.  Tables created by SELECT are normal .DBFs and are, therefore, guaranteed to have existence separate from any query and to be present on disk.

In general, if values in the tables used to create a cursor are changed after the cursor is created, the values in the cursor MAY change.  If you don't want that to happen, you can:

SELECT into a .DBF or an array

Refrain from modifying the original tables

Or to prevent others from modifying the original tables, you can:

Lock the tables used to create the cursor

Open the tables used to create the cursor exclusively


SQL Cursors SeeAlso
See Also

CREATE CURSOR Command - SQL

SELECT Command - SQL

SQL Commands Overview


System Capacities - FoxPro for Windows
System Capacities

Table and Index Files

Field Characteristics

Memory Variables and Arrays

Program and Procedure Files

Report Writer Capacities

Window Support

Miscellaneous Capacities

Color Support

Table and Index Files

Max. # of records per table	1 billion*
Max. # of chars per record	65,000
Max. # of fields per record	255
Max. # of open DBFs	225
Max. # of chars per field	254
Max. # of chars per index key (IDX)	100
Max. # of chars per index key (CDX)	240
Max. # of open index files per table	unlimited**
Max. # of open index files in all work areas	unlimited**
Max. # of relations	unlimited
Max. length of relational expressions	unlimited
*	The actual file size (in bytes) cannot exceed 2 gigabytes for single-user or exclusively opened multi-user tables.  Shared tables with no indexes or .IDX indexes cannot exceed 1 gigabyte.  Shared tables with structural .CDX indexes cannot exceed 2 gigabytes.

**	Limited by memory. In FoxPro for MS-DOS and FoxPro for Windows, also limited by available MS-DOS file handles.  Each .CDX file uses only 1 file handle.  The number of MS-DOS file handles is determined by the CONFIG.SYS FILES parameter.

Field Characteristics

Max. size of character fields	254
Max. size of numeric fields	20
Max. # of chars in field names	10
Digits of precision in numeric computations	16
Memory Variables and Arrays

Default # of memory variables	1,024
Max. # of memory variables	65,000
Max. # of arrays	65,000
Max. # of elements per array	65,000
Program and Procedure Files

Max. # of lines in source program files	unlimited
Max. size of a single compiled PROCEDURE or FUNCTION	64K
Note   A program or application can contain an unlimited number of program modules.
Max. # of procedures per file	unlimited
Max. # of nested DO calls	32
Max. # of READ nesting levels	5
Max. # of nested structured programming commands	64
Max. # of procedure parameters	24
Report Writer Capacities

Max. # of objects in a report definition	unlimited**
Max. # of lines in a report definition	255
Max. # of grouping levels	20
**	Limited by memory. In FoxPro for MS-DOS and FoxPro for Windows, also limited by available MS-DOS file handles.  Each .CDX file uses only 1 file handle.  The number of MS-DOS file handles is determined by the CONFIG.SYS FILES parameter.

Window Support

Max. # of open windows	unlimited**
Max. # of open Browse windows	225
**	Limited by memory. In FoxPro for MS-DOS and FoxPro for Windows, also limited by available MS-DOS file handles.  Each .CDX file uses only 1 file handle.  The number of MS-DOS file handles is determined by the CONFIG.SYS FILES parameter.

Miscellaneous Capacities

Max. # of chars per string	2 gigabytes
Max. # of chars per command line	2,048
Max. # of chars per macro subset.	2,048
Max. # of open files	System limit
Max. # of keystrokes per keyboard macro	1,024
Max. fields that can be selected by an SQL SELECT statement -- in the projection list (same as the maximum fields per record in a table)	255
Color Support

Number of color schemes per color set	24
Max. # of color sets	unlimited
Number of colors per scheme	10
Schemes available for user definition	8


RUN Command

The RUN command in FoxPro for Windows has a new /N parameter that allows you to launch a Windows application:

RUN /N C:\WORD\WINWORD.EXE README.DOC

The Microsoft Windows Control Panel contains many utilities that you can use in your applications. You can also call these utilities using the RUN command:

RUN /N CONTROL COLOR
RUN /N CONTROL PRINTERS
RUN /N CONTROL DESKTOP


Macintosh Tips

Opening and Closing Folders in the Finder

To open a different folder and close the current folder, press the Option key while double-clicking on the folder you want to open.

Using TeachText to Copy PICT Files to General Fields

You can use TeachText, a program that comes with System 7, to open and display PICT files. Once a picture is displayed in TeachText, you can select part or all of the picture, copy it, and then paste it into a general field in your FoxPro table.

Be sure that you use the version of TeachText that comes with System 7 on the Tidbits disk. This is TeachText version 7.0 or later. Other applications you might install on your Macintosh, such as Microsoft Excel, do not require System 7 and may install an older version of TeachText that does not support PICT files.

Multiple Configurations with Macintosh Aliases

You can start FoxPro for Macintosh by double-clicking on the icon for the CONFIG.FPM configuration file. You can create multiple configuration files (in separate folders) and start FoxPro for Macintosh in different configurations by using Macintosh aliases.

After you create a CONFIG.FPM configuration file, you can create an alias for it by selecting the file from within the Finder and then choosing the Make Alias command from the File menu. Double-click on the alias to start FoxPro for Macintosh in the configuration specified in the original CONFIG.FPM configuration file. You can rename the alias and move it to a different folder, the Macintosh desktop or another disk.

For example, you can create multiple CONFIG.FPM files, create aliases for them, rename the aliases and then move the aliases to the Macintosh desktop. This allows you to start FoxPro for Macintosh in different configurations from the Macintosh desktop.

Whenever you edit or delete the original CONFIG.FPM file, you must also delete the Macintosh alias and create a new alias. Since the Macintosh alias points to the original file, if you edit a CONFIG.FPM in the FoxPro editor and Create Backup Copy is checked in the Edit Preferences dialog, the alias still points to the backup file, CONFIG.BAK, rather than the new CONFIG.FPM.


Interface Tips

Font Considerations

When designing applications that will be used in 1024 x 768 (not small font) video resolution, keep in mind that FoxFont is only a small font.  This means that as other fonts are expanded to appear larger in that mode, FoxFont stays the same.  This may cause problems in applications that have multiple windows on the screen at the same time, or applications that use specific placement of bitmaps.  For this reason, FoxFont should not be used as the base font when defining these application windows.  Instead, use a common font that is supplied with Windows:

1	Set the font of the main FoxPro window to a standard Windows font such as MS Sans Serif 8.

2	Define, generate and position your application's windows while using this font.

3	Set the font of the main FoxPro window to your chosen font at the start of your application (or in the startup code snippet). Remember to set it back to its initial value at the end of your application (or in the cleanup code snippet).

Available Fonts

To find out if the font you want to use is available, use AFONT( ).

Monospaced and Proportional Fonts

The TXTWIDTH( ) function is useful in determining whether a font is mono- or proportionally-spaced. If TXTWIDTH( 'I') = TXTWIDTH('M' ), then the font is monospaced. You can also use the FONTMETRIC( ) function for this purpose; if FONT(6)=FONT(7), then the font is monospaced.

Text Editor

To select an entire line of text (including the carriage return) when editing, triple-click on the line.

To move or copy selected text, use "drag-and-drop." You can drag a copy of the text by holding down the Ctrl key as you drag the selected text.  When you use drag-and-drop, FoxPro places the dragged text on the clipboard.  Anything on the clipboard is overwritten when you use drag-and-drop.

To indent and unindent large sections of code or text, use Indent and Undent on the Text menu.

Right Mouse Button

You can set your right mouse button to emulate the Enter key by using ON KEY LABEL RIGHTMOUSE KEYBOARD CHR(13).  Now, you can press the right mouse button instead of the Enter key to execute commands, select items, and so on.

Color in Pictures

If the colors of a picture you are displaying do not look as expected, try using SET PALETTE ON to display the picture using the color palette it was created with instead of FoxPro's default color palette.  Chances are that a different color palette was used when the picture was originally created. But note that it affects all pictures displayed.

Bitmaps/Wallpaper

When using a bitmap as wallpaper, try to use bitmaps that look good on screens of various sizes.  If an application must use a wallpaper that requires objects to be in a specific location (for example, a button must always be on Bobo's nose), use the following steps:

1	Create one bitmap scaled for 1024 x 768 large fonts.(BOBO.LRG)

2	Create another bitmap scaled for all others.(BOBO.SML)

3	At the beginning of the application, check FONTMETRIC(1) to see if small or large fonts are loaded. For instance, FONTMETRIC(1,'MS SANS SERIF',8) always returns 13 if small fonts are loaded and 16 for large fonts.

4	Copy the appropriate bitmap file to the one used for the wallpaper. (for example, BOBO.SML => BOBO.BMP)

Customizing the Main FoxPro Window

You can modify the main FoxPro window using the MODIFY WINDOW SCREEN command. This command allows you to set various attributes of the window including font, font size, font style, wallpaper, color, icon file, title, size and so on.

The MODIFY WINDOW SCREEN command restores the main FoxPro window to the size it was when FoxPro for Windows was launched. This size is stored in the FOXPRO.INI file and is saved when you exit FoxPro.

The ZOOM WINDOW SCREEN NORM command restores the FoxPro window to the size it was before you used a ZOOM WINDOW SCREEN MAX or ZOOM WINDOW SCREEN MIN command.

Notice that you can issue multiple MODIFY WINDOW commands to adjust different characteristics of a window without changing characteristics that you've already set.

To change the font of the main FoxPro window, hold down the Shift key and choose Screen Font... from the Text menu. You can also change the font with the MODIFY WINDOW SCREEN command.

With the Screen Builder, you can create a DESKTOP window in the Window Style dialog. This option allows you to customize the main FoxPro window.

Icon Placement

To place a minimized window icon in a specific location, try this:

DEFINE WINDOW x FROM 10,10 TO 20,20 MINIMIZE FLOAT CLOSE
ACTIVATE WINDOW x NOSHOW
ZOOM WINDOW x MIN
MOVE WINDOW x TO 1,1
SHOW WINDOW x

Closing Multiple Windows

To close several windows at one time, hold down the Shift key and choose Close All from the File menu. You can temporarily hide all windows by simultaneously pressing Shift+Ctrl+Alt (Shift+Ctrl+Option+ [image] on Macintosh).

Frontmost Window

You can create windows which can exist outside the main FoxPro window using the IN DESKTOP clause. These windows look like normal FoxPro windows but behave differently.

An IN DESKTOP window always remains in front of any other window, even if you open another window later.  WONTOP( ) will always return the IN DESKTOP window. This is especially important in event-driven programs. IN DESKTOP can also be used to simulate a "floating palette" which always stays on top of the active window. Floating palettes are common in Microsoft Windows and Macintosh software products.

The location of IN DESKTOP windows is determined by the Microsoft Windows coordinate system.  Normal user-defined windows use FoxPro's coordinate system.

Command Window on Top {FoxPro for Macintosh only}

To always keep the Command window on top of the main FoxPro window, include the following lines in your CONFIG.FPM configuration file:

MACDESKTOP = OFF
COMMAND = SET MACDESKTOP ON

Hiding the Main FoxPro Window on Startup {FoxPro for Macintosh only}

You can start FoxPro for Macintosh with the main FoxPro window hidden by placing the following line in your CONFIG.FPM configuration file:

COMMAND = HIDE WINDOW SCREEN

Password Protection

If your application requires a password, try using a font size that is too small to read or a password font in which all the characters are the same.


Performance Tips

Out-of-Date Index

If a table operation is returning the wrong answer, try recreating the index in case the index is out-of-date.  It is best to recreate an index instead of using the REINDEX command because REINDEX does not fix a damaged index file.

Rebuild .CDX Files

Rebuild .CDX files occasionally. This can reduce the .CDX file size, thereby improving performance.  When re-creating .CDX tags, you should first remove the tags using the DELETE TAG ALL command.

Pack Tables and Memo Files

PACK your tables periodically.  This will reduce the size of the tables and improve performance.  Use the PACK MEMO command to reduce the size of associated memo files, especially for tables in which you frequently make changes to memo fields.

BROWSE and SCAN Performance

To enhance the performance of BROWSE or SCAN commands, periodically SORT tables into the most frequently used order (that is, sort into the order of the most frequently used index).

Multi-Table Query Performance

To enhance multi-table queries, SORT the tables by the join condition.

Optimizing Queries

Queries are optimized when the table has no order set. Use SET ORDER TO without a tag name to remove a set order. If you have SET DELETE ON, you will need a .CDX tag on DELETED( ) to optimize queries for that table.

Adding Records to a Table

Use the INSERT - SQL command to add new records to a table.  This command provides better performance and greater integrity across a network than the combination of the APPEND BLANK and REPLACE commands.

Screen Input/Output

For best performance, screen input/output in FoxPro for Windows must be carefully handled. On a typical FoxPro for MS-DOS machine with 25 rows by 80 columns, you have 2000 screen elements to refresh each time. In Microsoft Windows, the standard VGA setting is 640 x 480 pixels. This equates to over 300,000 pixels which need to be redrawn each time the screen is refreshed. Compared to a character monitor, this is about a 150:1 ratio.

The SHOW GETS command is commonly used to refresh @...GET commands on screen when a change is made. Using SHOW GETS can dramatically impact the performance of applications using screens with many objects or on slower machines. Instead, consider using the SHOW GET command to refresh only the @...GET being modified instead of the entire screen.

In addition, FoxPro for Windows allows you to create picture buttons and check boxes by specifying a .BMP file; in FoxPro for Macintosh you specify a picture file. These types of controls take longer to refresh than normal text prompts.

Run Fewer Applications

Reduce the number of applications running in a Windows (or Macintosh) session. Windows and Macintosh are cooperative multitasking environments.  The more applications you have running, the more system resources are diverted from FoxPro.

Memory Variables

Use the #DEFINE directive in FoxPro to significantly reduce the number of memory variables used in your applications, freeing memory.

Wallpaper Considerations

If you have limited memory, do not use wallpaper because it requires extra memory.  In addition, it impacts performance whenever the screen is refreshed.

Color Considerations

Using lots of colors in applications requires memory. This is especially true if you hard-code colors instead of allowing Microsoft Windows color schemes. When possible, use 16-color .BMP files because they require less disk space and display well on standard VGA monitors. Unless you need to use MS-DOS color sets for visual compatibility in cross-platform applications, you should allow users to choose their own colors using the Microsoft Windows Control Panel.

Memory Allocation

FoxPro does not allocate memory for all its resources when it is launched. For example, FoxPro windows are allocated from the available memory pool. Therefore, you should make enough memory available using the MEMLIMIT setting in your CONFIG.FPW file (CONFIG.FPM in FoxPro for Macintosh).

Memory for FoxPro for MS-DOS

If you set the KB Desired setting in the PIF file for the FoxPro for MS-DOS product to -1, Microsoft Windows will give it all the available memory.  Refer to the Microsoft Windows PIF Editor help file for more information.


Power Tool Tips

Invisible Buttons in Screens

Invisible buttons are a type of push button and can be created using the push button tool in the Screen Builder toolbox.

Picture Buttons in Screens

You can create picture screen controls such as push buttons, check boxes and radio buttons using the SHOW GET command. In addition, you can specify a separate .BMP file for each of the three states in which a control can exist (enabled, selected, disabled) as shown in this example:

SHOW GET mybtn,7  PROMPT ;
'EXITEN.BMP,EXITSEL.BMP,EXITDIS.BMP'

In FoxPro for Macintosh, you can specify a separate picture/.PCT file for each of the three states:

SHOW GET mybtn,7  PROMPT ;
'EXITEN.PCT,EXITSEL.PCT,EXITDIS.PCT'

Automatic Color for Screen Objects

If you intend to allow users to set their own colors in applications, make sure that screen objects use the Automatic color setting from the Screen menu color palettes.

Bitmap Files for Screen Controls

When using bitmap files in a set of controls, try to use bitmaps that are the same size. You should also use bitmaps that have a white (distinguishing) background so that when you disable them, they will have a well-defined outline. Try to use a bitmap file that is slightly smaller than the overall control because extra border space is added automatically. (This tip also applies to the use of picture files in FoxPro for Macintosh.)

Three-Dimensional Screens

You can create dialogs which appear three-dimensional, making objects look like they are recessed into the screen. To create this effect, change the color of the screen to light gray. Next, use the line tool to make a box for the area you want to recede or bring out. Finally, change the pen color of one set of adjacent lines to white and the other to black. Coloring the top line white makes the screen section appear to come out at you. Using white on the bottom gives a recessed appearance. Try to use a small pen size for the best effect.

Spinner Limits

When creating spinners, remember that the minimum and maximum settings do not stop a user from typing in any value they desire.  You must specify range values to limit the values that users can type.

Override Snap to Grid

The Snap To Grid option in the Screen Builder allows you to align objects to a grid defined in the Ruler/Grid dialog. To override the Snap To Grid setting, hold down the Ctrl key when moving an object. If you are not sure whether objects are aligned, use the line tool to create a temporary line for alignment purposes. Also, you can use the Show Position menu option to display the exact coordinates of an object in the status bar.

Single Platform Screens

If you are generating screens for use in FoxPro for Windows only, make sure you have the Window Objects Only option checked in the Generate Screen dialog. This will reduce the amount of code generated and the time required to generate code.

Transparent/Opaque Screen Objects

The Screen Builder allows you to apply a Mode attribute to certain objects such as text. The Mode attribute can be opaque or transparent. A text object's fill colors appear only if the object is opaque. Avoid using a transparent mode on @...SAY commands that are later refreshed with different text. This will cause the old text to be overwritten on top by the new text.

Since new objects can overwrite old objects, you may not see the desired effect when creating transparent objects that toggle between enabled and disabled states. You can, however, attain some interesting and desired special effects using a transparent mode. For example, a disabled control such as a check box dims the text prompt as well as the box portion of the control.  You can make the text prompt appear enabled even though the check box is actually disabled. You simply need to ENABLE and then DISABLE the control using the SHOW GET command.

The SET INTENSITY command can be used to control the background appearance of the @...GET fields.

Read-Only Edit Regions in Screens

The @...EDIT command is used to create edit regions for memo fields on screens. The Screen Builder does not have an option to make these read-only. You can create a workaround solution by defining the WHEN clause of the edit region as an expression and typing in the following code:

.T.  NOMODIFY

Quick Screen

If you create a Quick Screen and you specify a column layout but only get one column, one or more of your fields may be too wide for multiple columns.  Adjust the maximum field width in the Quick Screen dialog and try again.

Hot Keys in Screens

In FoxPro for Windows, screen objects are assigned default hot keys.  These hot keys can be chosen by pressing Alt+key. This is standard in Microsoft Windows applications.

Templates for Screens and Reports

If you usually use settings in the Screen Builder or Report Writer that are not the default (ruler settings, show position, and so on), consider creating a template with your custom settings and using the template as the basis for new screens or reports.

Circles in Screens and Reports

To create a circle (oval) in the Screen Builder or Report Writer, use the rounded-rectangle tool to create the object, then double-click on it and select the round button.

Size Report and Screen Fields

To easily size fields one character at a time, use FONTMETRIC(7) to determine the maximum character width for the font you're using, then set the horizontal grid to the maximum character width.  When you size fields, they will move one "character" at a time.

Drawing Multiple Objects in Screens and Reports

In the Screen Builder and Report Writer, after you select a tool from the toolbox and draw an object, the selection pointer becomes the active tool. To keep another tool active when drawing multiple objects of the same type, double-click on the tool. It will appear darkened when it is selected in this manner.

Special Characters in Reports and Screens

When you add text to a screen or report, you can use any character in the current font, even those characters you can't directly type on the keyboard.  To enter special characters, hold down the Alt key and type in the number of the character using the numeric keypad.   For example, in ANSI-standard fonts, character number 0169 is the copyright symbol.  Character number 0174 is the trademark symbol.  Release the Alt key to display the symbol.

Placing Objects in Screens and Reports

In FoxPro for Windows, the keyboard is the best device to use to precisely place objects. When an object is selected, you can use the arrow keys to move it 1 pixel at a time. To resize the object, hold down the Shift key while you use the arrow keys.

Multi-Line Text Objects

You can create multi-line text objects in the Screen Builder and Report Writer by pressing Enter to continue typing on the next line. You are limited to 255 characters per text object.

Redo Quick Screen/Report/Menu

To redo a Quick Screen, Report or Menu, delete all the objects and choose the Quick Screen/Report/Menu option again.

Managing Snippets

Open and minimize any snippets that are complex or that you use regularly so that when you open the screen or menu, they are easily accessible from the bottom of the main FoxPro window.

Multi-Column Snaking Reports

Because FoxPro for Windows and FoxPro for Macintosh use the same format for labels as for reports, you can create multi-column snaking reports. In fact, the .FRX and .LBX files are identical, and the REPORT FORM and LABEL FORM commands are interchangeable.

AS Clause in RQBE

RQBE does not have a built-in way to create an AS clause to rename an output column. To create an AS clause in RQBE, open the RQBE Select Fields dialog and type the field name followed by the AS name in the Functions/Expression box.  This is especially handy when using a function:

COUNT(people.name) AS 'Employees'

Note   When FoxPro reopens a .QPR file, it will ignore the AS clause. It still exists in the file until you save over it. This trick can be quite useful with on-the-fly queries that don't need to be saved.

Right Margin Settings

The Right Margin option in the Print Options dialog is not available in FoxPro for Windows.  Instead, use the Print Setup dialog to select the proper paper size.


Moving a Screen Object

Use _CUROBJ to move to a particular screen object.  This object can even be itself.  You might want to do this in order to change the value of an @...GET object while in that object's VALID clause.

The following example changes the value of x without leaving the @...GET. When you set the value of _CUROBJ, try to avoid hard-coding an actual number there because reordering fields in the Screen Builder can cause unexpected results.

x = some_value
_CUROBJ = _CUROBJ
RETURN .T.

To avoid hard coding a value, use an expression like:

_CUROBJ = OBJNUM(myvar)


Drives and Directories
Drives and Directories/Folders

Drives and Directories in FoxPro for Windows

Several FoxPro functions can be used to obtain information about drives and directories.  Compare the returned values after issuing the command SET DEFAULT TO C:\FOXPROW.

Drive:

? SYS(5)

C:
? SET('DEFAULT')

C:

Directories:

? CURDIR()

\FOXPROW\
? SYS(2003)

\FOXPROW
? FULL(SET('DEFA'))

C:\FOXPROW\

You can also use the ADIR( ) function to see if a specific directory exists. The following example returns 0 only if the path name does not exist. Remember that the path to a network server may not exist if the network connection is broken.

ADIR(temparr,'C:\FOXPROW\*.*','D')=0

Drives and Folders in FoxPro for Macintosh

You can use the same FoxPro functions to obtain information about drives and folders on the Macintosh.  Compare the returned values after issuing the command SET DEFAULT TO \FOXPRO.

Drive:

? SYS(5)
MacHD:
? SET('DEFAULT')
MacHD:

Folders:

? CURDIR()
\FOXPRO\
? SYS(2003)
\FOXPRO
? FULLPATH(SET('DEFA'))
MacHD:\

You can also use the ADIR( ) function to see if a specific Macintosh folder exists.


Set Volume to Shorten Paths
Set Volume to Shorten Paths {FoxPro for Macintosh only}

You can use SET VOLUME to ease the task of typing long Macintosh folder and path names.

For example, assume your Macintosh hard disk is named MacHD, and the folders in which your files are located are MacHD:PICT Files and MacHD:Microsoft FoxPro:Project One. If you issue the following commands:

SET VOLUME C TO "MacHD:Microsoft FoxPro:Project One"
SET VOLUME D TO "MacHD:PICT Files"

whenever you use a command that specifies a file in these folders, you can use the single-letter drive or volume designation.  For example:

COPY FILE D:GraphicImage.PIC TO C:

instead of

COPY FILE MacHD:PICT Files:GraphicImage.PIC ;
TO MacHD:Microsoft FoxPro: Project One

The volume mapping can also be specified in your CONFIG.FPM configuration file. For example, you can place the following lines in your CONFIG.FPM configuration file:

VOLUME C = "MacHD:\Microsoft\FoxPro"
VOLUME D = "MacHD:\Microsoft\FoxPro\Project One"
VOLUME E = "MacHD:\PICT files"
DEFAULT = C:

Except for the colon following the Macintosh hard disk name, colons and backslashes can both be used as delimiters in FoxPro for Macintosh. Note that FoxPro for Macintosh does not recognize folder names containing embedded backslashes (\).

For more information, see SET VOLUME.


USE Command

You can issue the command USE IN 0 to open a table in the first available work area.  This command does not select that work area in which it opened the table.  You must use the SELECT command to do this.  You can issue the command USE IN <alias> to close a table without selecting its work area.

A new SHARE clause for the USE command allows you to open a table for shared use without using the SET EXCLUSIVE command.  For more information about the USE command, refer to the USE topic.


Cross-Tab Output to Spreadsheets

Run the GENXTAB program to create cross-tabulated output that you can COPY TO or EXPORT to a spreadsheet.


Custom Messages

You can display custom messages in the FoxPro status bar. To do this, use SET TALK OFF, then use the SET MESSAGE TO <expC> command to specify a message.  (You can pass a null string to display nothing.) SET MESSAGE TO without a parameter will restore the status bar to its normal functionality.


Preprocessor Directives

Do not use _WINDOWS, _DOS, _MAC, or _UNIX with preprocessor directives (that is, #IF...#ENDIF).  These are designed to be runtime variables.  For example, the following will not work:

#define _DOS .t.
#define _WINDOWS .f.
* For code compile in MS-DOS, the following would not work:
DO CASE
CASE _DOS
? "Running in MS-DOS"
CASE _WINDOWS
? "Running in Windows"
ENDCASE

This code will not work because _DOS would be changed to .T. and _WINDOWS would be changed to .F., so that the code could never work properly again.  Instead, use the following:

#if "Win" $ VERS()
#define WINDOWS_CODE .t.
#elif "Mac" $ VERS()
#define MAC_CODE .t.
#elif "Unix" $ VERS()
#define UNIX_CODE .t.
#else
#define DOS_CODE .t.
#endif
#if WINDOWS_CODE
? "Compiled under WINDOWS"
#elif DOS_CODE
? "Compiled under DOS"
#endif


Prevent Preprocessor Substitution in Text Strings

#DEFINE prevents preprocessor substitution in text strings.  Note that square brackets [ ] can be used do delimit text strings.  This means that no substitution will be made in the following:

#DEFINE nosub 1
DECLARE an_array(3)
*** This will cause a 'variable NOSUB not found' error
*** because no substitution was made
? afunc[an_array[nosub]]
FUNCTION afunc
PARAMETER x
RETURN x


Development Tools

The FOXTOOLS.FLL file, which is located in your FoxPro for Windows root directory, contains a variety of functions that you can use to enhance your applications. Many of these functions provide access to API routines and Microsoft Windows functions.  You can view these using the DISPLAY STATUS command (after you SET LIBRARY TO foxtools).

In FoxPro for Macintosh, this file is named FOXTOOLS.MLB, and is located in your Systems:Extensions folder.


Cross Platform Tips

Cross Platform Code

When designing cross platform applications, much of the same code can be used transparently across platforms. Try to separate this code from platform specific code. Code that involves database operations can usually be generic across platforms. Interface code, on the other hand, can vary across platforms.

Separate platform specific code using IF...ENDIF and DO CASE...ENDCASE structures with platform system variables such as _DOS, _WINDOWS, _MACINTOSH, and _UNIX.

Updating Cross Platform Applications

You can run FoxPro versions 2.5 and 2.6 applications transparently on different platforms. However, remember that some changes you make on one platform are not automatically reflected on other platforms, because changes made in one platform do not necessarily update all platforms.

For example, if you add a new object to a screen in FoxPro for Windows and recompile the application, that new object will not appear when you run the .APP in FoxPro for MS-DOS.  You must open the screen in FoxPro for MS-DOS and rebuild the application.  The Transporter dialog appears, showing that new objects were added on another platform and asking if you'd like to make the same changes on this platform.

Transporting Screen Elements

When transporting applications across platforms, you may need to adjust some screens, especially if you are going from a character to graphical environment. If you intend to port Windows or Macintosh applications to MS-DOS, leave extra space in screens because there are more pixels in a graphical environment than there are rows and columns in a character environment.  Also, try to use objects available on each of the platforms your application supports.  OLE and picture objects cannot be used in FoxPro for MS-DOS.


Transporting Files

When transported across platforms, most screens, reports and labels work the same.  In some cases, while the screen, report or label objects transport to the new platform, specific enhancements (such as font or fill color) do not.  Because of the differences between development platforms, you may need to adjust some of the screens in your application, especially if you are transporting from a character to a graphical environment.

The following topics discuss specific details of transporting objects across platforms:

Transporter Directives

Transporting Screens Between Windows and Macintosh

Transporting Reports Between Windows and Macintosh

Transporting Screens and Reports from MS-DOS to Windows or Macintosh

Transporting Screens from Windows or Macintosh to MS-DOS

Transporting Reports from Windows or Macintosh to MS-DOS

Transporting Labels from Windows or Macintosh to MS-DOS


Transporting Screens Between Windows and Macintosh

See Also

The following topics discuss specific details of transporting files:

When you transport a screen developed in FoxPro for Windows over to the Macintosh platform and you specify a font with the Font... button on the Transporter, text objects (static text, fields and SAY expressions) will be transported in the font you selected.  If you do not specify a font, these text objects will appear in the default font--Geneva 9 bold for 3D screens and Chicago 12 nonbold for 2D screens.

Text buttons, radio buttons, check boxes, invisible buttons and spinners that were created in fonts common to both platforms retain their original font after transporting from Windows to the Macintosh.  Those objects created in fonts that are not common to both platforms are mapped to new fonts.  The following table shows the relationship between the object style, object font and the font of the transported object.

Object Style	Object Font on Windows Platform	Font of Object When Transported to Macintosh Platform
2D or 3D	common font*	Remains the designated common font
2D	not a common font*	Defaults to Chicago 12, not bold
3D	not a common font*	Defaults to Geneva 9 Bold
* Fonts common to the Macintosh and Windows platforms are Arial, Courier New, and Times New Roman.

Objects created with a Windows font that cannot be mapped to a Macintosh counterpart font (e.g., MS Sans Serif) are mapped to the default fonts.

The font you select via the Font... push button does not affect screen control objects (text buttons, radio buttons, check boxes, invisible buttons and spinners).

When you transport screens between FoxPro for Macintosh and FoxPro for Windows, you'll notice these differences:

While most screen objects transport well, if you use fonts that don't have an exact mapping on the other platform, some objects may be a bit too far apart or may overlap a bit.  Note that even fonts that are common to both platforms require a different number of pixels to display on each platform, so some minor positioning differences are normal.

The default height of a push button in Windows is taller than it is on the Macintosh.  If your Windows push button had the default height, the Transporter converts it to the Macintosh default height, potentially opening up extra space between vertical buttons.


See Also

Transporting Files

Transporter Directives

Transporting Reports Between Windows and Macintosh


Transporting Reports Between Windows and Macintosh

See Also

Reports developed solely on the Macintosh platform must be transported before you can run them in Windows. If you use the REPORT FORM TO command to run an untransported Macintosh report in Windows, FoxPro generates a brief report instructing you to transport the report before running it on the Windows platform.

When you transport reports between FoxPro for Macintosh and FoxPro for Windows, you'll notice these differences:

Most objects become somewhat taller on the Macintosh, though you often won't notice the effect unless you have a very large detail band.  It is a side-effect of preserving "WYSIWYG" in the report writer since the Macintosh and Windows have different screen and printer resolutions.  Conversely, when you transport reports from the Macintosh to Windows, objects will tend to be somewhat shorter.

Printer setup definitions are not transported.  For example, if your report is to be printed in landscape mode you will need to redefine the page layout after transporting in either direction between Macintosh and Windows.  However, you will only need to do this the first time you transport.  Once the report is set up correctly on both platforms, you don't need to change the printer definitions each time you transport.

Grouped objects are no longer grouped after transporting.


See Also

Transporting Files

Transporter Directives

Transporting Screens Between Windows and Macintosh


Transporting Screens and Reports from MS-DOS
to Windows or Macintosh

See Also

When you transport screens or reports from MS-DOS to FoxPro for Windows or FoxPro for Macintosh, you'll notice that grouped objects are no longer grouped after transporting.

You'll also find these differences in reports you transport from MS-DOS to FoxPro for Windows or FoxPro Macintosh:

Objects with Float as Band Stretches checked do transport and are positioned relative to the bottom of the band in FoxPro for Windows or FoxPro for Macintosh reports.

Objects in reports that have Float as Band Stretches and Stretch Vertically both checked do transport, are positioned relative to the top of the band, and can stretch in FoxPro for Windows or FoxPro for Macintosh reports.


See Also

Transporter Directives

Transporting Screens from Macintosh to MS-DOS

Transporting Reports from Macintosh to MS-DOS

Transporting Labels from Macintosh to MS-DOS


Transporting Screens from Windows or Macintosh to MS-DOS

See Also

If you intend to port Windows or Macintosh applications to MS-DOS, leave extra space in screens because there are more pixels in a graphical environment than there are rows and columns in a character environment. Also, try to use objects available on both platforms.

When transporting screens to from Windows or Macintosh to FoxPro for MS-DOS, note the following:

Transported picture buttons become regular controls with the bitmap (.BMP) file name as the prompt.

Transported rounded rectangles become regular rectangles.

Transported spinners become numeric GET fields.

Rectangles, lines and text colors are transported because MS-DOS accepts them as an individual color pair.

Fonts, font styles and font sizes are not transported.  Instead, FoxPro removes their attributes and places them on the screen as mono-spaced character mode text.

Multiple-line text objects are broken into separate objects.  Each line becomes its own object.

Multiple-line text objects that have 1-1/2 line spacing transport to single line spacing.

OLE and picture objects cannot be used in FoxPro for MS-DOS.

Pictures fields are ignored.  Nothing is transported.

Grouped objects are no longer grouped after they are transported.

Coordinates in FoxPro for Windows and FoxPro for Macintosh are fractional.  After transporting, these become whole numbers based on a complex algorithm.

Pen sizes transport as follows:

Pen Size in FoxPro for Windows or FoxPro for Macintosh	Equivalent after transporting to FoxPro for MS-DOS
1	Single
2	Double
4	Panel
6	Single


See Also

Transporter Directives

Transporting Screens and Reports from MS-DOS to Macintosh

Transporting Reports from Macintosh to MS-DOS

Transporting Labels from Macintosh to MS-DOS


Transporting Reports from Windows or Macintosh to MS-DOS

When transporting reports to FoxPro for MS-DOS, note the following:

Multi-column reports are transported as single column reports and the column headers and footers are merged into the page headers and footers.

OLE and picture objects cannot be used in FoxPro for MS-DOS.

Colors in reports do not transport.

Individual fields in FoxPro for Windows or FoxPro for Macintosh can have the blank lines suppressed option turned on or off.  If one field in a FoxPro for Windows or FoxPro for Macintosh report has this option turned on, then the Transporter turns the option on for the entire report in FoxPro for MS-DOS.

Group header and group footer fields that are marked to stretch, are cut off at the group header or group footer band when transported to FoxPro for MS-DOS.

When repeated values are suppressed, the following features transports as follows:

FoxPro for Windows or FoxPro for Macintosh	FoxPro for DOS
Page or Column	Page
Group	Group
Group Overflow	Does not transport
None	Report
Fonts, font styles and font sizes are not transported.  Instead, FoxPro removes their attributes and places them on the screen as mono-spaced character mode text.

Multiple-line text objects are broken into separate objects.  Each line becomes its own object.

Multiple-line text objects that have 1-1/2 line spacing transport to single line spacing.

Pictures fields are ignored.  Nothing is transported.

Grouped objects are no longer grouped after they are transported.

Coordinates in FoxPro for Windows and FoxPro for Macintosh are fractional.  After transporting, these become whole numbers based on a complex algorithm.

Pen sizes transport as follows:

Pen Size in  FoxPro for Windows or FoxPro for Macintosh	Equivalent after transporting objects to FoxPro for  MS-DOS
1	Single
2	Double
4	Panel
6	Single


Transporting Labels from Windows or Macintosh to MS-DOS

When transporting labels to FoxPro for MS-DOS, note the following:

Rectangles and lines do not transport.

Objects that are determined by the Transporter to be on the same line are merged into a single, comma-delimited expression.  This means horizontal information is not transported.

Single-column labels are transported to FoxPro for MS-DOS as labels with a width of 80.

Fonts, font styles and font sizes are not transported.  Instead, FoxPro removes their attributes and places them on the screen as mono-spaced character mode text.

Multiple-line text objects are broken into separate objects.  Each line becomes its own object.

Multiple-line text objects that have 1-1/2 line spacing transport to single line spacing.

Pictures fields are ignored.  Nothing is transported.

Grouped objects are no longer grouped after they are transported.

Coordinates in FoxPro for Windows and FoxPro for Macintosh are fractional.  After transporting, these become whole numbers based on a complex algorithm.

Pen sizes transport as follows:

Pen Size in  FoxPro for Windows or FoxPro for Macintosh	Equivalent after transporting objects to FoxPro for  MS-DOS
1	Single
2	Double
4	Panel
6	Single


Transporter Directives

FoxPro provides transporter directives that you can insert into your code to control how objects are transported across platforms.

#TRAN SNIPPET ONLY Screen Directive

#TRAN SNIPPET ONLY affects how screen objects are transported and is designed to limit the Transporter's changes to just screen snippets, and is placed in a screen's Setup snippet.

When screen objects are transported to a different FoxPro platform, only the screen snippets for updated screen objects are transported if #TRAN SNIPPET ONLY is included. All other screen object attributes are not transported to the different platform.

Note that #TRAN SNIPPET ONLY only affects updated screen objects; it does not affect new or unchanged screen objects or screen objects being transported for the first time.

Platform-specific Directives

Four transporter directives are available to specify that objects created in the Screen Builder and Report Writer should be transported only to certain platforms.  Use transporter directives for objects that belong on certain platforms but not others.

Directive	FoxPro Platform
#DOSOBJ	MS-DOS
#MACOBJ	Macintosh
#UNIXOBJ	UNIX
#WINOBJ	Windows
For example, you include a push button in your FoxPro for Windows screens that enables users to take advantage of a feature specific to Windows such as a Dynamic Data Exchange (DDE) transfer of data from FoxPro to Microsoft Word. However, you don't want the push button to appear in your FoxPro for MS-DOS or FoxPro for Macintosh screens. You can use the #WINOBJ Windows transporter directive for the push button object to specify that this button should not be transported to your FoxPro for MS-DOS or FoxPro for Macintosh screens.

To specify transporter directives for an object, choose the Comment... push button to display the Comment dialog.  In the Comment text editing region, enter the transporter directive for each platform you'd like the object to transport to. You can put more than one directive in the comment snippet. For example, if you have an object that should be present on both Windows and the Macintosh, but not on MS-DOS, put #WINOBJ and #MACOBJ in the comment snippet. Place each directive on a separate line and do not abbreviate them.  You can place transporter directives between your personal comments.

If you do not specify any transporter directives for an object, the object is transported to all FoxPro platforms.


2D and 3D Objects

See Also

When you create controls and rectangles using the Screen Builder, you can choose whether the object is displayed with a 2D (two-dimensional) black-and-white or 3D (three-dimensional) gray-scale appearance. The default selection for all controls and rectangles in the Screen Builder is 3D. To change the setting of a rectangle, double-click on the rectangle and choose 2D Style in the Rectangle dialog. If you choose the 2D look for a particular object, such as a push button, 2D becomes the default setting for that object and is used for all new push buttons you create. This setting is saved in the FOXUSER resource file on a per-object basis and is used for all subsequent screens.

To change the default setting for a type of object, simply change the setting for any object of that type. The new setting will become the default.


2D and 3D Objects See Also
See Also

FOXUSER Resource File


Using Graphs

You can include a graph in a general field of your FoxPro table using MS Graph. To start MS Graph, follow these steps:

1	Double-click on the general field in which you want to insert a graph.

2	Choose Insert Object... from the Edit menu.

3	Select Microsoft Graph from the Object Type list, then click OK. This launches MS Graph.

4	Use the options in MS Graph to customize the appearance of the graph. For online Help on customizing a graph, click the Help menu button (? icon) on the MS Graph menu bar, then select Microsoft Graph Help... from the Help menu.

5	When your graph looks the way you want it to look, choose Quit and Return to FoxPro from the File menu.

6	A dialog appears asking if you would like to update the graph in FoxPro. Choose Yes if you want your latest changes to the graph to be embedded in your FoxPro table.


Using PICT Files

See Also

FoxPro for Macintosh supports images in the PICT format and uses OLE to store and manipulate PICT files. You can copy PICT files to and from FoxPro using the Cut, Copy, and Paste options on the Edit menu in the Finder.

Though FoxPro for Macintosh stores and displays PICT data in the general field, FoxPro does not offer PICT file editing functions. You can open the fields and view the data. You can append to the table and delete records; but you cannot change the PICT data in FoxPro for Macintosh.

You can use a Macintosh utility such as Teach Text, which is part of System 7, to open and view PICT format files. Although Teach Text is a limited application, it lets you view and copy PICT images to FoxPro for Macintosh through the Clipboard. Teach Text cannot create or save PICT files.

The largest color image Teach Text can view and copy is approximately three inches square (216 pixels x 216 pixels). For larger or more complex images, use a graphics program that produces PICT files. You can also use a program, such as Microsoft Word, that handles PICT images.

Note   If you use Teach Text to access PICT files, use version 7.0 or later. Earlier versions of this Apple utility do not recognize PICT files.

Though you can use Teach Text to view and copy PICT images, you will achieve better results with a program designed to manipulate PICT files, especially if it also handles .BMP files.

FoxPro for Macintosh handles PICT and .BMP files, and QuickTime objects through its support of OLE in the general field.


Using PICT See Also
See Also

Object Linking and Embedding

APPEND GENERAL

Using .BMP files

Converting PICT Files


Using BMP Files

See Also

FoxPro for Windows stores pictures in bitmap format with a .BMP extension. For maximum cross-platform compatibility, FoxPro for Macintosh reads and displays .BMP files as well as PICT files. Bitmap files can be stand-alone files, or they can be stored in a general field. You cannot edit .BMP files on the Macintosh; however, with an appropriate graphics program you can convert them to PICT files.

You can copy .BMP files to a Macintosh disk and use those files as backgrounds for screens or as buttons. You can store a .BMP image in the general field of a FoxPro table.  FoxPro allows you to view the data, but you won't be able to edit the field.

To view .BMP data in general fields, copy the FoxPro for Windows .DBF and .FPT files to your Macintosh and open the table in FoxPro for Macintosh. (Be certain to copy both files.) You can view the data, but you cannot edit the field contents in FoxPro for Macintosh.


Using BMP Files See Also
See Also

Picture Dialog

Report Layout Window

Report Picture Dialog

Screen Design Window

Using PICT files

Converting PICT Files


Version Control & Projects

When several developers are working on the same FoxPro project, a version control system can help prevent multiple write accesses to the same file.  Although the FoxPro Project Manager is not designed to be multi-user and is not a version control system, it does work effectively with any of the commercially available version control systems.

To track revisions to a FoxPro project and allow multiple developers to work on a project:

Make sure that a version control system exists on the network.

Store the components of a project (screens, menus, programs, and so on) on the network under version control.

Keep a complete copy of the project (.PJX and .PJT) and its components on each developer's machine.  Each developer should have all the project components in read-only form, along with his own copy of the project.

When a developer needs to change a project component, the component must be "checked out" from the network version control system so that the developer has write access to it.  The developer can then make changes to the component, rebuild the local project, test the changes, and make more changes if necessary.

When the developer is done changing a component, the component should be checked back into the network version control system so that others can update the component on their machines.

All developers should frequently update and rebuild their local copies of the project with components from the network.

When the project is ready for distribution, the project leader should update his or her machine so that the entire project and its components are current, then create the application or executable.


XCMDs and XFCNs

See Also

An XCMD or XFCN is a code segment, typically written and compiled in C, Pascal, or assembly language, that can be invoked from FoxPro for Macintosh or FoxBASE+ for Macintosh. You can access Macintosh toolbox routines with XCMDs and XFCNs.

To run an XCMD or XFCN in FoxPro for Macintosh

1	Open the XCMD or XFCN using the SET XCMDFILE command. The command syntax is:

SET XCMDFILE TO <file>

2	Load the XCMD or XFCN into memory using the LOAD command. The command syntax is:

LOAD <file> [FUNCTION]

3	FoxPro looks for an XCMD file by default. If the file you want to load is an XFCN, include the optional FUNCTION clause. Multiple XCMDs and XFCNs can be loaded into memory at one time.

4	Run the XCMD or XFCN using the CALL command. The command syntax is:

CALL <file>

To release XCMDs or XFCNs from memory

1	To release a single XCMD or XFCN from memory, issue the following command:

RELEASE MODULE <file>

2	To release all open XCMDs and XFCNs from memory, issue the following command:

SET XCMDFILE TO

Note   To run an XCMD or XFCN in FoxPro, the compiled code segment must be stand-alone code that does not require the presence of the originating application.

For more information about writing XCMDs and XFCNs, see your Macintosh documentation.


XCMDs and XFCNs See Also
See Also

CALL

LOAD

RELEASE MODULE

SET XCMDFILE


Glossary

A

active window

aggregate function

alert

alias

AND

ANSI

API

Apple Events

Apple menu

AppleScript

AppleTalk

application

argument

arithmetic expression

arithmetic operator

array

ASCII

assembler

assembly language

B

Balloon Help

band

basic optimizable expression

batch file

binary file

BOF

branch

breakpoint

browse

buffer

C

calculated value

case sensitive

catalog

character code

character expression

character field

character limit

checkbox

Chooser

ClassName

clause

cleanup code

click and drag

clipboard

code

code snippet

command

Command key

command keyword

command scope

compact single-entry index

compiler

compiler directive

compound index file

concatenate

conditional branch

configuration

constant

context-sensitive

control

control break

control character

control panels

controlling table

count

custom views

D

Database Container

database management system (DBMS)

data grouping

data table

data type

date field

debug

default

default button

del key

delete key

delimiter

Detail band

dialog

dimension

disable

disk cache

E

Easy Access

element

embedded

embedding

enable

EOF

end-of-line (EOL) character

error code

error message

Escape key

escape sequence

event-driven

executable program

expression

Expression Builder

expression list

F

field

field object

file server

file type

Finder

flag

float field

floating-point notation

folder

font

form

function

G

general field

generated code

generated name

generator directive

graphic objects

group band

group footer

group header

grouped objects

H

hide

high bit ASCII characters

hot key

I

IAC

independent IDX

index

index key

index variable

indexed table

INIT

initialize

insert mode

insertion point

interface

invisible buttons

J

join condition

K

Key Caps

key field

keyboard shortcuts

keyword

L

leading zero

linking

list

literal

local alias

lock

logical field

logical operator

long names

loop

M

Macintosh alias

macro

macro substitution

main FoxPro window

main memory

main report

memo field

memory

memory location

memory-resident

memory variable

menu bar

menu name

menu options

menu pads

menu system

modal

modifier key

N

name expression

nested loop

network

non-modal

non-compact single-entry index

non-procedural

NOT

null

numeric field

numeric keypad

O

object

object-level clause

object program

OEM

OLE

OLE client

OLE object

OLE server

online Help

operand

operator

optimize

Option key

OR

outlined folder structure

overflow

overwrite mode

P

pack

page down region

page footer

page header

page up region

parameter

pass by reference

pass by value

paste

path

PICT

point

pointer

point of call

pop-up

pop-up menu

precedence

procedure

program

program line

programming language

project

projection list

push buttons

Q

query

QuickTime

R

radio buttons

read

READ-level clause

record

recursion

related table

relation

relational expression

relational operator

Report Detail band

Report Footer band

Report Header band

report object

reserved word

Restart

return address

return values

routine

RQBE

RUN

Rushmore technology

S

scientific notation

screen set

Scrapbook

scroll

scroll bars

scroll box

select

selection

selection marquee

setup code

Shift+click

Shutdown

SIMM

smart windows

source

source program

spinner

SQL

starting value

start up

Startup Items

statement

string

string literals

structural compound index

style

subroutine

subscript

substring

Summary band

syntax

system extension

System folder

system program

T

table field

tags

tagging

TeachText

template

text editor

text file

text object

text-editing window

title band

title bar

Top-of-form command

trace

Trash

TrueType Fonts

type-ahead buffer

U

unary operator

unconditional branch

unlock

user-defined function

user defined window

user interface

utilities

utility screen

V

value

variable

virtual memory

volume

W

wildcard

window

Wizards

wordwrap

work area

wrap around

X

XCMD

Y

Z

zoom

zoom box


active window

The window on the screen where the next action will take place. The active window is indicated by a colored title bar and border.


aggregate function

A preprogrammed feature that performs numeric operations. In SQL these include: SUM( ), AVG( ), MIN( ), MAX( ), COUNT( ), STD( ), and VAR( ).


alert

A warning or notice of an error in the form of a message, a sound from the computer's speaker, or both.


alias

A name assigned to a table. A table can be referenced by its alias and the work area in which it is opened. See also Macintosh alias.


AND

A logical operator that produces a true result if both of its operands are true, and a false result if either or both of its operands are false. See also: OR, NOT.


ANSI

An acronym for the American National Standards Institute, an organization that sets standards for a variety of programming languages and systems.


API

An acronym for Application Program Interface, the set of commands that an application uses to request and carry out lower-level services performed by a computer's operating system. The FoxPro API contains commands that allow C and Assembly language routines to interact with FoxPro.


Apple events

The Macintosh System 7 framework for program collaboration. This framework describes a set of commands that work between applications and between computers, even across a network. See also AppleScript.


Apple menu

On a Macintosh, the Apple icon on the menu bar. This menu is one way to access the Macintosh Control panel, Desk Accessories, and other information contained in the System folder. See also System folder.


AppleScript

On a Macintosh, a mechanism that uses a text file to access the functions of one application from another. AppleScripts rely on the System 7 Apple events framework. See also Apple events.


AppleTalk

The networking software in all Macintosh computers and most LaserWriters. It allows different types of computers and software to communicate with each other.


application

A collection of FoxPro programs and generated screens and menus that are compiled into a single executable program.


argument

A value on which a function or procedure operates.  For example, in the FoxPro statement SPACE(10), the number 10 is the argument. See also: operand.


arithmetic expression

A combination of numbers and arithmetic operators (such as 3 + 5) specifying a calculation that FoxPro carries out.


arithmetic operator

An operator, such as +, that indicates an arithmetic operation. Using an arithmetic operator causes FoxPro to manipulate numeric values to produce a numeric result. The operators are: + (addition), - (subtraction), * (multiplication), / (division), and ^ (exponentiation).  See also: operator, logical operator, relational operator.


array

An ordered collection of data contained in a memory variable and referenced by a single variable name. Each element of the array can be referenced by a numerical subscript.


ASCII

An acronym for American Standard Code for Information Interchange, pronounced "ASK-ee." It's a code in which the numbers from 0 to 255 stand for letters, numbers, punctuation marks, and other characters. ASCII code is standardized to facilitate transmitting text between computers or between a computer and a peripheral device.


assembler

A language translator that converts a program written in assembly language, which can be read by humans, into an equivalent executable machine language program.


assembly language

A low-level programming language in which individual machine language instructions are written in a symbolic form that is easier to understand than machine language itself. Each assembly language instruction produces one machine language instruction.


Balloon Help

The Macintosh System 7 facility that uses small balloons with text in them to supply information about Finder objects, and screen objects in applications that support it. The balloon contains information about a screen objects and their use. The balloon appears when you move the pointer cursor over it.


band

An area in a report that can contain text, data from table fields, calculated values or user-defined functions as well as pictures, lines, and boxes. Several different types of bands can appear in a report, including the Page Footer band, the Detail band, and the Page Header band.


basic optimizable expression

An expression whose execution time can be reduced using Rushmore technology. A basic optimizable expression can form an entire expression or can appear as part of an expression. The rules for combining basic optimizable expressions are explained in the FoxPro Language Reference and the "Optimizing Your Application" chapter of the FoxPro Developer's Guide. See also Rushmore Technology.


batch file

A file containing commands that control the operation of the computer. These commands take the place of input from the keyboard. Batch files have a .BAT extension.


binary file

A file whose data is to be interpreted in 8-bit form. Machine language programs and pictures are stored in binary files.


BOF

An acronym for Beginning of File.


branch

(v) To pass program control to a line or statement other than the next line or statement in sequence; (n) A statement that performs a branch. See also conditional branch, unconditional branch.


breakpoint

A position in a program at which execution pauses and control returns to you.


browse

To view a table, either for a particular item or for anything of interest, displayed in a Browse window.


buffer

A temporary holding area in memory where information can be stored. In editing, it is an area in memory where cut or copied data is held, sometimes called the clipboard. See also Clipboard, type-ahead buffer.


calculated value

A value that is the result of an expression or calculation. An expression or calculation can consist of fields, constants, and/or functions connected by operators.


case sensitive

Able to distinguish between upper-case characters and lower-case characters. Programming languages are case sensitive if they require all uppercase letters, all lowercase letters, or proper use of uppercase and lowercase letters.


catalog

A catalog is a group of files that can include tables, queries, screens, reports, labels, and programs. Each catalog is stored in a separate file that contains references to the names and locations of files included in that catalog. A FoxPro catalog file has an .FPC file extension and is associated with an .FCT memo file; a dBASE catalog file has a .CAT extension.


character code

A number used to represent a character for processing by a computer system.


character expression

A collection of character data that's treated as a unit.


character field

A table field, with a maximum width of 254, that can include any ASCII characters such as letters, numbers and punctuation symbols, as well as graphics (box-drawings), foreign alphabets and special symbol characters.


character limit

The maximum number of characters allowed in a single command.


check box

A hollow box followed by text or a picture that can be toggled by clicking the box. Settings can be turned on and off by choosing a check box. If a check box has an X in it, the setting is on. Clicking on a check box will sometimes bring up another dialog.


Chooser

On a Macintosh, an option under the Apple menu that allows you to choose items on the network. These items could include printers and servers. See also Apple menu.


ClassName defined
ClassName

Identifies the application used to create an OLE object. Each OLE object is of a particular type, called its class, which depends on the application that was used to create the object. The ClassName identifies this application (and thus the server to invoke when you edit or display the object); for example, ExcelWorksheet (Microsoft Excel) and MSGraph (Microsoft Graph).


clause

An additional statement that follows a command and provides further instructions for performing the command.


cleanup code

Code that is executed after the menu definition code in an .MPR file or after the screen definition code in an .SPR file. Cleanup code can include user-defined functions and procedures.


click and drag

The process of placing the pointer on an object, pressing and holding down the mouse button, moving the mouse, and then releasing the button. It is usually done to move objects or size windows.


clipboard

An area in the computer's memory that functions as a holding place for what you last cut or copied. Information contained on the clipboard can be inserted (pasted) into other documents and other applications.


code

One or more lines of a program containing commands.


code snippet

A procedure or an expression associated with a specific menu pad, menu option or menu, or with a specific object in a screen. You can also define code snippets that perform actions on the entire menu system or the entire screen.


command

An instruction that, when issued by the user, causes the computer to perform some action. A command can be typed from a keyboard, selected from a menu with a hand-held device (such as a mouse), or embedded in program code.


Command key

Specified by a [image] symbol on a Macintosh keyboard, it is the primary modifier key. There is one Command-key at each end of the space bar on the Macintosh keyboard.

The Command key is usually equivalent to the Ctrl or Control key on MS-DOS based PCs. In commands and functions, it is represented by CMD or CTRL. For maximum cross-platform capability, always use CTRL.


command keyword

A portion of a command that is English-like and describes the action that will occur.


command scope

A condition that specifies the general set of table records to which a command applies.


compact single-entry index

An index file limited to one index entry. You must explicitly open this index file and it must be active when you update a table. Otherwise, the index is not updated. The compact single-entry index has an .IDX file extension.


compiler

A language translator that converts source code written in a high-level programming language into object code, for later execution.


compiler directive

A command used in a program to alter the action of a compiler.


compound index file

An index file containing multiple index entries, called tags. This file has a .CDX file extension.


concatenate

To chain together sequentially. You can combine two or more strings into a single, longer string by joining the beginning of one to the end of the other. For example, you might join "Hello" with "there" to form the single string "Hello there" Strings and files can be concatenated.


conditional branch

A branch whose execution depends on the truth of a condition or the value of an expression.  See also branch, unconditional branch.


configuration

(1) The total combination of hardware components that forms a computer system, including the central processing unit, video display device, keyboard, and peripheral devices; (2) The software settings that allow various hardware components of a computer system to communicate with each other; (3) The software settings used to customize an application.


constant

In a program, a symbol that represents a fixed, unchanging value. See also variable.


context sensitive

Able to perceive the situation in which an event occurs. For example, context-sensitive Help presents information specific to the particular task you're performing, rather than presenting just a general list of commands.


control

A push button, check box, radio button, pop-up, spinner, scrollable list, or text-editing region in a dialog used to designate, confirm, or cancel actions.


control break

(1) An expression that defines the contents of a group in a report; (2) A term used to describe the stopping of the execution of a program or routine.


control character

A nonprinting symbol that controls or modifies the way information is printed or displayed. Control characters have ASCII values between 0 and 31. Typically, control characters are typed from a keyboard by holding down the [image] key while pressing some other key.


control panels

On a Macintosh, a number of different programs that allow you to adjust various settings, such as mouse options, date and time, and the Finder window format. The control panels are in the Control Panels folder inside the System folder.


controlling table

When tables are related, the controlling table determines the order in which the records in other tables are accessed.


count

An internal computation that returns the number of records.


custom views

On a Macintosh, user-selectable icon, type size, and type font in Finder windows. See also Finder.


Database Container

The central area where you can view and work with your tables, forms, queries, programs, and reports.


database management system (DBMS)

A software system for organizing, storing, retrieving, analyzing, and modifying information.


data grouping

Categorizing information into groups in a report corresponding to a specified order. Headers and footers can be defined to print every time the value for a data group changes.


data table

Information stored on the computer and organized into records and fields so that it can be readily manipulated and sorted by a computer user. Each FoxPro table is stored in its own file with a ".DBF" extension.


data type

One of the seven different ways of identifying information in FoxPro, including Character, Numeric, Float, Logical, Date, Memo and General.


date field

A field, with a length of eight characters, used for dates in the format of MM/DD/YY. Computations can be performed on date fields.


debug

To locate and correct an error, problem, or malfunction in a computer program. Usually synonymous with troubleshoot.


default

A preset response to a question or prompt. The default is automatically used by the computer if you do not supply a different response. Default responses prevent a program from stalling or crashing if no value is supplied by the user.


default button

The push button with a bold border in dialogs. The default button often has a dotted-line border around the button name. The default button is chosen when you press Return (or [image] +Return depending on your configuration).


del key

On a Macintosh keyboard, it is used for forward deletion.


delete key

On a Macintosh keyboard, it is used for backward deletion. It is equivalent to the Backspace key on MS-DOS based PCs.


delimiter

A character that marks the beginning or end of a sequence of characters and is not considered part of the sequence itself. For example, the double quotation mark (") is one delimiter for string constants; the string "DOG" consists of the three characters D, O and G, and does not include the quotation marks.


Detail band

An area of a report that typically contains one or more lines for each record that is printed from a table.


dialog

A box, containing controls and options, that requests more information to complete a command or an expression.


dimension

The size of an array.


disable

To make an item unavailable for use. Disabled items reflect the Macintosh color settings for disabled commands, and generally appear dimmed and cannot be chosen.


disk cache

On a Macintosh, the part of the computer's memory which is set aside to store frequently used information from disk. You can adjust the size of the disk cache by using the Memory control panel.


Easy Access

On a Macintosh, a control panel that adjusts the keyboard to make mouse and keyboard manipulation easier for people who have difficulty typing on the keyboard or manipulating the mouse.


element

A member of a set or collection; specifically, one of the individual members that make-up an array.


embedded

Contained within. For example, the string "WEST COAST" contains one embedded space. Also used in the context of OLE (Object Linking and Embedding), where a new or existing OLE object is embedded into the client document. The embedded object contains all the information needed to recreate the object, including a reference to the server application, so that the object can be edited, played, or run.


embedding

The process of inserting a new or existing OLE object into the client document. The embedded object contains all the information needed to recreate the object, including a reference to the server application, so that the object can be edited, played, or run.


enable

To make an item, such as a menu option, available to be acted upon. When enabled, items no longer appear dimmed (or in the Macintosh color setting for disabled commands) and can be chosen by the user.


EOF

An acronym for End of File.


end-of-line (EOL) character

A control character indicating that the preceding text constitutes a complete line. See Also control character


error code

A number or other symbol representing a type of error. Error codes are typically issued by a program.


error message

A message displayed to tell the user about an error or problem in the execution of a program or in the user's communication with the system. An error message is often accompanied by a beep.


Escape key

A key that generates the escape character. The Escape key is labeled Esc on the keyboard. In many applications, pressing Esc allows you to return to a previous menu or to stop a procedure.


escape sequence

A sequence of keystrokes or output characters that begins with the Esc character. Escape sequences are typically used for positioning the cursor and controlling the display of text on the screen, or as codes to control printers.


event-driven

A state in which the sequence of actions is determined by the user. When a program is event-driven, the computer responds to you instead of making you respond to it.


executable program

A set of code that you can run without performing any other work on it.


expression

A number, variable, word, or group of words that can be evaluated using operators and functions to form a new value (of Character, Numeric, Logical, Float or Date type).


Expression Builder

A dialog used to build expressions by choosing items from pop-ups and lists. The options include fields, variables, operators, and functions.


expression list

One or more expressions separated by commas.


field

A particular type or category of information in a record. One or more fields make a record. One or more records make up a table.


field object

An entity in a report or screen that draws its definition from a field or memory variable.


file server

A combination of controller software and a mass-storage device that allows computer users to share common files and applications through a local area network.


file type

The categories of files specified by FoxPro extensions: .APP, .DBF, .PRG, .CDX, .FRX, and so on.


Finder

The part of the Macintosh system software that creates the desktop and keeps track of your files, folders, and disks. The Finder also maintains the consistency of commands between applications.


flag

A variable whose value (usually 1 or 0, standing for true or false) indicates whether some condition holds or whether some event has occurred. A flag is used to control the program's actions at some later time.


float field

A field specifically designed for scientific data.


floating-point notation

A method of representing numbers inside the computer in which the decimal point (more correctly, the binary point) is permitted to float to different positions within the number. Some of the bits within the number itself are used to keep track of the point's position.


form

dBASE term. The equivalent FoxPro term is screen.


function

A preprogrammed calculation that can be carried out on request from any point in a FoxPro program. Because a function takes in one or more arguments and returns a single value, it can be embedded in an expression. Functions contain a pair of parentheses that distinguish them from commands. See also argument, expression, user-defined function.


general field

A field that can include information from a binary file. The information can represent a picture, a sound, and so on.


generated code

Programs created by GENSCRN, the FoxPro screen generator or GENMENU, the FoxPro menu generator. Generated screen programs have a .SPR extension and generated menu programs have an .MPR extension.


generated name

A unique name generated by SYS(2015). These names are inserted in generated programs with corresponding clauses and code snippets.


generator directive

A command that communicates solely with GENSCRN, the FoxPro screen generator.


graphic objects

Lines and boxes used in reports and screens.


group band

Fields that appear together in a report based on criteria that you specify by choosing the Data Grouping... option on the Report menu.


group footer

A report band in which objects can be defined to print each time a group expression changes. Group footers usually contain calculated values for data in the group.


group header

A report band in which objects can be defined to print each time a group expression changes. Group headers usually contain information to preface the data that follows.


grouped objects

A set of two or more fields combined in a report or screen so that they act as one field to be moved, copied, and pasted.


hide

To make a window invisible without closing it.


high bit ASCII characters

The ASCII characters that have decimal values of 128 to 255. They are called high ASCII because their high bit (first binary digit) is set to 1 (for on) rather than 0 (for off).


hot key

An underlined letter in a menu or dialog (when KEYCOMP = WIN) that you can type to immediately choose an item.


IAC

On a Macintosh, an acronym for Interapplication Communication. IAC makes it possible for different programs to communicate with each other.


independent IDX

Index files containing one index entry. An independent index file cannot have the same name as the associated table and will not automatically open with the table. See also compound index file.


index

A file that orders records within a table, based on key fields.


index key

A file whose entries identify the position of data in a table.


index variable

A variable whose value changes on each pass through a loop. It is often called a control variable or a loop variable.


indexed table

A table whose entries have been ordered in an ascending or descending sequence based on the value of one or more fields.


INIT

On a Macintosh, a system extension.


initialize

To set to a beginning state or value in preparation for some computation.


insert mode

The default text-editing mode in which any character you type is inserted at the cursor position and the text to the right of the cursor is shifted to the right.


insertion point

The place in a document where something will be added.


interface

The point of communication between a person and a computer. The FoxPro interface consists of menus, windows, and dialogs.


invisible buttons

Screen controls that are invisible. The behavior of invisible buttons can be defined in object-level clauses for the buttons.


join condition

A state that specifies a relationship between two tables, usually based on a field common to both tables, such as a customer number or a transaction number. Related tables can have several join conditions.


Key Caps

On a Macintosh, a desk accessory that allows you to view the characteristics of each font in your system. See also font.


key field

A column, or portion of a column, in a table that is used in an index.


keyword

A special sequence of characters that identifies a particular type of statement or command, such as RUN, USE or PRINT. Keywords are sometimes called reserved words because FoxPro reserves these special words for internal use.


keyboard shortcuts

The keystroke combinations that you can use to choose menu options instead of using the mouse.


leading zero

A zero occurring at the beginning of a decimal number. It is deleted by most computing programs.


linking defined
linking

The process of inserting a reference to an OLE object into the client document. Just as for embedded objects, the object appears in the client document, but the data for the object is stored by the server, and the client document contains only a reference to this data (including the path to the source application). Linked objects in FoxPro can also be linked in other applications.


list

A set of items displayed on the screen. FoxPro displays lists in dialogs so that you can make choices to complete commands. You select items from the lists.


literal

A character that is entered as a constant part of a format. For example, the slash characters (/) in date fields (8/11/89) are literals.


local alias

In the SQL SELECT command, a temporary name for a table specified in the FROM clause.


lock

To prevent documents, files, or entire disks from being altered. Files can be locked with software commands. Entire disks can be physically locked by using a write-protect tab on the disk jacket; in this sense lock is synonymous with write-protect. See also unlock.


logical field

A field that accepts only true or false conditions.


logical operator

An operator, such as AND, that combines logical values to produce a logical result (true or false); sometimes called a Boolean operator. See also arithmetic operator, relational operator.


long names

On a Macintosh, disks can have names up to 27 characters long. The startup hard disk on a Macintosh is designated by name rather than by letter.  Folders can have names of 31 characters. A folder on the Macintosh is equivalent to a directory on an MS-DOS based PC.  Files can have names of 31 characters.  To use a long filename in FoxPro for Macintosh, the filename must either have quotes around it, or an extension on it.  This signals FoxPro that it is really a file you are after, and it will not try to find it as a procedure.  For your files to work correctly on MS-DOS and Windows platforms, filenames should always begin with 8 significant characters, followed by and extension or should be limited to 8 characters.


loop

A section of a program that executes repeatedly until a limit or condition is met, such as a variable reaching a specified ending value.


Macintosh alias

A pointer to an object on a Macintosh or on a network to which a Macintosh is connected. The object can be a file, an application, or another volume. You can use an alias to easily access something buried in the hierarchy of your disks and folders. A Macintosh alias can locate its original object even if you move the object or change the alias name. File listings and icons display Macintosh alias names in italics.


macro

A feature that allows you to assign a number of FoxPro actions and keystrokes to a single keystroke. Macros save time by allowing you to avoid doing the same actions over and over again.


macro substitution

The act of replacing names with memory variables. Macro substitution places an ampersand (&) before the memory variable to tell FoxPro to use the value of the memory variable as a name. A command or function containing a name expression executes faster than one containing macro substitution; always use a name expression instead of macro substitution. See also name expression.


main FoxPro window

In FoxPro, the window that underlies all system and user-defined windows.


main memory

The part of a computer's memory whose contents are directly accessible to the microprocessor; usually synonymous with random-access memory (RAM). Programs are loaded into main memory, where the computer holds information while you work. It is sometimes simply called memory.


main report

The part of a FoxPro report that follows the title and consists of the page header, report body and page footer.


memo field

A field used to hold large amounts of information. Memo fields can include any letters, numbers, and punctuation symbols, any of the graphic (box-drawing), foreign alphabet, and special symbol characters, plus binary data. The default memo width is 10 for the purpose of defining the table structure, but there is no actual size limit other than disk space.


memory

A hardware component of a computer system that can store information for later retrieval.


memory location

A unit of main memory that is identified by an address and can hold a single item of information of a fixed size.


memory-resident

Held continually in memory even while not in use.


memory variable

A location in the computer's memory where data is stored. You can change the contents of a memory variable but its name and storage area are reserved for use until you end the FoxPro session or release the memory variable. Memory variables and their values are lost unless you save them to disk before quitting FoxPro or shutting off the computer.


menu bar

A horizontal strip that appears at the top of the screen and contains menu pads.


menu options

Commands, found on menus, that perform specific actions. When you choose a menu option, you are telling FoxPro what action to take.


menu pads

The menu names on the menu bar.


menu name

A word, phrase or icon on the menu bar that designates one menu. Selecting the menu pad highlights the name and causes the menu options to appear.


menu system

The combination of the menu bar, menu pads, menus, and menu options.


modal

Describes the state of a window or dialog when it does not allow another window or dialog to be brought in front of it until that window or dialog is dismissed; for example, the Expression Builder dialog.


modifier key

Any key that controls the operation that results from pressing other keys (for example, CapsLock, [image], and Shift). When you hold down a modifier key while pressing another key, the combination causes a result that is different from pressing the other key by itself.


name expression

A memory variable or array surrounded by parentheses that can replace a name in a command or function. Name expressions provide flexibility in FoxPro commands and functions.


nested loop

A loop contained within the body of another loop and executed repeatedly during each pass through the outer loop. See also loop.


network

A collection of interconnected, individually controlled computers, together with the hardware and software used to connect them. A network allows users to share data and peripheral devices (such as printers and storage media), to exchange electronic mail, and so on.


non-modal

A window or dialog that allows another window or dialog in front of it while it is open; for example, the Command window.


non-compact single-entry index

A single-entry index file that is not optimized to save disk space. Non-compact single-entry index files should be created only if you need to maintain compatibility with older versions of FoxPro (prior to FoxPro 2.0) or if you're sharing data with FoxBASE+ and FoxBASE+ for Macintosh.


non-procedural

Describes the act of controlling the interface by manipulating objects rather than typing.


NOT

A unary logical operator that produces a true result if its operand is false, and a false result if its operand is true. See also AND, OR.


null

An undefined value. Null is different from zero; zero is a value just like other numbers, whereas null means no value at all (of the expected type). A null string contains nothing. For example, " " is not a null string because it contains a space character; "" represents a null string. Null is synonymous with "empty."


numeric field

A field for numbers used in calculations such as quantities, prices, and credit limits. It can include numbers, a decimal point and a leading plus or minus sign.


numeric keypad

A calculator-style block of keys, either built-in or peripheral, which you can use to type numbers. The layout of numbers on the keypad makes it easier and faster to use than the regular keyboard.


object

An item in the Screen Design window or Report Design window that can be manipulated through the Object menu.


object-level clause

An @ … GET clause defined for a specified object in a screen. It is a clause for a specific object in a screen. A code snippet can be defined for each clause.


object program

The code produced by a language translator, such as a compiler or assembler, that was translated from the source code of a program.  Also called object code. See also source program.


OEM

Acronym for Original Equipment Manufacturer. An OEM is the original manufacturer of a product. OEMs can be contrasted with VARs (Value Added Resellers) which are companies that add products or services to existing equipment and then resell the packaged equipment.


OLE

Acronym for Object Linking and Embedding. OLE enables you to embed or link text data, spreadsheet data, video and pictures from one Macintosh or Windows application into another application.


OLE client

The application that produces the document where the OLE object is embedded or linked. This document is called the client document or container document. In the case of FoxPro for Macintosh, an OLE object (or the reference to a linked OLE object) is always stored in a general field in a table. This field can then be used to display the OLE object in a screen or report. This general field is the container document. For example, if you embed a Microsoft Excel spreadsheet file in a FoxPro table, FoxPro is the client application and the general field in the FoxPro table where the Microsoft Excel file is stored is the container document. Both the client application and client document are often referred to as the client.


OLE object defined
OLE object

A unit of data that can be linked or embedded. This includes text, graphics, video, and even entire files (for example, a Microsoft Excel spreadsheet). If the object is embedded in your FoxPro table, it is stored in your table, along with the name of the application used to create the data (the server application). If the object is linked to the server application, it is stored in that application or in a file created by that application, and your FoxPro table contains only a reference (pointer) to the object.


OLE server

The source application that was used to create the embedded or linked object. For example, if you embed a Microsoft Excel spreadsheet in your FoxPro table, Microsoft Excel is the server for this embedded spreadsheet. The server application is used to edit, display, play, or run the OLE object. In the case of a linked object, the object data is also stored in the server or in a file created by the server.


online Help

An online reference guide, accessible while using FoxPro, that provides additional information about FoxPro commands, functions, and the FoxPro interface.


operand

The object of a mathematical operation performed through program code. See also argument.


operator

A symbol or sequence of characters, such as + or AND, specifying an operation to be performed on one or more operands to produce a result. See also arithmetic operator, relational operator, unary operator.


optimize

To cause something to work as effectively as possible. For example, optimizing an application means to use code that causes the application to run as quickly as possible in a given environment.


Option key

On a Macintosh keyboard, the modifier key just outside each Command-key. It is usually equivalent to the Alt key on MS-DOS based PCs.  In FoxPro for Macintosh, Control+Option is the equivalent to Alt. See also Command key.


OR

A logical operator that produces a true result if either or both of its operands are true, and a false result if both of its operands are false. See also AND, NOT.


outlined folder structure

On a Macintosh, window lists that reflect the hierarchy and content of objects through symbols and indenting. You can expand and collapse folder lists without opening the folder. Nested folder lists are indented.


overflow

The condition that exists when an attempt is made to put more data into a given memory area than it can hold; for example, a computational result that exceeds the allowed range.


overwrite mode

A text-editing mode in which any character you type replaces the text at the cursor.


pack

To permanently remove the records in a table that have been marked for deletion.


page down region

The region on the scroll bar between the down arrow and the scroll box. Clicking in this area causes a window to scroll forward through a full page of text at a time.


page footer

A printed area at the bottom of every page of a report.


page header

A printed area at the top of every page of a report.


page up region

The region on the scroll bar between the up arrow and the scroll box. Clicking in this area causes a window to scroll backward through a full page of text at a time.


parameter

A value that is given to a variable, either at the beginning of an operation or before an expression is evaluated by a command.


pass by reference

A means of passing a variable to a user-defined function (UDF). The calling routine passes the address of the variable to the called routine, which can then use that address to retrieve or modify the variable. When the UDF changes the value of the passed variable, the variable's original value in the calling program is also changed. See also argument, pass by value.


pass by value

A means of passing a variable to a user-defined function (UDF). A copy of the value of the variable is created and passed to the called routine. When this method is used, the called routine can modify the copy of the argument but it cannot modify the original argument. The variable's value might be changed by the procedure or UDF, but the variable's original value in the calling program is not changed. See also argument, pass by reference.


paste

To place the contents of the Clipboard at the insertion point.


path

The full name by which an operating system identifies a file. A path is a sequence of folder and file names, each preceded by a colon, that specifies the path from device to folder to file that the operating system takes to locate that file. On a Macintosh, paths are arranged like this:  volume:folder1:folder2:file. See also volume, folder.


PICT

On a Macintosh, the standard file extension for graphic images, such as pictures and bitmaps.


point

(n) A unit of measurement for type; 12 points equal 1 pica, and 6 picas equal 1 inch; thus, 1 point equals approximately 1/72 inch; (v) To position the pointer at a location on the screen. Roll the mouse to place the pointer on an object.


pointer

(1) A small solid box or arrow on the screen that follows the movement of the mouse and shows where your next action will take place; (2) An item of information consisting of the memory address of some other item; for example, pointers to the most recently stored variable, the most recently typed program line, and the most recently read data item.


point of call

The place in a program from which a subroutine or function is called.


pop-up

The menu that appears when you choose a pop-up menu in a dialog.


pop-up menu

A rectangle with an underlined arrow in a gray box to the right of it. Choose the box containing the arrow to display the associated menu.


precedence

The prioritized order in which operators are applied in evaluating a mathematical expression.


procedure

A set of instructions that work as a unit; a subroutine.


program

(n) A set of instructions describing actions for a computer to perform in order to accomplish some task, conforming to the rules and conventions of a particular programming language; (v) To write a set of instructions describing actions for a computer to perform in order to accomplish some task, conforming to the rules and conventions of a particular programming language.


program line

The basic unit of a program, consisting of one or more statements.


programming language

A set of symbols and associated rules or conventions for writing programs.


project

A special table that keeps track of all programs, screens, menus, libraries, reports, labels, queries, format files, and other types of files that are needed to create an application.


projection list

In the SQL SELECT command, the projection list is the list of fields, constants and expressions that appear in the query output.


push buttons

Keywords or pictures that appear within a gray box. The action associated with a push button occurs immediately when you choose the push button unless it contains an ellipsis (…). The ellipsis indicates that another dialog will appear when you choose the push button.


query

A question posed to obtain information. FoxPro allows you to work with two kinds of queries: .QPR queries, which extract information by using SQL, and .FPQ queries which use Xbase commands to present selected information from your tables. SQL allows for faster and more sophisticated queries. Xbase allows you to modify the data obtained from a query so that the changes are reflected in your original tables.


QuickTime

A Macintosh System 7 extension that lets you manipulate sound, video, and other time-slice data. With QuickTime, you can view and control video images and sound clips in files on your hard disk or, with the appropriate peripherals, from CDs, video players, or cameras.


radio buttons

A set of hollow circles followed by text or pictures that can be toggled by clicking. Radio buttons are grouped so that only one can be chosen at a time, like the buttons on a car radio. Choose a radio button to activate it. When a radio button is chosen, it appears filled in and any previously chosen radio button becomes deselected.


read

To transfer information into the computer's memory from an external source (such as a disk drive or modem) or into the computer's processor from an external source (such as the keyboard or main memory).


READ-level clause

A READ clause defined for a specific screen.


record

A unit of storage in a table. Every table can contain a large number of records; each record is comprised of fields.


recursion

The ability of a routine to call itself resulting in the continued repeating of an operation or a group of operations. Excessive use of recursion can cause a program to run out of stack space during execution, usually halting the program and sometimes causing the entire system to crash.


related table

A table that is linked to the controlling table. See also controlling table.


relation

Links between tables that allow data to be accessed from more than the currently selected table. The link is based on a common field or a value (record number).


relational expression

An expression that describes a link between two tables based on a common field or value.


relational operator

An operator, such as > (greater than), that manipulates numeric and other types of values to produce a logical result. See also arithmetic operator, operator.


Report Detail band

The area between the page header and the page footer, consisting of detail lines based on the records from the selected table or tables.


Report Footer band

A band in the Report Design window that contains the data that appears at the bottom of a page (page numbers, section, and so on).


Report Header band

A band in the Report Design window that contains information that appears once per report. Typically, items placed in a report header include a report title, column headings and the current date.


report object

A graphic, field, or text item in the Report Design window.


reserved word

A sequence of characters reserved by FoxPro for some special use and therefore unavailable as a variable name in a program.


Restart

On a Macintosh, an option under the Special menu that allows you to restart the Macintosh without turning it off.


return address

The point in a program to which control returns on completion of a subroutine or function.


return values

The calculation results or information returned by a function to the calling program. The DATE( ) function returns the system date from your computer. See also error code.


routine

A part of a program that accomplishes some task subordinate to the overall task of the program. See also procedure.


RQBE

Acronym for Relational Query By Example. The RQBE dialog can be used to find specific information from one or more tables based on the characteristics of the data. It is a way to find specific information by questioning with examples.


RUN

A FoxPro command that brings an external program into memory and runs it.


Rushmore technology

A data access technique that permits sets of records to be accessed very efficiently.


scientific notation

A method of expressing numbers in terms of powers of 10, useful for expressing very small or very large numbers. For example, 6.02E23 means 6.02 times 10 to the 23rd power. (The letter E stands for exponent.) The number is easier to understand in this form.


screen set

Two or more screens in a file.


Scrapbook

On a Macintosh, a desk accessory that allows you save multiple objects that are frequently used, such as pictures, graphic images, icons, or text. You can then cut, copy, and paste these objects. The Scrapbook allows you place more than one object inside of it.


scroll

To move through the contents of a window so that a different part becomes visible.


scroll bars

The controls that are used to view text that extends beyond the edge of a window. A window can have vertical and/or horizontal scroll bars.


select

(1) To designate where the next action will take place. To select using a mouse, you click on or drag across information. You can also select menu items by typing a letter or number at a prompt, by using a combination of keystrokes, or by using arrow keys; (2) To highlight. Selecting prepares something to be chosen.


selection

The information or items that will be affected by the next command. A selection usually appears highlighted.


selection marquee

A way of selecting multiple objects by dragging the selection pointer. The selection marquee appears as a dotted line in the Screen Design window or Report Writer window. All objects enclosed in the marquee are selected. Objects that are partially contained in the marquee are selected as well.


setup code

The portion of a program that executes before the screen or menu system is defined and might include code to open files, declare memory variables, or place a previous menu system on a stack so it can be retrieved later without redefining it. See also memory variable.


Shift+click

A technique that allows you to extend a selection. Position the pointer on what you want to select, then hold down the Shift key and click the mouse button.


Shutdown

On a Macintosh, an option under the Special menu that allows you to turn off your Macintosh from the screen.


SIMM

An acronym for Single Inline Memory Module. SIMMs are used to expand random-access memory.


smart windows

On a Macintosh, windows that attempt to size themselves according to the amount of information they contain. When you click the zoom box, it expands or contracts to display the folder contents unless there are enough items to fill a full screen.


source

The original, as opposed to the duplicate. When you are making a copy of a file, the source is the location you are copying from.


source program

The source-code version of a program given to a language translator, such as a compiler or an assembler, for conversion into another form. See also executable program.


spinner

A control that allows you to adjust a numeric value. To use a spinner, click on the up arrow to increase the numeric value, or the click on the down arrow to decrease the numeric value. You can also click in the text region and edit the value.


SQL

Acronym for Structured Query Language. A standard language used to work with data stored in tables. FoxPro supports SQL commands. The FoxPro SQL commands make use of Rushmore technology to optimize performance, and a single SQL command can be used to replace multiple FoxPro commands.


starting value

The value assigned to the index variable on the first pass through a loop.


start up

To get the system running by reading an operating system program from the disk and then running an application.


Startup Items

On a Macintosh, everything in the STARTUP ITEMS folder (located in the SYSTEM folder). All items in the STARTUP ITEMS folder, including application programs, documents, and desk accessories, will be opened when you start your computer.


statement

One or more lines of program code related to a single command.


string

An item of information consisting of a sequence of text characters.


string literals

A character string surrounded by single or double quotation mark. For example, "Ohio" or 'Ohio'.


structural compound index

A file created when you include TAG <tag name> without including the optional OF <.CDX file> clause. Also called structural CDX files, they always have the same base name as the table, but they have a CDX extension. A structural compound index file is automatically opened every time the table is opened, and it is automatically updated when the table changes.


style

A variation of a font, such as italic, bold, underline, shadow or outline.


subroutine

A part of a program that can be executed on request from another point in the program and that returns control, on completion, to the point of the request.


subscript

An index number used to identify a particular element of an array.


substring

A string that is part of another string.


Summary band

An area of a report that appears once, at the end of the report.


syntax

(1) The rules governing the structure of statements or instructions in a programming language; (2) A representation of a command that specifies all the possible forms the command can take.


System folder

On a Macintosh, this folder is the location for most system files. The System folder is roughly equivalent to the DOS or BIN directory on a computer running MS-DOS, or the Windows sub directory on a computer running Windows. The System folder contains the Finder and System files, fonts, sounds, and the Apple and Control Panel folders, and system extensions of all types, including printer and network drivers.


system program

A program that makes the resources and capabilities of the computer available for general purposes, such as an operating system or a language translator. See also application.


table field

Any data item contained in a record. One or more fields make up a record in a table, and one or more records make up a table.


tags

Any of the separate index entries contained in a compound index file.


tagging

In lists, selecting the file(s) that an operation will affect. A tagged file appears with a black dot or rectangle to the left of its name. You can tag files individually or in groups.


TeachText

A utility program supplied with Macintosh system software. It functions as a limited word processor and is used primarily for Readme files.


template

A predefined set of instructions designed to create a FoxPro program to perform a specific task.


text editor

The part of FoxPro that allows you to create and modify text and program files.


text file

A file that contains information expressed in text form whose contents are interpreted as characters encoded using the ASCII format. See also binary file.


text object

Text in screens and reports. Text is usually used to convey information, making the screen or report easier to use.


text-editing window

A window in which text is displayed and can be scrolled.


scroll box

A gray box in the scroll bar that indicates the relative position in the text. If you want to move through the text rapidly, you can drag the scroll box up and down.


title band

A report header that prints once at the beginning of a report.


title bar

A horizontal band across the top of a window that displays the window's title.


Top-of-form command

A command causing a printer to feed paper until the paper reaches a preset position relative to the top of a single sheet.


trace

To watch your program code as it executes. You trace programs in order to debug them.


Trash

On a Macintosh, an icon that is usually located in the lower right hand corner of the desktop. The Trash allows you to delete, or discard, unwanted items by placing them in the Trash and then choosing Empty Trash from the Special menu.


TrueType Fonts

On a Macintosh, outline, scalable fonts that maintain correct appearance, at any size, whether output to low- or high-resolution devices.


type-ahead buffer

A buffer that accepts and holds characters that are typed faster than the computer can process them.


unary operator

An operator that applies to a single operand. For example, the minus sign (-) in a negative number such as -6 is a unary arithmetic operator.


unconditional branch

A branch whose execution does not depend on the truth of any condition. See also conditional branch.


unlock

To remove the restriction on the use of a disk or a file so that it can be changed, deleted or renamed. See also lock.


user-defined function

A preprogrammed calculation, created by the user from FoxPro commands. The user-defined function (UDF) can be carried out on request from any point in a FoxPro program. See also function.


user-defined window

A window you create with the DEFINE WINDOW command or through the Screen Designer.


user interface

The rules and conventions by which a computer system communicates with the person operating it.


utilities

Programs that allow you to rename, copy, format, delete, and otherwise manipulate files.


utility screen

A screen designed to be used multiple times throughout an application or in different applications. Utility screens are usually designed to be independent of the structure and context of a particular table.


value

An item of information, such as a number or a string, that can be stored in a variable.


variable

(1) A location in the computer's memory where a value can be stored; (2) The symbol used in a program to represent such a storage location. See also constant.


wildcard

A character that can be used to represent a sequence of characters in a pathname. A common wildcard character is the asterisk (*). As an example, if you request a listing of *.TXT files in a particular application, you would see a list of all files ending with the extension TXT.


window

(1) The area that displays information on the screen. You can open or close a window, move it around on the desktop, and sometimes change its size, scroll through it, and edit its contents; (2) The portion of a collection of information (such as a document, picture or worksheet) that is visible in a viewing area on the display screen.


wordwrap

The automatic continuation of text from the end of one line to the beginning of the next, so that you do not have to press the Return key at the end of each line you type. If wordwrap is set off, the text you type might extend beyond the edge of the window.


work area

A numbered region that identifies a table. By choosing the work area in the View window, you can open the associated table.


wrap around

An option in the Find dialog that tells FoxPro to search for a specified string throughout a file from your present cursor position back to that position, rather than stopping at the end of the file.


zoom

To enlarge a window or a page in the Page Preview window. When you zoom an object that is already enlarged, FoxPro shrinks it to its original size.


zoom box

A window control that you can use to make the window as big as the screen and to change it back again.


system extension

On a Macintosh, items stored in the Extensions folder, within the System folder, that expand the functionality of system software.


font

A distinctive style for letters and numbers. Different fonts make letters and numbers look different. They are used for design and readability.


folder

On a Macintosh, the primary organizing element. Folders contain files, programs, documents, and other folders. Folders are arranged hierarchically.


virtual memory

Hard disk space set aside and used as an extension of the computer's main memory.


volume

On a Macintosh, a disk or part of a disk that functions as storage space. Each volume has its own icon on the desktop. The hard disk and file servers are the most often referred to volumes.


Wizards

Wizards are tools which help you with common database tasks, such as quickly creating tables, queries, screens, and reports. The Wizard asks you a series of questions, and then performs a task based on your answers.


XCMD

On a Macintosh, a code segment written and compiled outside FoxPro for Macintosh. It is typically written in C, Pascal, or assembly language. It is a separately compiled code resource that you load into the Macintosh memory and execute through a call from FoxPro for Macintosh. XCMDs extend functionality.


Help Systems

FoxPro supports two online Help systems:

Graphical Help.

.DBF-style Help.

To decide which of these Help systems to use, and to find out more about some FoxPro Help features, click the topics below.

Note   For information on how to use Help, press F1 now or at any time when using graphical Help.

A Short Tour of Graphical Help

Choosing an Online Help System

Copying Code Examples

Finding Information Quickly

Using .DBF-Style Help


A Short Tour of Graphical Help

See Also

This short tour of graphical Help shows you how to use the Help Table of Contents as a starting point to getting the information you want quickly and easily.

Note   If this window obscures part of the Help window, move and resize the Help window to fit on the right half of your screen so you can see both windows at the same time.

As you continue through this tour, you may need to adjust the position and size of windows that overlap this one.

Help Table of Contents

The Help Table of Contents provides a list of the kinds of topics available in FoxPro Help.

Choose the Contents button in the Help window to display the Help Table of Contents.

The Help Table of Contents is divided into three main sections:

Interface

Language Reference

Additional Reference

Interface

The Interface section of the Help Table of Contents lists interface topics both alphabetically and by the categories menus, windows and dialogs.

For example, to see information on navigating in the FoxPro interface:

1	In the Help Table of Contents, click Interface A-Z.

Help displays an alphabetical list of interface topics.

2	Click the N button in the alphabet near the top of the screen.

3	Click Navigating in the Interface.

Help displays the Navigating in the Interface topic that describes how to accomplish tasks with the keyboard and mouse.

4	Choose the Contents button to return to the Help Table of Contents.

If you want information about an interface item but aren't sure of its name, you can start with one of the three interface categories:

Menus:  The menu topics provide an overview of the FoxPro menu structure.  From here you can display topics on many of the menu options.

Windows:  Most actions in FoxPro, such as viewing data, modifying a table or designing a screen, take place in windows.  The windows topics describe the choices you can make, or the information available to you, when a specific window is active.

Dialogs:  Dialogs are boxes that ask you to make additional choices about an action before the action can take place.  They may include controls such as lists, check boxes or radio buttons.

Language Reference

The Language Reference section of the Help Table of Contents provides entry points to all commands, functions and system memory variables in the FoxPro language.   It also provides a list of commonly used commands and functions [image] a good place to start learning the FoxPro language.

To see categories by which the Command and Function topics are arranged:

1	Click Commands and Functions by Category.

2	Choose the Contents button to return to the Help Table of Contents.

Additional Reference

The Additional Reference section includes topics on subjects such as compatibility and configuring FoxPro to meet your specific needs,  The Miscellaneous section lists a variety of topics on setting colors, Rushmore technology, and so on.  The Additional Reference section also provides an alphabetical list of error messages.

To see a list of miscellaneous topics, in the Help Table of Contents click Miscellaneous.

To see the list of error messages, in the Help Table of Contents click Error Messages.

Viewing related topics

Help topics often include a See Also popup with jumps to related topics.

1	Choose the Contents button to return to the Help Table of Contents.

2	Click System Memory Variables in the Language Reference section.

3	Click _BOX System Memory Variable.

4	In the _BOX topic, click See Also near the top of the screen.

5	In the See Also popup, click DEFINE BOX Command to see a Help topic related to the _BOX System Memory Variable topic.

FoxPro displays the DEFINE BOX Command topic.

6	From here you can:

Choose the Back button to return to the preceding topic (_BOX System Memory Variable).

Choose the Contents button to return to the Help Table of Contents.

Explore additional Help topics on your own.

Note   To close the window displaying this short tour of graphical Help, double-click the Control-menu box in its upper-left corner.


A Short Tour of Help SeeAlso
See Also

Choosing an Online Help System

Copying Code Examples

Finding Information Quickly

Using .DBF-Style Help


Choosing an Online Help System

See Also

FoxPro for Windows gives you the option of using either the graphical or the .DBF-style online Help system.  Although the two Help systems contain the same information, graphical Help provides additional features such as the capability to search for topics by keywords, annotate topics and create bookmarks.

During installation of FoxProWindows, you are prompted to install either one or both Help systems.  If you install both, FoxPro uses graphical Help by default.  You can, however, issue a command to use a different Help system at any time.

Changing Help Systems

To use either Help system, the required Help files must reside on your hard disk:

FOXHELP.HLP for graphical Help.

FOXHELP.DBF and FOXHELP.FPT for .DBF-style Help.

When you install one or both Help systems, these required files are copied to the FoxPro directory or folder on your hard disk.  If the file or files you need are not in this location, copy them from the product disk.

To change Help systems for the current FoxPro session only, specify the alternate Help file in the View window or the Command window.  To change Help systems for all future FoxPro sessions, specify the Help file in the configuration file.

Specifying a Help File in the View Window

1	Open the View window by choosing View from the Window menu or by entering SET in the Command window.

2	Choose the Files icon (a picture of open and closed file folders to the left of the numbered work areas) in the View dialog.

3	Choose the Help File... push button in the View dialog.

4	To change to graphical Help, choose FOXHELP.HLP in the Open File dialog.

To change to .DBF-style Help, choose FOXHELP.DBF in the Open File dialog.

Specifying a Help File in the Command Window

To change to graphical Help, type:
SET HELP TO FOXHELP.HLP

To change to .DBF-style Help, type:
SET HELP TO FOXHELP.DBF

Specifying a Help File in the FoxPro Configuration File

In the FoxPro configuration file, to specify:

graphical Help, use:
HELP = FOXHELP.HLP

.DBF-style Help, use:
HELP = FOXHELP.DBF


Choosing an Online Help System SeeAlso
See Also

A Short Tour of Graphical Help

Copying Code Examples

Finding Information Quickly

Using .DBF-Style Help


Copying Code Examples

See Also

Language Reference topics often provide examples that you may find useful in your own programs.  Instead of retyping the code example, you can copy part or all of the example to the clipboard using the buttons at the top of the Example window.  From the clipboard, you can then paste the selected code into your program.

For instance, if you want to copy part of the code example of the TEXT ... ENDTEXT Command into your program:

1	From the Help menu in FoxPro, choose Contents to display the Help Table of Contents.

2	In the Help Table of Contents, click Commands and Functions A-Z.

3	Click the T button in the alphabet near the top of the screen.

4	Click TEXT ... ENDTEXT Command.

5	Click Example near the top of the TEXT ... ENDTEXT topic.

FoxPro Help displays the TEXT ... ENDTEXT Example window.

6	With the Example window displayed, click the Copy button.

FoxPro displays the Copy dialog.

7	Select the text you want to copy.

Important   You can copy the entire text of the code example to the Clipboard by choosing Copy without selecting any text.  However, although all comments on the code examples are preceded by asterisks (*) that mark them as unexecutable comments, the topic title and any introductory remarks are also copied to the Clipboard and will cause an execution error if inserted into your program without your preceding them with an asterisk.

8	Choose the Copy button in the Copy dialog.

FoxPro copies the selected text to the Clipboard.

9	Display your program code, place the cursor where you want to insert the code example, and choose Paste from the Edit menu.  FoxPro copies the code example to your program.  You can then edit the code to fit your program.

Notes

To close the Copy dialog and the Example window, double-click the Control-menu box in the upper-left corner of each window.

The Copy dialog closes automatically if you choose the Copy button.

If you click the FoxPro window without closing the Copy dialog, the FoxPro window may cover the Help window and the Copy dialog.  If this happens, press Alt+Tab to return to the Copy dialog.


Copying Code Examples See Also
See Also

A Short Tour of Graphical Help

Choosing an Online Help System

Using .DBF-Style Help


Finding Information Quickly

See Also

Getting Help

There are three ways to get Help:

Press F1 or [image] +1 to get context-sensitive Help on the current window, dialog or menu.

Choose Contents or Search for Help on... from the Help menu.

Press Shift+F1 to display the question mark pointer.  Then point at any dialog or menu and click to get context-sensitive Help about that feature.

Searching Help

From the Help window, a good way to look for information is to choose the Search button or press s.  Search is like an automated book index, with hundreds of key words and cross-references.  Follow the directions in the Search dialog to find the information you need.

Keeping Help on Top

By default, the Help window is covered by other windows when you click outside it.  However, you can choose Always on Top from the Help window's Help menu to keep the Help window in view while you work in FoxPro.  Choose Always on Top again to turn the option off.


Finding Information Quickly SeeAlso
See Also

A Short Tour of Graphical Help

Choosing an Online Help System

Copying Code Examples

Using .DBF-Style Help


Using .DBF-Style Help

See Also

The .DBF-style Help window consists of two panels.  One panel lists Help topics and the other displays details about each topic.

Selecting a Topic in the Help Window

To select a topic in the Help window, you can:

Scroll through the topics to find the one you want.

Type a letter or series of letters to select the first topic beginning with those letters.

Displaying Details about a Topic

To display details about a topic, you can:

Select the topic and choose the Help push button.

Select the topic and press Enter or Return.

Double-click the topic with the mouse or the Spacebar.

When finished, you can:

Choose the Topics push button to return to the Help topics list.

Choose the Next push button to see information about the next topic.

Choose the Previous push button to see information about the previous topic.

You can also get Help on a topic by typing HELP and the topic title in the Command window and then pressing Enter or Return.


Using FoxPro for DOS Help SeeAlso
See Also

A Short Tour of Graphical Help

Choosing an Online Help System

Copying Code Examples

Finding Information Quickly


Commands and Functions A-Z

% Operator

& Function

$ Function

= Command

\ | \\ Commands

? | ?? Commands

??? Command

@

@ ... BOX Command

@ ... CLEAR Command

@ ... EDIT - Text Edit Regions Command

@ ... FILL Command

@ ... GET Command

@ ... GET - Check Boxes Command

@ ... GET - Invisible Buttons Command

@ ... GET - Lists Command

@ ... GET - Popups Command

@ ... GET - Push Buttons Command

@ ... GET - Radio Buttons Command

@ ... GET - Spinners Command

@ ... MENU Command

@ ... PROMPT Command

@ ... SAY Command

@ ... SAY - BMPs & OLE Objects Command

@ ... SCROLL Command

@ ... TO Command

A

ABS( ) Function

ACCEPT Command

ACOPY( ) Function

ACOS( ) Function

ACTIVATE MENU Command

ACTIVATE POPUP Command

ACTIVATE SCREEN Command

ACTIVATE WINDOW Command

ADEL( ) Function

ADIR( ) Function

AELEMENT( ) Function

AFIELDS( ) Function

AFONT( ) Function

AINS( ) Function

ALEN( ) Function

ALIAS( ) Function

ALLTRIM( ) Function

ANSITOOEM( ) Function

APPEND Command

APPEND FROM Command

APPEND FROM ARRAY Command

APPEND GENERAL Command

APPEND MEMO Command

ASC( ) Function

ASCAN( ) Function

ASIN( ) Function

ASORT( ) Function

ASSIST Command

ASUBSCRIPT( ) Function

AT( ) Function

ATAN( ) Function

ATC( ) Function

ATCLINE( ) Function

ATLINE( ) Function

ATN2( ) Function

AVERAGE Command

B

BAR( ) Function

BARPROMPT( ) Function

BETWEEN( ) Function

BLANK Command

BOF( ) Function

BROWSE Command

BUILD APP Command

BUILD EXE Command

BUILD PROJECT Command

C

CALCULATE Command

CALL Command

CANCEL Command

CAPSLOCK( ) Function

CDOW( ) Function

CDX( ) Function

CEILING( ) Function

CHANGE Command

CHR( ) Function

CHRSAW( ) Function

CHRTRAN( ) Function

CLEAR Commands

CLOSE Commands

CLOSE MEMO Command

CMONTH( ) Function

CNTBAR( ) Function

CNTPAD( ) Function

COL( ) Function

COMPILE Command

CONTINUE Command

Controls Overview

COPY FILE Command

COPY INDEXES Command

COPY MEMO Command

COPY STRUCTURE Command

COPY STRUCTURE EXTENDED Command

COPY TAG Command

COPY TO Command

COPY TO ARRAY Command

COS( ) Function

COUNT Command

CPCONVERT( ) Function

CPCURRENT( ) Function

CPDBF( ) Function

CREATE Command

CREATE COLOR SET Command

CREATE CURSOR Command - SQL

CREATE FROM Command

CREATE LABEL Command

CREATE MENU Command

CREATE PROJECT Command

CREATE QUERY Command

CREATE REPORT Command

CREATE REPORT Command - Quick Report

CREATE SCREEN Command

CREATE SCREEN Command - Quick Screen

CREATE TABLE Command - SQL

CREATE VIEW Command

CTOD( ) Function

CURDIR( ) Function

D

DATE( ) Function

DAY( ) Function

DBF( ) Function

DDE Functions

DDEAbortTrans( ) Function

DDEAdvise( ) Function

DDEEnabled( ) Function

DDEExecute( ) Function

DDEInitiate( ) Function

DDELastError( ) Function

DDEPoke( ) Function

DDERequest( ) Function

DDESetOption( ) Function

DDESetService( ) Function

DDESetTopic( ) Function

DDETerminate( ) Function

DEACTIVATE MENU Command

DEACTIVATE POPUP Command

DEACTIVATE WINDOW Command

DECLARE Command

#DEFINE ... #UNDEF Preprocessor Directives

DEFINE BAR Command

DEFINE BOX Command

DEFINE MENU Command

DEFINE PAD Command

DEFINE POPUP Command

DEFINE WINDOW Command

DELETE Command

DELETE FILE Command

DELETE TAG Command

DELETED( ) Function

DESCENDING( ) Function

DIFFERENCE( ) Function

DIMENSION Command

DIR or DIRECTORY Command

DISKSPACE( ) Function

DISPLAY Command

DISPLAY FILES Command

DISPLAY MEMORY Command

DISPLAY STATUS Command

DISPLAY STRUCTURE Command

DMY( ) Function

DO Command

DO CASE ... ENDCASE Command

DO WHILE ... ENDDO Command

DOW( ) Function

DTOC( ) Function

DTOR( ) Function

DTOS( ) Function

E

EDIT Command

EJECT Command

EJECT PAGE Command

EMPTY( ) Function

EOF( ) Function

ERASE Command

ERROR( ) Function

EVALUATE( ) Function

EXIT Command

EXP( ) Function

EXPORT Command

EXTERNAL Command

F

FCHSIZE( ) Function

FCLOSE( ) Function

FCOUNT( ) Function

FCREATE( ) Function

FDATE( ) Function

FEOF( ) Function

FERROR( ) Function

FFLUSH( ) Function

FGETS( ) Function

FIELD( ) Function

FILE( ) Function

FILER Command

FILTER( ) Function

FIND Command

FKLABEL( ) Function

FKMAX( ) Function

FLDLIST( ) Function

FLOCK( ) Function

FLOOR( ) Function

FLUSH Command

FONTMETRIC( ) Function

FOPEN( ) Function

FOR( ) Function

FOR ... ENDFOR Command

FOUND( ) Function

FPUTS( ) Function

FREAD( ) Function

FSEEK( ) Function

FSIZE( ) Function

FTIME( ) Function

FULLPATH( ) Function

FUNCTION Command

FV( ) Function

FWRITE( ) Function

G

GATHER Command

GETBAR( ) Function

GETDIR( ) Function

GETENV( ) Function

GETEXPR Command

GETFILE( ) Function

GETFONT( ) Function

GETPAD( ) Function

GO/GOTO Commands

GOMONTH( ) Function

H

HEADER( ) Function

HELP Command

HIDE MENU Command

HIDE POPUP Command

HIDE WINDOW Command

HOME( ) Function

I

IDXCOLLATE( ) Function

#IF ... #ENDIF Preprocessor Directive

IF ... ENDIF Command

IIF( ) Function

IMPORT Command

INDEX Command

INKEY( ) Function

INLIST( ) Function

INPUT Command

INSERT Command

INSERT Command - SQL

INSMODE( ) Function

INT( ) Function

ISALPHA( ) Function

ISBLANK( ) Function

ISCOLOR( ) Function

ISDIGIT( ) Function

ISLOWER( ) Function

ISREADONLY( ) Function

ISUPPER( ) Function

J

JOIN Command

K

KEY( ) Function

KEYBOARD Command

KEYMATCH( ) Function

L

LABEL Command

LASTKEY( ) Function

LEFT( ) Function

LEN( ) Function

LIKE( ) Function

LINENO( ) Function

LIST Commands

LOAD Command

LOCATE Command

LOCFILE( ) Function

LOCK( ) Function

LOG( ) Function

LOG10( ) Function

LOOKUP( ) Function

LOWER( ) Function

LTRIM( ) Function

LUPDATE( ) Function

M

MAX( ) Function

MCOL( ) Function

MDOWN( ) Function

MDX( ) Function

MDY( ) Function

MEMLINES( ) Function

MEMORY( ) Function

MENU Command

MENU - System Menu Names

MENU TO Command

MENU( ) Function

MESSAGE( ) Function

MIN( ) Function

MLINE( ) Function

MOD( ) Function

MODIFY COMMAND / MODIFY FILE Commands

MODIFY GENERAL Command

MODIFY LABEL Command

MODIFY MEMO Command

MODIFY MENU Command

MODIFY PROJECT Command

MODIFY QUERY Command

MODIFY REPORT Command

MODIFY SCREEN Command

MODIFY STRUCTURE Command

MODIFY WINDOW Command

MONTH( ) Function

MOVE POPUP Command

MOVE WINDOW Command

MRKBAR( ) Function

MRKPAD( ) Function

MROW( ) Function

MWINDOW( ) Function

N

NDX( ) Function

NOTE | * | && Commands

NORMALIZE Function

NUMLOCK( ) Function

O

OBJNUM( ) Function

OBJVAR( ) Function

OCCURS( ) Function

OEMTOANSI( ) Function

ON APLABOUT Command

ON BAR Command

ON ERROR Command

ON ESCAPE Command

ON EXIT BAR Command

ON EXIT MENU Command

ON EXIT PAD Command

ON EXIT POPUP Command

ON KEY Command

ON KEY = Command

ON KEY LABEL Command

ON MACHELP Command

ON PAD Command

ON PAGE Command

ON READERROR Command

ON SELECTION BAR Command

ON SELECTION MENU Command

ON SELECTION PAD Command

ON SELECTION POPUP Command

ON SHUTDOWN Command

ON( ) Function

ORDER( ) Function

OS( ) Function

P

PACK Command

PAD( ) Function

PADC( ) | PADL( ) | PADR( ) Functions

PARAMETERS Command

PARAMETERS( ) Function

PAYMENT( ) Function

PCOL( ) Function

PI( ) Function

PLAY MACRO Command

POP KEY Command

POP MENU Command

POP POPUP Command

POPUP( ) Function

PRINTJOB ... ENDPRINTJOB Command

PRINTSTATUS( ) Function

PRIVATE Command

PRMBAR( ) Function

PRMPAD( ) Function

PROCEDURE Command

PROGRAM( ) Function

PROMPT( ) Function

PROPER( ) Function

PROW( ) Function

PRTINFO( ) Function

PUBLIC Command

PUSH KEY Command

PUSH MENU Command

PUSH POPUP Command

PUTFILE( ) Function

PV( ) Function

Q

QUIT Command

R

RAND( ) Function

RAT( ) Function

RATLINE( ) Function

RDLEVEL( ) Function

READ Command

READ MENU Command

READKEY( ) Function

RECALL Command

RECCOUNT( ) Function

RECNO( ) Function

RECSIZE( ) Function

REGIONAL Preprocessor Directive

REINDEX Command

RELATION( ) Function

RELEASE Commands

RELEASE MODULE Command

RENAME Command

REPLACE Command

REPLACE FROM ARRAY Command

REPLICATE( ) Function

REPORT Command

RESTORE FROM Command

RESTORE MACROS Command

RESTORE SCREEN Command

RESTORE WINDOW Command

RESUME Command

RETRY Command

RETURN Command

RGBSCHEME( ) Function

RIGHT( ) Function

RLOCK( ) Function

ROUND( ) Function

ROW( ) Function

RTOD( ) Function

RTRIM( ) Function

RUN | ! Command

RUNSCRIPT

S

SAVE MACROS Command

SAVE SCREEN Command

SAVE TO Command

SAVE WINDOWS Command

SCAN ... ENDSCAN Command

SCATTER Command

SCHEME( ) Function

SCOLS( ) Function

SCROLL Command

SECONDS( ) Function

SEEK Command

SEEK( ) Function

SELECT Command

SELECT( ) Function

SELECT Command - SQL

SET Command

SET ALTERNATE Commands

SET ANSI Command

SET APLABOUT Command

SET AUTOSAVE Command

SET BELL Command

SET BLINK Command

SET BLOCKSIZE Command

SET BORDER Command

SET BRSTATUS Command

SET CARRY Command

SET CENTURY Command

SET CLEAR Command

SET CLOCK Command

SET COLLATE Command

SET COLOR Commands Overview

SET COLOR OF Command

SET COLOR OF SCHEME Command

SET COLOR SET Command

SET COLOR TO Command

SET COMPATIBLE Command

SET CONFIRM Command

SET CONSOLE Command

SET CPCOMPILE Command

SET CPDIALOG Command

SET CURRENCY Command

SET CURSOR Command

SET DATE Command

SET DEBUG Command

SET DECIMALS Command

SET DEFAULT Command

SET DELETED Command

SET DELIMITERS Command

SET DEVELOPMENT Command

SET DEVICE Command

SET DISPLAY Command

SET DOHISTORY Command

SET ECHO Command

SET ESCAPE Command

SET EXACT Command

SET EXCLUSIVE Command

SET FIELDS Command

SET FILTER Command

SET FIXED Command

SET FORMAT Command

SET FULLPATH Command

SET FUNCTION Command

SET HEADINGS Command

SET HELP Command

SET HELPFILTER Command

SET HOURS Command

SET INDEX Command

SET INTENSITY Command

SET KEY Command

SET KEYCOMP Command

SET LIBRARY Command

SET LOCK Command

SET LOGERRORS Command

SET MACDESKTOP Command

SET MACHELP Command

SET MACKEY Command

SET MARGIN Command

SET MARK OF Commands

SET MARK TO Command

SET MEMOWIDTH Command

SET MESSAGE Command

SET MOUSE Command

SET MULTILOCKS Command

SET NEAR Command

SET NOCPTRANS Command

SET NOTIFY Command

SET ODOMETER Command

SET OPTIMIZE Command

SET ORDER Command

SET PALETTE Command

SET PATH Command

SET PDSETUP Command

SET POINT Command

SET PRINTER Commands

SET PROCEDURE Command

SET READBORDER Command

SET REFRESH Command

SET RELATION Command

SET RELATION OFF Command

SET REPROCESS Command

SET RESOURCE Command

SET SAFETY Command

SET SCOREBOARD Command

SET SEPARATOR Command

SET SHADOWS Command

SET SKIP Command

SET SKIP OF Command

SET SPACE Command

SET STATUS Command

SET STATUS BAR Command

SET STEP Command

SET STICKY Command

SET SYSMENU Command

SET TALK Command

SET TEXTMERGE Command

SET TEXTMERGE DELIMITERS Command

SET TOPIC Command

SET TRBETWEEN Command

SET TYPEAHEAD Command

SET UDFPARMS Command

SET UNIQUE Command

SET VIEW Command

SET VOLUME Command

SET WINDOW OF MEMO Command

SET XCMDFILE Command

SET( ) Function

SHOW GET Command

SHOW GETS Command

SHOW MENU Command

SHOW OBJECT Command

SHOW POPUP Command

SHOW WINDOW Command

SIGN( ) Function

SIN( ) Function

SIZE POPUP Command

SKIP Command

SKPBAR( ) Function

SKPPAD( ) Function

SORT Command

SOUNDEX( ) Function

SPACE( ) Function

SQL Commands Overview

SQRT( ) Function

SROWS( ) Function

STORE Command

STR( ) Function

STRTRAN( ) Function

STUFF( ) Function

SUBSTR( ) Function

SUM Command

SUSPEND Command

SYS( ) Functions Overview

SYS(0) Function - Network Machine Number

SYS(1) Function - Julian System Date

SYS(2) Function - Seconds Since Midnight

SYS(3) Function - Unique File Name

SYS(5) Function - Default Drive

SYS(6) Function - Current Printer Device

SYS(7) Function - Current Format File

SYS(9) Function - FoxPro Serial Number

SYS(10) Function - String From Day Number

SYS(11) Function - Julian Day Number

SYS(12) Function - Available Memory in Bytes

SYS(13) Function - Printer Status

SYS(14) Function - Index Expression

SYS(15) Function - Character Translation

SYS(16) Function - Executing Program File Name

SYS(17) Function - Processor in Use

SYS(18) Function - Current @ ... GET Field or  Object

SYS(20) Function - Transform German Text

SYS(21) Function - Controlling Index Number

SYS(22) Function - Controlling Tag or Index Name

SYS(23) Function - FoxPro EMS Memory Usage

SYS(24) Function - EMS Memory Limit

SYS(100) Function - Console Setting

SYS(101) Function - Device Setting

SYS(102) Function - Printer Setting

SYS(103) Function - Talk Setting

SYS(1001) Function - FoxPro Memory

SYS(1016) Function - User Object Memory Use

SYS(1037) - Print Setup Dialog

SYS(2000) Function - File Name Wildcard Match

SYS(2001) Function - SET ... Command Status

SYS(2002) Function - Turn Cursor On or Off

SYS(2003) Function - Current Directory

SYS(2004) Function - FoxPro Start Directory

SYS(2005) Function - Current Resource File

SYS(2006) Function - Current Graphics Card

SYS(2007) Function - Check Sum Value

SYS(2008) Function - Cursor Shape

SYS(2009) Function - Swap Cursor Shape

SYS(2010) Function - CONFIG.SYS File Settings

SYS(2011) Function - Current Lock Status

SYS(2012) Function - Memo Field Blocksize

SYS(2013) Function - System Menu Name String

SYS(2014) Function - Minimum Path

SYS(2015) Function - Unique Procedure Name

SYS(2016) Function - SHOW GETS WINDOW Name

SYS(2017) Function - Display Sign-On Screen

SYS(2018) Function - Error Message Parameter

SYS(2019) Function - Configuration File Name and Location

SYS(2020) Function - Default Disk Size

SYS(2021) Function - Filtered Index Expression

SYS(2022) Function - Disk Cluster Size

SYS(2023) Function - Temporary File Drive

SYS(2027) Function - Platform Specific Path Conversion

SYSMETRIC( ) Function

T

TAG( ) Function

TAGCOUNT( ) Function

TAGNO( ) Function

TAN( ) Function

TARGET( ) Function

TEXT ... ENDTEXT Command

TIME( ) Function

TOTAL Command

TRANSFORM( ) Function

TRIM( ) Function

TXTWIDTH( ) Function

TYPE Command

TYPE( ) Function

U

UNLOCK Command

UPDATE Command

UPDATED( ) Function

UPPER( ) Function

USE Command

USED( ) Function

User-Defined Functions (UDFs)

V

VAL( ) Function

VARREAD( ) Function

VERSION( ) Function

W

WAIT Command

WBORDER( ) Function

WCHILD( ) Function

WCOLS( ) Function

WEXIST( ) Function

WFONT( ) Function

WLAST( ) Function

WLCOL( ) Function

WLROW( ) Function

WMAXIMUM( ) Function

WMINIMUM( ) Function

WONTOP( ) Function

WOUTPUT( ) Function

WPARENT( ) Function

WREAD( ) Function

WROWS( ) Function

WTITLE( ) Function

WVISIBLE( ) Function

XYZ

YEAR( ) Function

ZAP Command

ZOOM WINDOW Command


System Memory Variables

System Memory Variables Overview

_ASSIST System Memory Variable

_ALIGNMENT System Memory Variable

_BEAUTIFY System Memory Variable

_BOX System Memory Variable

_CALCMEM System Memory Variable

_CALCVALUE System Memory Variable

_CLIPTEXT System Memory Variable

_CUROBJ System Memory Variable

_DBLCLICK System Memory Variable

_DIARYDATE System Memory Variable

_DOS System Memory Variable

_FOXDOC System Memory Variable

_FOXGRAPH System Memory Variable

_GENGRAPH System Memory Variable

_GENMENU System Memory Variable

_GENPD System Memory Variable

_GENSCRN System Memory Variable

_GENXTAB System Memory Variable

_INDENT System Memory Variable

_LMARGIN System Memory Variable

_MAC System Memory Variable

_MLINE System Memory Variable

_PADVANCE System Memory Variable

_PAGENO System Memory Variable

_PBPAGE System Memory Variable

_PCOLNO System Memory Variable

_PCOPIES System Memory Variable

_PDRIVER System Memory Variable

_PDSETUP System Memory Variable

_PECODE System Memory Variable

_PEJECT System Memory Variable

_PEPAGE System Memory Variable

_PLENGTH System Memory Variable

_PLINENO System Memory Variable

_PLOFFSET System Memory Variable

_PPITCH System Memory Variable

_PQUALITY System Memory Variable

_PRETEXT System Memory Variable

_PSCODE System Memory Variable

_PSPACING System Memory Variable

_PWAIT System Memory Variable

_RMARGIN System Memory Variable

_SHELL System Memory Variable

_SPELLCHECK System Memory Variable

_STARTUP System Memory Variable

_TABS System Memory Variable

_TALLY System Memory Variable

_TEXT System Memory Variable

_THROTTLE System Memory Variable

_TRANSPORT System Memory Variable

_UNIX System Memory Variable

_WINDOWS System Memory Variable

_WRAP System Memory Variable


Commands and Functions by Category

Data Types Character Functions Data Conversion Functions  Date and Time Functions Numeric Functions Databases Field Manipulation Indexes Record Manipulation Relations Table Manipulation FoxPro Environment Environment File Management	Input and Output Data Formatting Menu Bars and Popups Printing Reports and Labels Typing, Keyboard and Mouse Windows FoxPro in a Multi-User Environment FoxPro in a Multi-User Environment Programming Array Manipulation Debugging and Error Handling Event Handlers Low-Level File Functions Memory Variable Manipulation Program Execution Structured Programming Obsolete Commands and Functions Obsolete Commands and Functions


Character Functions

The entries in this category operate on character type data.

$ Function ALLTRIM( ) Function ASC( ) Function AT( ) Function ATC( ) Function ATCLINE( ) Function ATLINE( ) Function BETWEEN( ) Function CHR( ) Function CHRTRAN( ) Function CPCONVERT( ) CTOD( ) Function DIFFERENCE( ) Function DTOC( ) Function EMPTY( ) Function EVALUATE( ) Function INLIST( ) Function ISALPHA( ) Function ISDIGIT( ) Function ISLOWER( ) Function ISUPPER( ) Function LEFT( ) Function LEN( ) Function LIKE( ) Function LOWER( ) Function LTRIM( ) Function MAX( ) Function MIN( ) Function NORMALIZE( ) Function	OCCURS( ) Function PADC( ) Function PADL( ) Function PADR( ) Function PROPER( ) Function RAT( ) Function RATLINE( ) Function REPLICATE( ) Function RIGHT( ) Function RTRIM( ) Function SOUNDEX( ) Function SPACE( ) Function STR( ) Function STRTRAN( ) Function STUFF( ) Function SUBSTR( ) Function SYS(10) Function - String From Day Number SYS(15) Function - Character Translation SYS(2007) Function - Check Sum Value TRANSFORM( ) Function TRIM( ) Function TXTWIDTH( ) Function TYPE( ) Function UPPER( ) Function


Numeric Functions

The entries in this category operate on and/or return numeric data.

% Operator ABS( ) Function ACOS( ) Function ASIN( ) Function ATAN( ) Function ATN2( ) Function BETWEEN( ) Function CALCULATE Command CEILING( ) Function COS( ) Function DTOR( ) Function EMPTY( ) Function EXP( ) Function FLOOR( ) Function FV( ) Function INT( ) Function	LOG( ) Function LOG10( ) Function MAX( ) Function MIN( ) Function MOD( ) Function PAYMENT( ) Function PI( ) Function PV( ) Function RAND( ) Function ROUND( ) Function RTOD( ) Function SET DECIMALS Command SIGN( ) Function SIN( ) Function SQRT( ) Function TAN( ) Function VAL( ) Function


Date and Time Functions

The entries in this category allow you to generate and manipulate date and time data.

BETWEEN( ) Function CDOW( ) Function CMONTH( ) Function CTOD( ) Function DATE( ) Function DAY( ) Function DMY( ) Function DOW( ) Function DTOC( ) Function DTOS( ) Function EMPTY( ) Function GOMONTH( ) Function INLIST( ) Function MAX( ) Function MDY( ) Function MIN( ) Function	MONTH( ) Function SECONDS( ) Function SET HOURS Command SET MARK TO Command SYS(1) Function - Julian System Date SYS(2) Function - Seconds Since Midnight SYS(10) Function - String From Day Number SYS(11) Function - Julian Day Number TIME( ) Function YEAR( ) Function


Data Conversion Functions

The functions in this category convert data from one type to another.

CHR( ) Function

CTOD( ) Function

SYS(10) Function - String From Day Number

SYS(15) Function - Character Translation

TRANSFORM( ) Function

VAL( ) Function


Field Manipulation

This category contains commands and functions that allow you to manipulate table/.DBF fields.

AFIELDS( ) Function

BLANK Command

DELETED( ) Function

FCOUNT( ) Function

FIELD( ) Function

FLDLIST( ) Function

FSIZE( ) Function

GATHER Command

ISBLANK( ) Function

LUPDATE( ) Function

NDX( ) Function

SCATTER Command

SET BLOCKSIZE Command

SET EXACT Command

SET NOCPTRANS Command

SET TEXTMERGE Command

SET TEXTMERGE DELIMITERS Command

SYS(14) Function - Index Expression


Table Manipulation

The entries in this section allow you to create, manipulate and monitor table/.DBF files.

APPEND Command AVERAGE Command BROWSE Command CHANGE Command CLOSE DATABASES Command COPY MEMO Command COPY STRUCTURE Command COPY STRUCTURE EXTENDED Command COPY TO Command COUNT Command CPCURRENT( ) Function CPDBF( ) Function CREATE Command CREATE FROM Command CREATE QUERY Command CREATE TABLE Command - SQL DELETE Command DELETED( ) Function DISPLAY STRUCTURE Command EDIT Command EXPORT Command FLUSH Command IMPORT Command	ISREADONLY( ) Function MEMLINES( ) Function MLINE( ) Function MODIFY GENERAL Command MODIFY MEMO Command MODIFY QUERY Command MODIFY STRUCTURE Command PACK Command RECALL Command REPLACE Command REPLACE FROM ARRAY Command SELECT Command SELECT Command - SQL SET ANSI Command SET AUTOSAVE Command SET DELETED Command SET FIELDS Command SET OPTIMIZE Command SORT Command SUM Command TOTAL Command UPDATE Command USE Command USED( ) Function ZAP Command


Record Manipulation

The commands and functions under this heading allow you to select records within a table/.DBF or position the record pointer.

APPEND FROM Command

APPEND MEMO Command

BLANK Command

CONTINUE Command

FILTER( ) Function

GO/GOTO Commands

INSERT Command

INSERT Command - SQL

ISBLANK( ) Function

KEYMATCH( ) Function

LOCATE Command

LOOKUP( ) Function

REPLACE FROM ARRAY Command

SEEK Command

SEEK( ) Function

SET COLLATE Command

SET FILTER Command

SET KEY Command

SET NEAR Command

SET RELATION Command

SKIP Command


Indexes

The commands and functions under this entry perform operations on and return information about index files.

CDX( ) Function

CLOSE INDEXES Command

COPY INDEXES Command

COPY TAG Command

DESCENDING( ) Function

DELETE TAG Command

FOR( ) Function

IDXCOLLATE( ) Function

INDEX Command

KEY( ) Function

KEYMATCH( ) Function

MDX( ) Function

NDX( ) Function

ORDER( ) Function

REINDEX Command

SET COLLATE Command

SET INDEX Command

SET KEY Command

SET ORDER Command

SET UNIQUE Command

SYS(14) Function - Index Expression

SYS(21) Function - Controlling Index Number

SYS(2021) Function - Filtered Index Expression

TAG( ) Function

TAGCOUNT( ) Function

TAGNO( ) Function

UNIQUE( ) Function


Relations

The commands and functions in this category allow you to establish or break relations between table/.DBF files.

RELATION( ) Function

SELECT Command - SQL

SET RELATION Command

SET RELATION OFF Command

SET SKIP Command

TARGET( ) Function


Debugging and Error Handling

The following commands and functions perform various debugging operations with FoxPro programs.

ERROR( ) Function

EXTERNAL Command

LINENO( ) Function

MESSAGE( ) Function

NOTE | * | && Commands

ON ERROR Command

ON READERROR Command

ON( ) Function

PROGRAM( ) Function

RETRY Command

SET DEBUG Command

SET DEVELOPMENT Command

SET ECHO Command

SET TALK Command

SET TRBETWEEN Command

SYS(16) Function - Executing Program File Name

SYS(18) Function - Current @ ... GET Field or  Object

SYS(2018) Function - Error Message Parameter

VARREAD( ) Function

WAIT Command


Program Execution

The following commands and functions perform actions associated with executing, suspending and terminating FoxPro programs.

BUILD APP Command BUILD EXE Command BUILD PROJECT Command CALL Command CANCEL Command CLEAR PROGRAM Command CLOSE ALL Command CLOSE PROCEDURE Command COMPILE Command CREATE PROJECT Command #DEFINE ... #UNDEF Preprocessor Directives DO Command FUNCTION Command #IF ... #ENDIF Preprocessor Directive LOAD Command MODIFY PROJECT Command PARAMETERS Command PARAMETERS( ) Function	PROCEDURE Command RELEASE MODULE Command RESUME Command RETURN Command RUN | ! Commands SET ESCAPE Command SET LIBRARY Command SET LOGERRORS Command SET PROCEDURE Command SET SYSMENU Command SET UDFPARMS Command SET VOLUME SET XCMDFILE SUSPEND Command SYS(2015) Function - Unique Procedure Name WAIT Command


Structured Programming

These commands and functions are used to control program execution and branching within a FoxPro program.

DO CASE ... ENDCASE Command

DO WHILE ... ENDDO Command

EXIT Command

FOR ... ENDFOR Command

#IF ... #ENDIF Preprocessor Directive

IF ... ENDIF Command

IIF( ) Function

SCAN ... ENDSCAN Command


Low-Level File Functions

The following functions are available in FoxPro to manipulate files and communication ports at a low level. Low-level file functions should be used carefully, especially when manipulating table/.DBF files. Test sample files before using these functions on files that contain important data.

FCHSIZE( ) Function

FCLOSE( ) Function

FCREATE( ) Function

FEOF( ) Function

FERROR( ) Function

FFLUSH( ) Function

FGETS( ) Function

FOPEN( ) Function

FPUTS( ) Function

FREAD( ) Function

FSEEK( ) Function

FWRITE( ) Function

HEADER( ) Function


Memory Variable Manipulation

The commands and functions in this category allow you to assign values to memory variables.

& Function = Command ACOPY( ) Function ADEL( ) Function ADIR( ) Function AELEMENT( ) Function AFIELDS( ) Function AINS( ) Function LEN( ) Function ASCAN( ) Function ASORT( ) Function ASUBSCRIPT( ) Function AVERAGE Command CLEAR ALL Command CLEAR MEMORY Command COUNT Command	DISPLAY MEMORY Command GETEXPR Command LIST MEMORY Command PARAMETERS Command PRIVATE Command PUBLIC Command REGIONAL Preprocessor Directive RELEASE Command RESTORE FROM Command SAVE TO Command STORE Command SUM Command WAIT Command


Array Manipulation

This category allows you to work with arrays of memory variables.

ACOPY( ) Function

ADEL( ) Function

ADIR( ) Function

AELEMENT( ) Function

AFIELDS( ) Function

AINS( ) Function

ALEN( ) Function

APPEND FROM ARRAY Command

ASCAN( ) Function

ASORT( ) Function

ASUBSCRIPT( ) Function

COPY TO ARRAY Command

DECLARE Command

DIMENSION Command

GATHER Command

SCATTER Command


Event Handlers

These commands specify the action to take when a given event occurs.

ON APLABOUT Command

ON ERROR Command

ON ESCAPE Command

ON KEY Command

ON KEY LABEL Command

ON MACHELP Command

ON PAD Command

ON SELECTION PAD Command

ON SELECTION POPUP Command

ON( ) Function


Data Formatting

These commands and functions allow the formatting and display of data from records, fields, memory variables or arrays to the screen or a window.  Entries under this heading also include general screen or window display features.

\ | \\ Commands ? | ?? Commands @ ... GET - Check Boxes Command @ ... GET - Invisible Buttons Command @ ... GET - Lists Command @ ... GET - Popups Command @ ... GET - Push Buttons Command @ ... GET - Radio Buttons Command @ ... GET - Spinners Command @ ... EDIT - Text Edit Regions Command @ ... BOX Command @ ... CLEAR Command @ ... FILL Command @ ... GET Command @ ... SAY Command @ ... SCROLL Command @ ... TO Command ACTIVATE SCREEN Command APPEND Command BROWSE Command CHANGE Command CLEAR Commands CLEAR READ Command CLOSE FORMAT Command COL( ) Function CREATE SCREEN Command DISPLAY Command EDIT Command FUNCTION Command INKEY( ) Function LIST Command MODIFY SCREEN Command OBJNUM( ) Function OBJVAR( ) Function RDLEVEL( ) Function READ Command READKEY( ) Function RESTORE SCREEN Command ROW( ) Function SAVE SCREEN Command	SCOLS( ) Function SCROLL Command SET BLINK Command SET CARRY Command SET CLEAR Command SET COLOR OF Command SET COLOR OF SCHEME Command SET COLOR SET Command SET COLOR TO Command SET CONFIRM Command SET CONSOLE Command SET CURSOR Command SET DECIMALS Command SET DEVICE Command SET FIXED Command SET FORMAT Command SET HEADINGS Command SET MARK TO Command SET MEMOWIDTH Command SET MESSAGE Command SET ODOMETER Command SET SPACE Command SET TEXTMERGE Command SET TEXTMERGE DELIMITERS Command SHOW GET Command SHOW GETS Command SHOW OBJECT Command SROWS( ) Function SYS(7) Function - Current Format File SYS(100) Function - Console Setting SYS(101) Function - Device Setting SYS(2002) Function - Turn Cursor On or Off TEXT ... ENDTEXT Command TRANSFORM( ) Function UPDATED( ) Function


Printing

These commands and functions are used to print or display data from records or memory variables on the screen, to a printer or to an output file.

\ | \\ Commands ? | ?? Commands ??? Command @ ... SAY Command CLOSE ALTERNATE Command DEFINE BOX Command DISPLAY Command EJECT Command EJECT PAGE Command LIST Command ON PAGE Command PCOL( ) Function PRINTJOB ... ENDPRINTJOB Command	PRINTSTATUS( ) Function PROW( ) Function PRTINFO( ) Function SET MARGIN Command SET PDSETUP Command SET PRINTER Commands SYS(6) Function - Current Printer Device SYS(13) Function - Printer Status SYS(102) Function - Printer Setting SYS(1037) - Print Setup Dialog TYPE Command


Menu Bars and Popups

These commands and functions are used for the development, display and activation of user-defined menu bars and popups.

\ | \\ Commands @ ... GET - Popups Command ACTIVATE POPUP Command BAR( ) Function BARPROMPT( ) Function CLEAR MENUS Command CLEAR POPUPS Command CNTBAR( ) Function CNTPAD( ) Function CREATE MENU Command DEACTIVATE MENU Command DEACTIVATE POPUP Command DEFINE BAR Command DEFINE MENU Command DEFINE PAD Command DEFINE POPUP Command GETBAR( ) Function GETPAD( ) Function HIDE MENU Command HIDE POPUP Command MODIFY MENU Command MOVE POPUP Command MRKBAR( ) Function MRKPAD( ) Function ON BAR Command ON EXIT BAR Command ON EXIT MENU Command ON EXIT PAD Command ON EXIT POPUP Command	ON PAD Command ON SELECTION BAR Command ON SELECTION MENU Command ON SELECTION PAD Command ON SELECTION POPUP Command PAD( ) Function POP MENU Command POP POPUP Command POPUP( ) Function PRMBAR( ) Function PRMPAD( ) Function PROMPT( ) Function PUSH MENU Command PUSH POPUP Command RELEASE BAR Command RELEASE MENUS Command RELEASE PAD Command RELEASE POPUPS Command SET BORDER Command SET MARK OF Command SET SKIP OF Command SIZE POPUP Command SKPBAR ( ) Function SKPPAD ( ) Function SHOW MENU Command SHOW POPUP Command SYS(2013) Function - System Menu Name String


Windows

These commands and functions are used for the development, display and activation of user-defined windows.

ACTIVATE WINDOW Command CLEAR WINDOWS Command CREATE SCREEN Command DEACTIVATE WINDOW Command DEFINE WINDOW Command HIDE WINDOW Command MODIFY SCREEN Command MODIFY WINDOW Command MOVE WINDOW Command RELEASE WINDOWS Command RESTORE WINDOW Command SAVE WINDOWS Command SET BORDER Command SET SHADOWS Command SET WINDOW OF MEMO Command	SHOW WINDOW Command SYS(2016) Function - SHOW GETS WINDOW Name WBORDER( ) Function WCHILD( ) Function WCOLS( ) Function WEXIST( ) Function WFONT( ) Function WLAST( ) Function WLCOL( ) Function WLROW( ) Function WMAXIMUM( ) Function WMINIMUM( ) Function WONTOP( ) Function WOUTPUT( ) Function WPARENT( ) Function WREAD( ) Function WROWS( ) Function WTITLE( ) Function WVISIBLE( ) Function ZOOM WINDOW Command


Typing, Keyboard and Mouse

These commands and functions are used with keyboard entry (typing) and the mouse.

CAPSLOCK( ) Function CHRSAW( ) Function CLEAR MACROS Command CLEAR TYPEAHEAD Command INSMODE( ) Function KEYBOARD Command LASTKEY( ) Function MCOL( ) Function MDOWN ( ) Function MROW ( ) Function NUMLOCK ( ) Function ON KEY Command	ON KEY LABEL Command PLAY MACRO Command POP KEY Command PUSH KEY Command RESTORE MACROS Command SAVE MACROS Command SET FUNCTION Command SET KEYCOMP Command SET MACKEY Command SET TYPEAHEAD Command SYS(2008) Function - Cursor Shape SYS(2009) Function - Swap Cursor Shape


Reports and Labels

These commands control report creation and output.

\ | \\ Commands

CREATE LABEL Command

CREATE REPORT Command

LABEL Command

MODIFY LABEL Command

MODIFY REPORT Command

REPORT Command


Environment

These commands and functions allow you to manage a wide range of FoxPro system and environment parameters.

ADIR( ) - SCHEME( )

ADIR( ) Function ASSIST Command CAPSLOCK( ) Function COL( ) Function CREATE COLOR SET Command CREATE VIEW Command DIR or DIRECTORY Command DISKSPACE( ) Function DISPLAY STATUS Command FKLABEL( ) Function FKMAX( ) Function FONTMETRIC( ) Function GETENV( ) Function GETFILE( ) Function GETFONT( ) Function HOME( ) Function HELP Command	INKEY( ) Function INSMODE( ) Function ISCOLOR( ) Function LIST STATUS Command LOCFILE( ) Function MEMORY( ) Function MESSAGE( ) Function NUMLOCK( ) Function OS( ) Function PCOL( ) Function PROW( ) Function PUTFILE( ) Function QUIT Command READKEY( ) Function ROW( ) Function SCHEME( ) Function
SET( ) - SET VIEW

SET( ) Function SET Command SET ANSI Command SET BELL Command SET BLOCKSIZE Command SET CENTURY Command SET CLEAR Command SET CLOCK Command SET COLOR Commands Overview SET COLOR OF Command SET COLOR OF SCHEME Command SET COLOR SET Command SET COMPATIBLE Command SET CURRENCY Command SET DATE Command SET DEBUG Command SET DEFAULT Command SET DISPLAY Command SET FIXED Command SET FUNCTION Command SET HELP Command SET HELPFILTER Command	SET INTENSITY Command SET KEYCOMP Command SET LIBRARY Command SET MACHELP SET MARK TO Command SET MOUSE Command SET NOTIFY Command SET PATH Command SET POINT Command SET RESOURCE Command SET SCOREBOARD Command SET SEPARATOR Command SET STATUS BAR Command SET STICKY Command SET TALK Command SET TEXTMERGE Command SET TEXTMERGE DELIMITERS Command SET TOPIC Command SET TYPEAHEAD Command SET VIEW Command SET XCMDFILE
SYS(3) - WFONT( )

SYS(3) Function - Unique File Name SYS(5) Function - Default Drive SYS(6) Function - Current Printer Device SYS(7) Function - Current Format File SYS(9) Function - FoxPro Serial Number SYS(12) Function - Available Memory in Bytes SYS(16) Function - Executing Program File Name SYS(17) Function - Processor in Use SYS(18) Function - Current @ ... GET Field or  Object SYS(24) Function - EMS Memory Limit SYS(100) Function - Console Setting SYS(101) Function - Device Setting SYS(102) Function - Printer Setting SYS(103) Function - Talk Setting SYS(1001) Function - FoxPro Memory SYS(1016) Function - User Object Memory Use SYS(2001) Function - SET ... Command Status	SYS(2003) Function - Current Directory SYS(2004) Function - FoxPro Start Directory SYS(2005) Function - Current Resource File SYS(2006) Function - Current Graphics Card SYS(2008) Function - Cursor Shape SYS(2009) Function - Swap Cursor Shape SYS(2010) Function - CONFIG.SYS File Settings SYS(2013) Function - System Menu Name String SYS(2016) Function - SHOW GETS WINDOW Name SYS(2017) Function - Display Sign-On Screen SYS(2019) Function - Configuration File Name and Location SYS(2020) Function - Default Disk Size SYS(2022) Function - Disk Cluster Size SYS(2023) Function - Temporary File Drive SYS(2027) - Platform Specific Path Conversion SYSMETRIC( ) Function TXTWIDTH( ) Function VERSION( ) Function WFONT( ) Function


File Management

The commands and functions in this category manage and manipulate disk files.

ADIR( ) Function ASSIST Command CLOSE ALL Command CLOSE ALTERNATE Command CLOSE DATABASES Command CLOSE FORMAT Command CLOSE INDEXES Command CLOSE PROCEDURE Command COPY FILE Command CREATE VIEW Command CURDIR( ) Function DELETE FILE Command DIR or DIRECTORY Command DISPLAY FILES Command DISKSPACE( ) Function ERASE Command FDATE( ) Function FTIME( ) Function FILE( ) Function FILER Command FLUSH Command FULLPATH( ) Function GETFILE( ) Function	LIST FILES Command LOCFILE( ) Function MODIFY COMMAND Command MODIFY FILE Command PUTFILE( ) Function RENAME Command SET ALTERNATE Commands SET DEFAULT Command SET FULLPATH Command SET PATH Command SET SAFETY Command SET VIEW Command SET VOLUME SYS(3) Function - Unique File Name SYS(2000) Function - File Name Wildcard Match SYS(2014) Function - Minimum Path SYS(2027) - Platform Specific Path Conversion TYPE Command


Network -- FoxPro in a Multi-User Environment
FoxPro in a Multi-User Environment

FoxPro allows multiple users on a network to share tables/.DBFs.  The following commands and functions are useful in a multi-user environment.

FLOCK( ) Function

LOCK( ) Function

RLOCK( ) Function

SET EXCLUSIVE Command

SET LOCK Command

SET MULTILOCKS Command

SET REFRESH Command

SET REPROCESS Command

UNLOCK Command


Obsolete Commands and Functions

Support for these commands and functions may be removed in later FoxPro versions. However, they are included in this online Help facility. Avoid using these obsolete commands and functions  use the suggested alternatives instead.

@ ... MENU	INSERT	SET DOHISTORY
@ ... PROMPT	JOIN	SET FORMAT
ACCEPT	MENU BAR	SET INTENSITY
ANSITOOEM( )	MENU TO	SET SCOREBOARD
DEFINE BOX	OEMTOANSI( )	SET WINDOW OF MEMO
FIND	READ MENU	SYS(15)
INPUT	SET DELIMITERS	SYS(20)


Error Messages

Error Messages A-Z

Error Messages by Number

Error Message Parameters

Troubleshooting

Connectivity Kit and Error Messages


Error Messages A-Z

A

78	** or ^ domain error.

*bad date*

1727	A .DBF style help file is required.

293	ACOS( ) : Out of Range.

13	ALIAS ["<alias>"] not found.

24	ALIAS name already in use.

1721	All work areas in use.

1098	API function _UserError( ) was called.

1726	API library not found

1711	API library revision mismatch.  Rebuild library.

1178	Application file "<file>" not closed.

1011	Area cannot contain handle.

1010	Area size exceeded during compaction.

291	ASIN( ) : Out of Range.

1153	Attempt to move file to different device.

1652	Attempt to use FoxPro function as an array.

B

1191	Bad .LIB file.

230	Bad array dimensions.

1907	Bad drive specifier.

1908	Bad width or decimal place argument.

167	Bar position must be a positive number.

38	Beginning of file encountered.

62	Beyond string.

1164	Browse structure changed.

1163	Browse table closed.

C

1651	CANCEL/SUSPEND is not allowed.

1152	Cannot access selected table.

1421	Cannot activate OLE server.

Cannot allocate screen map.

1672	Cannot append from password protected file.

1795	Cannot arrange an untransported screen.

1719	Cannot build APP/EXE while suspended.

1689	Cannot build APP/EXE without a main program.

176	Cannot clear menu in use.

177	Cannot clear popup in use.

1659	Cannot convert Memo file for a read-only table file.

102	Cannot create file "<file>".

1102	Cannot create file.

Cannot create program workspace.

1693	Cannot find screen/menu generation program.

Cannot find spell check program.

1846	Cannot GROUP by aggregate field.

1671	Cannot import from password protected file.

1729	Cannot initialize Shared Library Manager.

1412	Cannot locate COMSPEC environment variable.

Cannot open configuration file.

1101	Cannot open file "<file>".

1730	Cannot print to file with selected printer driver.

174	Cannot redefine menu in use.

175	Cannot redefine popup in use.

1253	Cannot rename current directory.

Cannot run on MS-DOS before version 3.0.

1720	Cannot SET FORMAT while in a READ with a FORMAT file.

1157	Cannot update file.

111	Cannot write to a read-only file.

1642	COLORSET resource not found.

223	Column number must be between 0 and 255.

1657	Column number must be between 0 and right margin.

1695	COLUMN/FORM/ALIAS/NOOVERWRITE/WIDTH allowed only with FROM clause.

1698	COLUMN/ROW/ALIAS/NOOVERWRITE/SIZE/SCREEN allowed only with FROM clause.

1252	Compiled code for this line too long.

1725	Constant is already #defined

42	CONTINUE without LOCATE.

1815	"<cursor>" must be created with SELECT ... INTO TABLE.

44	Cyclic relation.

D

9	Data type mismatch.

1706	Descending not permitted on IDX files.

216	Display mode not available.

1307	Division by 0.

103	DO nesting too deep.

1156	Duplicate field names.

E

4	End of file encountered.

1214	Endtext without text.

1424	Error copying OLE object to clipboard.

1423	Error creating OLE object.

1508	Error initializing OLE.

1245	Error in label field definition.

1296	Error reading resource.

1422	Error saving OLE object.

110	Exclusive open of file is required.

67	Expression evaluator fault.

F - H

Fatal error <expN> reporting error <expN>.

1001	Feature not available.

1919	Feature not available when FoxPro is not the active application.

1832	"<field> | <variable>" is not unique and must be qualified.

1165	"<field>" is not related to the current work area.

1913	Field must be a General field.

350	Field must be a Memo field.

1130	"Field" phrase not found.

1	File ["<file>"] does not exist.

1705	File access denied.

7	File already exists.

1503	File cannot be locked.

1112	File close error.

1462	File internal consistency error.

108	File is in use by another.

3	File is in use.

1196	"<file>" is not a FoxPro EXE file.

1309	"<file>" is not an object file.

1708	File is open in another work area.

1718	File is read only.

1338	File is the wrong version.

1637	File must be opened exclusively to convert Memo file.

1918	File name too long.

1113	File not open.

1104	File read error.

91	File was not LOADed.

1105	File write error.

1140	FILTER expression too long.

37	FILTER requires a logical expression.

1127	For/while need logical expressions.

1008	Foreign node found during compaction.

1294	FOXUSER file is invalid.

1003	Free handle not found.

1999	Function not implemented.

I

1002	I/O operation failure.

1211	If/else/endif mismatch.

1912	Illegal operation for a General field.

34	Illegal operation for MEMO field.

1910	Illegal printer driver recursion.

1103	Illegal seek offset.

46	Illegal value.

1679	Import only Worksheet A for Lotus 1-2-3 version 3.0 files.

1647	Improper data type in field expression.

1241	Improper data type in group expression.

1009	Incorrect handle found during compaction.

114	Index does not match table file.  Recreate index.

23	Index expression is too big.

19	Index file does not match table.

1683	Index tag not found.

1684	Index tag or filename must be specified.

43	Insufficient memory.

1308	Insufficient stack space.

1192	Internal .LIB undefined symbol error.

1000	Internal consistency error.

1243	Internal error: Too many characters in report.

1190	Invalid .LIB signature.

227	Invalid box dimensions.

1155	Invalid buffdirty call.

1154	Invalid buffpoint call.

1220	Invalid character in command.

Invalid compact EXE file.

115	Invalid DIF file header.

117	Invalid DIF type indicator.

116	Invalid DIF vector - DBF field mismatch.

1661	Invalid Excel version 2.0 file format.

1713	Invalid field width or number of decimal places.

1111	Invalid file descriptor.

11	Invalid function argument value, type or count.

112	Invalid key length.

356	Invalid keyboard macro file format.

1662	Invalid Lotus 1-2-3 version 1.0 file format.

297	Invalid Lotus 1-2-3 version 2.0 file format.

1678	Invalid Lotus 1-2-3 version 3.0 file format.

1670	Invalid Multiplan version 4.0 file format.

1115	Invalid operation for CURSOR.

1420	Invalid or corrupted OLE object.

1712	Invalid or duplicate field name.

Invalid or missing EXE file.

1688	Invalid Paradox version 3.5 file format.

202	Invalid path or filename.

1722	Invalid preprocessor expression.

124	Invalid printer redirection.

231	Invalid SET expression.

31	Invalid subscript reference.

120	Invalid SYLK file dimension bounds.

121	Invalid SYLK file format.

119	Invalid SYLK file header.

1673	Invalid Symphony version 1.0 file format.

1674	Invalid Symphony version 1.1 file format.

17	Invalid table number.

1223	Invalid variable reference.

1632	Invalid WINDOW file format.

J - L

1255	Key label ["<label>"] is invalid.

1257	Key string too long.

1124	Key too big.

54	Label file invalid.

1653	Label nesting error.

221	Left margin plus indent must be less than right margin.

1691	Library file is invalid.

222	Line number must be less than page length.

18	Line too long.

1194	Link command failed.

Localized product required for this environment.

58	LOG( ) : Zero or negative.

292	LOG10( ) : Zero or negative.

Logical expression required.

M

355	Macro not defined.

1607	Maximum allowable menu items (128) exceeded.

1608	Maximum allowable menus (25) exceeded.

392	Maximum record length exceeded in import file.

1148	Meaningless use of expression.

41	MEMO file is missing/invalid.

55	Memory Variable file is invalid.

1687	Menu file invalid.

178	MENU has not been activated.

168	MENU has not been defined.

181	MENU is already in use.

169	Menu item cannot be defined.

170	Menu item cannot be released.

1611	Menu item/titles must be type CHARACTER.

279	Menu/Popup was not pushed.

1723	Mismatched #if/#elsif/#else/#endif.

1256	Mismatched braces in key label.

1213	Mismatched case structure.

1306	Missing ,

1724	Missing #endif.

1304	Missing (

1300	Missing )

1193	Missing .RTT section.

152	Missing expression.

1231	Missing operand.

1710	MULTISELECT/MOVERS not supported for PROMPT style popup.

1145	Must be a character, date or numeric key field.

1226	Must be a file variable.

1225	Must be a memory variable.

1232	Must be an array definition.

N

226	"<name>" is not a file variable.

225	"<name>" is not a memory variable.

232	"<name>" is not an array.

1844	Nested aggregation not allowed.

1254	Nested key labels are invalid.

96	Nesting error.

166	No bars have been defined for this popup.

47	No fields to process.

138	No fields were found to copy.

1149	No memory for buffer.

1150	No memory for file map.

1151	No memory for file name.

1604	No menu bar defined.

1621	No pads defined for this menu.

1238	No PARAMETER statement found.

1605	No popup menu defined.

1649	No previous printjob to match this command.

1612	No such menu/item is defined.

52	No table in USE.

45	Not a character expression.

27	Not a numeric expression.

15	Not a table/DBF file.

1682	Not a user-defined window.

256	Not a valid Framework II database/spreadsheet.

255	Not a valid RapidFile database.

56	Not enough disk space for "<file name>".

1600	Not enough memory to USE table.

101	Not suspended.

1696	NOWAIT/SAVE/NOENVIRONMENT/IN/WINDOW clauses not allowed with FROM.

39	Numeric overflow (data was lost).

O - P

1195	Object file "<file>" is the wrong version.

107	Operator/operand type mismatch.

1012	OS memory error.

164	PAD has not been defined.

1217	Picture error in GET statement.

1108	Picture too big, corrupt, or wrong format.

179	POPUP has not been activated.

165	POPUP has not been defined.

182	POPUP is already in use.

287	POPUP is too small.

Popup too big, first <expN> entries shown.

30	Position is off the screen.

1681	PREVIEW clause not allowed with OFF/NOCONSOLE or TO PRINT/FILE.

1643	Printer driver is corrupted.

1644	Printer driver not found.

125	Printer not ready.

1337	Printjobs cannot be nested.

1162	Procedure "<procedure>" not found.

Product has not been properly installed.

1202	Program too large.

1685	Project file is invalid.

Q - R

1716	Queue "<queue>" not found.

109	Record is in use by another.

1502	Record is in use:  Cannot write.

20	Record is not in index.

130	Record is not locked.

5	Record is out of range.

1126	Record too long.

1206	Recursive macro definition.

50	Report file invalid.

1645	Report nesting error.

1221	Required clause not present in command.

1405	RUN/! command failed.

1411	RUN/! command string too long.

1921	RUNSCRIPT command failed.

S

1507	Screen code too large for memory.

1686	Screen file invalid.

1917	Script error "<script>".

1851	SELECTs are not UNION compatible.

1715	Server "<server>" not found.

Source code not found.

Source code out of date.

1811	SQL aggregate on non-numeric expression.

1839	SQL cancelled operation.

1806	SQL column "<field> | <variable>" not found.

1802	SQL could not locate table.

1831	SQL err building temporary index.

1801	SQL Error Correlating Fields.

1845	SQL expression too complex.

1828	SQL illegal GROUP BY in subquery.

1830	SQL index not found.

1800	SQL Internal Error.

1820	SQL invalid * in SELECT.

1822	SQL invalid aggregate field.

1819	SQL invalid DISTINCT.

1807	SQL invalid GROUP BY.

1803	SQL Invalid HAVING.

1808	SQL invalid ORDER BY.

1804	SQL invalid SELECT statement.

1826	SQL invalid SELECT.

1825	SQL invalid subquery.

1810	SQL Invalid use of subquery.

1813	SQL Invalid use of union in subquery.

1833	SQL invalid WHERE clause.

1818	SQL no FROM clause.

1809	SQL out of memory.

1814	SQL queries of this type are not supported at present.

1812	SQL statement too long.

1842	SQL subqueries nested too deep.

1841	SQL too many columns referenced.

1805	SQL Too many subqueries.

1834	SQL Too many UNIONs.

61	SQRT domain error.

95	Statement not allowed in interactive mode.

21	String memory variable area overflow.

1903	String too long to fit.

1707	Structural CDX file not found.

1235	Structure invalid.

1212	Structure nesting too deep.

1860	Subquery returned more than one record.

1234	Subscript out of bounds.

1242	Syntax error in field expression.

10	Syntax error.

T

228	Tab stops must be in ascending order.

26	Table is not ordered.

1690	Table/DBF operation invalid while indexing.

1147	Target is already engaged in relation.

1229	Too few arguments.

1230	Too many arguments.

1694	Too many extensions specified.

6	Too many files open.

22	Too many memory variables.

1201	Too many names used.

1310	Too many PICTURE characters specified.

1250	Too many PROCEDURES.

1249	Too many READs in effect.

1161	Too many records to BROWSE/EDIT in demo version.

1646	Total field type must be numeric.

1246	Total label width exceeds maximum allowable size.

1106	Transaction in progress.

1007	Transgressed node found during compaction.

U - Z

1410	Unable to create temporary work file(s).

Unable to locate desired version of FoxPro.

Unable to process error.

Unknown error code <expN>.

104	Unknown function key.

16	Unrecognized command verb.

1141	Unrecognized index file revision.  Please recreate index.

36	Unrecognized phrase/keyword in command.

1692	Unresolvable REGIONAL name conflict.

1004	Use of invalid handle.

1006	Use of transgressed handle.

1005	Use of unallocated handle.

12	Variable ["<variable>"] not found.

1134	Variable must be in selected table.

127	View file invalid.

214	WINDOW ["<window name>"] has not been defined.

332	WINDOW coordinates are invalid.

215	WINDOW has not been activated.

1425	Word files must be embedded.

1680	Worksheet A for Lotus 1-2-3 version 3.0 file is hidden.

1117	Wrong length key.

94	Wrong number of parameters.

1920	XCMD/XFCN resource not found.


Error Messages by Number

0001

1	File ["<file>"] does not exist.

3	File is in use.

4	End of file encountered.

5	Record is out of range.

6	Too many files open.

7	File already exists.

9	Data type mismatch.

10	Syntax error.

11	Invalid function argument value, type or count.

12	Variable ["<variable>"] not found.

13	ALIAS ["<alias>"] not found.

15	Not a table/DBF file.

16	Unrecognized command verb.

17	Invalid table number.

18	Line too long.

19	Index file does not match table.

20	Record is not in index.

21	String memory variable area overflow.

22	Too many memory variables.

23	Index expression is too big.

24	ALIAS name already in use.

26	Table is not ordered.

27	Not a numeric expression.

30	Position is off the screen.

31	Invalid subscript reference.

34	Illegal operation for MEMO field.

36	Unrecognized phrase/keyword in command.

37	FILTER requires a logical expression.

38	Beginning of file encountered.

39	Numeric overflow (data was lost).

41	MEMO file is missing/invalid.

42	CONTINUE without LOCATE.

43	Insufficient memory.

44	Cyclic relation.

45	Not a character expression.

46	Illegal value.

47	No fields to process.

50	Report file invalid.

52	No table in USE.

54	Label file invalid.

55	Memory Variable file is invalid.

56	Not enough disk space for "<file name>".

58	LOG( ) : Zero or negative.

61	SQRT domain error.

62	Beyond string.

67	Expression evaluator fault.

78	** or ^ domain error.

91	File was not LOADed.

94	Wrong number of parameters.

95	Statement not allowed in interactive mode.

96	Nesting error.

0100

101	Not suspended.

102	Cannot create file "<file>".

103	DO nesting too deep.

104	Unknown function key.

107	Operator/operand type mismatch.

108	File is in use by another.

109	Record is in use by another.

110	Exclusive open of file is required.

111	Cannot write to a read-only file.

112	Invalid key length.

114	Index does not match table file.  Recreate index.

115	Invalid DIF file header.

116	Invalid DIF vector - DBF field mismatch.

117	Invalid DIF type indicator.

119	Invalid SYLK file header.

120	Invalid SYLK file dimension bounds.

121	Invalid SYLK file format.

124	Invalid printer redirection.

125	Printer not ready.

127	View file invalid.

130	Record is not locked.

138	No fields were found to copy.

152	Missing expression.

164	PAD has not been defined.

165	POPUP has not been defined.

166	No bars have been defined for this popup.

167	BAR position must be a positive number.

168	MENU has not been defined.

169	Menu item cannot be defined.

170	Menu item cannot be released.

174	Cannot redefine menu in use.

175	Cannot redefine popup in use.

176	Cannot clear menu in use.

177	Cannot clear popup in use.

178	MENU has not been activated.

179	POPUP has not been activated.

181	MENU is already in use.

182	POPUP is already in use.

0200

202	Invalid path or filename.

214	WINDOW ["<window name>"] has not been defined.

215	WINDOW has not been activated.

216	Display mode not available.

221	Left margin plus indent must be less than right margin.

222	Line number must be less than page length.

223	Column number must be between 0 and 255.

225	"<name>" is not a memory variable.

226	"<name>" is not a file variable.

227	Invalid box dimensions.

228	Tab stops must be in ascending order.

230	Bad array dimensions.

231	Invalid SET expression.

232	"<name>" is not an array.

255	Not a valid RapidFile database.

256	Not a valid Framework II database/spreadsheet.

279	Menu/Popup was not pushed.

287	POPUP is too small.

291	ASIN( ) : Out of Range.

292	LOG10( ) : Zero or negative.

293	ACOS( ) : Out of Range.

297	Invalid Lotus 1-2-3 version 2.0 file format.

0300

332	WINDOW coordinates are invalid.

350	Field must be a Memo field.

355	Macro not defined.

356	Invalid keyboard macro file format.

392	Maximum record length exceeded in import file.

1000

1000	Internal consistency error.

1001	Feature not available.

1002	I/O operation failure.

1003	Free handle not found.

1004	Use of invalid handle.

1005	Use of unallocated handle.

1006	Use of transgressed handle.

1007	Transgressed node found during compaction.

1008	Foreign node found during compaction.

1009	Incorrect handle found during compaction.

1010	Area size exceeded during compaction.

1011	Area cannot contain handle.

1012	OS memory error.

1098	API function _UserError( ) was called.

1100

1101	Cannot open file "<file>".

1102	Cannot create file.

1103	Illegal seek offset.

1104	File read error.

1105	File write error.

1106	Transaction in progress.

1108	Picture too big.

1111	Invalid file descriptor.

1112	File close error.

1113	File not open.

1115	Invalid operation for CURSOR.

1117	Wrong length key.

1124	Key too big.

1126	Record too long.

1127	For/while need logical expressions.

1130	'Field' phrase not found.

1134	Variable must be in selected table.

1140	FILTER expression too long.

1141	Unrecognized index file revision.  Please recreate index.

1145	Must be a character, date or numeric key field.

1147	Target is already engaged in relation.

1148	Meaningless use of expression.

1149	No memory for buffer.

1150	No memory for file map.

1151	No memory for file name.

1152	Cannot access selected table.

1153	Attempt to move file to different device.

1154	Invalid buffpoint call.

1155	Invalid buffdirty call.

1156	Duplicate field names.

1157	Cannot update file.

1161	Too many records to BROWSE/EDIT in demo version.

1162	Procedure "<procedure>" not found.

1163	Browse table closed.

1164	Browse structure changed.

1165	"<field>" is not related to the current work area.

1178	Application file "<file>" not closed.

1190	Invalid .LIB signature.

1191	Bad .LIB file.

1192	Internal .LIB undefined symbol error.

1193	Missing .RTT section.

1194	Link command failed.

1195	Object file "<file>" is the wrong version.

1196	"<file>" is not a FoxPro EXE file.

1200

1201	Too many names used.

1202	Program too large.

1206	Recursive macro definition.

1211	If/else/endif mismatch.

1212	Structure nesting too deep.

1213	Mismatched case structure.

1214	Endtext without text.

1217	Picture error in GET statement.

1220	Invalid character in command.

1221	Required clause not present in command.

1223	Invalid variable reference.

1225	Must be a memory variable.

1226	Must be a file variable.

1229	Too few arguments.

1230	Too many arguments.

1231	Missing operand.

1232	Must be an array definition.

1234	Subscript out of bounds.

1235	Structure invalid.

1238	No PARAMETER statement found.

1241	Improper data type in group expression.

1242	Syntax error in field expression.

1243	Internal error: Too many characters in report.

1245	Error in label field definition.

1246	Total label width exceeds maximum allowable size.

1249	Too many READs in effect.

1250	Too many PROCEDURES.

1252	Compiled code for this line too long.

1253	Cannot rename current directory.

1254	Nested key labels are invalid.

1255	Key label ["<label>"] is invalid.

1256	Mismatched braces in key label.

1257	Key string too long.

1294	FOXUSER file is invalid.

1296	Error reading resource.

1300

1300	Missing )

1304	Missing (

1306	Missing ,

1307	Division by 0.

1308	Insufficient stack space.

1309	"<file>" is not an object file.

1310	Too many PICTURE characters specified.

1337	Printjobs cannot be nested.

1338	File is the wrong version.

1400

1405	RUN/! command failed.

1410	Unable to create temporary work file(s).

1411	RUN/! command string too long.

1412	Cannot locate COMSPEC environment variable.

1420	Invalid or corrupted OLE object.

1421	Cannot activate OLE server.

1422	Error saving OLE object.

1423	Error creating OLE object.

1424	Error copying OLE object to clipboard.

1425	Word files must be embedded.

1462	File internal consistency error.

1500

1502	Record is in use:  Cannot write.

1503	File cannot be locked.

1507	Screen code too large for memory.

1508	Error initializing OLE.

1600

1600	Not enough memory to USE table.

1604	No menu bar defined.

1605	No popup menu defined.

1607	Maximum allowable menu items (128) exceeded.

1608	Maximum allowable menus (25) exceeded.

1611	Menu item/titles must be type CHARACTER.

1612	No such menu/item is defined.

1621	No pads defined for this menu.

1632	Invalid WINDOW file format.

1637	File must be opened exclusively to convert Memo file.

1642	COLORSET resource not found.

1643	Printer driver is corrupted.

1644	Printer driver not found.

1645	Report nesting error.

1646	Total field type must be numeric.

1647	Improper data type in field expression.

1649	No previous printjob to match this command.

1651	CANCEL/SUSPEND is not allowed.

1652	Attempt to use FoxPro function as an array.

1653	Label nesting error.

1657	Column number must be between 0 and right margin.

1659	Cannot convert Memo file for a read-only table file.

1661	Invalid Excel version 2.0 file format.

1662	Invalid Lotus 1-2-3 version 1.0 file format.

1670	Invalid Multiplan version 4.0 file format.

1671	Cannot import from password protected file.

1672	Cannot append from password protected file.

1673	Invalid Symphony version 1.0 file format.

1674	Invalid Symphony version 1.1 file format.

1678	Invalid Lotus 1-2-3 version 3.0 file format.

1679	Import only Worksheet A for Lotus 1-2-3 version 3.0 files.

1680	Worksheet A for Lotus 1-2-3 version 3.0 file is hidden.

1681	PREVIEW clause not allowed with OFF/NOCONSOLE or TO PRINT/FILE.

1682	Not a user-defined window.

1683	Index tag not found.

1684	Index tag or filename must be specified.

1685	Project file is invalid.

1686	Screen file invalid.

1687	Menu file invalid.

1688	Invalid Paradox version 3.5 file format.

1689	Cannot build APP/EXE without a main program.

1690	Table/DBF operation invalid while indexing.

1691	Library file is invalid.

1692	Unresolvable REGIONAL name conflict.

1693	Cannot find screen/menu generation program.

1694	Too many extensions specified.

1695	COLUMN/FORM/ALIAS/NOOVERWRITE/WIDTH allowed only with FROM clause.

1696	NOWAIT/SAVE/NOENVIRONMENT/IN/WINDOW clause not allowed with FROM.

1698	COLUMN/ROW/ALIAS/NOOVERWRITE/SIZE/SCREEN allowed only with FROM clause.

1700

1705	File access denied.

1706	Descending not permitted on IDX files.

1707	Structural CDX file not found.

1708	File is open in another work area.

1710	MULTISELECT/MOVERS not supported for PROMPT style popup.

1711	API library revision mismatch.  Rebuild library.

1712	Invalid or duplicate field name.

1713	Invalid field width or number of decimal places.

1715	Server "<server>" not found.

1716	Queue "<queue>" not found.

1718	File is read only.

1719	Cannot build APP/EXE while suspended.

1720	Cannot SET FORMAT while in a READ with a FORMAT file.

1721	All work areas in use.

1722	Invalid preprocessor expression.

1723	Mismatched #if/#elsif/#else/#endif.

1724	Missing #endif.

1725	Constant is already #defined

1726	API Library not found.

1727	A .DBF style help is required.

1729	Cannot initialize Shared Library Manager.

1730	Cannot print to file with selected printer driver.

1795	Cannot arrange an untransported screen.

1800

1800	SQL Internal Error.

1801	SQL Error Correlating Fields.

1802	SQL could not locate table.

1803	SQL Invalid HAVING.

1804	SQL invalid SELECT statement.

1805	SQL Too many subqueries.

1806	SQL column "<field> | <variable>" not found.

1807	SQL invalid GROUP BY.

1808	SQL invalid ORDER BY.

1809	SQL out of memory.

1810	SQL Invalid use of subquery.

1811	SQL aggregate on non-numeric expression.

1812	SQL statement too long.

1813	SQL Invalid use of union in subquery.

1814	SQL queries of this type are not supported at present.

1815	"<cursor>" must be created with SELECT ... INTO TABLE.

1818	SQL no FROM clause.

1819	SQL invalid DISTINCT.

1820	SQL invalid * in SELECT.

1822	SQL invalid aggregate field.

1825	SQL invalid subquery.

1826	SQL invalid SELECT.

1828	SQL illegal GROUP BY in subquery.

1830	SQL index not found.

1831	SQL err building temporary index.

1832	"<field> | <variable>" is not unique and must be qualified.

1833	SQL invalid WHERE clause.

1834	SQL Too many UNIONs.

1839	SQL cancelled operation.

1841	SQL too many columns referenced.

1842	SQL subqueries nested too deep.

1844	Nested aggregation not allowed.

1845	SQL expression too complex.

1846	Cannot GROUP by aggregate field.

1851	SELECTs are not UNION compatible.

1860	Subquery returned more than one record.

1900

1903	String too long to fit.

1907	Bad drive specifier.

1908	Bad width or decimal place argument.

1910	Illegal printer driver recursion.

1912	Illegal operation for a General field.

1913	Field must be a General field.

1917	Script error "<script>".

1918	File name too long.

1919	Feature not available when FoxPro is not the active application.

1920	XCMD/XFCN resource not found.

1921	RUNSCRIPT command failed.

1999	Function not implemented.


Interface A-Z

1-To-Many Dialog

A

About FoxPro Dialog

Add/Modify Index Dialog

Add File Dialog

Add Screen Dialog

Alerts

Append From Dialog

Append Mode

Associated Windows Dialog

Attributes Dialog

Average Dialog

B

Beautification Options Dialog

Browse Window

Build Option Dialog

C

Calculate Dialog

Calculate Field Dialog

Calculator

Calendar/Diary

Catalog Manager

Catalog Manager Print Dialog

Catalog Manager Settings Dialog

Change Label Dialog

Change Link

Change Mode

Change Query Dialog

Change Report Dialog

Change Screen Dialog

Check Box Dialog

Choose Field/Variable Dialog

Client-Server Wizard

Code Snippet Dialog

Command Window

Comment Dialog

Compile Dialog

Control Menu

Convert To Static

Copy Directory Dialog

Copy Files Dialog

Copy To Dialog

Count Dialog

Create Label Dialog

Create Program Dialog

Create Query Dialog

Create Report Dialog

Create Screen Dialog

Create Table Dialog

D

Data Grouping Dialog

Data Menu

Database Menu

Debug Window

Delete Dialog

Delete Directory Dialog

Delete Files Dialog

Detail Dialog

Do Dialog

E

Edit Link Dialog

Edit Menu

Edit Region Dialog

Edit Screen Set Dialog

Environment Dialog

Execution Throttle Dialog

Exit

Exit Catalog Dialog

Export Data Dialog

Expression Builder Dialog

Expression Dialog

F

Field Dialog

Field Picker Dialog

File Description Dialog

File Information Dialog

File Menu

Filer

Find Dialog

Find Files Dialog

Font Dialog

Format Codes Dialog

Format Dialog

FoxDoc Dialog

G

General Options Dialog

Generate Dialog

Generate Menu Dialog

Generate Screen Dialog

Goto Dialog

Goto Line Dialog

Group Info Dialog

Group/Total Report Wizard

H - L

Help Menu

Hot Keys Dialog

Icon File Dialog

Import Data Dialog

Index Dialog

Insert Object Dialog

Insert Object From File Dialog

Introductory Screen

Key Definition Dialog

Label Dialog

Label Wizard

List Dialog

Locate Dialog

Locate File Dialog

M

Macro Edit Dialog

Macro Key Definition Dialog

Macros Dialog

Mail Merge Wizard

Make Directory Dialog

Menu Design Window

Menu Options Dialog

Move Directory Dialog

Move Files Dialog

Multi-Column Report Wizard

N

Navigating in the Interface

New Dialog

New Label Dialog

O

Object

Object Menu

Object Order Dialog

Open Dialog

Options Dialog

Order Table Dialog

P

Pack

Pad Name Dialog

Page Footer Dialog

Page Header Dialog

Page Layout Dialog

Page Preview Dialog

Page Setup Dialog

Paste Special Dialog

Path Dialog

Picture Dialog

Popup Dialog

Preferences Dialog

Print Dialog

Print Setup Dialog

Print When Dialog

Program Menu

Project Information Dialog

Project Window

Prompt Options Dialog

Push Button Dialog

Puzzle

Q

Quick Report Dialog

Quick Screen Dialog

Quit

R

Radio Button Dialog

Recall Dialog

Record Menu

Rectangle/Line Dialog

Reindex

Remove File Dialog

Rename Directory Dialog

Rename Files Dialog

Replace Dialog

Report Dialog

Report Expression Dialog

Report Layout Window

Report Picture Dialog

Report Variables Dialog

Report Wizard

Restore Macros Dialog

Revert

Round Rectangle Dialog

RQBE Display Options Dialog

RQBE Group By Dialog

RQBE Having Dialog

RQBE Join Condition Dialog

RQBE Order By Dialog

RQBE Select Fields Dialog

RQBE Window

Ruler/Grid Dialog

Run Menu

S

Save As Dialog

Scope Dialog

Screen Code Dialog

Screen Color Dialog

Screen Design Window

Screen Layout Dialog

Screen Picture Dialog

Screen Wizard

Seek Dialog

Select Directory Dialog

Select Folder Dialog

Set Index Order Dialog

Setup Dialog

Size Dialog

Sort Dialog

Sort Files Dialog

Specify Text Dialog

Spelling

Spelling Options Dialog

Spinner Dialog

SQL Query Wizard

Stop Recording Macro Dialog

Sum Dialog

System Messages

T

Table Structure Dialog

Table Wizard

Target Directory Dialog

Text Dialog

Text Editing

Text Menu

Title/Summary Dialog

Tools Menu

Total Dialog

Trace Window

Transporter Dialog

Try It Dialog

U - Z

Updatable Query Wizard

Variable Definition Dialog

View Menu

View Window

Window Menu

Window Style Dialog


Menus

Browse Menu

Control Menu

Data Menu

Database Menu

Edit Menu

File Menu

Help Menu

Menu Menu

Object Menu

Program Menu

Project Menu

Record Menu

Report Menu

RQBE Menu

Run Menu

Screen Menu

Text Menu

Tools Menu

View Menu

Window Menu


Windows

Browse Window

Catalog Manager

Command Window

Debug Window

Introductory Screen

Menu Design Window

Project Window

Report Layout Window

RQBE Window

Screen Design Window

Trace Window

View Window


Dialogs

1-To-Many Dialog

A

About FoxPro Dialog

Add File Dialog

Add/Modify Index Dialog

Add Screen Dialog

Append From Dialog

Associated Windows Dialog

Attributes Dialog

Average Dialog

B

Beautification Options Dialog

Build Option Dialog

C

Calculate Dialog

Calculate Field Dialog

Catalog Manager Print Dialog

Catalog Manager Settings Dialog

Change Label Dialog

Change Query Dialog

Change Report Dialog

Change Screen Dialog

Check Box Dialog

Choose Field/Variable Dialog

Code Snippet Dialog

Comment Dialog

Compile Dialog

Copy Directory Dialog

Copy Files Dialog

Copy To Dialog

Count Dialog

Create Label Dialog

Create Program Dialog

Create Query Dialog

Create Report Dialog

Create Screen Dialog

Create Table Dialog

D

Data Grouping Dialog

Delete Dialog

Delete Directory Dialog

Delete Files Dialog

Detail Dialog

Do Dialog

E

Edit Link Dialog

Edit Region Dialog

Edit Screen Set Dialog

Environment Dialog

Execution Throttle Dialog

Exit Catalog Dialog

Export Data Dialog

Expression Builder Dialog

Expression Dialog

F

Field Dialog

Field Picker Dialog

File Description Dialog

File Information Dialog

Find Dialog

Find Files Dialog

Font Dialog

Format Codes Dialog

Format Dialog

FoxDoc Dialog

G

General Options Dialog

Generate Menu Dialog

Generate Screen Dialog

Goto Dialog

Goto Line Dialog

Group Info Dialog

H-J

Hot Keys Dialog

Icon File Dialog

Import Data Dialog

Index Dialog

Insert Object Dialog

Insert Object From File Dialog

K-L

Key Definition Dialog

Label Dialog

List Dialog

Locate Dialog

Locate File Dialog

M

Macro Edit Dialog

Macro Key Definition Dialog

Macros Dialog

Make Directory Dialog

Menu Options Dialog

Move Directory Dialog

Move Files Dialog

N

Navigating in the Interface Dialog

New Dialog

New Label Dialog

O

Object Order Dialog

Open Dialog

Options Dialog

Order Table Dialog

P

Pad Name Dialog

Page Footer Dialog

Page Header Dialog

Page Layout Dialog

Page Preview Dialog

Path Dialog

Picture Dialog

Popup Dialog

Preferences Dialog

Print Dialog

Print Setup Dialog

Page Setup Dialog

Print When Dialog

Project Information Dialog

Prompt Options Dialog

Push Button Dialog

Q

Quick Report Dialog

Quick Screen Dialog

R

Radio Button Dialog

Recall Dialog

Rectangle/Line Dialog

Remove File Dialog

Rename Directory Dialog

Rename Files Dialog

Replace Dialog

Report Dialog

Report Expression Dialog

Report Picture Dialog

Report Variables Dialog

Restore Macros Dialog

Round Rectangle Dialog

RQBE Display Options Dialog

RQBE Group By Dialog

RQBE Having Dialog

RQBE Join Condition Dialog

RQBE Order By Dialog

RQBE Select Fields Dialog

Ruler/Grid Dialog

S

Save As Dialog

Scope Dialog

Screen Code Dialog

Screen Color Dialog

Screen Layout Dialog

Screen Picture Dialog

Seek Dialog

Select Directory Dialog

Select Folder Dialog

Set Index Order Dialog

Setup Dialog

Size Dialog

Sort Dialog

Sort Files Dialog

Specify Text Dialog

Spelling Options Dialog

Spinner Dialog

Stop Recording Macro Dialog

Sum Dialog

T-Z

Table Structure Dialog

Target Directory Dialog

Text Dialog

Title/Summary Dialog

Total Dialog

Transporter Dialog

Try It Dialog

Variable Definition Dialog

Window Style Dialog


1-To-Many Dialog

See Also

The 1-To-Many dialog is used to create 1-To-Many relations using SET SKIP TO.  This dialog contains these options:

Child Aliases list

Double-click on a table in this list, or select the table then choose the Move push button to move it to the Selected Aliases list.

Selected Aliases list

Double-click on a table in this list, or select the table then choose the Remove push button to remove it from the Selected Aliases list.

Move push button

Moves selected table from Child Aliases list to Selected Aliases list.

All push button

Moves all tables from Child Aliases list to Selected Aliases list.

Remove push button

Removes selected table from Selected Aliases list.

Remove All push button

Removes all tables from Selected Aliases list.


1-To-Many SeeAlso
See Also

View Window


About FoxPro Dialog

See Also

This dialog displays useful information about FoxPro. Use the push buttons to display the next and previous screens and to remove the dialog from screen. You will need to provide information from this dialog if you contact Microsoft for technical assistance.


About FoxPro SeeAlso
See Also

Help Menu


Add File Dialog

See Also

This dialog allows you to add an existing file to a project in the Project Manager, or to add a file to a catalog in Catalog Manager.

Project Manager

In the Project Manager the dialog contains these options:

File to Add list

Displays all files specified by the List Files of Type popup or All Files check box.  To add a file to the project, select the desired file and choose the Add push button, or double-click the file name.

All Files check box

Check this box to display all files in the selected directory or folder, regardless of type.

List Files of Type popup

From this popup, choose the file type to add to the project.

Directory list or Folders popup

Specifies the directory or folder in which the desired file is located.

Drive popup

Specifies the drive on which the desired file is located.

Add push button

Adds the selected file to the project.

New push button

Creates a file of the specified type and adds it to the project.

Cancel push button

Exits the dialog without taking any action.

Catalog Manager

In the Catalog Manager the dialog contains these options:

File to Add list

Displays all files specified by the Add File popup or All Files check box.  To add a file to the catalog, select the desired file and choose the Add push button, or double-click on the file name.

Directory list or Folder popup

Specifies the directory or folder in which the desired file is located.

Drive popup

Specifies the drive on which the desired file is located.

All Files check box

Check this box to display all files in the selected directory, regardless of type.

Add push button

Adds the selected file to the active catalog.

Cancel push button

Exits the dialog without taking any action.


Add File SeeAlso
See Also

Catalog Manager

File Menu

Project Window


Add Screen Dialog

See Also

The Add Screen dialog is used to add a screen to a screen set.  Change the drive or disk and directory or folder settings as necessary, then select a screen from the list and choose Add.  The Generate Screen dialog displays the new screen as part of the screen set that you can generate into one .SPR program file.


Add Screen SeeAlso
See Also

Generate Screen Dialog


Alerts

Alerts display warning and error messages.  If the alert contains push buttons, you can choose the appropriate push button to remove the alert.  Otherwise, remove the alert by pressing any key (except Control, [image], or Shift) or clicking the mouse.


Append Mode

See Also

This displays the Browse window in append mode, allowing you to add records to the selected table.


Append Window SeeAlso
See Also

Browse Window

Record Menu


Append From Dialog

See Also

In the Append From dialog, you can add records to the active table from another table or file. The Append From dialog contains these options:

Output area

From... push button

Displays the Open dialog with a list of files of the type specified in the Append From dialog.  Choose the appropriate file by double-clicking on it, or by selecting it and choosing OK.  The file name appears in the From... text box.  Or, in the From... text box, type the name of the file which contains information to append.

Fields... push button

Displays the Field Picker dialog so you can choose the desired fields by double-clicking on them in the All Fields list.  When the desired fields are listed in the Selected Fields list, choose OK.  The selected fields appear in the non-editable text region next to the Fields... push button.  See the Field Picker topic for more information.

File Type popup

Displays the possible file types from which you can append:

File Type	Description
Table (DBF)	FoxPro table
Delimited with Tabs	Text file with fields separated by one tab
Delimited with Commas	Text file with fields separated by one comma
Delimited with Spaces	Text file with fields separated by one space
System Data Format (SDF)	Text file with fixed length records that end with a carriage return and line feed
Symbolic Link Format (SYLK)	Symbolic Link interchange format
Data Interchange Format (DIF)	Data Interchange Format
Microsoft Excel (XLS)	Microsoft Excel versions 2.0, 3.0 and 4.0
Microsoft Multiplan (4.01)(MOD)	Microsoft Multiplan version 4.x Binary File Format
Symphony (1.0)(WRK)	Symphony versions 1.0 and 1.01 spreadsheet
Symphony (1.1/1.2)(WR1)	Symphony versions 1.1 and 1.2 spreadsheet
Lotus 1-2-3 (1A)(WKS)	Lotus 1-2-3 release 1-A spreadsheet
Lotus 1-2-3 (2.x)(WK1)	Lotus 1-2-3 release 2.xx spreadsheet
Lotus 1-2-3 (3.0)(WK3)	Lotus 1-2-3 release 3.0 spreadsheet
Paradox (PDOX)	Paradox versions 3.5 and 4.0 table
RapidFile (1.2)(RPD)	RapidFile table
Framework II (FW2)	Framework II spreadsheet
4th Dimension (3.0 or later)	4th Dimension table
Filemaker Pro (2.1)	Filemaker Pro table
To choose a file type, click on the Down Arrow to display the popup, then click on the desired file type.

Criteria area

You can use push buttons in the Criteria area to specify conditions that records must meet to be appended to the table.

Scope... push button

This push button is disabled because FoxPro assumes that you want to append all records.

For... push button

Displays the Expression Builder so you can create a logical expression that every record must meet to be appended to the table.  See the Expression Builder topic for more information.

While... push button

This push button is disabled.

Append push button

Adds the selected fields to the current table.

Cancel push button

Exits the Append From dialog without taking action.


Append From Dialog SeeAlso
See Also

Database Menu

Expression Builder Dialog

Field Picker Dialog

Open Dialog

Scope Dialog


Associated Windows Dialog

See Also

The Associated Windows dialog is used to specify windows that can be accessed along with the screens in a screen set.  Only those windows entered in the list can be activated.  If other windows are present when the screen is executed, they can be seen but cannot be activated or accessed.

The Associated Windows dialog contains these options:

OK push button

When you've entered the desired window titles in the list, choose OK.

Clear push button

Removes all window titles from the list.

Cancel push button

Exits the dialog without taking action.


Associated Windows SeeAlso
See Also

Generate Screen Dialog


Attributes Dialog

See Also

The Attributes dialog is used to change the attributes of tagged files in the Filer. This dialog contains these options:

Read Only check box

When checked, allows the file to be read but not modified.

Archived check box

When checked, signifies that a file has been modified or is newly created.  When unchecked, the file is skipped by the MS-DOS BACKUP or XCOPY commands issued with the /M switch.

System File check box

When checked, classifies the file as a system file.

Hidden File check box

When checked, hides the file so it doesn't appear in an MS-DOS directory listing.

Change push button

Assigns selected attributes to the file.

Change All push button

Changes the attributes of all tagged files.

Cancel push button

Returns to the Files panel of Filer without taking action.

For more information about file attributes, see your MS-DOS manual.


Attributes SeeAlso
See Also

Filer


Average Dialog

See Also

The Average dialog is used to compute the average for a numeric expression.  This dialog contains these options:

Expr... check box

Displays the Expression Builder so you can create an expression to average using fields from an open table.  When checked, an expression has been created.

Scope... check box

Displays the Scope dialog so you can specify which records to include in the average.  When checked, a Scope other than ALL has been specified.

For... check box, While... check box

Displays the Expression Builder to specify For and/or While conditions.  When checked, a For and/or While condition has been set.

Memory Variables list

Displays existing memory variables.

To Variable text box

To store the results of the average in an existing or new memory variable, choose the existing variable from the Memory Variables list or type new variable name in the text box.

OK push button

Computes the average.

Cancel push button

Exits the dialog without taking action.


Average Dialog SeeAlso
See Also

Database Menu

Expression Builder Dialog

Scope Dialog

View Window


Beautification Options Dialog

See Also

Displays the Beautification Options dialog so you can make cosmetic changes to the appearance of a program file.  The Beautification Options dialog contains these options:

Make Key Words area

UPPER CASE radio button

Changes key words to all upper-case.

lower case radio button

Changes key words to all lower-case.

No Change radio button

Leaves capitalization unchanged.

Make Variables area

UPPER CASE radio button

Changes variables to all upper-case.

lower case radio button

Changes variables to all lower-case.

No Change radio button

Leaves capitalization unchanged.

Indentation area

Tabs radio button

Uses established tab settings to indent control structures (for example, IF/ENDIF and DO WHILE/ENDDO).  You can use the Tabs option when indenting program files that use proportional fonts so that the program will line up visually.  For more information about setting tabs in FoxPro, refer to the _TABS topic.

Spaces radio button

Uses spaces to indent under control structures (for example IF/ENDIF, DO WHILE/ENDDO).  Use the spinner to specify the number of spaces to indent, or type the number in the text box.

Extra Indent Beneath Procedures check box

When checked, FoxPro adds an extra indent beneath procedure and function statements.

Extra Indent Beneath DO CASE check box

When checked, FoxPro adds an additional indent under DO CASE statements.

Use Action Diagram Symbols check box

This check box is enabled only when the font used in the current editing session is FoxFont.  When checked, FoxPro adds action diagram symbols to your program file.  These symbols connect control structures (for example, IF) and their terminators (for example, ENDIF) to give you a quick visual check on the organization of your program.

You must delete the action diagram symbols before saving or compiling your program.  To delete action diagram symbols, choose Undo from the Edit menu before saving the file, or choose Beautify... again and clear the Action Diagram Symbols check box.

Existing FoxDoc Headings area

If your program contains FoxDoc headings, you can choose to leave them unchanged or delete them automatically by selecting the appropriate radio button.

Beautify push button

Applies the specified options to your file.

Cancel push button

Exits the dialog without taking action.

Changes made to beautify your program file are not permanent until you save the altered file.  You can choose Beautify... as many times as you want, selecting different combinations of options each time to create the desired appearance for your program file.  To save changes to the program file, choose Save or Save As... from the File menu.


Beautification Options SeeAlso
See Also

FoxDoc Dialog

Program Menu

Save As Dialog

_TABS System Memory Variable


Browse Window

See Also

The Browse window displays the contents of the selected table.  The Browse menu allows you to examine and make changes to the table, and contains these options:

Change/Browse

Displays the table in the Browse window in Change mode.  If the window is in Browse mode, the menu option is Change.  If the window is in change mode, the menu option is Browse.

Grid

Removes or adds vertical lines between data in Browse window.  If the grid is on, a check mark appears to the left of the Grid menu option.  If the grid is off, the menu option appears without a check mark.  Choose the option to toggle between on and off.

Link Partitions

Links or unlinks the two partitions of a split window.  If the partitions are linked, a check mark appears to the left of the Link Partitions menu option.  When partitions are linked, scroll with either vertical scroll bar to scroll both partitions.  If the partitions are unlinked, the menu option appears without a check mark.  Choose the option to toggle between linked and unlinked partitions.

Change Partition

Activates the inactive partition of a split window and deactivates the active partition.  This menu option is only enabled when the Browse window is split.

Font...

Displays the Font dialog so that you can change the font, font style or font size of the text in the Browse window.

Size Field

Allows you to change the size of a field by using the arrow keys and then pressing Enter or Return.

Move Field

Allows you to move a field to a new location in the table by using the arrow keys then pressing Enter or Return.

Resize Partitions

Activates the window splitter so that you can use the arrow keys to partition the window or change size of an existing partition.

Goto...

Displays the Goto dialog, which allows you to position the record pointer on a specific record in Browse window.

Seek...

Displays the Expression Builder, which allows you to search the active table using an index.  This option is enabled when the table is indexed and an order is set.

Toggle Delete

Activates or deactivates the deletion marker at the left edge of a record, marking or unmarking it for deletion.

Append Record

Adds a blank record to the end of the table.

To create calculated fields, use the BROWSE FIELDS command in Command window.


Browse SeeAlso
See Also

Append Mode

Change Mode

Database Menu

Expression Builder Dialog

Font Dialog

Goto Dialog

Table Structure Dialog

Text Editing

View Window


Build Option Dialog

See Also

This dialog is used to create a new project file, refresh an existing project file or create a custom application.  This dialog contains these options:

Rebuild Project radio button

Builds a project.

Build Application radio button

Creates an application from the project.

Build Executable radio button

Creates executable programs (enabled only when the optional FoxPro Distribution Kit is installed).

Display Errors check box

Displays errors that occur during build process.

Rebuild All check box

Refreshes all files in project.

OK push button

Builds the project, application or executable file.  If FoxPro cannot locate a file in the project, the Locate File dialog appears.

Cancel push button

Exits the dialog without taking action.


Build Option SeeAlso
See Also

Locate File Dialog

Project Window


Calculate Dialog

See Also

The Calculate dialog is used to perform financial and statistical operations on fields in a table or on expressions involving fields.  This dialog contains these options:

Expr... check box

Displays a special Expression Builder dialog with only the Math popup so that  you can create a calculated expression.  When checked, an expression has been created.

Scope... check box

Brings forward the Scope dialog so that you can specify which records the calculation will include.  When checked, a scope other than ALL has been set.

For... check box, While... check box

Displays the Expression Builder to specify For and/or While conditions.  When checked, a For and/or While condition has been set.

Memory Variables list

Displays existing memory variables.

To Variable text box

To store the results of the calculation in an existing or new memory variable, choose the existing variable from the Memory Variables list or type new variable name in the text box.

OK push button

Performs the calculation.

Cancel push button

Exits the dialog without taking action.


Calculate SeeAlso
See Also

Database Menu

Expression Builder Dialog

Scope Dialog


Calculate Field Dialog

See Also

In the Calculate Field dialog, you select a mathematical operation to create a computed field.  The options in this dialog are:

Reset popup

Specifies the point at which the calculate operation for a field is set to zero.  Possibilities include End of Report, End of Page, End of Column and any defined groups.

Nothing radio button

No computations are made on field or variable.

Count radio button

Counts number of times variable exists.

Sum radio button

Computes additive sum of values of variable.

Average radio button

Computes arithmetic mean (average) of variable values.

Lowest radio button

Displays lowest value that occurred in variable.

Highest radio button

Displays highest value that occurred in variable.

Std. Deviation radio button

Returns square root of variance for variable values.

Variance radio button

Measures degree to which an individual field value varies from the average of all the values.

OK push button

Remembers settings and returns you to the Report Expression dialog.

Cancel push button

Exits the dialog without taking action.


Calculate Field SeeAlso
See Also

Data Grouping Dialog

Report Expression Dialog

Report Layout Window


Calculator

See Also

The Calculator desk accessory can be used like a typical calculator.

Calculator keyboard equivalents:

Keystroke	Equivalent
Q	*
R	MR
N	*
A	M+
Z	MC
S	M-
C	Press once to erase current value, twice to erase current calculated value and operator.
MC	Clears stored number from memory.
MR	Restores number from memory.
M+	Stores a number in memory or adds to number in memory.
M-	Subtracts from number in memory.


Calculator SeeAlso
See Also

Help Menu

Preferences Dialog


Calendar/Diary

See Also

The Calendar/Diary desk accessory is used to schedule appointments.

This dialog contains these options:

< Month|Month > push buttons

Changes month backward and forward.

< Year|Year > push buttons

Changes year backward and forward.

Today push button

Selects today's date.

Diary panel

A text region.  Use standard text editing techniques.


Calendar/Diary SeeAlso
See Also

Help Menu

Preferences Dialog


Change Link

See Also

When a general field editing window is frontmost, you can choose the Change Link... option to display the Edit Link dialog.  This dialog enables you to reestablish a link between a source application and the OLE object in the active general field.  You need to reestablish the link if you have changed the name or location of a linked file after creating the link.


Change Link SeeAlso
See Also

Edit Link

Edit Menu

Insert Object Dialog

Paste Special


Change Mode

See Also

This displays the Browse window in Change mode, allowing you to edit data in the selected table.


Change SeeAlso
See Also

Browse Window

Record Menu


Check Box Dialog

See Also

The Check Box dialog is used to specify check box settings and contains these options:

2D Style radio button (FoxPro for Macintosh only)

Click if you would like the check box to have a two-dimensional look.

3D Style radio button (FoxPro for Macintosh only)

Choose if you would like the check box to have a three-dimensional look.

Picture

Choose to include pictures instead of written prompts for the check boxes.

Picture File... push button

Choose this button to select and preview a picture file. Enabled when you choose Picture.

Check Box Prompt text box

Enter text to appear next to the check box.

Variable... push button

Brings forward the Choose Field/Variable dialog so you can specify a numeric or logical memory variable or table field for the check box.

Options area

Checked check box

When checked, assigns default value to the check box.

Disabled check box

When checked, the check box in the generated screen will be disabled by default.  The check box in the generated screen can be enabled later by issuing SHOW GETS ENABLE or SHOW <field> ENABLE in a code snippet.

Clauses area

When... push button

Opens the Code Snippet dialog so you can add code that is processed before the field is entered.  If the code you add doesn't return a logical .T., the field cannot be selected.

Valid... push button

Opens the Code Snippet dialog so you can add code that is processed before the field is exited.  If the code you add doesn't return a logical .T., the field cannot be exited.

Message... push button

Opens the Code Snippet dialog so you can add a procedure or an expression to be displayed in the status bar.

Comment... push button

Opens the Comment dialog so you can add comments to the generated code.  Comments are entirely for your reference and are ignored when the screen program is run.

OK push button

Established check box settings.

Cancel push button

Exits the dialog without taking action.


Check Box SeeAlso
See Also

Choose Field/Variable Dialog

Code Snippet Dialog

Comment Dialog

Expression Builder Dialog

Hot Keys Dialog

Picture Dialog

Screen Design Window


Choose Field/Variable Dialog

See Also

The Choose Field/Variable dialog contains these options:

Choose a Field or Variable text box

Enter the desired field or memory variable.

Fields list

Displays fields in the table displayed on the From Table popup control. Double-click on the desired field to move the field to the Choose a Field or Variable text box.

Memory Variables list

Displays available memory variables.  Double-click on the desired memory variable to move it to the Choose a Field or Variable text box.

From Table popup

Displays open tables so you can choose the table containing the desired field.

OK push button

Performs the calculation.

Cancel push button

Exits the dialog without taking action.


Choose Field/Variable SeeAlso
See Also

Check Box Dialog

Popup Dialog

Push Button Dialog

Radio Button Dialog

Screen Design Window


Code Snippet Dialog

See Also

The Code Snippet dialog is used to create a code snippet for a procedure or an expression and contains these options:

Procedure radio button

Specifies a procedure code snippet for the specified clause.

Expression radio button

Defines an expression code snippet for the specified clause.

Edit push button

Opens an editing window for the procedure or brings forward the Expression Builder for an expression.  Choose OK to enter the editing window.  Closing the editing window retains changes.  If you don't want to keep the changes after you close the editing window, do not save changes when you close the screen or menu.

Text Edit Region

Displays and allows you to edit the expression or procedure.  Use of tabs is permitted.

OK push button

Saves the code snippet.

Cancel push button

Exits the dialog without taking action.


Code Snippet SeeAlso
See Also

Expression Builder Dialog

Generate Screen Dialog

Menu Design Window

Screen Design Window

Screen Layout Dialog

Text Editing


Command Window

See Also

The Command window is used to enter FoxPro commands.  The Command window keeps a history of the commands that you enter during a FoxPro session, and you can re-execute commands by positioning the cursor on the desired command and pressing Enter (Return). If the Command window is not visible, choose Command from the Window menu.


Command SeeAlso
See Also

Text Editing

Window Menu


Comment Dialog

See Also

The Comment dialog is used to enter comments about the selected object in a screen, report or query.  Comments are for personal use and do not affect the output.

You can also include transporter directives in comments to tranport objects created in the Screen Builder and Report Writer to specific FoxPro platforms.  For additional information about these transporter directives, see the Transporting Files topic.


Comment SeeAlso
See Also

Check Box Dialog

List Dialog

Popup Dialog

Push Button Dialog

Radio Button Dialog

Report Expression Dialog

Report Layout Window

RQBE Window

Screen Design Window


Compile Dialog

See Also

The Compile dialog is used to compile program (.PRG), screen (.SPR), menu (.MPR), query (.QPR) and format (.FMT) files.  The Compile dialog contains these options:

File to Compile list

Select the file(s) to compile.

Current Directory/Folder list

Select the directory or folder containing the file(s) to compile.

Drives popup

Select the drive where the file(s) to compile are located.

Show All Files check box

Displays all file types when checked.

Compile push button

Compiles the selected files.

Cancel push button

Exits the dialog without taking action.

Tag All push button

Selects all file names in scrollable list.

Tag None push button

Deselects all files chosen.

More>> push button

Expands the dialog so you can specify additional information in the following areas.

Options area

Encrypt Compiled Files check box

When checked, scrambles compiled files for security.

Include Debugging Information check box

When checked, displays each line of the program in Trace window during execution.

Compiled Updated Files Only check box

When checked, compiles new files or those that were updated since last compiled.

Error Location area

.ERR File check box

Stores error messages in an .ERR file for each file selected.

File... push button

This push button is enabled when the .ERR file check box is unchecked.  Stores error messages for all files selected in the Files to Compile list together in the log file you specify.  Specify a name for the log file by typing a name in the text box or choosing File... to display the Save As dialog.

Append check box

When checked, adds error messages to specified log file.

Location of Compiled Files area

Directory.../Folder... push button

Displays the Select Directory or Select Folder dialog so you can specify a directory where compiled files will be saved.


Compile SeeAlso
See Also

Program Menu

Save As Dialog

Select Directory Dialog

Select Directory/Folder Dialog

Trace Window


Convert to Static

See Also

This option is enabled when a general field window is frontmost.  The Convert to Static option allows you to change the OLE object in the general field so that it cannot be modified.

For example, you may have embedded into the general field a graph designed and created using MS Graph, but you don't want the graph to be changed.  The Convert to Static option changes the linked or embedded OLE object in the current general field window to a standalone, or static, picture.  The picture can be viewed from a general field window, but you can't open the source application from FoxPro for Windows to make changes.  If the object is a sound object, or a Microsoft Word document, just the icon remains in the general field window.  If the selected OLE object is a linked object, this option also breaks the link to the source application so that it is no longer affected by changes in the source document.

Using the Convert to Static option to change an OLE object to a picture has the same effect as if you originally had embedded or linked the object using the Paste option and had chosen the picture format.

Note   You cannot convert a static object back to an embedded or linked object.  If you want to make the object editable, embed or link it again.


Convert To Static SeeAlso
See Also

Edit Menu

Insert Object Dialog

Object

Paste Special


Control Menu

See Also

The Control menu allows you to restore a window to its previous size, move a window or dialog, size a window, minimize a window, maximize a window, close a window or dialog, or select the next window using the keyboard.

Click on the Control-menu box in the upper left corner of the window or dialog to display the Control menu.  The Control menu for a window contains all of the options listed below, while the Control menu for a dialog typically contains only the Move and Close options.

Restore

Available only when the current window is maximized, the Restore option returns the window to its previous, unmaximized size.

Move

Allows you to move a window or dialog using the keyboard.  When you choose the Move option on the window or dialog's Control menu (or press Ctrl+F7) the pointer changes to a four-headed arrow.  Use the arrow keys to move the window or dialog to a new location.  An outline of the window or dialog moves as you use the arrow keys.  When you press Enter, the window or dialog moves to the location of the outline.

Size

Allows you to change the size of a window using the keyboard.  When you choose Size from the Control menu, the pointer changes to a four-headed arrow.  Use the arrow keys to increase or decrease the width and/or height of the window outline.  When you press Enter, the window appears in the new size.

Minimize

Reduces the current window to an icon, which is placed in the lower-left corner of the desktop.  Although the window appears closed, it is only temporarily removed from view.

Maximize

Expands the current window to the full size of the screen display.

Close

Closes an open window or dialog.  You can also close a window or dialog by double-clicking on the Control-menu box.

Next Window

Activates the next open window.


Control Menu See Also
See Also

Navigating in the Interface


Copy Directory Dialog
Copy Directory/Copy Folder Dialog

See Also

The Copy Directory/Folder dialog copies directories or folders tagged in the Filer to the specified location.  This dialog contains these options:

Target Directory.../Folder... push button

Displays the Target Directory dialog so you can choose a destination drive and directory or folder.

Replace Existing Files check box

When checked, overwrites files without confirmation.

Preserve Directories check box

When checked, copies directory structure as well as files themselves.

Copy push button

Copies the tagged directories.

Cancel push button

Exits dialog without taking action.


Copy Directory SeeAlso
See Also

Filer

Target Directory Dialog


Copy Files Dialog

See Also

The Copy Files dialog is used to copy tagged files in the Filer to a new location without disturbing files in the original location.  This dialog contains these options:

Copy Tagged Files As text box

Specify name for copied file.

Target Directory.../Folder... push button

Displays the Target Directory dialog so you can specify the drive and directory to which files will be copied.

Replace Existing Files check box

When checked, overwrites files in target directory having the same name as files being copied without prompting for confirmation.

Preserve Directories/Folders check box

When checked, copies directory structure and files.

Copy push button

Copies the tagged files.

Cancel push button

Exits dialog without taking action.


Copy Files SeeAlso
See Also

Filer

Target Directory Dialog


Copy To Dialog

See Also

The Copy To dialog is used to copy the contents of a table to another file, and contains these options:

Output area

Save As... push button

Displays the Save As dialog so you can specify a name for the new file.

Fields... push button

Displays the Field Picker dialog so you can select the fields to be output to the file.  Choose the appropriate field by double-clicking on it.  The selected fields are then displayed in the non-editable text region next to the Fields... push button.  See the Field Picker topic for more information.

File Type popup

Displays the possible file types to copy to:

File Type	Description
Table (DBF)	FoxPro table
Delimited with Tabs	Text file with fields separated by one tab
Delimited with Commas	Text file with fields separated by one comma
Delimited with Spaces	Text file with fields separated by one space
System Data Format (SDF)	Text file with fixed length records that end with a carriage return and line feed
Symbolic Link Format (SYLK)	Symbolic Link interchange format
Data Interchange Format (DIF)	Data Interchange Format
Microsoft Excel (XLS)	Microsoft Excel versions 2.0, 3.0 and 4.0
Microsoft Multiplan (4.01)(MOD)	Microsoft Multiplan version 4.x Binary File Format
Symphony (1.0)(WRK)	Symphony versions 1.0 and 1.01 spreadsheet
Symphony (1.1/1.2)(WR1)	Symphony versions 1.1 and 1.2 spreadsheet
Lotus 1-2-3 (1A)(WKS)	Lotus 1-2-3 release 1-A spreadsheet
Lotus 1-2-3 (2.x)(WK1)	Lotus 1-2-3 release 2.xx spreadsheet
Lotus 1-2-3 (3.0)(WK3)	Lotus 1-2-3 release 3.0 spreadsheet
To choose a file type, click on the Down Arrow to display the popup, then click on the desired file type.

Criteria area

You can use push buttons in the Criteria area to specify conditions that records must meet to be appended to the table.

Scope... push button

Displays the Scope dialog so you can specify which records to copy.

For... push button

Displays the Expression Builder so you can create a logical expression that every record must meet to be copied to the table.  See the Expression Builder topic for more information.

While... push button

This push button is disabled.

Copy push button

Copies the contents of the file.

Cancel push button

Exits the Append From dialog without taking action.


Copy To SeeAlso
See Also

Database Menu

Expression Builder Dialog

Field Picker Dialog

Save As Dialog

Scope Dialog


Count Dialog

See Also

The Count dialog returns the number of records in the active table that fall within a specified scope, and contains these options:

Count area

Scope... check box

Displays the Scope dialog.  When checked, a scope other than ALL has been set.

For... check box

Displays the Expression Builder so you can specify a For condition.  When checked, a For condition has been set.

While... box

Displays the Expression Builder so you can specify a While condition.  When checked, a While condition has been set.

Memory Variables list

Lists existing variables that you can choose to place results in.

To Variable text box

Allows you to type in the name of a new or existing variable in which to place the count results.


Count SeeAlso
See Also

Database Menu

Expression Builder Dialog

Scope Dialog


Data Grouping Dialog

See Also

This dialog is used to create up to 20 separate groups of data and perform operations on those groups.  Grouping data allows you to print headers and footers when the group value changes.  It does not order the records.  Sorting or indexing must be performed outside of the Report Writer.

The options in this dialog are:

Group list

Displays group expressions as defined.  To change order of groups in the list, select the group and press Ctrl+PgUp (or [image] +Page Up) or Ctrl+PgDn ( [image] +Page Down) or click on the button to the left of the group name and drag.  Objects previously defined in a group band are moved when their order is changed.  Groups lower in the list appear as subgroups of groups higher in the list.

Add... push button

Opens the Group Info dialog so you can define a group expression and determine page breaks and header reprinting.

Change... push button

Brings forward Group Info dialog for selected group.  This button is enabled when an expression is displayed in the Group list.

Delete push button

Deletes the selected group from the Group list and the report.

OK push button

Creates the specified groups in the report.


Data Grouping SeeAlso
See Also

Calculate Field Dialog

Expression Builder Dialog

Group Info Dialog

Report Layout Window


Database Menu

See Also

The Database menu contains options for performing operations on tables, and printing reports and labels, including:

Setup... displays the Setup dialog so you can modify or maintain the active table.

Browse opens a Browse window in the active table.

Append From... displays the Append From dialog so you can move data from another table or another file to the active table.

Copy To... displays the Copy To dialog so you can move data from the active table to another table or another file.

Sort... displays the Sort dialog so you can create a new table of rearranged data from the active table.

Total... displays the Total dialog so you can sum the values in specified fields of the active table.

Average... displays the Average dialog so you can calculate the average of a specified expression.

Count... displays the Count dialog so you can display the number of records that meet specified criteria.

Calculate... displays the Calculate dialog so you can calculate financial or statistical value based on a specific expression.

Report... starts the Report Writer so you can produce a report from the active table.

Label... starts the Report Writer so you can produce a set of labels from the active table.

Pack removes records marked for deletion from the active table.

Reindex rebuilds any open index files associated with the active table.


See Also

Append From Dialog

Average Dialog

Browse Window

Calculate Dialog

Copy To Dialog

Count Dialog

Pack

Reindex

Report Writer

Setup Dialog

Sort Dialog

Sum Dialog

Total Dialog


Debug Window

See Also

The Debug window monitors values in programs.

Type variables and expressions to be monitored in the left partition of the Debug window and press Enter (Return) after each.  As your program runs, the values are displayed in the right partition of the Debug window.  You can also set breakpoints based on a variable or expression by clicking in the breakpoint column (between the two partitions) next to the desired variable or expression.

In FoxPro for Windows, You can use the Font..., Enlarge font and Reduce font options on the Control menu for the Debug window to change the font in the Debug window.


Debug SeeAlso
See Also

Font Dialog

Program Menu

Trace Window


Delete Directory Dialog
Delete Directory/Delete Folder Dialog

See Also

The Delete Directory/Folder dialog deletes directories or folders tagged in the Tree panel of the Filer. This dialog contains these options:

Delete Files Only check box

When checked, removes files from disk but leaves directory structure intact.

Remove All Subdirectories/Subfolders check box

When checked, deletes subdirectories/subfolders of tagged parent directories or folders.

Delete push button

Removes the tagged directory or folder and files it contains and displays next tagged directory or folder.

Skip push button

Leaves current directory or folder unchanged and displays next tagged directory or folder.

Cancel push button

Halts operation without deleting additional directories or folders.

Delete All push button

Deletes all tagged directories or folders and files in those directories or folders.


Delete Directory SeeAlso
See Also

Filer


Delete Files Dialog

See Also

The Delete Files dialog is used to erase files tagged in the Filer and contains these options:

Delete push button

Erases displayed file from disk.  If more files are tagged, next file appears in the Delete Files dialog.

Skip push button

Passes over displayed file without deleting it.

Delete All push button

Bypasses confirmation function of dialog and deletes tagged files.

Cancel push button

Returns to Files panel of Filer.


Delete Files SeeAlso
See Also

Filer


Delete Dialog

See Also

The Delete dialog is used to mark records for deletion.  The Delete dialog contains these options:

Scope... push button

Brings forward Scope dialog.  The default value is Next 1, which specifies the current record.

For... push button
While... push button

Both push buttons display the Expression Builder so you can specify For and/or While conditions.  The expression you build is then displayed in the non-editable text region in the Delete dialog.

Delete

Marks records for deletion.


Delete SeeAlso
See Also

Expression Builder Dialog

Pack

Recall Dialog

Record Menu

Scope Dialog


Detail Dialog

See Also

When you double-click on the button to the left of the detail band separator bar in the Report Layout window, the Detail dialog appears so you can specify settings for the detail band.

This dialog contains these options:

Height spinner

Set the height of the band in the spinner.  You can also adjust the size of the bands by dragging the button to the left of the detail, page header and page footer bars.

In. radio button
Cm. radio button

Sets the unit of measurement, inches or centimeters, displayed in the spinner.

Constant Band Height check box

When checked, prevents the detail band from stretching to accommodate lengthy data or shrinking to absorb blank lines that have been removed. Keeping the band height constant is especially important if you are printing on a predetermined label form.

OK push button

Applies settings to detail band.

Cancel push button

Exits dialog without taking action.


Detail SeeAlso
See Also

Data Grouping Dialog

Print When Dialog

Report Expression Dialog

Report Layout Window


Do Dialog

See Also

The Do dialog specifies a program to execute and contains these options:

Do Program File text box

Type in the name of the program you want to run.

Do Program File list

Displays all files in the specified directory or folder that you can run.

Directory list

Displays the current directory and a list of all available directories so you can specify the directory in which the desired program is located.

Drives/Folder popup

Specifies the drive or folder where the desired file is located.

Do push button

Runs the selected program.


Do SeeAlso
See Also

Command Window

Program Menu


Edit Link Dialog

See Also

This dialog allows you to select the file to which the object in the open and frontmost general field window will be linked.  The Edit Link dialog contains the following options:

File Name text box

Allows you to type in the name of the file you want to link.

File Name list

Displays all files specified by either the List Files of Type popup or the All Files check box.  Select the file and choose the OK button, or double-click on the file name.

List Files of Type popup

Allows you to specify which type of file to display in the File Name list.

Directory list

Displays a list of all available directories and allows you to specify the directory in which the desired file is located.

Drive/Folder popup

Allows you to specify the drive or folder where the desired file is located.

OK push button

Links the selected file to the object in the open and frontmost general field editing window.

Cancel push button

Exits the dialog without taking action.

All Files check box

When checked, this option displays all files, regardless of type, in the File Name list.


Edit Link Dialog SeeAlso
See Also

Edit Menu

Insert Object Dialog


Edit Menu

See Also

The Edit menu provides text editing functions. Most of the Edit menu options move a text cursor, or manipulate or modify text, but one set of options provides access to OLE functions.  The Edit menu OLE options are available only for a general field of an open table.

The Edit menu contains the following options.

Undo reverses the most recent text editing action.

Redo reverses the most recent Undo.

Cut removes the selected text to the Clipboard.

Copy duplicates the selected text.

Paste places cut or copied text at the cursor location.

Paste Special... displays the Paste Special dialog so you can move OLE objects to general fields.

Clear removes the selected text without placing it on the Clipboard.

Insert Object... displays the Insert Object dialog so you can place an OLE object in a general field.

Object... activates an OLE object

Change Link... displays the Edit Link dialog so you can update an object link.

Convert To Static changes a linked or embedded OLE object to a static picture.

Select All selects all objects or text in the active window (except Browse windows).

Goto Line... displays the Goto Line dialog so you can move the cursor to the specified line number.

Find... displays the Find dialog so you can search for text.

Find Again repeats the last text search.

Replace And Find Again substitutes new text and continues the search.

Replace All substitutes new text for all occurrences of the specified text.

Preferences... displays the Preferences dialog so you can establish save, justification, and editing preferences.


See Also

Edit Link Dialog

Find Dialog

Goto Line Dialog

Insert Object Dialog

Object Dialog

Paste Special Dialog

Preferences Dialog

Text Editing


Edit Region Dialog

See Also

The Edit Region dialog is opened by clicking the edit region tool then dragging to size in the Screen Design window or by double-clicking on an edit region in the Screen Design window.  This dialog allows you to define an editable text region, usually for a memo field, in the generated screen.

The Edit Region dialog contains the following options:

Input... push button

Opens the Choose Field/Variable dialog.  You can also enter the field or variable that will hold the text of the editable text region in the text box beside the push button.

Format... push button

Opens the Format dialog so you can choose right alignment or centering for text entered in the edit region.  By default, text entered in a text editing window is left aligned.

Clauses area

When... push button

Opens the Code Snippet dialog so you can add code that is processed before the edit region is entered.  If the code you add doesn't return a logical .T., the edit region cannot be selected.

Valid... push button

Opens the Code Snippet dialog so you can add code that is processed before the edit region is exited.  If the code you add doesn't return a logical .T., the edit region cannot be exited.

Message... push button

Opens the Code Snippet dialog so you can add a procedure or an expression to be displayed in the status bar.

Error... push button

Opens the Code Snippet dialog so you can include custom error messages to be displayed if the code you add returns a logical .F.

Comment... push button

Opens the Comment dialog so you can add comments to the generated code.  Comments are entirely for your reference and are ignored when the screen program is run.

Options area

Select on Entry check box

When checked, text in the edit region will be selected when the edit region is entered.

Initially Disable Edit Region check box

When checked, the edit region in the generated screen will be disabled by default.  The edit region can later be enabled by issuing SHOW GETS ENABLE in a code snippet.

Scroll Bar on Edit Region check box

When checked, a scroll bar is included with the edit region.

Allow Tabs in Edit Region check box

When checked, the user can set and use tabs in the edit region.  Ctrl+Tab or [image] +Tab will allow the user to exit the edit region.  If not checked, Tab will move the cursor to the next field in the screen.

Character Length spinner

Enter the maximum number of character that can be entered in the edit region.  If you select 0, no limit is placed on the number of characters.


Edit Region SeeAlso
See Also

Choose Field/Variable Dialog

Code Snippet Dialog

Comment Dialog

Format Dialog

Screen Design Window


Edit Screen Set Dialog

See Also

The Edit Screen Set dialog is used to manipulate your screen sets and contains these options:

Edit push button

Opens the Screen Design window so you can edit the selected screen(s).  If you are opening a screen that needs conversion, this button first displays the Transporter dialog.

Add push button

Displays the Add Screen dialog so you can add a screen to the screen set.

Remove push button

Removes the selected screen(s) from the Screen Set list.

Arrange push button

Displays the Arrange dialog so that you can arrange the screens within the window.

Screen Set Name text box

Enter a name for the screen set.

More>> push button

Expands the dialog to include Generated Code Options so that you can specify whether or not specific code segments will be automatically generated.

Generated Code Options area

Output File... push button

Displays a Save As dialog so you can specify a name for screen set.

Open Files check box

When checked, code is generated to open databases and indexes and to set up relations.

Close Files check box

When checked, code is generated to close all files upon completion of generated program.

Define Windows check box

When checked, windows are automatically defined in the generated program using the information specified in Screen Layout dialog.

Release Windows check box

When checked, RELEASE WINDOW statements are generated.

Cycle Through Fields check box

When checked, READ CYCLE is generated in the program.

Execute Multiple READs check box

When checked, a READ command is generated between the format statements for each screen panel.

READ NOLOCK check box

When checked, a NOLOCK clause is generated with the READ command.

Modal Screens check box

When checked, a MODAL clause is generated with the READ command so that only widows involved in the READ can be activated or accessed.

Associated Windows... push button

When checked, brings forward the Associated Windows dialog.

OK push button

Applies the settings you've specified.

Cancel push button

Exits dialog without taking action.


Edit Screen Set SeeAlso
See Also

Add Screen Dialog

Associated Windows Dialog

Comment Dialog

Debug Window

Menu Design Window

Open Dialog

Project Window

Save As Dialog

Screen Design Window

Screen Layout Dialog

Trace Window

Transporter Dialog


Environment Dialog

See Also

The Environment dialog is used to set environment information for reports or screens and contains these options:

Save push button

Saves the current environment, including open tables, selected work area, indexes, relations.

Restore push button

If you have changed environment settings while modifying a screen or a report, Restore returns the environment to the previously saved environment.

Clear push button

Clears previously saved environment.

Cancel push button

Exits dialog without taking action.


Environment SeeAlso
See Also

Page Layout Dialog

Report Layout Window

Screen Design Window

Screen Layout Dialog


Execution Throttle Dialog

See Also

The Execution Throttle dialog specifies execution speed of programs in the Trace window.  Use the spinner or type in number of seconds you want each line of program code to delay when executing.  Value ranges 0 to 5.0 seconds.


Execution Throttle SeeAlso
See Also

Command Window

Debug Window

Trace Window


Exit

See Also

When you choose Exit from the File menu, your FoxPro session ends and control is returned to the system.  The same actions occur when you type QUIT in the Command window.


Exit SeeAlso
See Also

Command Window

File Menu


Quit

See Also

When you choose Quit from the File menu, your FoxPro session ends and control is returned to the Windows Program Manager.  The same actions occur when you type QUIT in the Command window.


See Also

Command Window

File Menu


Expression Builder Dialog

See Also

The Expression Builder dialog is used to create expressions and contains these options:

Functions area

String Functions popup

Displays available functions for creating strings in an expression.  Click the desired option to insert it in the Expression text area.

Logical Functions popup

Displays available functions for adding conditions to an expression.  Click the desired option to insert it in the Expression text area.

Math Functions popup

Displays available functions for performing calculations in an expression.  Click the desired option to insert it in the Expression text area.

Date Functions popup

Displays available functions for inserting dates in an expression.  Click the desired option to insert it in the Expression text area.

Expression text region

Displays the expression as it is built.  You can also type in the expression with the keyboard.

Fields list

Displays the fields from the open table.  Double-click on the field, or Tab to the list, select the field and press Enter (Return).

Variables list

Displays available memory variables.  Double-click on the variable, or Tab to the list, select the variable and press Enter (Return).

Table popup

Displays a list of tables from which you can choose.  The Fields list shows fields from the table displayed here.

Verify push button

Choose this button to see whether the expression displayed in the Expression text area is valid.  The message "Expression is valid" appears in the status bar if the expression is OK; if not, an error message is displayed.

OK push button

Saves created expression.

Cancel push button

Exits dialog without taking action.


Expression Builder SeeAlso
See Also

Browse Window

Report Expression Dialog

Report Variables Dialog

Seek Dialog

Text Editing

View Window


Field Dialog

See Also

The Field dialog is opened by clicking the field tool then clicking in the Screen Design window or by double-clicking on a field object in the Screen Design window.  This dialog allows you to define an input field (a Get field) or an Output field (a Say field) in your screen and contains these options:

Field area

Input Field (Get) radio button

When chosen, an input field is defined in your screen.  If the field is not disabled, information can be entered or edited in an input field in your generated screen.  Input Field (Get) is the default Field.

Output Field (Say) radio button

When checked, an output field is defined in your screen.  Information can be displayed in an output field in your generated screen, but this information cannot be directly edited by the user.

Options area

3D Style check box (FoxPro for Macintosh only)

When checked, applies a three-dimensional look to the field.

Select Field on Entry check box

When checked, selects entire field when cursor enters field.

Refresh Output Field check box

Enabled when the Output Field (Say) radio button is chosen.  When checked, a SHOW routine is generated for the READ.  By including a SHOW GETS command in a valid code snippet, you can cause the output field to be updated or refreshed as the current record or expression changes.

Initially Disable Field check box

Enabled when the Input Field radio button is chosen.  When checked, the input field in the generated screen will be disabled by default.  The field can later be enabled by issuing SHOW GETS ENABLE or SHOW <field> ENABLE in a code snippet.

Range area

Lower... push button

Opens the Code Snippet dialog so you can enter a procedure or expression to set the lowest allowable value that can be entered in the input field.  You can also directly enter the value in the text box beside the push button.  If the user inputs a value lower than the value assigned to the low value in the range clause, a message with the allowed parameters is displayed in the status bar.

Upper... push button

Opens the Code Snippet dialog so you can enter a procedure or expression to set the highest allowable value that can be entered in the input field.  You can also directly enter the value in the text box beside the push button.  If the user inputs a value higher than the value assigned to the high value in the range clause, a message with the allowed parameters is displayed in the status bar.

Input... push button

Available when the Input Field radio button is chosen, this push button opens the Choose Field/Variable dialog.  You can also enter a field or variable directly in the text box beside the push button.

Output... push button

Available when the Output Field radio button is chosen.  Opens the Expression Builder dialog.  You can also enter a field or expression directly in the text box beside the push button.

Format... push button

This button is activated when a field or variable has been chosen and opens the Format dialog so you can set a default type and format for a variable or a format for a field.

Clauses area

When... push button

Opens the Code Snippet dialog so you can add code that is processed before the field is entered.  If the code you add doesn't return a logical .T., the field cannot be selected.

Valid... push button

Opens the Code Snippet dialog so you can add code that is processed before the field is exited.  If the code you add doesn't return a logical .T., the field cannot be exited.

Message... push button

Opens the Code Snippet dialog so you can add a procedure or an expression to be displayed in the status bar.

Error... push button

Opens the Code Snippet dialog so you can include custom error messages to be displayed if the code you add returns a logical .F..

Comment... push button

Opens the Comment dialog so you can add comments to the generated code.  Comments are entirely for your reference and are ignored when the screen program is run.

OK push button

Applies field settings.

Cancel push button

Exits dialog without taking action.


Field SeeAlso
See Also

Choose Field/Variable Dialog

Code Snippet Dialog

Comment Dialog

Screen Design Window


Field Picker Dialog

See Also

The Field Picker dialog allows you to specify active fields from tables.  This dialog contains the following options:

From Table popup

Displays all open tables.  The fields in the All Fields list are from the table displayed on the popup control.

All Fields list

Double-click on a field, or select the field then choose the Move push button to move it to the Selected Fields list.

Selected Fields list

Double-click on a field, or select the field then choose the Remove push button to remove it from the Selected Fields list.

Move push button

Moves the selected field from the All Fields list to the Selected Fields list.

All push button

Moves all fields from the All Fields list to the Selected Fields list.

Remove push button

Removes the selected field from the All Fields list.

Remove All push button

Deletes all fields from the Selected Fields list.

OK push button

Makes fields in the Selected Fields list active.

Cancel push button

Exits dialog without taking action.


Field Picker SeeAlso
See Also

Report Layout Window

Screen Design Window

Setup Dialog


File Information Dialog

See Also

The File Information dialog displays information about the selected file in a project, including:

Name/path of selected file

Type of selected file

Date and timestamp of current version

Date and timestamp of version last built

Date and timestamp of last build

Information about symbols

This dialog has these options:

Prior push button

Displays information for previous file.

Next push button

Displays information for next file.

OK push button

Returns to the Project window.


File Information SeeAlso
See Also

Project Window


File Menu

See Also

The FoxPro File menu options provide access to system hardware like disks and printers.  These options are:

New... displays the New dialog so you can select a file type, then opens the appropriate FoxPro power tool.

Open... displays the Open dialog so you can open an existing file.

Close removes the current window from the desktop.

Save copies the active file from memory to disk.

Save As... displays the Save As dialog so you can copy the active file from memory to disk under a new file name.

Revert allows you to abandon all modifications to the open file, returning to the last saved version of the file.

Print Setup... or Page Setup... displays the Print Setup dialog or Page Setup dialog so you can specify printer options like printer, page size, page layout, and so on.

Print... displays the Print dialog so you can print files.

Catalog Manager... starts the Catalog Manager so you can access dBASE IV and FoxPro catalogs.

If a catalog is open, you can select a tab that contains the files you want to use.

If no catalog is open, the Open dialog appears so you can choose either a FoxPro or a dBASE IV catalog.

Exit or Quit closes FoxPro.

The Catalog Manager File menu options provides the following options:

New Catalog... displays the Save As Dialog so you can create and open a new catalog.

Open Catalog... displays the Open Dialog so you can open an existing catalog.

Save copies the active file to disk.

Save As... displays the Save As Dialog so you can copy the active file to disk under a new file name.

Revert abandons all modifications to the open file, returning to the last saved version of the file.

Close removes the current window from the desktop.

Add File... allows you to select the file type from a popup list, then displays the Open Dialog so you can add the file to the open catalog.

Remove File... displays the Remove File Dialog so you can delete the selected file from the active catalog.

File Description... displays the File Description Dialog so you can change the comment that appears in the Catalog Manager status bar.

Show Paths toggles the Catalog Manager display between full path and file name-only file lists.

Print... displays the Catalog Manager Print Dialog so you can print files.

Command Window closes Catalog Manager and activates the Command window.

Quit closes Catalog Manager and exits FoxPro.


File Menu SeeAlso
See Also

Catalog Manager

Catalog Manager Print Dialog

Exit

File Description Dialog

New Dialog

Open Dialog

Print Dialog

Print Setup Dialog

Remove File Dialog

Save As Dialog


Filer

See Also

Displays the Filer desk accessory, which you can use to copy, move, rename and delete files; create directories or folders; view and change file attributes; find specific files; or check the size of one file or a group of files.  The Filer has two panels: the Files panel and the Tree panel.

The Files panel contains the following options:

A list that includes the following information about directories and files:

Item	Description

Name	Name of a file or directory/folder

Size	Size of a file in bytes

Last Modified	Date and time when the file or directory/folder was last changed

Attr	Attributes of the file (see Attr push button below)

Drives popup

Specifies the current drive.

Directories popup

Specifies the current directory or folder.  Tagged files remain tagged and subject to manipulation even if you change directories.

Files Like text box

Specifies the files you want to display.  Specify a file name and extension or any portion of a file name and extension that includes wildcard characters.  Include several specifications by separating them with semicolons.  For example, to display all .DBF and .APP files, enter: *.DBF;*.APP.

Tag All push button

Tags all files in the scrollable list.

Tag None push button

Untags all tagged files in all directories or folders.

Invert push button

Untags all tagged files and tags all untagged files in the current directory or folder.

Find push button

Displays the Find Files dialog so you can determine the criteria for finding files.

Edit push button

Opens text editing windows for all tagged files.

Copy push button

Displays the Copy Files dialog so you can copy files.

Attr push button

Displays the Attributes dialog, which shows the attributes of the tagged file.

Move push button

Displays the Move Files dialog so you can move files to other directories or folders.

Rename push button

Displays the Rename Files dialog so you can rename the tagged file(s).

Delete push button

Displays the Delete Files dialog so you can delete the tagged file(s).

Size push button

Displays the Size dialog, which shows the size of the file in bytes.

Sort push button

Displays the Sort dialog so you can set the criteria for sorting the files in the File panel.

Tree push button

Displays the Tree panel, which shows the organization of the files and directories or folders on the current volume (drive)

The Tree panel contains these options:

Rename push button

Displays the Rename Directory dialog so you can rename a directory/folder or subdirectory/subfolder.

Copy push button

Displays the Copy Directory dialog so you can copy a directory/folder or subdirectory/subfolder.

Chdir  push button

Changes the working directory or folder.

Move push button

Displays the Move Directory dialog so you can move one or more directories/folders or subdirectories/subfolders.

Mkdir push button

Displays the Make Directory dialog so you can create a new directories/folders or subdirectories/subfolders.

Delete push button

Displays the Delete Directory dialog so you can delete one or more directories/folders or subdirectories/subfolders.

Size push button

Displays the size dialog, which shows size information about the selected directories/folders or subdirectories/subfolders.

Files push button

Displays the Files panel.


Filer SeeAlso
See Also

Attributes Dialog

Copy Directory Dialog

Copy Files Dialog

Delete Files Dialog

Find Dialog

Find Files Dialog

Help Menu

Move Directory Dialog

Rename Directory Dialog

Rename Files Dialog

Size Dialog

Sort Files Dialog

Specify Text Dialog

Text Editing


Find Dialog

See Also

The Find dialog allows you to specify text to search for and replace in the current editing window or Browse window.  When a Browse window is frontmost, you can use the Find dialog to search fields in a table for specific text.  The Replace With text box and Search Backward check box are not available when searching in a Browse window.

The Find dialog contains these options:

Look For text box

Specifies the text string to search for.

Replace With text box

Specifies the text string that replaces the Look For text string.

Options area

Ignore Case check box

When checked, locates text with any combination of upper- and lower-case letters.  This option is checked by default.

Match Whole Word check box

When checked, locates distinct occurrences of words, not embedded text.

Wrap Around check box

When checked, searches file from the cursor location to the end of the file, then continues to the beginning of the file and searches to the original cursor position.

Search Backward check box

When checked, searches from the current cursor location toward the beginning of the file.

Find push button

Begins the search process.

Replace All push button

Only enabled when the Replace With: text area has data entered, finds all occurrences of the Look For: text string and automatically replaces those occurrences with the Replace With: text.

Cancel push button

Exits the dialog without taking any action.

You can search for special characters in the Find dialog using these character representations:

Type ...	To Find ...

\r	Enter (carriage return)

\t	Tab

\\	Backslash

\n 	New line (line feed)

After FoxPro locates the text string you specified in the Find dialog, the following options are enabled on the Edit menu:

Find Again

Locates the next occurrence of the string.  The keyboard shortcut for Find Again is Ctrl+G or [image] +G.

Replace and Find Again

Replaces a matching string of Look For text with the Replace With text that you specified in the Find dialog, then continues to search for the next occurrence of matching text.  When FoxPro finds the next match, it pauses again to await instructions.  If you don't want to replace this specific match, choose Find Again instead of Replace and Find Again.  You can also use the Ctrl+E or [image] +L key combination as a shortcut when replacing and finding text again.

Replace All

Replaces every occurrence of a matching string of Look For text with the Replace With text that you specified in the Find dialog.  It does not pause and ask about replacing the text each time it encounters a match.  When FoxPro has found the last match in the text, a "Not found" message appears on the status bar to let you know that the search is complete.

For information about searching for a string of text in multiple files, refer to the Filer help topic.


Find SeeAlso
See Also

Browse Window

Edit Menu

Filer

Text Editing


Find Files Dialog

See Also

The Find Files dialog is used to search for files by file type and name in the Filer.

This dialog contains these options:

Find and Tag Files Which Have Names Like text box

Specifies a file name and extension or any portion of a file name and extension that includes wildcard characters.  Include several file specifications by separating them with semicolons.  For example, to find and tag all .DBF and .APP files, enter: *.DBF;*.APP.

Specify Text to Search For... check box

Displays the Specify Text dialog in which you can enter text strings that you want to find.

Search Subdirectories check box

When checked, this finds files that meet specifications in the current directory/folder and its subdirectory/subfolder.

Find push button

Performs the specified find operation.

Cancel push button

Exits dialog without taking action.


Find Files SeeAlso
See Also

Filer

Specify Text Dialog


Font Dialog

See Also

The Font dialog allows you to select a font type, style and size for text in the current editable window, report or screen.  Examples of the selected font attributes appear in the Sample area.

The Font dialog contains these options:

Font list

Select a font.

Font Style list

Select a font style.

Size list

Select a font size.

OK push button

Applies the selected font attributes.

Cancel push button

Discard changes and close the dialog.


Font SeeAlso
See Also

Browse Window

Report Layout Window

Screen Design Window

Text Editing


Format Dialog

See Also

The Format dialog is used to format your expressions.  The following are the formatting options available for each table field or variable type:

Character Data Formatting Options

Alpha Only check box

When checked, allows only alphabetic characters.

To Upper Case check box

When checked, converts all characters to uppercase.

R check box

When checked, non-format characters in the format expression are displayed in the screen or report.

Edit "SET" Date check box

When checked, displays data as date using current SET DATE format.

British Date check box

When checked, displays data as European (BRITISH) date.

Trim check box

When checked, removes all leading and trailing blank spaces.

Right Align check box

When checked, prints data flush right in field.

Center check box

When checked, centers data in field.

Numeric Data Formatting Options

Left Justify check box

When checked, all numeric data for field begins at leftmost position in field.

Blank if Zero check box

When checked, field is blank if output is 0.

(Negative) check box
Clauses

When checked, places negative numbers in parentheses.

Edit "SET" Date check box

When checked, displays data as date using current SET DATE format.

British Date check box

When checked, displays data as European (BRITISH) date.

CR if Positive check box

When checked, CR (credit) appears after number if number is positive.

DB if Negative check box

When checked, DB (debit) appears after number if number is negative.

Leading Zeros check box

When checked, prints all leading zeros.

Currency check box

When checked, displays currency format.

Scientific check box

 When checked, displays in scientific notation.

Date Data Formatting Options

Edit "SET" Date check box

When checked, displays data as date using current SET DATE format.

British Date check box

When checked, displays data as European (BRITISH) date.


Format Dialog See Also
See Also

Edit Region Dialog

Field Dialog

Report Expression Dialog

Report Layout Window

Screen Design Window


Format Codes Dialog

See Also

Several dialogs contain a Format text box.  You can enter the following format codes in the Format text box:

Code	Description

A	Displays only alphabetic characters.

K	Selects entire field when cursor enters field.

L	Displays logical data only.

N	Displays letters and digits only.

X	Displays any character.

9	Displays digits only for character data.  Displays digits and signs for numeric data.

#	Displays digits, blanks and signs.

$	Displays fixed dollar sign in front of numeric value.

$$	Displays floating dollar sign in front of numeric value.

*	Displays asterisks in front of the numeric value (used in combination with $ for check protection).

. (period)	Specifies decimal point position.

, (comma)	Separates digits left of the decimal point.


Format Codes SeeAlso
See Also

Edit Region Dialog

Field Dialog

Report Expression Dialog


FoxDoc Dialog

See Also

Invokes FoxDoc, a FoxPro application that automatically formats and documents FoxPro programs, applications or entire projects.

Application text box

Enter the name of your project, application or program.

Author text box

Enter your name here.

Copyright Holder text box

Enter the copyright holder information here.  If you enter an author or copyright holder but not both, FoxDoc assumes they are the same.

Copyright Date text box

Enter the copyright year or a range of years in any form.

Main File... push button

Displays a dialog in which you can choose the name of the first file in an application or the name of a project.  You can also enter the file or project name in the text box to the right of the push button.

Program Dir/Folder...  push button

Displays a dialog in which you can choose the directory or folder containing your source code.  You can also enter the directory or folder name in the text box to the right of the push button.

Data Dir/Folder...  push button

Displays a dialog in which you can choose the directory or folder containing the data files used by your application.  You can also enter the directory or folder name in the text box to the right of the push button.  Data files are tables/.DBFs, indexes, memory variable files, etc.

Output Dir/Folder...  push button

Displays a dialog in which you can choose the directory or folder where you want the FoxDoc output files to go.  You can also enter the directory or folder name in the text box to the right of the push button.  Output files contain the formatted source code files, action diagrams and documentation reports.

Source Code and Action Diagrams area

Create Formatted Source Code Files check box

Choose this check box to format your source code files.

Options push button

Choose this button to display a dialog that lets you specify formatting for key words and variables, code indentation, comment control structures, add file headings and so on.

Prepare Action Diagrams check box

Choose this check box to create action diagrams for your source code.

Options push button

Choose this button to display a dialog that lets you specify the extension for action diagrams, the action diagram symbols and program line numbers.

Generate push button

Choose the Generate push button to start the documentation process.

Cancel push button

Choose Cancel to exit FoxDoc without taking action.

Help push button

Choose Help to display the FoxDoc help topic for additional information about FoxDoc.

Configuration area

Save... push button

Choose this push button to save the information you specify in the FoxDoc dialog to a configuration file.

Restore... push button

Choose this push button to restore FoxDoc information previously saved in a FoxDoc configuration file.

Other Options area

Reports... push button

Choose this push button to display the Report Options dialog.  In this dialog you can specify which reports to print, the name and extension of the reports and the options for Cross Reference and Tree Diagram reports.

Printing... push button

Choose this push button to display the Printing Options dialog.  In this dialog you can specify what files to print, which FoxDoc session to print files from and which printing template to use.

Extensions... push button

Choose this push button to specify your own file extensions for index files, report forms and label forms.


FoxDoc SeeAlso
See Also

Beautification Options Dialog

Program Menu


General Options Dialog

See Also

The General Options dialog contains these options:

Procedure text region

Defines a procedure for the entire menu system.  When any menu pad in the menu system is chosen, this procedure is executed.

Edit push button

Launches program editing window to define procedure.

Menu Code area

Setup... push button

Launches program editing window to define setup code for the menu system.

Cleanup... push button

Launches program editing window to define cleanup code for the menu system.

Location area

Replace radio button

Replaces existing menu system with new menu system.

Append radio button

Adds new menu system to the right of current menu system.

Before radio button

Displays menu system before specified prompt.  Choose the prompt that the menu system will come before from the popup that appears when the Before radio button is selected.

After radio button

Displays menu system after specified prompt.  Choose the prompt that the menu system will come after from the popup that appears when the After radio button is selected.

OK push button

Applies general options to menu.

Cancel push button

Exits the dialog without taking action.


General Options SeeAlso
See Also

Comment Dialog

Menu Design Window


Generate Dialog

See Also

This menu option displays the Generate Screen Dialog or the Generate Menu Dialog (corresponding to the active window).


Generate SeeAlso
See Also

Add Screen Dialog

Comment Dialog

Debug Window

Generate Menu Dialog

Generate Screen Dialog

Menu Design Window

Open Dialog

Program Menu

Save As Dialog

Screen Design Window

Screen Layout Dialog

Trace Window


Generate Menu Dialog

See Also

The Generate Menu dialog allows you to generate a menu program and contains the following options:

Output File... push button

Brings forward the Save As dialog to indicate a new or choose an existing menu program to save the generated menu as.

Comment Options... push button

Brings forward the Options dialog.

Generate push button

Generates the menu.

Cancel push button

Exits the dialog without taking action.


Generate Menu SeeAlso
See Also

Comment Dialog

Menu Design Window


Generate Screen Dialog

See Also

The Generate Screen dialog allows you to generate a screen program and contains the following options:

Screen Set list

Displays screens to be generated into one program file.  To change the order of the screens, click on the double-headed arrow and drag or select the screen and press Ctrl+PgUp or Ctrl+PgDn ( [image] +Page Up or [image] +Page Down).  Double-click on a screen name to modify the screen.

Edit push button

Displays Screen Design window for selected screen.

Add push button

Displays Add Screen dialog.

Remove push button

Removes selected screen from screen set.

Arrange push button

Allows you to arrange screens on the monitor for generation purposes only.

Generated Code area

Output File... push button

Allows entry of name for screen set to be included in project.

Options push button

Brings forward the Options dialog so you can include developer information and set comment defaults.

More>> push button

Expands the dialog to include Generated Code Options so that you can specify whether or not specific code segments will be automatically generated.

Generated Code Options area

Open Files check box

When checked, code is generated to open tables and indexes and to set up relations.

Close Files check box

When checked, code is generated to close all files upon completion of generated program.

Define Windows check box

When checked, windows are automatically defined in the generated program using the information specified in Screen Layout dialog.

Release Windows check box

When checked, RELEASE WINDOW statements are generated.

Modal Screens check box

When checked, a MODAL clause is generated with the READ command so that only widows involved in the READ can be activated or accessed.

Border for GETS check box

When checked, a box outline is displayed around Input Fields in the generated screen.

Cycle Through Fields check box

When checked, READ CYCLE is generated in the program.

READ NOLOCK check box

When checked, a NOLOCK clause is generated with the READ command.

Execute Multiple READs check box

When checked, a READ command is generated between the format statements for each screen panel.

Windows/Macintosh Objects Only check box

When checked, code is generated only for objects on the indicated platform.

Associated Windows... push button

Opens the Associated Windows dialog.

Generate push button

Generates screen code.

Cancel push button

Exits dialog without taking action.


Generate Screen SeeAlso
See Also

Add Screen Dialog

Associated Windows Dialog

Comment Dialog

Debug Window

Menu Design Window

Open Dialog

Project Window

Save As Dialog

Screen Design Window

Screen Layout Dialog

Trace Window


Goto Dialog

See Also

The Goto dialog is used to position the record pointer in a table and contains these options:

Top radio button

Positions the pointer on the first record in the table.

Bottom radio button

Positions the pointer on the last record in the table.

Record radio button

Once this radio button is chosen, allows you to type in a specific record number.

Skip radio button

Once this radio button is chosen, allows you to type the number of records to bypass before positioning the pointer.

Goto push button

Positions the record pointer.

Cancel push button

Exits the dialog without taking action.


Goto SeeAlso
See Also

Record Menu


Goto Line Dialog

See Also

This option moves the cursor to designated line in a text, program or memo editing window or in the Command window.  Only available when the Wrap Words option is not checked in the Preferences dialog.

Line Number text box

Specifies the line number where you want cursor to appear or use the spinner control to select a line number.

Goto push button

Choose this button to move cursor to specified line number.

Cancel push button

Exits the dialog without taking action.


Goto Line SeeAlso
See Also

Command Window

Text Editing


Group Info Dialog

See Also

Accessed by double-clicking on the button to the left of a group header or footer bar, or by choosing Add... or Change... in the Group dialog. In this dialog you create and modify expressions to control groups.

The Group Info dialog contains the following options:

Group... push button

Enter group expression in text box or choose Group... push button to bring forward the Expression Builder.

When Group Changes, Begin area

New Column check box

When checked, a new column is entered each time the group expression changes.

New Page check box

When checked, a page break occurs each time the group expression changes.

New Page (Page No. = 1) check box

When checked, the Page number is set to 1 each time the group expression changes.

Reprint Header on Subsequent Pages check box

When checked, the header is reprinted on each page that the group spans.

If Less Than <expN> Below Header, Begin New Page spinner

To avoid having a group header print near the bottom of the page while most of the detail lines associated with the header are printed on the next page, use the spinner to set the minimum distance from the bottom that a group header will be printed.

Inches / Cm radio button

Choose whether the units in the size spinner are inches or centimeters.


Group Info SeeAlso
See Also

Data Grouping Dialog

Expression Builder Dialog

Report Layout Window


Help Menu

See Also

FoxPro for Windows

The Help menu in FoxPro for Windows contains information about FoxPro features, support, and special topics under the following options:

Contents

Displays the Help table of contents.

Search for Help On...

Displays the Help Search dialog so you can find help on a specific topic.

How to Use Help

Displays the Help Systems dialog that describes the ways you can use help.

Help for dBASE Users...

Displays information on switching from dBASE.

About FoxPro...

Displays information about FoxPro, system configuration, and FoxPro support.

The remaining Help menu options are displayed from the main FoxPro window Help menu only. They are not displayed from the Catalog Manager Help menu.

Calculator

Displays the Calculator desk accessory in FoxPro.

Calendar/Diary

Displays the Calendar/Diary desk accessory in FoxPro.

Filer

Displays the Filer desk accessory.

Puzzle

Displays the Puzzle desk accessory in FoxPro.

FoxPro for Macintosh

The Help menu provides you with access to online Balloon Help and Microsoft FoxPro Help and contains the following options:

About Balloon Help...

Explains that Balloon Help provides explanations of icons, menus, commands, and other features of the interface that you point to with the mouse. The explanations appear in comic strip-type balloons.

Show Balloons

Displays help balloons when you click on the item you need help on. When you choose this option, the option on the Help menu changes to Hide Balloons. Click this option to turn Balloon Help off.

Microsoft FoxPro Help...

Displays the FoxPro Help table of contents screen. Help also provides features such as the capability to search for topics by keywords, annotate topics and create "bookmarks." For more information on using Help, see the Help Systems topic.


Help Menu SeeAlso
See Also

About FoxPro Dialog

Calculator

Calendar/Diary

Filer

Help Systems

Help table of contents

Puzzle

dBASE Help


Hot Keys Dialog

See Also

When defining push buttons, radio buttons and check boxes in a screen or prompts in a menu pad or popup, you can define hot keys associated with the prompts by placing \< before the letter of the prompt that will be the hot key.  Pressing Alt + the hot key of an item chooses the item.

For hot keys to work in FoxPro for Macintosh, you must issue SET KEYCOMP TO WINDOWS in the Command window. To use a hot key, press Control+Option + the underlined letter.


Hot Keys SeeAlso
See Also

Check Box Dialog

Menu Design Window

Push Button Dialog

Radio Button Dialog


Icon File Dialog

See Also

This dialog allows you to open an icon file for a minimized screen. The Icon File dialog contains the following items:

Select An Icon text box

Allows you to type in the name of the icon file you wish to open, bypassing the Directories and Drives lists.

File name list

Displays files with .ICO extension or all files, as specified by the List Files of Type popup.  Select the file and choose the Open button, or double-click on the file name.

List Files of Type popup

Allows you to specify which type of file to display in the File name list.

Directory list

Displays a list of all available directories and allows you to specify the directory in which the desired file is located.

Drive popup

Allows you to specify the drive on which the desired file is located.

Preview Picture area

Displays a copy of the icon in the highlighted file, and a description of the size and color depth of the image.

Open push button

Opens the selected file.

Cancel push button

Exits the dialog without taking action.


See Also

Window Style Dialog


Index Dialog

See Also

This option creates compound or single-entry indexes.  A compound index file (.CDX) is an index file that contains any number of separate index entries or tags.  Because the number of tags in a compound index file is limited only by disk space, you can have as many tags in the file as disk space permits.  All tags in a compound index are available when the file is opened.

A single entry index file (.IDX) is limited to one index entry.  You must open this index file and make it active for it to be updated with a table.  Non-compact single entry indexes should be created only if you need to maintain compatibility with older version of FoxPro (prior to FoxPro 2.0) or if you're sharing data with FoxBASE+ for MS-DOS or FoxBASE+ for the Macintosh.

This dialog contains these options:

Fields list

Displays fields of active table.

Tag Name text box

Type in the name of the tag.

Index Key list

Lists all index tags or expressions.

Index Key... push button

Type in an expression in the text box or choose Index Key...  to display the Expression Builder to create an index expression.

Index Filter... push button

Type in an expression in the text box or choose Index Filter... to display the Expression Builder to create a For clause.

Ascending radio button

Sorts fields in ascending order.

Descending radio button

Sorts fields in descending order.

Unique check box

When checked, the index will only include the first instance of records that have identical contents in the field indexed on.

Add to Index List push button

Places tag in Index Key list.

New Key push button

Clears the existing tag name from the Index Key... and Tag Name text boxes so that you can create a new key.

Remove From List push button

Removes tag from Index Key list.

Output File area

Save As... push button

Type in the name of the index or choose Save As to display the Save As dialog.

Compound Index File (CDX) radio button

Creates a .CDX index.

Single Index File (IDX) radio button

Creates .IDX index.

Structural Index Structure

When checked, creates a structural .CDX index.

Compact Index Structure

When checked, creates a compact .IDX index.

OK push button

Creates the indexes you have specified.

Cancel push button

Exits the dialog without taking action.


Index SeeAlso
See Also

Expression Builder Dialog

New Dialog


Insert Object Dialog

See Also

To embed an object into a field that is not on the clipboard or has yet to be created, use the Insert Object dialog.  This dialog allows you to create an object and/or insert an object into a general field and is enabled when you have a general field window open and frontmost.

The Insert Object dialog contains these options:

Object Type list

The Object Type list displays the OLE server applications installed on your computer.  If you want to create and embed a new object, double-click on an object type (for example, Microsoft Excel Worksheet) on the list, or select the object type and choose OK to launch the application.  Create the object in the application.  After you create and update the object, exit the application and FoxPro automatically embeds the object in the field.

File... push button

Displays the Insert Object From File dialog so you can choose and insert an object you've already created and saved in a file.

Cancel push button

Exits the dialog without taking action.


Insert Object Dialog SeeAlso
See Also

Edit Menu

Insert Object From File Dialog


Insert Object From File Dialog

See Also

This dialog allows you to select and insert an object you've already created and saved in a file, and is displayed when you choose the File... push button on the Insert Object dialog.  The Insert Object From File dialog contains the following options:

File Name text box

Allows you to type in the name of the file you want to insert, bypassing the Directory and Drives lists.

File Name list

Displays all files specified by either the List Files of Type popup or the All Files check box.  Select the file and choose the Insert button, or double-click on the file name.

List Files of Type popup

Allows you to specify which type of file to display in the File Name list.

Directory list/Folder popup

Displays a list of all available directories or folders and allows you to specify the location of the desired file.

Drive popup

Allows you to specify the drive on which the desired file is located.

Insert push button

Inserts the selected file in the open and frontmost general field editing window.

Cancel push button

Exits the dialog without taking action.

All Files check box

When checked, this option displays all files, regardless of type, in the File Name list.


Insert Object From File SeeAlso
See Also

Edit Menu

Insert Object Dialog


Introductory Screen

See Also

The Introductory Screen always appears when you start FoxPro until you select the check box Don't display this Introductory Screen again. The Introductory Screen presents you with three options:

Proceed to the Catalog Manager takes you to the Catalog Manager, where you can open any existing FoxPro (.FPC) or dBASE (.CAT) catalog, create an empty catalog, or create a new catalog working with existing files in a directory.

Proceed to the FoxPro menu system and Command Window goes directly to the Command window instead of the Catalog Manager.

Explore a sample FoxPro catalog opens the sample catalog (.FPC) that is installed with FoxPro.

When you select the check box Don't display this Introductory Screen again, FoxPro starts the next session in the environment that was active when you quit. For example, if you choose not to display the Introductory Screen again, and quit with the Catalog Manager active, the next time you start FoxPro the Catalog Manager will be active.

If you change your mind later and want to display the Introductory Screen again, remove the CATMAN= line in your configuration file.

No matter what environment you're working in, you can easily make the other one active. To go to the Catalog Manager from the Command window, choose Catalog Manager... from the File menu. To go to the Command window from the Catalog Manager, Choose Command Window from the File menu.


Introductory Screen See Also
See Also

Configuring the Catalog Manager

Using the Catalog Manager


Key Definition Dialog

See Also

This dialog allows you to specify a Key Label definition that designates the key or key combination used to choose the menu pad or option.

The options in this dialog are:

Key Label text box

Press the desired key combination.  It will be displayed in the Key Label text box.  Valid key combinations include function keys, Shift + function keys, and Alt or Ctrl + function keys, letters or numbers.

Key Text text box

Enter the text that appears to the right of the menu option in a popup.  You can define key text for menu pads, but it will not appear in the menu bar.

OK push button

Choosing OK returns you to the Prompt Options dialog.  Your selected shortcut key is attached to the pad or option.

Cancel push button

Exits dialog without taking action.


Key Definition SeeAlso
See Also

Menu Design Window

Prompt Options Dialog


Label Dialog

See Also

This dialog allows you to print labels from a table, using an existing label file.  This dialog contains the following options:

Input area

Form... button

Choose this button to specify a file with an .LBX extension from the Open dialog.

Form name edit box

Type the .LBX file name here if you don't use the Form... button.

Restore Environment check box

Choose this check box to restore the environment saved with the label.

Sample check box

Choose this check box to print a sample label to check text alignment on the designated printer.

Output Location Area

To Printer check box

Choose this check box to send labels to the designated printer.

Page Preview check box

Choose this check box to send labels to the Page Preview Dialog.

Console On check box

Choose this check box to display labels on the screen while they print.

Criteria area

Scope... button

Choose this button to display the Scope dialog so you can select the range of labels to print.

For... button

Choose this button to display the Expression Builder dialog so you can specify the FOR condition of labels to print.

While... button

Choose this button to display the Expression Builder dialog so you can specify the WHILE condition of labels to print.


See Also

Expression Builder

Open Dialog

Scope Dialog


List Dialog

See Also

The List dialog allows you to specify attributes of and attach code to lists in your screen.

This dialog contains these options:

List Items area

From Array radio button

The list is defined from an array.  Enter the array name in the text box beside the From Array radio button.

From Popup radio button

The list is defined from an existing popup.  Enter the popup name in the text box beside the From Popup radio button.

From Files radio button

Files available on disk become options in the list.  Enter FILES LIKE specification beside the Files radio button. In FoxPro for Windows, the default is *.*.

From Field radio button

Records in the specified field from the selected table become options in the list.  Choose the Field... push button to open the Field Picker dialog or type the field name in the text box beside the Field... push button.

From DBF Structure radio button

Fields from the selected table become options in the list.

Variable... push button

Specify the list variable (numeric or character memory variable or table field) in the text box or use Choose the Variable... push button to bring forward the Choose Field/Variable dialog.

Options area

Terminate When Choice is Made check box

When checked, terminates the READ when the user chooses an option in the list.

Initially Disable List check box

When checked, the list is initially disabled in the generated screen.  The list can later be enabled by issuing SHOW GETS ENABLE in a code snippet.

Clauses area

When...

Opens the Code Snippet dialog so you can add code that is processed before the list is entered.  If the code you add doesn't return a logical .T., the list cannot be selected.

Valid...

Opens the Code Snippet dialog so you can add code that is processed before the list is exited.  If the code you add doesn't return a logical .T., the list cannot be exited.

Message...

Opens the Code Snippet dialog so you can add an expression or a procedure that generates an expression to be displayed in the status bar.

1st Element...

Available when the list is defined from an array.  Opens the Code Snippet dialog so you can define the first element of the array.

# Elements...

Available when the list is defined from an array.  Opens the Code Snippet dialog so you can define the number of elements in the array.

Comment...

Opens the Comment dialog so you can add comments to the generated code.  Comments are entirely for your reference.

OK push button

Returns you to the Screen Design window where the list is added to the screen.

Cancel push button

Exits the dialog without taking any action.  No list is added to the screen.


List SeeAlso
See Also

Choose Field/Variable Dialog

Code Snippet Dialog

Comment Dialog

Expression Builder Dialog

Screen Design Window


Locate Dialog

See Also

This menu command displays the Locate dialog, which allows you to look for a record in the active table that matches specified conditions.  The Locate dialog contains these options:

Scope... push button

Displays the Scope dialog.

For... push button

Displays the Expression Builder to specify For conditions.

While... push button

Displays the Expression Builder to specify While conditions.

Locate push button

Searches the table for records that match the criteria you have defined.

Cancel push button

Exits the dialog without taking action.

If more than one matching record is located, the first occurrence of the record in the table becomes the current record.  To continue locating matching records, use the Continue option. The Continue option causes FoxPro to resume the previous search that you specified when you chose the Locate... option.  This Locate... begins at the current position in the table.  Continue is enabled only after you use Locate... to find a record.


Locate SeeAlso
See Also

Expression Builder Dialog

Record Menu

Scope Dialog


Locate File Dialog

See Also

The Locate File dialog allows you to help a project find a file it contains.  This dialog displays the name of the file that cannot be located, along with these options:

Locate push button

Displays an Open File dialog so you can adjust the drive and directory, or disk and folder as necessary to locate the file, select the file and choose Open.

Ignore push button

Ignores the file that it can't find and builds the project without knowing where the file is located.

Remove push button

Removes the specified file from the project, then continues with the build process.

Cancel push button

Cancels the build process and returns you to the Project window.


Locate File SeeAlso
See Also

Build Option Dialog

Project Window


Macro Key Definition Dialog

See Also

This dialog allows you to define the key combination that activates the macro and assign a name to the macro.  The Macro Key Definition dialog contains the following options:

Defined Key text box

Press a valid key combination used to activate the macro.  The key combination appears in the text box.

Macro Name text box

Enter a name for the macro.  This name appears in the list of macros in the Macros dialog.  If the macro is not named, the key combination is used as the name by default.

OK push button

Begins recording key strokes to be stored to the Macro.  Press Shift+F10 to stop recording key strokes.

Cancel push button

Exits the dialog without taking action.


Macro Key Definition SeeAlso
See Also

Macros Dialog

Macro Edit Dialog

Stop Recording Macro Dialog

Text Editing


Macro Edit Dialog

See Also

This dialog allows you to create and edit macros manually.  The Macro Edit dialog contains the following options:

Defined Key

Press a valid key combination used to activate macro.  The key combination appears in the text box.

 The following table lists valid key combinations for FoxPro for Macintosh:

Macro Key Combinations

Modifier Key(s)	Keys
None	Plus: F1 to F10, Del, Home, End, Page Up, Page Down, Arrow keys
Shift	Plus: F1 to F9, Del, Delete, Home, End, Page Up, Page Down, Arrow keys
Shift+ [image] (or Control)	Plus: A to Z*, F1 to F10, Home, End, Page Up, Page Down, [image],
(or Control)	Plus: A to I, K to Z, F1 to F10, Home, End, Page Up, Page Down, [image],
Control+Option	Plus: A to Z, F1 to F9
Control+Option+F10	Plus: A to Z
*Shift+ [image] +Q and Shift+ [image] +S are not recommended.
The following table lists key combinations that are reserved by Macintosh system software and should not be used as macro keystrokes:

Macintosh Reserved Key Combinations

Modifier Key(s)	Keys
	Plus: A, C, N, O, P, Q, S, V, W, X, Z, . (period)
Macro Name

Enter a name for the macro.  This name appears in the list of macros shown in the Macros dialog.  If the macro is not named, the key combination is used as the name by default.

Macro Contents

Enter a combination of text and keystrokes to define the contents of the macro.  Use <key label> assignments listed in the FoxPro Language Reference and enclose them in braces ({ }) to represent desired keystrokes.


Macro Edit SeeAlso
See Also

Macros Dialog

Text Editing


Macros Dialog

See Also

Macros can greatly simplify your interactions with FoxPro.  The Macros dialog contains the following options:

Individual Macro area

The list contains currently defined macros.

Record... push button

Displays the Macro Key Definition dialog and allows you to automatically record a macro.

New... push button

Displays the Macro Edit dialog, which allows you to define a macro.

Edit... push button

Displays the Macro Edit dialog, which allows you to edit the current macro.

Clear... push button

Removes selected macro from a macro set.

Macro Set area

Save... push button

Displays the Save Macros dialog to name and save current macro set.

Restore... push button

Displays the Restore Macros dialog to restore macro set.

Set Default

Saves the current macro set as DEFAULT.FKY. When FoxPro is started, it looks for the default macro file DEFAULT.FKY. If found, it is loaded.

FoxPro for Windows stores the DEFAULT.FKY file in the same directory as your FOXUSER file.  If a FOXUSER file doesn't exist, DEFAULT.FKY is stored in the current directory.

In FoxPro for Macintosh, the DEFAULT.FKY file must be in the default folder (the folder containing FoxPro) for FoxPro to find and load it when you run FoxPro.  FoxPro stores the DEFAULT.FKY file wherever it finds your FOXUSER resource file. If no FOXUSER file exists or if no resource file has been designated in CONFIG.FPM, FoxPro stores the DEFAULT.FKY file in the current folder.

Clear All

Removes all macros from the current macro set.

OK push button

Exits the Macros dialog.


Macros SeeAlso
See Also

Macro Edit Dialog

Macro Key Definition Dialog

Program Menu

Restore Macros Dialog

Stop Recording Macro Dialog


Make Directory Dialog

See Also

This dialog (accessed through the Filer) allows you to create a directory or folder on your drive or disk. To open the dialog, choose the Tree push button in the Filer dialog, select the directory or folder in which you want to create the subdirectory or subfolder, and choose the Mkdir push button.

The Make Directory dialog contains these options:

New Directory text box

Enter the name of the new directory or folder.

Mkdir push button

Creates a directory or folder with the name displayed in the New Directory text box in the parent directory or folder displayed at the top of the dialog.

Cancel push button

Exits the dialog without taking action.


Make Directory SeeAlso
See Also

Filer


Menu Design Window

See Also

In the Menu Design window, you can design or modify a menu system. The Menu Design windows has these options:

Prompt

Enter a prompt name in the Prompt box.  Include a backslash and a less than sign (\<) in front of a letter you want to designate as the hot key for the prompt.  If you don't include one,  the first letter of the prompt is designated as the hot key.

To change the order of items, click on the button to the left of the prompt and drag the item to the desired location in the list.

Choose result from the Result popup.  Options in this popup are:

Submenu

To create a submenu for a menu pad or option.  When you choose Submenu, the Create push button appears.  Choose the Create push button to bring forward a design window to define the submenu.

Command

To define a command for a menu pad or option.  When you choose Command, a text box appears.  Enter the command in the text box.

Pad Name/Bar#

Pad Name appears when defining pads, Bar# appears when defining submenu options.  When you choose this option, a text box appears.  Enter a pad name or Bar# in the text box.

Procedure

To define a procedure associated with the pad or option.  When you choose this option, the Create push button appears.  Choose Create to launch an editing window for the procedure.

Options push button

Choosing this button displays the Prompt Options dialog.

Menu Level popup

Displays the level of the menu displayed in the Menu Design window.  This popup contains the names of the menu pads or options, from the submenu being edited back to the Menu Bar.  Choose the menu or submenu that you want to edit.

Try It push button

Displays the menu system you have created.  Choose a menu pad or an option on a menu to display the Try It dialog with information about the choice.

Item area

Insert push button

Inserts a menu pad or menu option in front of the selected pad or option.

Delete push button

Deletes the selected pad or option.

When the Menu Design window is active, a Menu menu appears on the system menu bar.  The options in this menu are:

General Options...

Displays the General Options dialog.

Menu Options...

Displays the Menu Options dialog.

Insert/Delete Item

Equivalents of Insert/Delete push buttons in Menu Design window.

Quick Menu

Available when menu structure is empty, choosing this option creates a complete menu structure based on the default FoxPro system menu.

Generating Code

When a Menu Design window is active, the Generate... option in the Program menu is enabled.  Choosing Generate... from the Program menu displays the Generate Menu dialog.


Menu Design SeeAlso
See Also

Comment Dialog

Expression Builder Dialog

General Options Dialog

Generate Menu Dialog

Menu Options Dialog

Prompt Options Dialog

Try It Dialog


Menu Options Dialog

See Also

This menu command in the Menu menu changes to reflect the name of the entire menu system or the prompt of a specific menu popup.

When defining menu pads, Menu Bar Options appears in the Menu menu.  When you define submenus for the menu pads or other menu options, the name of the prompt for the submenu is displayed.

Choose Menu Options... to display the Menu Options dialog.  This dialog contains the following options:

Name text box

Enter a name for the menu option.  By default, defined prompt is displayed.  This text box is disabled when defining menu pads.

Procedure edit region

Define a procedure for the entire menu system or a particular popup.

Edit... push button

Launch an editing window to define a procedure for the entire menu system or a particular popup.

OK push button

Close the Menu Options dialog.


Menu Options SeeAlso
See Also

General Options Dialog

Menu Design Window


Move Directory Dialog

See Also

Available through the Tree panel of the Filer, this dialog allows you to move all files in a directory to a new location.  To display the Move Directory dialog, choose the Tree push button in the Filer dialog, then choose the Move push button.

The Move Directory dialog contains the following options:

Target directory... push button

Enter the directory you want to move to in the text box, or choose the Target Directory push button to display the Target Directory dialog.

Replace existing files check box

When checked, files in the target directory with the same names as files in the directory being moved are automatically overwritten.

Preserve directories

When checked, the directory structure is preserved in the new location (relative to the target).  All files are moved to the respective directories.

Move push button

Moves the directory you have specified to the location you have specified.

Cancel push button

Exits the dialog without taking action.


Move Directory SeeAlso
See Also

Filer


Move Files Dialog

See Also

Available through the Files panel of the Filer, this dialog allows you to move files to a new location.  To display the Move Files dialog, choose the Move push button in the Filer dialog when files are selected.

The Move Files dialog contains the following options:

Move tagged files as  text box

Enter wild card characters to specify the file name in the new location.  By default, *.* is displayed and all files retain their current names.

Target directory... push button

Enter the directory you want to move to in the text box, or choose the Target Directory push button to display the Target Directory dialog.

Replace existing files

When checked, files in the target directory with the same names as files being moved are automatically overwritten.

Preserve directories

When checked, this moves the directory structure with the files.  Files in the directory closest to the root are moved to the specified target directory. The directory structure is preserved in the new location (relative to the target). All files are moved to their respective directories.

Move push button

Moves selected files to the selected directory.

Cancel push button

Exits the dialog without taking action.


Move Files SeeAlso
See Also

Filer

Target Directory Dialog


Navigating in the Interface

See Also

FoxPro requires a mouse, but some tasks can be accomplished with the keyboard.  With the click of a button, a mouse can accomplish the equivalent of a single keystroke or many keystrokes on the keyboard.  With a keyboard, you can use the arrow keys and keystroke combinations to select and choose objects and controls in the interface.

Using the Mouse

To select an item means to highlight that item in preparation for an action, that is, in preparation to be chosen.  To choose an item means to activate that item, generating an action.

To Select ...	Do This ...
The main menu system, a menu pad, or a menu	Click on the appropriate menu prompt.
An item in a dialog or list	Click on that item.
To Choose ...	Do This ...
An option on a menu	Click on that option.
A control in a dialog	Click on the control.
An item in a list	Double-click on the item.
Using the Keyboard

To select an item means to highlight that item in preparation for an action, that is, in preparation to being chosen.  To choose an item means to activate that item, generating an action.

To Select ...	Do This ...
The main menu bar	Press the Alt key or press F10.
A menu pad	Press the Right or Left Arrow until the appropriate menu pad is selected.
A menu option	Press the Down or Up Arrow until the appropriate menu option is selected.
An item in a dialog	Press Tab or Shift+Tab until the appropriate item is selected.
An item in a list	Press the Down or Up Arrow until the appropriate item is selected.
An item in an alphabetical list	Type the first few distinguishing letters of the item.
The first or last item in a list	Press the Home or End key.
To Choose ...	Do This ...
The main menu bar	Press the Alt key or press F10.
A menu pad	Press the Right or Left Arrow until the appropriate menu pad is selected, then press Enter.  Or, press the hot key for that menu.  The hot key is the underlined letter in the menu pad.
A menu option	Press the Down or Up Arrow until the appropriate menu option is selected, then press Enter.  Or, press the hot key for that option.  The hot key is the underlined letter in an option.
An item in a dialog	Press Tab or Shift+Tab until the appropriate item is selected, then press Enter or the spacebar.
An item in a list	Press the Down or Up Arrow until the appropriate item is selected, then press Enter.
An item in an alphabetical list	Type the first few distinguishing letters of the item, then press Enter.
The first or last item in a list	Press the Home or End key, then press Enter.
Using Menus

The FoxPro menu system consists of the following parts: menu bar, menu pads, menu popups and menu options.

Menu Bar

To access the menu bar using the mouse, click on a menu name.  To access the menu bar using the keyboard, press the Alt key, or press F10.  To exit the menu bar, press Esc, Alt or F10.  With the mouse, click anywhere except on the menu bar or menu popup.

Menu Pad

Menu pads signify that all options on that menu perform actions specifically related to the same topic.  To select a menu pad with the mouse, click on the pad.  To select a menu pad with the keyboard, press the Right or Left Arrow when the menu bar is selected.  A menu popup appears.

Menu popups

Menu popups are lists of related options.  To display a menu popup with the mouse, click on the appropriate menu pad.  To display a menu popup with the keyboard, do one of the following:

Press Alt, then press the hot key in the menu pad.  The hot key is the underlined letter in the menu name.

Press F10, then press the hot key in the menu pad.

To deactivate a menu without choosing an option, press Esc, Alt or F10.  With the mouse, click anywhere off the menu.

Menu options

Menus contain options that are logically related to the menu name.  If a menu option is followed by an ellipsis (...), a dialog appears when this option is chosen.  To choose an option with the mouse, click on the appropriate option.  To choose an option with the keyboard, use the Up or Down Arrow to select the option, then press enter.

Some menu options have a keyboard shortcut (a key or a combination of keys to be pressed at the same time) listed next to them.  Use this key combination to choose the menu option without displaying the menu popup.

Using Dialogs

Dialogs contain a variety of controls used to designate, confirm or cancel actions.  When a dialog is displayed, you must exit it before you can use any other features of FoxPro.  To exit a dialog, choose the appropriate button or press Esc to cancel the dialog.

Push Button

With one exception, the action associated with a push button occurs immediately when you choose it. The exception occurs if the option name contains an ellipsis (...), in which case another dialog appears, requesting more information.

Check Box

Check boxes act as toggles by turning options on and off.  If a check box has an X in it, the setting is on.  To turn a check box on or off, click in the box.  Multiple boxes can be checked at once.

Some check boxes are followed by an ellipsis (...), which means that when you choose the check box, another dialog is displayed.  If a check box with an ellipsis is checked, you can still choose the check box to display the dialog.

Radio Button

Unlike check boxes, only one radio button in a group can be chosen at once.  When it is chosen, a bullet appears in the circle and any previously chosen radio button in the group becomes deselected.  Click a radio button to choose it.

Popup

A rectangle with a Down Arrow on the right side is a popup.  To display the list, click on the popup.  Scroll through the list that is displayed by using the scroll arrows, if available, or by selecting items in the list.  To choose an item in the list, click on the appropriate item.

List

Like the  popup, a list contains choices you can click on.  Unlike the popup, you do not need to display the list before choosing an option.  Scroll through the list that is displayed by using the scroll arrows, if available, or by selecting items in the list.  Click on the desired item to select it, then choose the appropriate button.

Text Box

When your input is requested, this box appears.  To enter text, click in the box to position the cursor.  Type and edit as usual.

Additional Menu Names

If the current dialog doesn't have hot keys, or has too many options to fit in the dialog, an additional menu name is added to the far right end of the menu bar.  Choose options from the additional menu as you would any other menu.

Repositioning Dialogs

Dialogs can be repositioned on the screen.  To move a dialog using the mouse, point to the title bar of the dialog, hold down the mouse button, then drag until the dialog is in the desired location.  Release the mouse button.

Controlling System Windows

Open

The Command window is automatically opened when you begin a FoxPro session.  If you close the Command window, you can open it again by choosing Command from the Window menu.  You can choose the View option from the Window menu to open the View window.  The Debug and Trace windows can be opened by choosing their names from the Program menu.

Open the Browse window by choosing Browse from the Database menu. You can open a Browse window from the View window by clicking the Browse push button, choosing Browse from the Database menu or double-clicking on a work area with an open table.

To open other system windows, choose Open... from the File menu.  The Open dialog appears.  See the Open topic for more information.

Close

To close an open window, choose Close from the File menu or press Ctrl+F4.  You can also close a window by double-clicking on the window's Control-menu box, which is located in the upper left corner of all system windows.

Hide

Hiding a window makes it invisible without closing it.  To hide a window, choose Hide from the Window menu.

To hide or display all open windows, hold down the Shift key and display the Window menu.  The Hide and Clear options are replaced with the options Hide All and Show All.  Choose the Hide All option.  To momentarily hide all windows in front of the current output window, press Shift+Ctrl+Alt.

To display a hidden window, choose its name from the bottom of the Window menu.

Move

To move a window to a new location, point to the window title bar and drag the window.  When the window is in its new location, release the mouse button.  You can also choose the Move option on the window's Control menu (or press Ctrl+F7) to move a window.  The pointer changes to a four-headed arrow.  Use the arrow keys to move the window to a new location.  An outline of the window moves as you use the arrow keys.  When you press Enter, the window moves to the location of the outline.

To move a window and maintain its position relative to other windows, hold down the Shift key and drag the window with the mouse.  The window will pass behind or in front of other windows.

Size

To change the size of a window, move the pointer to the side, bottom, or corner window border.   When the pointer becomes a double-ended arrow, hold the mouse button down, drag the border to the desired size, then release.  You can also click on the size control in the lower right corner of the window and drag in any direction.

Maximize

The Maximize button expands the current window to the full size of the screen display.  To maximize a window, click on the Maximize button (the triangle) in the upper-right corner of the window.  You can also maximize a window by choosing Maximize from the Control menu, or by pressing Ctrl+F5.

Minimize

The Minimize button reduces the current window to an icon, which is placed in the lower-left corner of the desktop.  Although the window appears closed, it is only temporarily removed from view.  To minimize a window, click on the Minimize button (the upside-down triangle) in the upper-right corner of the window.  You can also minimize a window by choosing the Minimize option from the Control menu, or by pressing Ctrl+F9.

Restore

Only available when the current window is maximized, the Restore button returns the window to its previous, unmaximized size.  To restore a window, click on the Restore button (the double triangle) in the upper-right corner of the window.  You can also Restore a window by choosing Restore from the Control menu, or by pressing Ctrl+F5.

Clear

You can clear the current output window by choosing Clear from the Window menu.  If an output window is not active when you choose Clear, the main FoxPro window is cleared.  This option differs from the Clear option on the Edit menu, which clears selected text from the current system window.

Cycle

Cycle refers to the process of rearranging open windows to bring successive ones forward.  Choose Cycle from the Window menu as many times as necessary to bring forward the window of your choice.  You can also click on the desired window to bring it forward.  You may have to move and size overlapping windows to bring the desired window forward.

Scroll

You can move through a window's contents with the keyboard by using the following keys: arrow keys, PgUp, PgDn, Home and End.

Scroll bars are located along the right edge and, sometimes, along the bottom edge of windows.  Click the arrows at either end of the scroll bar to move through the contents of a window one line at a time.  Click one time in the page up or page down region (the regions between the thumb and the arrows at the ends of the scroll bar) to move up or down one window.  Drag the thumb to move through the window contents rapidly.


Navigating in the Interface SeeAlso
See Also

Control Menu

File Menu

Window Menu


Navigating in the Macintosh Interface

See Also

FoxPro requires a mouse, but some tasks can be accomplished with the keyboard.  With the click of a button, a mouse can accomplish the equivalent of a single keystroke or many keystrokes on the keyboard.  With a keyboard, you can use the arrow keys and keystroke combinations to select and choose objects and controls in the interface.

Controlling System Windows

Open

The Command window is automatically opened when you begin a FoxPro session.  If you close the Command window, you can open it again by choosing Command from the Window menu.  You can choose the View option from the Window menu to open the View window.  The Debug and Trace windows can be opened by choosing their names from the Program menu.

Open the Browse window by choosing Browse from the Database menu. You can open a Browse window from the View window by clicking the Browse push button, choosing Browse from the Database menu or double-clicking on a work area with an open table.

To open other system windows, choose Open... from the File menu.  The Open dialog appears.  See the Open topic for more information.

Close

To close an open window, choose Close from the File menu or click on the window's close box, which is located in the upper-left corner of all system windows.  To close all open windows, hold down the Shift key and select Close All from the File menu.

Hide

Hiding a window makes it invisible without closing it.  To hide a window, choose Hide from the Window menu.

To hide or display all open windows, hold down the Shift key and display the Window menu.  The Hide option is replaced with the options Hide All and Show All.  Choose the Hide All option.  To To display a hidden window, choose its name from the bottom of the Window menu.

Move

You can clear the current output window by choosing Clear from the Window menu.  If an output window is not active when you choose Clear, the main FoxPro window is cleared.  This option differs from the Clear option on the Edit menu, which clears selected text from the current system window.

Cycle

Cycle refers to the process of rearranging open windows to bring successive ones forward.  Choose Cycle from the Window menu as many times as necessary to bring forward the window of your choice.  You can also click on the desired window to bring it forward.  You may have to move and size overlapping windows to bring the desired window forward.

Cursor Movement Keys

The following table lists cursor movement keys you can use to navigate in FoxPro:

Cursor Movement Keys

Key	Action
	Moves cursor one character to the right.
	Moves cursor one character to the left.
	Moves cursor up one line.
	Moves cursor down one line.
Page Up	Moves cursor up one window of text.
Page Down	Moves cursor down one window of text.
Home	Moves cursor to beginning of current line.
End	Moves cursor to end of current line.
+	Moves cursor one word to the right.
+	Moves cursor one word to the left.
+ Home	Moves cursor to beginning of text.
+ End	Moves cursor to end of text.

The following table lists keyboard shortcuts:

Command Key Shortcuts

Key	Action
+A	Select All
+C	Copy
+D	Do
+L	Replace and Find Again
+F	Find
+G	Find Again
+K	Continue
+M	Resume
+N	New
+O	Open . . .
+P	Print . . .
+Q	Quit
+R	Redo
+S	Save
+V	Paste
+W	Close
+X	Cut
+Z	Undo
+. (period)	Terminates an operation.
+F1	Cycles windows.
+F2	Displays Command window.
Esc	Exit current edit without saving modifications; exit dialog without taking action.

The following table lists the default values assigned by FoxPro to the function keys F1 through F10 and list their standard keyboard equivalents:

Extended  Keyboard Key	Standard  Keyboard Key	Function
F1	+1	Activate online Help
F2	+2	Set (displays the View window)
F3	+3	List
F4	+4	Dir(ectory)
F5	+5	Display Structure
F6	+6	Display Status
F7	+7	Display Memory
F8	+8	Display
F9	+9	Append
F10	+0	Activate/deactivate the system  menu bar

The following table lists key combinations for selecting text:

Key Combinations for Selecting Text

Key	Action
Shift+Arrow ( [image] or [image])	Selects one character at a time.
Shift+Arrow ( [image] or [image])	Selects one line at a time.
Shift+ [image] +Arrow ( [image] or [image])	Selects from cursor to beginning/end of word.
Shift+ [image] +End	Selects from cursor to end of text.
Shift+ [image] +Home	Selects from cursor to beginning of text.
+A	Selects all text.


See Also

File Menu

Window Menu


New Dialog

See Also

This dialog allows you to create a new file.  The New dialog contains the following options:

File Type area

Table/DBF radio button

Displays the Table Structure dialog.

Program radio button

Displays an untitled program editing window.

File radio button

Displays an untitled text editing window.

Index radio button

Displays the Index dialog for currently selected table. This button is disabled when there is no open table in the currently selected work area.

Report radio button

Displays an untitled Report Layout window.

Label radio button

Displays the New Label dialog so you can choose a Label Layout.

Screen radio button

Displays an untitled Screen Design window.

Menu radio button

Displays an untitled Menu Design window.

Query radio button

Displays the RQBE window if table is open in selected work area.  If no table is open,  the Open dialog appears.

Project radio button

Displays an untitled project window.

New push button

Creates a new file of the type you have specified.

Cancel push button

Exits the dialog without taking action.


New SeeAlso
See Also

File Menu

Index Dialog

Menu Design Window

Project Window

Report Layout Window

RQBE Window

Screen Design Window

Table Structure Dialog

Text Editing


New Label Dialog

See Also

This dialog allows you to specify a label layout for a new label.  The New Label dialog contains the following options:

Choose a Layout list

This list contains the Avery label form number, the height, the width, and the number of columns per page for each label layout.  Select the layout you want from the list.

OK push button

Opens the Report Layout window with the detail band set for the dimensions of the label layout you have chosen.

Cancel push button

Exits the dialog without taking action.


New Label SeeAlso
See Also

Report Layout Window


Object

See Also

When a general field window is frontmost, the Object... option is enabled.  This menu option changes to reflect the type of OLE object selected in a field.  For example, if you've selected a picture that was linked or embedded from MS Graph, this menu option changes to Edit Microsoft Graph Object.

For some types of OLE objects, such as Microsoft Excel objects, choosing the Object... option immediately launches the linked application, if you have access to the type of application that created the object.

For other types of OLE objects, such as a Sound object, choosing this command displays a cascading menu with options for use with the selected object.  The cascading menu options vary depending on the source application.

The first option on the cascading menu is the action taken when you double-click the object or press Enter or Return in an open general field window.  For example, a Sound object may have Play as the first option on the menu, allowing you to activate and play the embedded sound object.

Since most objects can be edited, an Edit option will usually be included on the cascading menu.


Object SeeAlso
See Also

Edit Menu

Change Link

Insert Object Dialog

Paste Special Dialog


Object Menu

See Also

The Object menu appears on the menu bar only if the Screen Builder or Report Writer is active.  It contains the following options:

Align to Grid

Moves selected objects to line up flush with the grid setting.  If you have a series of fields, you can make sure that they line up perfectly by selecting them and choosing Align To Grid.

Bring to Front

Brings selected objects to the front so that they show up on top of any overlapping objects.

Send to Back

Sends selected objects to the back so that any overlapping objects show up on top of them.

Center

Moves an object in the Report Layout window horizontally to the center of its band.  Moves an object in the Screen Design window horizontally to the center of the screen.  Center does not affect the vertical placement of the object.

Center is an action performed on an object, not an attribute assigned to the object.  If you change the size of the screen or report, the position of the object is not adjusted until you select it and choose Center again.

Group

Joins selected objects so that they can be moved, cut and pasted as if they were a single object.

Ungroup

Separates previously grouped objects so that they can be manipulated individually.

Font

Opens the Font dialog so that you can set the type face, style and size of the characters in the selected object.

Text Alignment

Displays a cascading menu that allows you to adjust the alignment and spacing of text within fields or text objects on your screen, report or label.  Text objects must be multi-line before these options have any effect on them.  The cascading menu contains these options:

Option	Description

Left	Left-justifies selected text.

Center	Centers selected text.

Right	Right-justifies selected text.

Single Space	Displays selected text single-spaced with no blank lines between lines of text.

1 1/2 Space	Displays selected text with one-and-a-half blank lines between lines of text.

Double	Displays selected text double-spaced with one blank line between lines of text.

Fill

Displays a cascading menu that allows you to fill selected objects with one of seven hatched and crosshatched patterns.  The default is None.

Pen

Displays a cascading menu that allows you to set the point size and design pattern of lines and outlines of rectangles and rounded rectangles on your report, label or screen.  The cascading menu contains these options:

Option	Description

Hairline	One pixel width outline for the selected object.

1 Point	One point width outline for the selected object.

2 Point	Two point width outline for the selected object.

4 Point	Four point width outline for the selected object.

6 Point	Six point width outline for the selected object.

None	No outline for the selected object.

Dotted	Dotted line outline for the selected object.

Dashed	Dashed line outline for the selected object.

Dash-dot	Alternating dashes and dots for the outline.

Dash-dot-dot	Alternating dashes and two dots for the outline of the selected object.

Mode

Displays a cascading menu that allows you to determine whether the selected object is opaque or transparent.  Mode only affects text objects, rectangles and rounded rectangles that have been given fill patterns.

Fill Color

Displays a cascading menu that allows you to choose one of sixteen different fill colors for the selected object.  If a fill pattern has been chosen for the object, the lines in the hatching or crosshatching pattern become the chosen color.  If no fill pattern has been chosen, the fill color solidly fills the selected object.

Pen Color

Displays a cascading menu that allows you to select one of sixteen different pen colors for the selected object.


Object Menu SeeAlso
See Also

Report Layout Window

Screen Design Window


Object Order Dialog

See Also

The Object Order dialog allows you to change the keyboard access order of objects in a screen.  The Object Order dialog contains the following:

A list of all controls and input field, output field and edit region objects on the screen.  These objects are listed in the order they will be accessed with the keyboard in the generated screen.  To change the access order of the objects, click on the button to the left of the object icon and drag the object to the position in the list that corresponds to its place in the desired access order.

By Row push button

Choose this button if you want all objects on the screen to be accessed by row, that is from left to right across the screen starting at the top.

By Column push button

Choose this button if you want all objects on the screen to be accessed by column, that is from top to bottom down the screen starting at the left side.

OK push button

Choose this button to return to the Screen Design window with the object access order adjusted according to the changes you have made.

Cancel push button

Exits the dialog without taking action.


Object Order SeeAlso
See Also

Screen Design Window


Open Dialog

See Also

This dialog allows you to open an existing file or create a new file in FoxPro.  The Open dialog contains the following items (optional items appear only if they apply):

File name text box

Allows you to type in the name of the file you wish to open.

File name list

Displays all files specified by the optional List Files of Type popup or by the All Files check box.  Select the file and choose the Open button, or double-click on the file name.

List Files of Type popup

Optional. Allows you to specify which type of file to display in the Open list.

Directory list/Folder popup

Displays a list of all available directories or folders and allows you to specify the location of the desired file.

Eject push button (FoxPro for Macintosh only)

Becomes active when you insert a floppy disk. Eject allows you to eject the floppy.

Desktop push button (FoxPro for Macintosh only)

Lists the objects on the desktop.

Drive popup

Allows you to specify the drive on which the desired file is located.

New button

Optional. Creates an untitled file of the specified type.

Add button

Optional. Opens the selected file in Catalog Manager.

Open button

Optional. Opens the selected file in FoxPro.

All Files check box

When checked, this option displays all files, regardless of type, in the Open list.

The following items are not included on the Open dialog when you choose Open Catalog... from the File menu in the Catalog Manager.

Read Only check box

Optional. When checked, this option allows you to specify that the file you open cannot be modified, only reviewed.

Environment check box

Optional. When you choose Report, Label or Screen on the List Files of Type popup control, the Environment check box is enabled, and is checked by default.  This means that when a report, label or screen file is opened, all environment settings are saved with the file, including tables and indexes in use, relations and set skip settings, are restored.  If you want to open a report, label or screen without opening an associated environment, clear the check box.

Exclusive check box

Optional. When checked, this option allows you exclusive use of the file.  No other user can open the file you are using if you open it with exclusive privileges.

Other Code Page check box

Optional. If a program (.PRG) or text file (.TXT) was created on a FoxPro platform other than the platform on which you want to open the file, you can translate the accented characters when you open the file by checking the Other Code Page check box.  Specify the platform on which the file was created in the dialog that appears after you choose Open.  The accented characters in the file are translated when displayed so they appear the same on the current platform as they did on the platform you specified.  No translation occurs if you don't check the Other Code Page check box.


Open See Also
See Also

File Menu


Options Dialog

See Also

The Options dialog is opened through the Generate Screen dialog, the Generate Menu dialog or the Project window.  This dialog contains the following options:

Developer Information area

Text boxes allow you to enter personal information about the developer.

Comment Style area

Boxes Around Comments radio button

When selected, generated code is displayed and printed with boxed comments.

Asterisks Around Comments radio button

When selected, generated code is displayed and printed with asterisks around comments.

Project Options area

Debugging Information check box

Specifies whether or not to highlight each line of code in Trace window during execution.

Encrypt Code check box

Scrambles compiled code for security.

Display Logo When Application is Run check box

Only affects executable files created with the FoxPro Distribution Kit.  When you create an executable with Logo checked, the FoxPro startup logo is displayed when you run the executable.  Clear Logo to build an executable that suppresses the logo display.

Generated Code Location area

Save Code check box

Saves generated screen and menu code.

With Screen or Menu radio button

Saves generated code in same location as corresponding source screen and/or menu file.

With Project radio button

Saves generated code in same location as project file.

In Folder/Directory radio button

Enables the Dir/Folder... push button.

Dir/Folder...button

Displays the Select Directory or Select Folder dialog, which allows you to specify the path for USE commands in programs generated from screens, and to specify the path for the command that contains the IN <menu name> clause in menus.

Home Directory... push button

Type the directory for generated code in the text box, or choose the Directory... button or Folder... button to display Select Directory or the Select Folder dialog.

Save As Default push button

Saves all information in this dialog in the FOXUSER file to be used as the default for all screens or menus generated.

OK push button

Returns you to the Generate Screen or Generate Menu dialog.  Generated code will conform to the choices you have made.

Cancel

Exits the dialog without taking action.


Options SeeAlso
See Also

Generate Menu Dialog

Generate Screen Dialog

Menu Design Window

Project Window

Screen Layout Dialog


Pack

See Also

This menu option permanently removes from the active table all records marked for deletion.  Before you pack a table, make a backup copy.  There is no way to recover deleted records after the table has been packed.

All open index files associated with the table are rebuilt automatically when the table is packed.

A pack can be interrupted by pressing the Escape key.  Pressing Escape stops the pack and the file remains unchanged.  If you run out of disk space during a pack, FoxPro automatically recovers the table.


Pack SeeAlso
See Also

Database Menu

Delete Dialog


Pad Name Dialog

See Also

Allows you to specify a pad name for a menu pad or a bar # for a menu popup option.


Pad Name SeeAlso
See Also

Prompt Options Dialog


Page Footer Dialog

See Also

The Page Footer dialog is accessed by double-clicking on the button to the left of the Page Footer band separator bar in the Report Writer.

This dialog contains these options:

Height spinner

Set the height of the band in the spinner.  You can also adjust the size of the bands by dragging the button to the left of the page footer separator bar.

In/Cm radio buttons

Set the unit of measurement, inches or centimeters, displayed in the spinner by selecting the appropriate radio button.

Constant Band Height check box

Check this option to prevent the band from stretching to accommodate lengthy data or shrinking to absorb blank lines that have been removed. Keeping the band height constant is especially important if you are printing on a predetermined label form.

OK push button

Accepts your changes and returns you to the Report Layout window.

Cancel push button

Exits the dialog without taking action.


Page Footer SeeAlso
See Also

Data Grouping Dialog

Print When Dialog

Report Expression Dialog

Report Layout Window


Page Header Dialog

See Also

The Page Header dialog is accessed by double-clicking on the button to the left of the Page Header band separator bar in the Report Writer.

This dialog contains these options:

Height spinner

Set the height of the band in the spinner.  You can also adjust the size of the band by dragging the button to the left of the page header separator bar.

In/Cm radio buttons

Set the unit of measurement, inches or centimeters, displayed in the spinner by selecting the appropriate radio button.

Constant Band Height

Check this option to prevent the band from stretching to accommodate lengthy data or shrinking to absorb blank lines that have been removed. Keeping the band height constant is especially important if you are printing on a predetermined label form.

OK push button

Accepts your changes and returns you to the Report Layout window.

Cancel push button

Exits the dialog without taking action.


Page Header SeeAlso
See Also

Data Grouping Dialog

Print When Dialog

Report Expression Dialog

Report Layout Window


Page Layout Dialog

See Also

The Page Layout dialog allows you to determine the number and width of columns in your report, the width of the left margin and space between columns, and whether the report is oriented according to report or label layout.   A model of the report page displays the column and margin settings. This dialog contains the following options:

Columns spinner

Indicates the number of columns in your report.  You can change this number by clicking on the spinner up and down arrows or typing the desired number in the text box.

Left margin spinner

Displays the width of the left margin. You can change this number by clicking on the spinner up and down arrows or typing the desired number in the text box.

Column width spinner

Displays the width of the columns. You can change this number by clicking on the spinner up and down arrows or typing the desired number in the text box.

Space between columns spinner

Displays the width of the space between columns. You can change this number by clicking on the spinner up and down arrows or typing the desired number in the text box.

Dimensions area

Inches radio button

Choose to display the widths in the spinners in inches.

Cm radio button

Choose to display the widths in the spinners in centimeters.

Print Area area

Printable Page radio button

Choose to allow for printer margins in your report.  The area of the page that is printed is determined according to the specifications of the default printer setup and is displayed within the box in the Page Layout area of the dialog.

Whole Page radio button

Choose to allow your report to fill the entire page.

Print Order picture radio buttons

Orients the report so that columns are filled from top to bottom starting at the left side of the page or so that rows are filled from left to right starting at the top of the page.

Print Setup... push button

Opens the Print Setup dialog.

Environment... push button

Opens the Environment dialog.

Font... push button

Opens the Font dialog so that you can set a default font for objects added to the report.

OK push button

Returns you to the Report Layout window, preserving the changes you made in the dialog.

Cancel push button

Exits the dialog without taking action.


Page Layout SeeAlso
See Also

Environment Dialog

Print Dialog

Report Layout Window


Page Preview Dialog

See Also

A scale model of the first page of your report is displayed when you open the Page Preview dialog. This dialog contains the following options:

Zoom In push button

Show a full size representation of your report page.  You can also click on the full page report to Zoom In.

Zoom Out push button

Show a full page representation of your report page.  You can also click on the full size report to Zoom Out.

Next push button

Move forward one page in your report.  You can also press Page Down to move forward one page.

Previous button

Move back one page in your report.  You can also press Page Up to move back one page.

Page push button

Select the number of the page you want to preview in the spinner and choose Page to go to that page.

OK push button

Closes the Page Preview dialog.


Page Preview SeeAlso
See Also

Report Dialog

Report Layout Window

RQBE Window


Paste Special Dialog

See Also

This dialog allows you to link or embed an OLE object on the clipboard to the current general field at the cursor location.  The object retains the formatting and other characteristics it had in the application that created it. For example, you can copy part of a Microsoft Excel spreadsheet and paste it as an object into a general field.  You can then double-click the object to open it in Excel and edit or print the object.

The Paste Special... menu option is not available until you copy the object you want to paste.  To use Paste Special..., first select information from the source document or application and use the Copy command from the Edit menu to place it on the clipboard.  Position the cursor in the field in which you want to place the object.  Choose Paste Special... to display the Paste Special dialog.  The dialog contains the following options:

Source area

Displays the application, directory or folder, and file you're pasting from.

Data Type list

Displays the available formats for the object.  Select the format for the object you're pasting according to what you want to be able to do with the stored object within FoxPro.  Object format allows you to edit the object (for example, a Microsoft Excel Worksheet object) by opening its source application from a field.  The picture or bitmap formats display the object and minimize the space it occupies in your table.  If you plan to change the size of the object, choose the Picture format.  If an object has a picture or bitmap format, you can't edit it from a table field.

Paste push button

Embeds the object from the clipboard into the current general field.

Paste Link push button

Links the object to FoxPro as the destination so you can modify the linked object from within FoxPro.

Cancel push button

Exits the dialog without taking action.


Paste Special Dialog SeeAlso
See Also

Edit Menu

Convert to Static


Path Dialog

See Also

Accessed through the View window, this dialog allows you to specify a path to the directory or folder in which FoxPro is installed. To display this dialog, choose View from the Window menu, choose the button that shows two file folders, then choose the FoxPro Path push button.

In the Path dialog, specify the appropriate path:

Enter path name

Displays the path to the FoxPro directory or folder.

Drive popup

Displays the drive containing the FoxPro directory or folder.

Select push button

Sets the path to the one you have designated in the dialog.

Cancel push button

Exits the dialog without taking action.


Path SeeAlso
See Also

View Window


Picture Dialog

See Also

The Picture dialog allows you to preview and select BMP or .PICT files for inclusion in screens or reports.

The Picture dialog contains the following options:

Select A Picture file list

Select a picture file from the list.

Directory list/Folder popup

Choose the directory or folder in which the pictures are located.

Drive popup

Choose drive on which directories are located.

List Files of Type popup

Determine what files will be displayed for selection in the File Name list.  Choose either all Windows Bitmaps or All Files in the directory.

Preview area

A picture of the currently highlighted graphics file is shown in this box and the dimensions of the picture are displayed below the box.

Open push button

Import the picture into your screen or report.

Cancel push button

Exits the dialog without taking action.


Picture SeeAlso
See Also

Report Layout Window

Report Picture Dialog

Screen Design Window

Screen Picture Dialog


Popup Dialog

See Also

The Popup dialog allows you to define a popup for your screen.  It contains the following options:

Popup Prompts list

When the List Popup radio button is checked, the prompts for the list are defined here.  To change the order of the prompts, drag the button to the left of a prompt to the position in the list that you want for the prompt in the popup.

Initial popup

Specify the prompt to be displayed on the popup control when the generated screen is first displayed.

Variable... push button

Specify the popup variable (a numeric or character memory variable or table field) in the text box, or use the Variable... push button to bring forward the Choose Field/Variable dialog.

Options area

List Popup radio button

Choose to define the prompts for the popup in the Popup Prompts list.

Array Popup radio button

Choose to define Popup from an array.  Enter the array name in the Array text box.

3D Style (FoxPro for Macintosh only)

Choose to create a three-dimensional look for the popup.

Initially Disable Popup check box

When checked, disables the popup in the generated screen. The popup in the generated screen can later be enabled by issuing SHOW GETS ENABLE in a code snippet.

Clauses area

When...

Opens the Code Snippet dialog so you can add code that is processed before the popup is entered.  If the code you add doesn't return a logical .T., the popup cannot be selected.

Valid...

Opens the Code Snippet dialog so you can add code that is processed before the popup is exited.  If the code you add doesn't return a logical .T., the popup cannot be exited.

Message...

Opens the Code Snippet dialog so you can add a procedure or an expression to be displayed in the status bar.

Comment...

Opens the Comment dialog so you can add comments to the generated code.  Comments are entirely for your reference and are ignored when the screen program is run.

1st Element..., # Elements...

Available when a popup is defined from an array.  Bring forward the Code Snippet dialog which allows you to specify the first element and the number of elements in the array.

OK push button

Returns you to the Screen Design window with the popup as you have defined it.

Cancel push button

Exits the dialog without taking action.  No popup is defined for your screen.


Popup SeeAlso
See Also

Choose Field/Variable Dialog

Code Snippet Dialog

Comment Dialog

Expression Builder Dialog

Screen Design Window


Preferences Dialog

See Also

Text editor, Calculator and Expression Builder each have preferences.

Text Editor Preferences

The Preferences menu option of the Edit menu is enabled when a text, program or memo window is active, and displays the Preferences dialog, which contains these options:

Save Options area

Option	Description
Create Backup Copy check box	When checked, automatically stores the previous version of an edited text or program file in a backup file . (with a .BAK extension).
Compile When Saved check box	Only enabled when editing program files, automatically compiles the program and checks for syntax errors when the file is saved.
Save Text With Ctrl-Z check box	When checked, places a Ctrl+Z at the end of a file when the file is saved.
Save Text With Line Feeds check box	When checked, saves files using a carriage return and line feed at end of all lines.
Save Preferences check box	When checked, stores preference settings in a resource file so each time the file is opened, it appears as it did at end of the last editing session.  This option also stores the window size and position, as well as the cursor location.
Justification area

Option	Description
Left radio button	Aligns all text at left edge of editing window.
Center radio button	Centers each line of text in window.
Right radio button	Aligns all text at right edge of editing window.
Edit and Display Options area

Option	Description
Drag-and-Drop Text Editing check box	When checked, allows you to select and move text to another location in the same file without using the Cut and Paste menu commands of the Edit menu.
Wrap Words check box	When checked, automatically moves the current word to the next line when the right margin is reached.  By default, this option is checked for text files and memo fields and unchecked for program files.
Auto Indent check box	When checked, allows you to construct indented programs by forcing the next line to be aligned with the previous line.
Status Bar check box	When checked, displays status information in the status bar at the bottom of the editing window.
Tab size spinner	Lets the distance (in number of spaces) that cursor advances when the Tab key is pressed.  The default is 4.
Use These Preferences as Default... check box	When checked, FoxPro uses the specified preferences as default for all files with the designated extension.
OK push button	Accept the preferences and return to the editing environment.
Cancel push button	Exit the dialog without taking action.
Calculator Preferences

The Preferences option on the Edit menu is enabled when the Calculator is active, and displays the Preferences dialog, which contains these options:

NumLock State area

Option	Description
Do Not Alter NumLock radio button	Invokes calculator without affecting whether NumLock is on or off.
Remember NumLock State radio button	Invokes Calculator and uses state of NumLock last time it was used.
Force NumLock ON radio button	Invokes Calculator and forces NumLock on.
Decimal Places area

Option	Description
Automatic radio button	Displays calculated results based on number of decimal places in numbers entered and operation performed.  Automatic is chosen by default.
Floating radio button	Displays numbers to highest degree of precision.  Numbers are shown with as many decimal places as necessary to display the entire number, with trailing zeros removed.
Fixed radio button	Allows you to specify in the text box how many decimal places to calculate.
OK push button	Accept the preferences and return to the calculator.
Expression Builder Preferences

The Edit menu Preferences option is enabled when the Expression Builder is active, and displays the Exp Builder Preferences dialog, which contains these options:

Function Popups List

Displays popup options corresponding to selected radio button (explained below).  All functions are selected by default when you first select a radio button.  Ctrl+click or [image] +click to clear individual functions, or use the All or Clear button to reset the list and then double-click to select or clear individual functions.

Option	Description
String radio button	Adjusts options that appear in String popup.
Math radio button	Adjusts options that appear in Math popup.
Logical radio button	Adjusts options that appear in Logical popup.
Date radio button	Adjusts options that appear in Date popup.
All push button	Adds all options to the Functions Popup list.
Clear push button	Removes all options from the Functions Popup list.
Field Aliases area

Option	Description
Always Add Alias radio button	The table name is included with fields used in the expression.
Add Non-Selected Alias Only radio button	When more than one table is open, FoxPro includes the name of any table that is not selected in the Work Areas list of the View window with any of its fields in the expression.
Never Add Alias radio button	Table names are not included with any field when creating the expression.
Show System Memory Variable check box	When unchecked, system memory variables are removed from the  Expression Builder.
OK push button	Accept the preferences and return to the Expression Builder.


Preferences SeeAlso
See Also

Calculator

Edit Menu

Expression Builder Dialog

Text Editing


Print Dialog

See Also

This dialog allows you to print a file.  The print dialog contains the following options:

Windows popup

Choose to print the contents of:

The Command window.

An open editing window

A file that is not open.

An ASCII file.

The clipboard.

File... push button

Enter the file name you wish to print in the text box, or choose the File push button to display the Print File dialog and select the file.

Line Numbers check box

When checked, adds line numbers to the output.

Page Eject Before check box

When checked, a form feed is sent to the printer before printing.

Page Eject After check box

When checked, a form feed is sent to the printer after printing.

OK push button

Prints according to the options you have chosen.

Cancel push button

Exits dialog without taking action.


Print SeeAlso
See Also

File Menu

Open Dialog

Print Setup Dialog

Page Setup Dialog


Page Setup Dialog

See Also

This dialog allows you to specify things such as the page layout and orientation of your print output. Options on the dialog are determined by the type of printer you have installed.


Page Setup Dialog SeeAlso
See Also

Open Dialog

Print Dialog


Print Setup Dialog

See Also

This dialog allows you to select the default printer or a specific installed printer, as well as other options for your printer.  The Print Setup dialog contains the following options:

Printer area

Default Printer radio button

Selects the current default printer you have set up in Windows

Specific Printer radio button and popup

Allows you to select a specific printer from the list of available printers.  To see a list of available printers, click the down arrow on the Specific Printer popup control, or press Alt+P and then Alt+Down Arrow.

Orientation area

Portrait radio button

Selects portrait print orientation.  This is the default setting.

Landscape radio button

Selects landscape print orientation.  Landscape prints along the page's long axis.

Paper area

Size

Choose the paper size you want to print on.

Source

Choose the paper source you want to print from.

OK push button

Activates the printer setup options you have chosen.

Cancel push button

Exits dialog without taking action.

Options... push button

This button is enabled if the printer you have selected has more print options available, and displays a dialog with the appropriate options for the printer you have chosen.  Some dialogs may display additional subdialogs, depending on the options available for your printer.  Each subdialog contains a Help push button that can be used to display specific help information for the dialog.


Print Setup Dialog SeeAlso
See Also

Open Dialog

Print Dialog


Print When Dialog

See Also

The Print When dialog allows you to determine the conditions under which items in your report or label are printed.  This dialog contains the following options:

Print Once Per Band area

Available if the Print When dialog was opened via the Text, Report Picture or Rectangle/Line dialogs.

Yes radio button

Choose to have the object print every time its band is printed in your report or label.

No radio button

Choose to have the Object print only in certain situations, which you can establish in other areas of the dialog.

Print Repeated Values area

Available if the Print When dialog was opened via the Report Expression dialog.

Yes radio button

Choose if you want the field to always print.

No radio button

Choose if you want the field to print only when the value in the field changes.

Also Print area

In First Whole Band of New Page/Column check box

Choosing this option causes the object to be printed in the first band of a new page or column that isn't an overflow from a previous page or column.

When This Group Changes check box

Choosing this option and choosing a group from the popup causes the object to be printed when the chosen group changes.

When Detail Overflows to New Page/Column check box

Choosing this option causes the object to be printed when the detail band overflows to a new page or a new column.

Print Only When Expression is True... check box

Opens the Expression Builder dialog so that you can define an expression to be evaluated before the object prints.  If the expression evaluates to false (.F.), the object will not print.  All other options in this dialog except Remove Line If Blank are disabled if you choose to include an expression.

Remove Line If Blank check box

Causes FoxPro to remove the line from the report if it is blank.  If you have set conditions so that the object doesn't print, FoxPro checks for other objects in the line.  If none are found, the line is removed.  If you do not check this box and have set conditions so that the object doesn't print, if there are no other objects on the line, a blank line is printed.

OK push button

Closes the Print When dialog, retaining the choices you have made.

Cancel push button

Exits the dialog without taking action.


Print When SeeAlso
See Also

Detail Dialog

Group Info Dialog

Page Footer Dialog

Page Header Dialog

Rectangle/Line Dialog

Report Expression Dialog

Report Layout Window


Program Menu

See Also

The Program menu contains options for working with running programs:

Do... displays the Do dialog so you can run a program.

Cancel ends program execution and returns control to FoxPro.

Resume continues operation of a suspended program.

Debug opens the Debug window so you can display selected variables in a running program.

Trace opens the Trace window so you can follow the progress of a program line-by-line through its code.

Compile... displays the Compile dialog so you can convert source code to object code.

Generate... displays the Generate dialog so you can convert the information from a FoxPro power tool into source code.

Macros... displays the Macro Edit dialog so you can define a macro to associate with a specific keystroke.

Beautify... displays the Beautification Options dialog so you can make cosmetic changes to a program file.

FoxDoc opens the FoxDoc dialog application so you can format and document a program, application or project.


See Also

Beautify Command

CANCEL Command

Compile Dialog

Debug Window

Do Dialog

FoxDoc Dialog

Generate Dialog

Macro Edit Dialog

RESUME Command

Trace Window


Project Window

See Also

The Project window allows you to organize and build applications.  Project files are displayed in the list in the left side of the window.

This window contains these options:

Edit push button

Opens the selected file for editing.

Information...

Displays the File Information dialog.

Add... push button

Displays the Add File dialog.

Remove push button

Deletes selected file from project.

Build... push button

Displays Build Option dialog.

Project menu options:

Options...

Displays Screen Generation Options dialog.

Project Info

Displays Project Information dialog.

Show Errors

Displays errors found in the project.

Set Main

Specifies the selected file as the main program.  The main program is indicated by a dot between the name of the program and the type of program.

Include/Exclude

Toggles to include or exclude selected file from project.  Excluded files must be distributed in addition to the application if they are needed by the application.

Edit

Opens selected file for editing.

File Info...

Displays the File Information dialog.

Add

Displays the Add File dialog.

Remove

Deletes the selected file from the project.

Build...

Displays the Build Option dialog.

Pack

Permanently removes all files from the project that have been removed from the list.


Project SeeAlso
See Also

Add File Dialog

Build Option Dialog

File Information Dialog

Generate Screen Dialog

Menu Design Window

Project Information Dialog

Report Layout Window

Screen Design Window

Text Editing


Project Information Dialog

See Also

This dialog displays the full file name and path of project and most recent date project was built.  It also lists each type of file project can contain along with:

Number of files of each type with current timestamp.

Number of files of each type with out-of-date timestamp.

Total number of files of each type included in Project.

When ready to return to Project window, choose OK.


Project Information SeeAlso
See Also

Project Window


Prompt Options Dialog

See Also

Choosing the Options check box in the Menu Design window for a menu pad or popup option displays the Prompt Options dialog.  This dialog contains the following options.

Comment text region

Holds comments to be stored in the .MNX database.  Comments do not affect the generated code in any way.

Shortcut... check box

Choose to display the Menu Shortcut dialog.

Skip For... check box

Choose to display the Expression Builder so you can specify a Skip For condition.

Message... check box

Choose to display the Expression Builder so you can specify a message to be displayed in the status bar when the menu pad or option is selected.

Pad Name... check box

When checked, displays a dialog allowing you to specify a pad name for a menu pad or a bar # for a menu popup option.

OK push button

Return to the Menu Design window retaining changes you have made.

Cancel

Exits the dialog without taking action.


Prompt Options SeeAlso
See Also

Menu Design Window

Menu Options Dialog


Push Button Dialog

See Also

Define push buttons for your screen in the Push Button dialog.  This dialog contains these options:

Type area

2D Style radio button (FoxPro for Macintosh only)

Choose to define a push button with a two-dimensional look.

3D Style radio button (FoxPro for Macintosh only)

Choose to define a push button with a three-dimensional look.

Invisible radio button

Choose to define invisible push buttons.  Indicate in the Number spinner how many invisible radio buttons you want to include in the set.  Invisible radio buttons allow you to define an action that takes place when the user clicks an area of the screen and are usually positioned over pictures or text.

Picture radio button

Choose to define pictures instead of written prompts for the push buttons.  When Picture is chosen, the Picture File... push button is activated.  Choose Picture File... to open the Picture dialog.

Push Button Prompts list

Enter prompts for normal push buttons.  To change the order of the prompts, drag the button to the left of a prompt to the position you want that prompt to occupy in the list.

Designate a default push button by including a backslash and an exclamation point (\!) before the prompt is defined.

Designate a cancel or escape push button by including a backslash and a question mark (\?) before the prompt when it is defined.

Designate a hot key for the button by including a backslash and a less than sign (\<) before the prompt when it is defined. FoxPro for Macintosh requires a KEYCOMP setting of WINDOWS for this feature to work.

Variable push button

Enter the push button variable (a numeric or character memory variable or table field) or use the Variable... push button to bring forward the Choose Field/Variable dialog.

Options area

Horizontal | Vertical radio buttons

Specify whether the group of buttons is displayed horizontally or vertically.

Initially Disable check box

When checked, the group of buttons is disabled when the screen is first activated.  The group of buttons can later be enabled by issuing SHOW GETS ENABLE in a code snippet.

Terminate READ on Selection check box

When checked, ends input when the user chooses the push button.

Space Between Buttons spinner

Set the number of pixels between buttons.

Clauses area

When...

Opens the Code Snippet dialog so you can add code that is processed before the push button is selected.  If the code you add doesn't return a logical .T., the push button cannot be selected.

Valid...

Opens the Code Snippet dialog so you can add code that is processed when the button is chosen.

Message...

Opens the Code Snippet dialog so you can add a procedure or an expression to be displayed in the status bar.

Comment...

Opens the Comment dialog so you can add comments to the generated code.  Comments are entirely for your reference and are ignored when the screen program is run.

OK push button

Returns you to the Screen Design window with the push buttons you have defined.

Cancel push button

Exits the dialog without taking action.


Push Button SeeAlso
See Also

Choose Field/Variable Dialog

Code Snippet Dialog

Comment Dialog

Expression Builder Dialog

Hot Keys Dialog

Screen Design Window


Puzzle

See Also

Choose the Shuffle push button to scramble the numbers, then click on one number at a time to move it to the adjacent empty square.  You're a winner when the numbers are in order.

To cheat, press Ctrl+End or [image] End.  The puzzle is solved.


Puzzle SeeAlso
See Also

Help Menu


Quick Report Dialog

See Also

Quick Report automatically places selected fields in the Report Layout window so you can position them and insert text or graphics to finish creating the report.  This option is enabled only on the Report menu popup when the Detail band of the Report Layout window is empty.

The Quick Report dialog contains the following options:

Field Layout area

Column Layout picture button

Fields are displayed from left to right across the page in the Detail band.

Form Layout picture button

Fields are displayed one below the other in the Detail band.

Titles check box

When checked, field names are displayed as titles above (Column Layout) or to the left (Form layout) of the corresponding field.

Fields... check box

Brings forward the Field Picker dialog to specify fields to be included in the report.  By default, all fields except general fields are included in the report.  General type fields are ignored by Quick Report.  When Fields... is checked, only the specified fields are included in the report.

Add Alias check box

When checked, the alias is inserted with all fields in the report.

OK push button

Returns you to the Report Layout window with the fields you have specified from the active table.

Cancel push button

Exits the dialog without taking action.


Quick Report SeeAlso
See Also

Field Picker Dialog

Format Dialog

Report Layout Window


Quick Screen Dialog

See Also

Quick Screen automatically places selected fields in the Screen Design window so you can position them and insert text or graphics to finish creating the screen.  This option is only available on the Screen menu popup when the Screen Design window is empty.

Options in the Quick Screen dialog are:

Field Layout area

Column Layout picture button

Fields are displayed from left to right across the screen. If the width of the selected fields is greater than the width of the Screen Design window, the fields will be displayed in row layout.

Row Layout picture button

Fields are displayed one below the other in the screen.

Max Field Width spinner

The width you set in the spinner determines the maximum size of the fields placed in the Screen Design window by Quick Screen.  The default value displayed in Max Field Width is the width of the screen.  You cannot set a maximum field width that is wider than the screen. If you set a default value smaller than the width of a field in your table, the field is displayed in the generated screen at the default width.  Text entered in the field will scroll to the size of the table field.  For example, if you have a table field that is 20 characters wide and you set the maximum field width to 5, in the generated screen, the user will be able to enter 20 characters, but only see 5 of them at a time.

Titles check box

When checked, field names are displayed as titles above or beside the fields.

Fields... check box

Brings forward the Field Picker dialog to specify fields to be included in the screen.  By default, all fields except general fields are included in the screen.  General type fields are ignored by Quick Screen.  When Fields... is checked, only the specified fields are included in the screen.

Add Alias check box

When checked, the table alias is added to all fields.

Memory Variables check box

When checked, creates memory variables for all the fields.  Creating memory variables allows editing of table fields indirectly so that changes can be discarded if desired.

OK push button

Returns you to the Screen Design window with the fields you have specified from the active table.

Cancel push button

Exits the dialog without taking action.


Quick Screen SeeAlso
See Also

Field Picker Dialog

Screen Design Window


RQBE Window

See Also

Displays the RQBE window so you can modify or create a query.

This window contains these options:

Tables list

Displays all tables included in the query.

Add push button

Displays the Open Dialog so you can choose a table to include in the query.

Clear push button

Closes the selected table.

Output Fields list

Displays fields and/or expressions to be included in the query output.  Fields are included in the order they appear in the list.

To change the order of items in a list drag the button with the double-headed arrow ( [image]) to the left of a field or expression to the desired location in the list.

Fields... check box

Displays the RQBE Select Fields dialog.  When checked, fields have been specified.

Order By... check box

Displays the RQBE Order By dialog.  When checked, an order has been specified.

Group By... check box

Displays the RQBE Group By check box.  When checked, a group has been specified.

Having... check box

Displays the RQBE Having dialog.  When checked, a having clause has been specified.

Output popup

Choose one of the following output options for query results:

Option	Description

Browse	Outputs results into a read-only Browse window.

Report/Label	Outputs results into a new or existing report or label form.

Table/DBF	Outputs results into a table that can be browsed, edited and saved.

Cursor	Outputs results into a temporary table.

Graph	Outputs results to Microsoft Graph.

Name text box

Enabled when Table/DBF, Cursor or Graph is chosen from the Output popup.  When Table/DBF is chosen, the Save As dialog is displayed first.  Use the Save As dialog to select a drive and directory or folder for the table, then choose OK to store the path and filename in the Name text box. When Cursor or Graph is chosen from the Output popup, type the file name and path for output file directly into the Name text box.

Options check box

Only enabled when Report/Label appears on the Output popup control.  Displays the RQBE Display Options dialog.  When checked, options have been specified.

Selection Criteria area

Field Name popup

Choose field to set comparison.  If <expression...> is chosen from the Field Name popup, the Expression Builder is displayed.

NOT check box

When checked, inverses condition.

Comparison popup

Choose one of the following comparisons for a condition:

Option	Description

Like	This the default option.  Like specifies that the field must match the example text in order for the record to be included in the query output ("CUSTOMER.STATE Like O" would match records from Ohio, Oklahoma and Oregon.)

Exactly Like	Specifies that the field must exactly match example text, character for character, in order for the record to be included in the query output.

More Than	Specifies that the field must be greater than the value in the example text in order for the record to be included in the query output.

Less Than	Specifies that the field must be less than the value in the example text in order for the record to be included in the query output.

Between	Specifies that the field must be greater than or equal to the lower value and less than or equal to the higher value in the example text in order for the record to be included in the query output ("INVOICES.IDATE Between 05/10/92,05/12/92" would match records for the 10th, 11th and 12th of May, 1992).

In	Specifies that the field must match one of several comma-delineated examples in the example text in order for the record to be included in the query output.

Example text box

Type in comparison text.

Up/Lo check box

When checked, the query ignores capitalization of character data.

Insert push button

Inserts new condition above selected condition.

Remove push button

Deletes selected condition.

Or push button

Creates an OR condition.

See SQL push button

Displays a read-only window containing the SQL SELECT command.  The command can be copied and pasted into a program editing window or the Command window.

Do Query push button

Performs created query.

The RQBE menu is intended for keyboard users who want quicker access to the options. It contains the same options available in the RQBE window, with the addition of Comments....

Comments...

Displays the Comment dialog so you can add comments.  Comments are for your own reference and do not affect the query in any way.


RQBE SeeAlso
See Also

Comment Dialog

Expression Builder Dialog

New Dialog

Open Dialog

RQBE Display Options Dialog

RQBE Group By Dialog

RQBE Having Dialog

RQBE Join Condition Dialog

RQBE Order By Dialog

RQBE Select Fields Dialog


RQBE Display Options Dialog

See Also

RQBE Display Options dialog allows you to format report/label options and set up output destinations.

The dialog contains these options:

Screen Display radio button

Displays query output to the main FoxPro window.

Report radio button

Enables report options for output.

Label radio button

Enables label options for output.

Form Name... check box

Type the file name and path of the desired Report/Label form into the text box, or choose Form Name... check box to display the Open dialog.

Quick Report... check box

Displays the Quick Report dialog.

Overwrite File check box

Enabled when Quick Report has been chosen.  When checked, overwrites existing Quick Report.

Page Preview check box

When checked, sends output to the Page Preview dialog instead of the printer.

Summary Information Only check box

When checked, displays summary information instead of the entire report.

Eject Page Before Report check box

When checked, sends a page eject before printing the report.

Report Heading... check box

Type a heading for the report into the text box or choose the Report Heading... check box to display the Expression Builder to create the heading.

Suppress Column Headings check box

When checked, does not display headings at top of each column.

Console On check box

When checked, output is displayed on the screen in addition to being sent to the printer.

Pause Between Screens check box

When checked, pauses output after a screen full of information.

Output Destinations area

To Printer check box

When checked, sends output to printer.

To File... check box

Type path and filename for the output file into the text box, or choose the To File... check box to display the Save As dialog.

Overwrite File

When checked, overwrites output file if it exists.


RQBE Display Options SeeAlso
See Also

Expression Builder Dialog

Print Dialog

Quick Report Dialog

Report Layout Window

RQBE Window


RQBE Group By Dialog

See Also

RQBE Group By dialog groups records in the query based on values in the table field or field function.

This dialog contains these options:

Table Fields list

Double-click on a field, or select the field then choose the Move push button to move it to the Group By Fields list.

Group By Fields list

Double-click on a field, or select the field then choose the Remove push button to remove it from the Group By Fields list.

To change the order of items in a list drag the button to the left of the field name to its desired location in the list.

Move push button

Moves the selected fields from the Table Fields list to the Group By Fields list.

Remove push button

Removes the selected fields from the Group By Fields list.

OK push button

Return to the RQBE window.  Data in the query will be grouped according to the fields you have specified.

Cancel

Exits the dialog without taking action.


RQBE Group By SeeAlso
See Also

RQBE Having Dialog

RQBE Window


RQBE Having Dialog

See Also

The RQBE Having dialog specifies conditions that groups must meet to be included in the query output.

This dialog contains these options:

Field Name popup

Choose a function or field to set the comparison.  If <expression...> is chosen from the Field Name popup, the Expression Builder is displayed.

NOT check box

When checked, inverses condition.

Condition popup

Choose a condition.  "Like" is displayed on the popup by default.

Example text box

Enter comparison text.

Up/Lo check box

When checked, ignores capitalization of character data.

Insert push button

Inserts a new condition above the selected condition.

Remove push button

Deletes the selected condition.

Or push button

Creates an OR condition.

OK push button

Returns you to the RQBE window.  Conditions specified in the dialog are applied to the query.

Cancel

Exits dialog without taking action.


RQBE Having SeeAlso
See Also

Expression Builder Dialog

RQBE Group By Dialog

RQBE Window


RQBE Join Condition Dialog

See Also

The RQBE Join Condition dialog appears every time an additional table is opened in Tables list of the RQBE window.

This dialog contains these options:

Leftmost popup

Choose a field from the table you just selected.

NOT check box

When checked, inverses condition.

Center popup

Choose type of comparison.  "Like" is the default.

Rightmost popup

Choose a field from another table in the query.

Ignore Upper/Lower Case check box

When checked, ignores capitalization of character data.

OK push button

Returns you to the RQBE window.  Join conditions specified in the dialog are applied to the query.

Cancel

Exits dialog without taking action.


RQBE Join Condition SeeAlso
See Also

RQBE Window


RQBE Order By Dialog

See Also

RQBE Order By dialog specifies the order of records that appear in query results.

This dialog contains these options:

Selected Output list

Double-click on field or select field then choose the Move push button to move it to the Ordering Criteria list.

Ordering Criteria list

Double-click on a field or select a field then choose the Remove push button to remove it from the Ordering Criteria list.

To change the order of items in a list drag the button to the left of the item to its desired location in the list.

Move push button

Moves selected fields from the Selected Output list to the Ordering Criteria list.

Remove push button

Removes selected fields from the Ordering Criteria list.

Order Options area

Ascending

Sorts data in ascending order, that is from lowest to highest.

Descending

Sorts data in descending order, from highest to lowest.

OK push button

Returns you to the RQBE window.  Ordering criteria specified in the dialog are applied to the query.

Cancel

Exits dialog without taking action.


RQBE Order By SeeAlso
See Also

RQBE Window


RQBE Select Fields Dialog

See Also

The RQBE Select Fields dialog allows you to specify fields, functions and expressions to include in a query, adjust the order of field appearance, remove fields and eliminate duplicate entries using these controls:

Table Fields list

Double-click on fields, or select fields then choose the Move push button to move them to the Selected Output list.

Selected Output list

Double-click on fields, or select fields then choose the Remove push button to remove them from Selected Output list.

To change the order of items in a list, drag the button to the left of an item to its desired location in the list.

Move push button

Moves selected fields from the Table Fields list to the Selected Output list.

All push button

Moves all fields from the Table Fields list to the Selected Output list.

Remove push button

Removes selected fields from the Selected Output list.

Remove All push button

Deletes all fields from the Selected Output list.

Functions/Expressions area

Choose a function to include in the output from the popup and then choose the Move push button.

No Duplicates check box

When checked, removes records in which all fields match.

Cross Tabulate check box

To output query results to Microsoft Graph, a report form or a table in cross tabular format, check Cross Tabulate.  Cross Tabulate is enabled only when you have exactly three items selected in the RQBE Select Fields dialog.  These three items represent the X axis, the Y axis and the cell value for the graph.

For example, if you want to generate a clients report that shows the amount billed to them by month for one year, you could create a graph that displays clients down the left side of the page, January-December across the top of the page and graphs the amount billed to each client each month.

OK push button

Returns you to the RQBE window.  Fields and/or expressions specified in the Selected Output list are included in the query.

Cancel

Exits the dialog without taking action.


RQBE Select Fields SeeAlso
See Also

RQBE Window


Radio Button Dialog

See Also

The Radio Button dialog contains these options:

Type area

2D Style radio button (FoxPro for Macintosh only)

Choose if you want the radio button to have a two-dimensional look.

3D Style radio button (FoxPro for Macintosh only)

Choose if you want the radio button to have a three-dimensional look.

Radio Button Prompts list

Enter prompts for radio buttons.  To change the order of the prompts, click on the double-headed arrow ( [image]) and drag or select a prompt and press Ctrl+PgUp or Ctrl+PgDn ( [image] Page Up or [image] Page Down).

Picture

Choose to include pictures instead of written prompts for the radio buttons.

Picture File... push button

Activated when Picture buttons is checked.  Opens the Picture dialog.

Initial popup

Allows you to select the radio button prompt to which you want to assign a variable.

Bottom radio button

Positions the rectangle or line at the bottom of the band.

Comment push button

Opens the Comment dialog so you can add comments to the .FRX or .LBX table.  Comments are entirely for your reference and do not appear in the printed report or label.

Variable text box

Enter a radio button variable (numeric or character memory variable or database field) or use the Variable... push button to bring forward the Choose Field/Variable dialog.

Horizontal | Vertical radio buttons

Specify whether group of buttons is displayed horizontally or vertically.

Initially Disable Buttons check box

When checked, disables radio buttons in the generated screen. The radio buttons in the generated screen can later be enabled by issuing SHOW GETS ENABLE or SHOW <field> ENABLE in a code snippet.

Space Between Buttons spinner

Set the number of pixels between buttons.

When... push button

Opens the Code Snippet dialog so you can add code that is processed before the field is entered.  If the code you add doesn't return a logical .T., the field cannot be selected.

Valid... push button

Opens the Code Snippet dialog so you can add code that is processed before the field is exited.  If the code you add doesn't return a logical .T., the field cannot be exited.

Message... push button

Opens the Code Snippet dialog so you can add a procedure or an expression to be displayed in the status bar.

Comment... push button

Opens the Comment dialog so you can add comments to the generated code.  Comments are entirely for your reference and are ignored when the screen program is run.


Radio Button SeeAlso
See Also

Choose Field/Variable Dialog

Code Snippet Dialog

Comment Dialog

Expression Builder Dialog

Hot Keys Dialog

Screen Design Window


Recall Dialog

See Also

This menu command displays the Recall dialog, which allows you to unmark records previously marked for deletion.  This dialog contains these options:

Scope... push button

Displays the Scope dialog.  See Scope dialog for more information.

For... push button

Displays Expression Builder to specify For conditions.  See Expression Builder dialog for more information.

While... push button

Displays Expression Builder to specify While conditions.  See Expression Builder dialog for more information.


Recall SeeAlso
See Also

Delete Dialog

Record Menu


Record Menu

See Also

The Record menu contains commands for performing operations on records in the active table.  The following options are available:

Append opens a Browse window in append mode.

Change opens a Browse window in change mode.

Goto... opens the Goto dialog so you can move to a specific record.

Locate... displays the Locate dialog so you can find the next record meeting your specifications.

Continue provides continuation of a LOCATE command.

Seek... displays the Seek dialog so you can specify a search in an indexed table.

Replace... displays the Replace dialog so you can change one or more records.

Delete... displays the Delete dialog so you can delete one or more records.

Recall... displays the Recall dialog so you can removes the delete tag from one or more records.


See Also

Append Mode

Change Mode

Delete Dialog

Expression Builder

Goto Dialog

Locate Dialog

Recall Dialog

Replace Dialog

Seek Dialog


Rectangle/Line Dialog

See Also

This dialog allows you to determine the rectangle or line's position in a band. The dialog is opened by double-clicking on a rectangle or a line in the Report Writer and contains the following options:

Print When... check box

Opens the Print When dialog, allowing you to specify when the rectangle or line is printed.

Top radio button

Positions the rectangle or line at the top of the band in the report.

Bottom radio button

Positions the rectangle or line at the bottom of the band.

Stretch with Band radio button

Allows the rectangle or line to stretch as the band does.

Comment... push button

Opens the Comment dialog so you can add comments to the generated code.  Comments are entirely for your reference and are ignored when the report is run.


Rectangle / Line SeeAlso
See Also

Comment Dialog

Report Layout Window


Reindex

See Also

Rebuilds any open index files associated with the active table.


Reindex SeeAlso
See Also

Database Menu

Setup Dialog


Rename Directory Dialog

See Also

Renames a directory tagged in the Filer.

To rename a directory, choose Filer from the Help menu, choose the Tree push button, select the directory you want to rename, choose the Rename push button, then enter the directory's new name in the To: text box.

To text box

After entering the name, choose the Rename push button to change the directory name.


Rename Directory SeeAlso
See Also

Filer


Rename Files Dialog

See Also

Renames files tagged in the Filer.

To rename a file, choose Filer from the Help menu, highlight the file, choose the Rename push button, then enter the name in the To: text box.

To text box

After entering the name, choose the Rename push button to change the name.


Rename Files SeeAlso
See Also

Filer


Replace Dialog

See Also

This menu option displays the Replace dialog, which allows you to change field information in one record or in a range of records.  This dialog contains these options:

Fields list

Allows you to choose the field or fields in which to place data.

Scope... check box

Displays the Scope dialog.  See Scope dialog for more information.

For... check box

Displays Expression Builder to specify For conditions.  See Expression Builder dialog for more information.

While... check box

Displays Expression Builder to specify While conditions.  See Expression Builder Dialog for more information.

From Table popup

Displays a list of tables from which you can choose.  The items in the Fields list correspond with the table displayed on the From Table popup.

With... push button

Choose this button to display the Expression Builder.  You can also type replacement text for the selected fields into the text box to the right of the With... push button.


Replace SeeAlso
See Also

Record Menu


Report Dialog

See Also

Displays or prints reports from selected table using predefined report definition file.  This dialog contains these options:

Form... push button

Type the name of the desired report definition file in the text box, or choose Form... and select the appropriate file from the Open dialog.

Restore Environment check box

When checked, the environment saved with the report form is restored automatically.

Quick Report... push button

Displays the Quick Report dialog.

Output Location

To Printer check box

When checked, sends report to designated print device.

Page Preview check box

When checked, previews the report before printing.

Console On check box

Activated when To Printer is checked. Displays the report on screen while it prints.

More >>

Opens the following options:

Scope... push button

Brings forward scope dialog.  The default scope is ALL.

For... push button

Display Expression Builder to specify the For conditions.

While... push button

Display Expression Builder to specify the While conditions.

Output Options

Option	Description
First Page Heading Only check box	When checked, prints report with page header only on the first page of the report.  Subsequent pages print without page headers.
No Initial Form Feed check box	When checked, suppresses initial form feed sent to printer prior to printing the report.
Summary Information Only check box	When checked, suppresses detail line printing.  Produces a report that includes all the information in the report (headings, footers, totals, and so on) except the detail lines.
Heading... push button	Adds additional heading line to the report.  Type line in text box or select Heading... to display the Expression Builder to specify a line that will print on the top line of each page of report.  You can use this option to customize the report output at runtime without changing the report form.
Choose the OK push button to begin running the report.


Report SeeAlso
See Also

Database Menu

Print Dialog

Report Layout Window

Save As Dialog

Scope Dialog

View Window


Report Expression Dialog

See Also

This dialog allows you to define a field expression for a report.

This dialog contains these options:

Expression... push button

Enter a field expression in the text box or choose Expression... to display the Expression Builder.

Format... push button

Displays the Format dialog so you can specify formatting options.  If you prefer to enter format codes in the text box, refer to Format Codes.

Calculate... check box

Displays the Calculate Field dialog.  When checked, a calculation has been set for the chosen field.

Print When... check box

Displays the Print When dialog.

Position Relative To (Area)

Top [image] Height radio button

Maintains the position of the field relative to the top of the band.  Does not allow stretching of the field to accommodate lengthy data.

Top [image] Field Can Stretch radio button

Maintains the position of the field relative to the top of the band.  Allows stretching of the field to accommodate lengthy data.

Bottom radio button

Maintains the position of the field relative to the bottom of the band.

Comment... push button

Displays the Comment dialog.  Comments are entirely for your reference.


Report Expression SeeAlso
See Also

Calculate Field Dialog

Comment Dialog

Expression Builder Dialog

Format Codes Dialog

Format Dialog

Report Layout Window


Report Layout Window

See Also

The Report Writer allows you to design custom reports and labels.

The tool palette to the left of the Report Design Window provides easy access to object tools.  The tools are, from top to bottom:

Selection pointer

Text tool

Field tool

Line tool

Rectangle tool

Rounded-rectangle tool

Picture tool

Selecting Objects

To select objects, click on the selection pointer then:

1	Click on an object to select it.

2	Shift+click on multiple objects to select them.

3	Drag the selection marquee around several objects to select them.

4	Double-click on objects to open dialogs so that you can add or change code snippets or other object attributes.

Once you have selected an object, you can move it, resize it and change its font, type face, fill and color by choosing menu commands from the Object menu.

Editing Text

To add or edit text in your report, click the text tool then click in the Screen Design window where you want to add or edit text.  Make the desired additions or changes.

Drawing Lines

To draw a line in your report, click the line tool, position the cursor where you want an end of the line to be, and drag until the line is the desired length.

Drawing Rectangles

To draw a rectangle in your report, click the rectangle tool, position the cursor where you want a corner of the box to be, and drag until the box is the desired size.

Drawing Rounded Rectangles

To draw a rectangle with rounded corners in your report, click the Rounded-Rectangle tool, position the cursor where you want a corner of the rounded rectangle to be, and drag until the rounded rectangle is the desired size.  To specify how rounded your rectangle is, double-click on the rounded-rectangle object to open the Round Rectangle dialog.

In this dialog, you can choose the shape of the rounded rectangle, from completely oval to very slightly rounded.

Defining Fields and Expressions

To define a field or expression for the report, click the Field tool, then click in the Report Writer window.

Defining Pictures

Click the Picture tool, then drag to size in the Report Layout window.  The Report Picture dialog opens.

Band Types

The bars that go across the column width of the report separate the report into band types.  To adjust the amount of space in the various bands, click and drag the button to the left of the separator bar.

Title band

Contains information that appears before the main report.

Page Header band

Displayed at top of each page of the report.

Group Header band

Displayed at top of each data group.

Detail band

Makes up report body and usually contains field information from selected tables.

Group Footer band

Displayed at bottom of each data group.

Page Footer band

Displayed at bottom of each page of the report.

Summary band

One or more pages that appear after report.

Report Menu

Page Layout...

Displays the Page Layout dialog.

Page Preview... push button

Displays the Page Preview dialog.

Show/Hide Position

Displays or hides the coordinates of the mouse pointer and the dimensions of selected objects in the status bar.  By default, position is hidden.

Ruler/Grid...

Displays the Ruler/Grid dialog.

Grid

Sets an invisible alignment grid so that objects are automatically aligned to the nearest grid line when they are created, sized or moved.

Quick Report...

Displays the Quick Report dialog.


Report Layout SeeAlso
See Also

Calculate Field Dialog

Data Grouping Dialog

Expression Builder Dialog

Field Picker Dialog

Format Dialog

Group Info Dialog

New Dialog

Open Dialog

Page Layout Dialog

Page Preview Dialog

Quick Report Dialog

Report Dialog

Report Expression Dialog

Report Variables Dialog

Round Rectangle Dialog

Ruler/Grid Dialog

Save As Dialog

Title/Summary Dialog

Variable Definition Dialog


Report Picture Dialog

See Also

The Report Picture dialog allows you to include BMP pictures, .PICT files or other information from a general table field in your report.  This dialog contains the following options:

Picture From area

File radio button

To include a picture in your report, choose the File radio button.  You can then choose the File... button to open the Picture dialog so you can select the desired BMP or .PICT file or you can type the name and path of the file in the text box beside the File... button.

Field radio button

To include a general table field in your report, choose the Field radio button.  You can then choose the Field... button to open the Choose Field/Variable dialog so you can select the desired table field or you can type the name of the field in the text box beside the Field... button.

If a record in the table contains an object other than a picture or a chart in the general field (for example, a Microsoft Excel spreadsheet or a Word for Windows document), an icon representing the object is printed in the report.

If Picture and Frame Different Size area

Clip Picture radio button

If the picture is bigger than the frame you created in the Report Layout window, Clip Picture will show a section of the original picture in the frame, retaining the picture's original dimensions.  The picture is anchored at the top and at the left of the frame.  You cannot see the lower right portion of the picture that extends beyond the frame.

Scale Picture [image] Retain Shape radio button

Displays the whole picture, filling as much of the frame that you size in the Report Layout window as possible while retaining the relative proportions of the picture.  This will protect your picture from vertical or horizontal distortion.

Scale Picture [image] Fill the Frame radio button

Display the whole picture, filling the frame that you size in the Report Layout window completely.  If necessary, the picture will be distorted vertically or horizontally to fit the frame.

Center Picture check box

If you are including a BMP or .PICT file in your report, Center Picture will have no effect on the single picture.  Because a single picture has known parameters, the picture will never be smaller than the frame.

The pictures included in a general data field can be a variety of shapes and sizes.  If the picture in a general field is smaller than the frame, it will be displayed in the upper left corner of the frame unless you check Center Picture.  Checking Center Picture ensures that general field pictures smaller than the frame are centered in the frame in the report or label.

Print When... check box

Opens the Print When dialog.

Position Relative To area

Top radio button

Causes the picture to remain in the position you give it in the Report Layout window and maintain that position relative to the top of the band.

Bottom radio button

Causes the picture to remain in the position you give it in the Report Layout window and maintain that position relative to the bottom of the band.

Comment push button

Opens the Comment dialog so you can add comments to the .FRX or .LBX table.  Comments are entirely for your reference and do not appear in the printed report or label.


Report Picture SeeAlso
See Also

Choose Field/Variable Dialog

Comment Dialog

Picture Dialog

Print When Dialog

Report Layout Window


Report Variables Dialog

See Also

Choose Variables from Report menu to display the Report Variables dialog.

This dialog contains these options:

Variables list

Displays variables in the order they are evaluated.

To change the order of items in the list, drag the button to the left of an item to the desired location in the list.

Add push button

Displays the Variable Definition dialog to create a new variable.

Change push button

Displays the Variable Definition dialog to edit the selected variable.

Delete push button

Deletes the selected variable.


Report Variables SeeAlso
See Also

Expression Builder Dialog

Report Layout Window

Variable Definition Dialog


Restore Macros Dialog

See Also

Adds a saved macro set to the current macros (those in the list box).

To restore a macro set, choose Macros... from the Program menu, choose the Restore... push button, then enter the appropriate information about the macro:

Restore Macros from File

The name of the file containing the macro you want to restore.

Directory/Folder

The directory or folder containing the file you want to restore.

Drive

The drive containing the directory.

After entering the information, choose the Open push button.


Restore Macros SeeAlso
See Also

Macros Dialog


Revert

See Also

Discards changes made to a text file, program file, screen file, menu file, report file, label file, query file, project file or memo field since the file was last saved.  To use this menu option, choose Revert from the File menu.


Revert SeeAlso
See Also

File Menu

Text Editing


Round Rectangle Dialog

See Also

This dialog allows you to choose the style of rounded rectangle you want to include in your report or screen, and contains the following options:

Style push buttons

Each button in this area has a picture of how the upper-right corner of the rectangle will appear.  Choose the appropriate button to create the desired rectangle.

Position Relative To area

Only available in the Report Writer.  Allows you to specify the position of the rectangle in relation to specific areas of the report.

Top radio button

Choose this option to have the top of the rectangle always appear at the top of the band.

Stretch with Band radio button

Choose this option to have the rectangle stretch as the band stretches.

Bottom radio button

Choose this option to have the bottom of the rectangle always appear in the bottom of the band.

Print When... check box

Only available in the Report Writer.  Displays the Print When dialog, which allows you to specify when the rectangle does or does not print.

Comment... push button

Displays the Comment dialog.  Comments are entirely for you reference and do not appear in a generated screen, a report or label.


Round Rectangle SeeAlso
See Also

Comment Dialog

Report Layout Window

Screen Design Window


Ruler/Grid Dialog

See Also

This dialog allows you to set the units for rulers to the left and at the top of the Screen Design window and the Report Layout window.

Ruler

Inches

Centimeters

Pixels

Characters (disabled in the Report Writer)

No Rulers (disabled in the Report Writer)

The unit you select is the one that is displayed in the rulers in the Screen Builder and Report Writer windows.  If you select No Rulers, no rulers are displayed.

Ruler Lines radio buttons

Choose whether or not a grid of lines is displayed on the screen.

Grid Size spinners

Set the number of units between horizontal and vertical grid lines.


Ruler/Grid SeeAlso
See Also

Report Layout Window

Screen Design Window


Run Menu

See Also

The Run menu provides instant, easy access to the FoxPro power tools.  If you prefer, you can prevent the Run menu from appearing on the system menu bar by including the following line in your configuration file:

_STARTUP = ""

New Query

When you choose the New Query option:

If a table is open, the RQBE Window appears so that you can create a query.

If a table is not open, the Open dialog appears so that you can specify a table to query.  Once you specify a table, the RQBE window appears so that you can create a new query.

Query

When you choose the Query... option, the Open dialog appears so that you can either:

Run an existing query by selecting the query name from the list, then choosing Run.

Create a new query to run by choosing New to display the RQBE Window.

Screen

When you choose the Screen... option, the Open dialog appears so that you can either:

Run an existing screen program by selecting the screen program name from the list then choosing Run.

Create a new screen to run by choosing New to display the Screen Design Window.

Report

When you choose the Report... option, the Open dialog appears so that you can either:

Run an existing report by selecting the report name from the list, then choosing Run... from the Run Report dialog to display the Output Destinations dialog.  In this dialog, you can specify whether you want the report output to be displayed in a Page Preview window or sent to a printer or file.

Create a new report to run by choosing New to display the Report Layout Window.

Label

When you choose the Label... option, the Open dialog appears so that you can either:

Run an existing label file by selecting the label file name from the list, then choosing Run... from the Run Label dialog to display the Output Destinations dialog.  In this dialog, you can specify whether you want the label output to be displayed in a Page Preview window or sent to a printer or file.

Create a new label to run by choosing New to display the Report Layout Window.

Application

When you choose the Application... option, the Open dialog appears so that you can either:

Run an existing application by selecting the application from the list then choosing Run.

Create a new application by choosing New to start FoxApp, the Application Generator.

Convert dBASE Files

When you choose the Convert dBASE Files... option, the Convert Files dialog appears so that you can convert existing dBASE IV screen, label, report and .FMT files to equivalent FoxPro files.

For more Help about this option, press F1 or choose the Help button in the Convert Files dialog.

Wizard

When you choose the Wizard... option, a cascading menu appears so that you can choose a wizard from the list.


See Also

FoxApp

New Label Dialog

Open Dialog

Report Layout Window

RQBE Window

Screen Design Window

Using Wizards


Save As Dialog

See Also

This dialog allows you to copy the current file to disk under a new name or to a new location. The Save As dialog provides the following items (optional items appear only if they apply).

File name text box

Allows you to type in the name of the file you wish to open.

File name list

Displays all files of the current file type or specified by the All Files check box.  Select the file and choose the Save button, or double-click on the file name.

Directory list/Folder popup

Allows you to specify the directory or folder in which the desired file is located.

Drive popup

Allows you to specify the drive on which the desired file is located.

New push button

Creates a new folder.

Desktop push button (FoxPro for Macintosh only)

Click this button to display a list of objects that are on the Macintosh desktop.

Save push button

Saves the selected file.

Save As text box

Place the cursor in the Save As text box and enter the new file name, or select an existing filename from the list, then click the Save button.

Eject button (FoxPro for Macintosh only)

Click this button to eject a floppy from the computer.

Cancel push button

Exits the dialog without taking action.

All Files check box

When checked, this option displays all files, regardless of type, in the File name list.

Change Code Page check box

Optional.  You can save a program or text file and translate it for use on another FoxPro platform by checking the Change Code Page check box.  Specify the desired platform in the dialog that appears after you choose Save.

If you're editing a program that you plan to compile on the current FoxPro platform, be sure to specify the current FoxPro platform when you save the program.


Save As SeeAlso
See Also

File Menu

Text Editing


Scope Dialog

See Also

The Scope dialog specifies records the command will affect.  This dialog contains the following options:

All radio button

Choose this button to specify all records in the table.

Next radio button

Choose this button, so you can specify the number of records on which the command will act.  The command acts on a range of records beginning with the current record and continuing for the specified number of records.

Record radio button

Choose this button, so you can specify the record number of the record on which the command will act.

Rest radio button

Choose this button to specify all the records beginning with the current record and ending with the last record in file.


Scope SeeAlso
See Also

Append From Dialog

Average Dialog

Calculate Dialog

Copy To Dialog

Count Dialog

Delete Dialog

Expression Builder Dialog

Locate Dialog

Recall Dialog

Replace Dialog

Report Layout Window

Sort Dialog

Sum Dialog

Total Dialog


Screen Code Dialog

See Also

This dialog allows you to specify code for entering, exiting, activating, deactivating and refreshing your screens.  The text areas for the buttons in this dialog are uneditable and display the first few characters of the code.  The Screen Code dialog contains these options:

Screen Setup Code push button

Displays an editing window so you can specify setup code for the screen.  Setup Code is processed when the screen program is initially run and is a good place to define variables, select work areas, use tables, set indexes and relations, and so on.

Cleanup and Procedures push button

Displays an editing window so you can specify cleanup code to restore settings and so on.  You can also enter code for procedures that will be used throughout the screen.  For example, if you will be using the same VALID procedure for several objects in the screen, writing your code here will prevent code duplication upon generation.

When writing procedure code in the Cleanup and Procedures editing window, you must include a PROCEDURE <procedure name> command.

On Screen Entry (When)... push button

Opens a Code Snippet dialog so you can enter code to determine whether or not the READ command is processed.  If a .T. is returned, the READ command is processed.  If .F. is returned, the READ command is not processed.

On Screen Exit (Valid)... push button

Opens a Code Snippet dialog so you can enter code to determine whether or not the READ command is terminated.  If a .T. is returned, the READ command is terminated.  If .F. is returned, the READ command is not terminated.

On Window Activate... push button

Opens a Code Snippet dialog so you can enter code that is executed when the READ command is issued or whenever the current READ window changes.

On Window Deactivate... push button

Opens a Code Snippet dialog so you can enter code that is executed whenever the user attempts to make any other window the active window.

On Refresh (Show Gets)... push button

Opens a Code Snippet dialog so you can enter code that is executed whenever the SHOW GETS command is issued.  SHOW GETS can be used to refresh output fields or enable or disable input fields.

OK push button

If you have chosen Screen Setup Code or Cleanup and Procedures, OK closes the Screen Code dialog and positions the cursor in the appropriate editing window.  If you have chosen any of the other options, OK saves the code you entered in Code Snippet dialogs and returns you to the Screen Design window.

Cancel push button

Returns you to the Screen Design window without saving any of the changes you may have made in the Screen Code dialog.


Screen Code SeeAlso
See Also

Code Snippet Dialog

Screen Design Window

Screen Layout Dialog


Screen Color Dialog

See Also

Accessed by choosing Color... in the Screen Layout dialog.  Choose the color you want the background of your screen to be.

Automatic push button

Choose Automatic (the default) if you want the screen background to correspond to the default color scheme.

Wallpaper... push button

Opens the Picture dialog so that you can set a .BMP or PICT file for the background of your screen.


Screen Color SeeAlso
See Also

Picture Dialog

Screen Design Window

Screen Layout Dialog


Screen Design Window

See Also

Allows you to create custom screens for user input.  The toolbox is the vertical column of buttons at the left of the Screen Design window.  When you select a tool from the toolbox, a description of the tool is displayed in the status bar.

Tools

Selection pointer

Text tool

Field tool

Edit region tool

Push button tool

Radio button tool

Check box tool

Popup tool

List tool

Spinner tool

Line tool

Rectangle tool

Rounded-rectangle tool

Picture tool

Using the Tools

Except for the selection pointer, each button in the toolbox represents a screen object.  Click the appropriate tool and move the mouse pointer to the desired location in the Screen Design window.  To include more than one of the same kind of object, double-click the appropriate tool.  Then, you can include multiple objects without having to click the tool multiple times.  When you finish adding objects, click the selection pointer tool.

Selecting Objects

To select objects, click the selection pointer then:

1	Click on an object to select it.

2	Shift+Click on multiple objects to select them.

3	Drag selection marquee around several objects to select them.

4	Double-click on objects to open dialogs so that you can add or change code snippets or object attributes.

Once you have selected an object, you can move it, resize it and change its font, type face, fill and color by choosing menu commands from the Object menu.

Editing Text

To add or edit text in your screen, click the text tool then click in the Screen Design window where you want to add or edit text.  Make the desired additions or changes.

Defining Fields

To define an input or an output field for the screen, click the field tool then click in the Screen Design window.  The Field dialog opens.

Defining Edit Regions

To define an edit region for the screen, click the edit region tool then click in the Screen Design window.  The Edit Region dialog opens.

Defining Push Buttons

To define push buttons for the screen, click the Push Button tool, then click in the Screen Design window.  The Push Button dialog opens.

Defining Radio Buttons

To define radio buttons for the screen, click the Radio Button tool, then click in the Screen Design window.  The Radio Button dialog opens.

Defining Check Boxes

To define a check box for the screen, click the Check Box tool, then click in the Screen Design window.  The Check Box dialog opens.

Defining Popups

To define a popup for the screen, click the Popup tool, then click in the Screen Design window.  The Popup dialog opens.

Defining Lists

To add a list to the screen, click the List tool, then drag to size in the Screen Design window.  The List dialog opens.

Defining Spinners

To add a spinner to the screen, click the Spinner tool, then drag to size in the Screen Design window.  The Spinner dialog opens.

Drawing Lines

To draw a line in your screen, click the Line tool, position the cursor where you want an end of the line to be, and drag until the line is the desired length.

Drawing Rectangles

To draw a rectangle in your screen, click the Rectangle tool, position the cursor where you want a corner of the rectangle to be, and drag until the rectangle is the desired size.

Drawing Rounded Rectangles

To draw a rectangle with rounded corners in your screen, click the Rounded-rectangle tool, position the cursor where you want a corner of the rounded rectangle to be, and drag until the rounded rectangle is the desired size.

To specify how rounded your rectangle is, double-click on the rounded-rectangle object to bring forward the Round Rectangle dialog.  In this dialog, you can choose the shape of the rounded rectangle, from oval to slightly rounded.

Defining Pictures

To include a .BMP or PICT file or a general field in the screen, click the picture tool and drag to size in the Screen Design window.  The Screen Picture dialog opens.

Screen Menu

Layout... option

Displays the Screen Layout dialog.

Open All Snippets option

Displays all code snippets in separate editing windows.

Show/Hide Position option

Displays or hides the coordinates of the mouse pointer and the dimensions of selected objects in the status bar.  By default, position is hidden.

Ruler/Grid option

Opens the Ruler/Grid dialog.

Snap to Grid option

Sets an invisible alignment grid so that objects are automatically aligned to the nearest grid line when they are defined or moved.

Object Order... option

Opens the Object Order dialog.

Quick Screen... option

Opens the Quick Screen dialog.


Screen Design SeeAlso
See Also

Check Box Dialog

Choose Field/Variable Dialog

Code Snippet Dialog

Comment Dialog

Edit Region Dialog

Expression Builder Dialog

Field Dialog

Format Dialog

Generate Screen Dialog

List Dialog

Popup Dialog

Push Button Dialog

Quick Screen Dialog

Radio Button Dialog

Round Rectangle Dialog

Screen Layout Dialog

Text Editing


Screen Layout Dialog

See Also

The Screen Layout dialog contains:

Size spinners

To change the size of the screen, do one of the following:

Click on the arrow buttons of the Horizontal and Vertical spinners.

Click on the numbers in the Horizontal and Vertical spinners and edit them.

Drag the lower right corner of the model screen.

Position spinners

To change the position of the screen:

1	Click on the arrow buttons of the Horizontal and Vertical spinners.

2	Click on the numbers in the Horizontal and Vertical spinners and edit them.

3	Click anywhere on the model screen except the lower right corner and drag.

4	Choose the Center check box to position your screen in the middle of the window.  When Center is checked, the position spinners are disabled and the screen cannot be repositioned by dragging the model.

Title text box

Specify the text that appears in the screen title bar.

Name text box

Enter a name for the screen.  If you do not type a name in this text box, a name will be generated.  To prevent possible name conflicts, unless you plan to reference the screen in code snippets, it is better to let FoxPro generate a unique name.

Code... push button

Open the Screen Code dialog.

Color... push button

Open the Screen Color dialog.

Window Style... push button

Open the Window Style dialog.

Environment... push button

Opens the Environment dialog.


Screen Layout SeeAlso
See Also

Environment Dialog

Font Dialog

Screen Code Dialog

Screen Color Dialog

Screen Design Window

Window Style Dialog


Screen Picture Dialog

See Also

The Screen Picture dialog allows you to include pictures or information from a general table field in your screen.  Screen Picture contains the following options:

Picture From area

File radio button

To include a picture in your screen, choose the File radio button.  You can then choose the File... button to open the Picture dialog so you can select the desired .BMP or PICT file or you can type the name and path of the file in the text box beside the File... button.

Field radio button

To include a general table field in your screen, choose the Field radio button.  You can then choose the Field... button to open the Choose Field/Variable dialog so you can select the desired table field or you can type the name of the field in the text box beside the Field... button.

If a record in the table contains an object other than a picture or a chart in the general field (for example, a Microsoft Excel spreadsheet or a Word for Windows document), an icon representing the object is displayed in the screen.  Double-clicking on this icon will not open the application associated with it.  Include an @ ... SAY command in a code snippet to activate the OLE object.

If Picture and Frame Different Size area

Clip Picture radio button

If the picture is bigger than the frame you created in the Screen Design window, Clip Picture will show a section of the original picture in the frame, retaining the picture's original dimensions.  The picture is anchored at the top and at the left of the frame.  You cannot see the lower right portion of the picture that extends beyond the frame.

Scale Picture [image] Retain Shape radio button

Displays the whole picture, filling as much of the frame that you size in the Screen Design window as possible while retaining the relative proportions of the picture.  This will protect your picture from vertical or horizontal distortion.

Scale Picture [image] Fill the Frame radio button

Display the whole picture, filling the frame that you size in the Screen Design window completely.  If necessary, the picture will be distorted vertically or horizontally to fit the frame.

Center Picture check box

If you are including a .BMP or PICT file in your report, Center Picture will have no effect on the picture.  Because a picture has known parameters, the picture will never be smaller than the frame.

The pictures included in a general data field can be a variety of shapes and sizes.  If the picture in a general field is smaller than the frame, it will be displayed in the upper left corner of the frame unless you check Center Picture.  Checking Center Picture ensures that general field pictures smaller than the frame are centered in the frame in the screen.

Refresh Output Field check box

If you include a general data field in your screen, the pictures in the field will probably change as the user moves through the records in the table.  Checking Refresh Output Field allows you to update the picture in the frame with the picture in the general data field in the current record.

Comment push button

Opens the Comment dialog so you can add comments to the .FRX or .LBX table.  Comments are entirely for your reference and do not appear in the printed report or label.


Screen Picture SeeAlso
See Also

Choose Field/Variable Dialog

Comment Dialog

Picture Dialog

Screen Design Window


Seek Dialog

See Also

Available when the active table has an open index and an order is set, this option displays the Expression Builder, allowing you to search the active table, using its index, for the first occurrence of an item.  Because it uses the index to find the specified record, Seek... is a fast way to find a record in a table.

The expression you create in the Expression Builder must be based on the field that your table is indexed on.  You must enclose character strings in single quotes (' '), double quotes (" ") or square brackets ([ ]).

If you want to search a table on an expression that is not based on the table index, or to find more than one occurrence of an item in a table, refer to Locate.


Seek SeeAlso
See Also

Browse Window

Expression Builder Dialog

Locate Dialog

Record Menu


Select Directory Dialog
Select Directory/Folder Dialog

See Also

This dialog allows you to specify the home directory or folder for a menu, project or screen file.  When the desired drive and directory or folder are displayed, choose the Select push button.


Select Directory SeeAlso
See Also

Project Window


Set Index Order Dialog

See Also

Contains indexes available for the related table.  Select the index that will determine the order of the related table.


Set Index Order SeeAlso
See Also

Index Dialog


Setup Dialog

See Also

The Setup dialog allows you to perform several operations associated with the table in the current work area, and contains these options:

Structure area

Structure list

Displays structure of table.

Modify... push button

Displays Table Structure dialog.

Indexes area

Indexes list

Displays any open single entry indexes or all tags in structural index.

Add... push button

Displays Open dialog to open or create an index.

Modify... push button

Displays Index dialog so you can modify the selected index.

No Order push button

Removes the order set for the selected tag.  You can tell if there is an order set on the tag because there is a small key preceding the tag.

Remove push button

Close indexes.  This option is disabled with structural indexes.  Tags in a structural index can be modified or removed through the index dialog.  Removing a single entry index closes the index file -- it does not delete the file from disk.  Removing a tag from a structural compound index deletes the tag from the index and from disk.

Index Description text area

This is a non-editable text region which displays the current index expression and index filter.  To change these settings, choose the Modify... button to display the Index dialog.

Selection area

Fields... push button

Displays the Field Picker dialog.

Use Fields List check box

Enabled when you have fields chosen in the Index dialog, this check box allows you to turn the fields list on (use the fields) or off (do not use the use fields).

Filter Data... push button

Displays Expression Builder to create a condition that records must meet to be available for processing.  The expression is displayed in the text description region next to the Filter Data... button.

Choose OK when you are done with the Setup dialog and you want to save your changes.  Choose Close from the Control menu or press Esc if you do not want the changes saved.


Setup SeeAlso
See Also

Append Mode

Change Mode

Database Menu

Expression Builder Dialog

Field Picker Dialog

Index Dialog

Open Dialog

Reindex

Table Structure Dialog

View Window


Size Dialog

See Also

In the Filer, this displays the total size of tagged files in all directories (if you are in the Files panel) or the size of files in all tagged directories (if you are in the Tree panel).


Size SeeAlso
See Also

Filer


Sort Dialog

See Also

This dialog allows you to create a new sorted table from an existing table, and contains these options:

All Fields list

Displays fields in current table.

Move push button

Moves selected field from All Fields list to Sort Order list.

Remove push button

Removes selected field from Sort Order list.

Field Options area

Ascending radio button

Specifies whether field selected in Sort Order list is sorted in ascending order.

Descending radio button

Specifies whether field selected in Sort Order list is sorted in descending order.

Ignore case check box

If checked, no distinction is made between upper- and lower-case letters in sorting.

Sort Order list

Displays fields in decreasing sort order.

From Table list

Displays names of open tables.  Field names in the All Fields list (described above) correspond to the table displayed on popup control.

Input area

Scope...

Displays Scope dialog.  When checked, a scope other than ALL has been set.

For...

Displays Expression Builder to specify For conditions.  When checked, a For condition has been set.

While...

Displays Expression Builder to specify While conditions.  When checked, a While condition has been set.

Output area

Save As... push button

Allows you to type in the name of a new table in the text box, or choose Save As... to display the Save As dialog.

Fields... check box

Displays the Field Picker dialog.  When checked, fields have been specified in the dialog.


Sort SeeAlso
See Also

Database Menu

Field Picker Dialog

Save As Dialog

Scope Dialog

View Window


Sort Files Dialog

See Also

Options in this dialog allow you to change how files are displayed in the Filer.

This dialog contains the following radio buttons:

Sort Order	Display

Name	Alphabetical Order:

Ascending (A - Z)

Descending (Z - A)

Extension	Extension Order:

Ascending (A - Z)

Descending (Z - A)

Size	Size Order (in bytes):

Ascending (smallest to largest)

Descending (largest to smallest)

Date	Date Order:

Ascending (oldest to most recent)

Descending (most recent to oldest)

Attributes	Attribute Order:

Ascending (r,a,s,h)

Descending (h,s,a,r)

Unsorted	System Order


Sort Files SeeAlso
See Also

Filer


Specify Text Dialog

See Also

In this dialog, specify text that you want to find using the Filer desk accessory.

This dialog contains these options:

Any radio button

Tags a file if it contains any of the specified strings.

All radio button

Tags a file if it contains all the specified strings entered in the text boxes.  Enter the character strings you want to locate in the files in the text boxes.

Ignore case check box

When checked, this treats upper- and lower-case letters identically.  Uncheck this box to make the search case-sensitive.

Match words check box

When checked, this requires an exact match in the specified string(s).

Choose the OK push button to return to the Find Files dialog.


Specify Text SeeAlso
See Also

Filer

Find Files Dialog


Spelling
Spelling Dialog

See Also

Activates FoxPro's spell checker and begins spell checking of text in an active text editing, memo editing, or code snippet window.  If the spell checker finds no errors, a message is displayed that FoxPro has finished spell checking.  If an error is found, the Spelling dialog is displayed, containing the following options:

Not in Dictionary/Extra Space text display area

Displays "Word not found" in your system's dictionary.  FoxPro also displays extra spaces found between words and sentences, if you have not disabled this option by checking the Ignore Extra Spaces check box in the Spelling Options dialog.  FoxPro's spell checker uses the dictionary referenced under [MS Proofing Tools] in your system's WIN.INI file.

Change to text box

When you choose Change, FoxPro replaces the word in the Not in Dictionary text box with the word entered here.  If the spell checker has found an extra space or repeated word, the Change button is replaced by a Delete button, and the extra space or repeated word is deleted.

Suggestions list

Lists alternative spellings or words for the word in the Not in Dictionary text box.  The first word in the list is selected by default and is placed in the Change To text box.  Scroll the list to select a different word.

Suggestions are automatically listed if the Always Suggest check box in the Spelling Options dialog is checked.  If the Always Suggest check box is not checked, you can choose the Suggest push button to request suggestions.

Ignore push button

Ignore the word in the Not in Dictionary text box and continue checking the text in the active window.

Ignore All push button

Ignore all occurrences of the word in the Not in Dictionary text box and continue checking the text in the active window.

Change push button

Replace the text in the Not in Dictionary text box with the text in the Change To text box.  This button changes to Delete when the spell checker finds a repeated word or extra space.

Change All push button

Replace all occurrences of the text in the Not in Dictionary text box with the text in the Change To text box.

Add push button

Add the text in the Not in Dictionary text box to the custom dictionary.

Undo Last push button

Undo last change

Options push button

Displays the Spelling Options dialog.

Suggest push button

Suggest alternate spelling or alternate words for the word in the Change To text box.  Alternates are listed in the Suggestions list.

Default Dictionary

FoxPro's spell checker uses a dictionary listed in your WIN.INI file under [MS Proofing Tools].  For example, if you have installed Microsoft Word for Windows on your system, your WIN.INI may contain the following entry:

[MS Proofing Tools]
Spelling 1033,0=C:\WINDOWS\MSAPPS\PROOF\MSSPELL.DLL,C:\WINDOWS\MSAPPS\PROOF\MSSP_AM.LEX
Custom Dict 1=C:\WINDOWS\MSAPPS\PROOF\CUSTOM.DIC

In the example above, the MSSP_AM.LEX file is the dictionary referenced by the FoxPro spell checker.  If you choose to add words to a custom dictionary, FoxPro will use the file listed after Custom Dict 1 in the WIN.INI file (see example above).

If multiple dictionaries are installed on your system, you can select a default dictionary, which is saved in your resource file.

Changing Custom Dictionary

FoxPro accesses only the custom dictionary listed as Cust Dict 1 in the WIN.INI file.  If you want to create a different custom dictionary for FoxPro than the custom dictionary you are using with Microsoft Word for Windows, use the Word for Windows Spelling dialog from the Spelling option on the Tools menu in Word to select a different custom dictionary for Word for Windows.  The new dictionary will be listed as Custom Dict 2, for example, in your WIN.INI file, and Word for Windows will use it as its default custom dictionary.


Spelling SeeAlso
See Also

Spelling Options Dialog

Text Menu


Spelling Options Dialog

See Also

This dialog allows you to select the options the FoxPro spell checker will use.  All options are saved when you exit FoxPro.

This dialog contains these options:

Always Suggest check box

When this check box is checked, FoxPro always suggests alternate words, if available, for the word in the Not in Dictionary text box.

If the Always Suggest check box is not checked, you can request suggestions for a specific word by choosing the Suggest push button on the Spelling dialog.  Spell checker performance is speeded up when this check box is not checked.

Ignore Words in UPPERCASE check box

Select to ignore words in which each character is an uppercase letter.

Ignore Extra Spaces check box

Select to ignore extra spaces between words and sentences.

Dictionary area

Language list

Select which language's dictionary you want FoxPro to use in checking your text for spelling.  If only one language dictionary is installed on your system, it is selected by default.

Type list

Select the type of dictionary from the list of dictionary types installed on your system.  Possible types include Normal, Concise, Complete, Medical and Legal.


Spelling Options SeeAlso
See Also

Spelling

Text Editing


Spinner Dialog

See Also

The Spinner dialog allows you to include spinner controls in your screen.  This dialog contains the following options:

Display area

Minimum text box

Enter the lowest numeric value that will be displayed in the spinner in the Minimum text box.

Maximum text box

Enter the highest numeric value that will be displayed in the spinner in the Maximum text box.

Increments by text box

Enter the incremental step by which values will be displayed in the spinner in the Increments by text box.  For example, if you enter a Minimum value of an even number and an Increment by value of 2, clicking the up and down arrows in the generated spinner will display only even numbers.

Variable push button

The variable specified for a spinner must be a numeric memory variable or a numeric field in a table.  To define the variable, enter the variable name in the text box to the right of the Variable... push button or click the Variable... button to open the Choose Field/Variable dialog.

Range push button

The minimum, maximum and incremental values in the Display area only affect the values <MI>displayed<D> in the spinner text box when the user clicks the up and down arrows of the spinner.  The user can still enter any numeric value in the spinner text box with the keyboard.  To ensure that the data entered in the spinner is within the boundaries you desire, set a range.  When you set a range, it is not necessary to set both upper and lower boundaries.  If one boundary is omitted, that portion of the range check is bypassed.

Lower... push button

Opens the Code Snippet dialog so you can enter a procedure or expression to set the lowest allowable numeric value that can be entered in the spinner.  You can also directly enter the value in the text box beside the push button.  If the user inputs a value lower than the value assigned to the low value in the range clause, a message with the allowed parameters is displayed in the status bar.

Upper... push button

Opens the Code Snippet dialog so you can enter a procedure or expression to set the highest allowable value that can be entered in the input field.  You can also directly enter the value in the text box beside the push button.  If the user inputs a value higher than the value assigned to the high value in the range clause, a message with the allowed parameters is displayed in the status bar.

Select on Entry check box

When Select on Entry is checked, the spinner text box is selected for immediate editing when the user selects the spinner.

Initially Disable check box

When Initially Disable is checked, the spinner in the generated screen will be disabled by default.  The spinner can later be enabled by issuing SHOW GETS ENABLE or SHOW <field> ENABLE in a code snippet.

Clauses area

When... push button

Opens the Code Snippet dialog so you can add code that is processed before the spinner is entered.  If the code you add doesn't return a logical .T., the spinner cannot be selected.

Valid... push button

Opens the Code Snippet dialog so you can add code that is processed before the spinner is exited.  If the code you add doesn't return a logical .T., the spinner cannot be exited.

Message... push button

Opens the Code Snippet dialog so you can add a procedure or an expression to be displayed in the status bar.

Error... push button

Opens the Code Snippet dialog so you can include custom error messages to be displayed if the code you add returns a logical .F..

Comment... push button

Opens the Comment dialog so you can add comments to the generated code.  Comments are entirely for your reference and are ignored when the screen program is run.


Spinner SeeAlso
See Also

Code Snippet Dialog

Screen Design Window

Screen Layout Dialog


Stop Recording Macro Dialog

See Also

This dialog allows you to perform several macro recording operations and contains these options:

Insert Literal push button

Records the literal meaning of the next keystroke.  To record the literal meaning of a key instead of the meaning assigned to it, choose Insert Literal, then press the appropriate key.

Insert Pause push button

Records a pause in the macro.

OK push button

Confirms that the macro is completed and makes it available for use.

Continue push button

Returns to where you were before the Stop Recording dialog appeared.

Discard push button

Erases the macro that you were creating.

Key to Resume check box

Specifies that, after a pause has occurred, a user must press a key in order to resume execution of the macro.  This key can be defined with the SET MACKEY command.

Seconds check box

An alternative to Key to Resume, this option specifies how long a pause lasts (in seconds) before resuming execution of the macro.


Stop Recording Macro SeeAlso
See Also

Macros Dialog


Sum Dialog

See Also

The Sum dialog allows you to add the contents of numeric field variables in the active table, and contains these options:

Sum area

Expr... check box

Displays Expression Builder to create expression to sum.  When checked, an expression is specified.

Scope... check box

Displays Scope dialog.  When checked, a scope other than ALL has been set.

For... check box

Displays Expression Builder to specify For conditions.  When checked, a For condition has been set.

While... check box

Displays Expression Builder to specify While conditions.  When checked, a While condition has been set.

Memory Variables list

Allows you to choose an existing variable to place results in.

To Variable text box

Allows you to type in a new variable name in which to place the variable results.


Sum SeeAlso
See Also

Database Menu

Expression Builder Dialog

Scope Dialog


System Messages

A system message is information that appears in the status bar to tell you about the action you are performing.  It differs from an alert because the information is not in the form of a warning or an error message.


Table Structure Dialog

See Also

The Table Structure dialog is used to define or modify structure of a table.

The Table Structure dialog contains these options:

Name text box

Enter a name for the field (up to 10 characters, beginning with a letter) below the Name heading, then specify the rest of its attributes.  If you want to add another field, click in the Field text box on the next line and enter a name for the next field.

To move a field to a different location in the table structure, click on the button to the far left of the field and drag the field to the desired location.

Type popup

Specify the data type of the field (Character, Numeric, Float, Date, Logical, Memo, General or Picture).

Width spinner

Specify the width of the field.  Certain types of fields are a fixed width, as shown in the following table.

Data Type	Width in Characters

Character	1-254

Numeric	1-20, including optional +/- signs and decimal place (.)

Date 	8

Logical	1

Memo 	10

Float	1-20, including optional +/- sign and decimal place (.)

General 	10

Dec spinner

Specify decimal width for numeric and float types.

Insert push button

Choose Insert to add a new field above the selected field.

Delete push button

Choose Delete to remove the selected field from the table.

Adding/Removing Structural Compound Index Tags

To add or remove a structural compound index tag, click on the Tag button to the left of the field name.  Each time you click on the Tag button, the index tag toggles between ascending [image], descending [image] or no index tag (empty).


Table Structure SeeAlso
See Also

Append Mode

New Dialog

Setup Dialog


Target Directory Dialog
Target Directory/Folder Dialog

See Also

This dialog is used to change drives and directories or disks and folders and contains these options:

Select Target Directory/Folder list

Specifies the directory or folder to which tagged files will be copied or moved.

Drive/Folder popup

Allows you to specify the drive or folder where tagged files will be copied or moved.

Select push button

Sets the drive and directory, or disk and folder, to which tagged files will be copied or moved.

Cancel push button

Exits dialog without taking action.


Target Directory SeeAlso
See Also

Copy Files Dialog

Filer

Move Files Dialog


Text Editing

See Also

This help topic briefly describes how to perform many text editing operations.  Text Menu options are discussed at the end of this topic.

Creating a New File

Choose New... from the File menu.  A New dialog appears.

Opening an Existing File

Choose Open... from the File menu.  The Open dialog appears.

Saving a New File

Choose Save as... from the File menu.  The Save As dialog appears.

Saving an Existing File

Choose Save from the File menu.

Cursor Movement Keys

Key	Cursor Action

Moves one character to the right.

Moves one character to the left.

Moves up one line.

Moves down one line.

PgUp (Page Up)	Moves up one window of text.

PgDn (Page Down)	Moves down one window of text.

Home	Moves to beginning of current line.

End	Moves to end of current line.

Ctrl+Right Arrow ( [image] [image])	Moves one word to the right.

Ctrl+ Left Arrow ( [image] [image])	Moves one word to the left.

Ctrl+Home ( [image] Home)	Moves to beginning of text.

Ctrl+End ( [image] End)	Moves to end of text.

Moving through text with a mouse

Click on the arrow at either end of the scroll bar.  Drag the thumb.  Point and click.

Entering Text

Before you type text, position the cursor where you want the text to appear.  You don't have to press Enter or Return every time the cursor reaches the right edge of the window.  You only need to press Enter or Return to start a new paragraph.

Keys for Selecting Text

Key	Cursor Action
Shift+Arrow ( [image] Left/Right)	Selects one character at a time.
Shift+Arrow ( [image] Up/Down)	Selects one line at a time.
Shift+Ctrl (or [image])+Arrow ( [image] or [image])	Selects from cursor to beginning/end of word.
Shift+Ctrl (or [image])+End	Selects from cursor to end of text.
Shift+Ctrl (or [image])+Home	Selects from cursor to beginning of text.
Ctrl (or [image])+A	Selects all text.
To deselect text, press any cursor movement key.

Selecting text with mouse

Position pointer on the character where you want selection to begin, drag to the right by holding down the mouse button and moving the mouse, then release the mouse button.  Drag down to highlight entire lines of text.

Mouse Shortcuts for Selecting Text

To Select ...	Do This ...
A word	Position pointer on the word and double-click.
A line	Position pointer on a line and triple-click.
Text letter-by-letter	Single-click and drag.
Text word-by-word	Double-click and drag.
Text line-by-line	Triple-click and drag.
Segment of text	Position cursor then Shift+click at another location to select from the original cursor location to the Shift+click location.
All text	Press Ctrl+A or [image] A, or choose Select All from the Edit menu.
Deleting Text

Key	Result
Backspace	If nothing is selected, deletes character to the left of cursor.  If text is selected, deletes selection.
Ctrl+Backspace or [image] Delete	Deletes word in which cursor is positioned.  If cursor is positioned to the left of a blank space after a word, the space and the previous word are deleted.
Delete or Del	If nothing is selected, deletes character to the right of the cursor.  If text is selected, deletes selection.
Clear option on the Edit menu	Permanently removes the selected text, data or object without placing it on the clipboard.  If you choose this option when text is selected, it is the same as pressing Delete or Backspace. Clear also erases the contents of the active FoxPro output window.  If you use Clear this way, the text, data or object does not have to be selected.
Inserting Text

Pressing the Insert key toggles between insert and overwrite mode.  When you begin a FoxPro session, the cursor, which appears as a flashing vertical line, is in insert mode, and Ins is displayed in the status bar.  Typing in insert mode inserts the character to the left of the cursor location and the original text is moved one position to the right.

In overwrite mode, each character you type replaces the character to the right of the cursor.  In general, when text is selected, typing any characters (except editor control characters) replaces the selected text with the typed text.

Inserting Special Characters

To insert a control character, press the ` key (left single quote) followed by the letter that would normally follow Ctrl.  For example, Ctrl+Q is inserted into a file by typing `Q.  To enter ` itself, you must type ` twice.

High-bit characters used to create boxes and other graphics can be entered directly in editor files by holding down the Alt key and typing the (decimal) key code of the desired character.

On the Macintosh platform, when you press the Option key with another character key, you produce an alternate character, which is part of the extended ASCII character set and is limited only by the font that is currently selected.

MS-DOS conventions for typing in extended keys are not supported in FoxPro for Macintosh.

Cutting, Copying, Pasting

Text can be reorganized within windows and moved among windows using Cut, Copy and Paste from the Edit menu.

Choose ...	To ...

Cut	Remove selected text for placement in a different location.

Copy	Duplicate selected text for use in another location.

Paste	Place cut or copied text into a file at the cursor location.

Using "Drag-and-Drop"

Using the drag-and-drop feature, text can be selected and moved to another location in a file, without using the Cut and Paste commands on the Edit menu.

To do so, select the desired portion of text and drag it to the new location.  You can also select text and drag a copy of it to the new location.  To do so, hold down the Ctrl key as you drag the copy of the selected text to its new location.

Undo and Redo

Undo and Redo are available on the Edit menu.

Choose ...	To ...

Undo	Reverse the most recent text editing action.  You can continue to undo (in reverse order) all text editing actions that you've made since you opened the file or saved it during the editing session.

Redo	Reverse the most recently undone command.

Find and Replace

When you want to find and/or replace a word or phrase that appears throughout a text file, program file, memo field or the Command window, choose the appropriate find and replace command from the Edit menu.

Setting Editor Preferences

Preferences... on the Edit menu allows you to change certain settings that are in effect during editing sessions.  You can make the preferences apply to only the current file you are editing or to all files of that type created in the future.


Text Editing SeeAlso
See Also

Command Window

Find Dialog

Font Dialog

Goto Line Dialog

New Dialog

Open Dialog

Preferences Dialog

Revert

Save As Dialog

Spelling


Text Menu

See Also

The Text menu provides the following text formatting options.

Font... displays the Font dialog so you can choose the desired font, font style and size.

Enlarge Font enlarges the font size for the entire text file to the next available point size.

Reduce Font reduces the font size for the entire text file to the next available point size.

Single Space changes the line spacing of entire text file to single space.

1 1/2 Space changes the line spacing of entire text file to one and one-half.

Double Space changes the line spacing of entire text file to double.

Indent moves selected lines to the next tab stop.

Undent moves selected indented lines back to the previous tab stop.

Spelling... activates the FoxPro spell checker.


Text Menu SeeAlso
See Also

Text Editing

Spelling Dialog

Font Dialog


Text Dialog

See Also

The Text dialog contains these options:

Print When... check box

Opens the Print When dialog, allowing you to specify when the text is printed.

Position Relative To area

Top radio button

Positions the text at the top of the band in the report.

Bottom radio button

Positions the text at the bottom of the band.

Comment... push button

Opens the Comment dialog so you can add comments to the generated code.  Comments are entirely for your reference and are ignored when the report is run.

OK push button

Applies the settings to the text object.

Cancel push button

Exits the dialog without taking action.


Text SeeAlso
See Also

Comment Dialog

Print When Dialog

Report Layout Window


Title/Summary Dialog

See Also

This dialog allows you to specify whether a title and/or summary band will be included in the report, and contains the following options:

Report Title area

Title Band check box

Allows you to include a Title band in the report.

New Page check box

Prints a Title band on its own page(s).  Check New Page to issue a page eject after the Title band.

Report Summary area

Summary Band check box

Allows you to include a Summary band in the report.

New Page check box

Prints a Summary band on its own page(s).  Check New Page to issue a page eject before the Summary band.


Title/Summary SeeAlso
See Also

Report Layout Window


Total Dialog

See Also

The Total dialog is used to compute totals for numeric fields in the current table.  The table must be sorted or indexed.  A separate total is calculated for each set of records with a unique index key value, and the results are placed into records in another table.  One record is created in the table for each unique index key value.

The Total dialog contains these options:

Expr... push button

Displays the Expression Builder so you can create the expression on which the source table is indexed or sorted.  Or, you can double-click on a field in the Total dialog list to display it in the Expr... text box as the expression on which the source table is sorted or indexed.

Conditions area

Scope... check box

Displays the Scope dialog so you can specify which records will be included in the total operation.  When checked, a scope other than ALL has been set.

For... check box

Displays the Expression Builder so you can specify a For condition that records must meet to be included in the total operation.  When checked, a For condition has been set.

While... check box

Displays the Expression Builder so you can specify a While condition that records must meet to be included in the total operation.  When checked, a While condition has been set.

Fields... check box

Displays the Field Picker dialog so you can specify that only certain numeric fields are totaled.  When checked, fields have been specified.  By default, all numeric fields are totaled.

Save As...

Displays the Save As dialog so you can specify a destination table where the totals will be saved.

OK push button

Begins the total operation.

Cancel push button

Exits the dialog without taking action.


Total SeeAlso
See Also

Database Menu

Expression Builder Dialog

Field Picker Dialog

Save As Dialog

Scope Dialog


Trace Window

See Also

The Trace window allows you to see your program as it runs.  You can pass parameters to a program or an application and then trace execution by following these steps:

1	Open the Trace window.

2	From the Program menu in the Trace window, choose Open... and choose the program or application.

3	Set a breakpoint on the first executable line of the program.

4	In the Command window, DO the program WITH the parameters.

The Trace window has its own menu bar, which includes the menus and menu pads described below.

Program menu options

Open...

Displays Open dialog to open a program.

Cancel

Cancels execution of suspended program.

Line Numbers

Toggle option to display/hide line numbers in a program.

Clear Breakpoints

Removes breakpoints from all programs opened in the Trace window.

Trace Between Breaks

Toggle option to display and highlight every line of program code as it executes.  When Trace Between Breaks is off, highlighting will remain on the last line executed until another line with a breakpoint is reached.

Throttle...

Displays the Execution Throttle dialog to specify execution speed of programs.

Do.../Resume menu pad

Displays the Do dialog so you can specify a program to run.  Program execution is suspended on the first executable line.  The Do... option toggles to Resume after program chosen to continue program execution.

Out! menu pad

Steps out of a currently executing program and suspends execution on the first line following the command that called the current program.

Over! menu pad

Continues program execution, without displaying  executed lines of subprocedure, to next statement of same procedure.

Step! menu pad

Executes one line of a program, allowing you to step through each line of code in a program one line at a time.


Trace SeeAlso
See Also

Command Window

Debug Window

Execution Throttle Dialog

Program Menu


Transporter Dialog

See Also

The Transporter dialog provides specific information to the Transporter about how you want your screens, reports and labels to transport.  The primary goal of the Transporter is to transfer records so that these files function properly on a new platform. This includes information contained in code snippets. To accomplish this, the Transporter adds a duplicate set of records to hold the information for the new platform. The additional information allows you to make changes to each platform without affecting the files on the other platform.

The Transporter also does a "best fit" transport to keep applications looking the same no matter which platform they are running on. In some situations, FoxPro cannot transfer objects properly or maintain alignments. The Transporter makes many decisions internally about each object in a file.

When the Transporter creates an identical record for each object in the project, screen, report, and label files, the records are appended to the file and marked as Macintosh, Windows, or MS-DOS. When a change is made to a file, FoxPro checks the current platform and makes the change only to the records marked for that platform.

The Transporter dialog contains the following options:

Convert Screen text box

Displays the name of the screen to be converted.

Transports Objects From popup

Choose the platform you want to convert the screen from.

Transport and Open push button

Transports the file and opens the appropriate editing window.

Open As Is

Open the file without making any changes from other platforms.

Cancel push button

Exits the dialog without making changes to your screen.  You can still open the screen in the older version of FoxPro.

Font... push button

Opens the Font dialog so you can choose the default font for your transported screen, report or label.

2D Controls check box (FoxPro for Macintosh only)

Generates objects with a two-dimensional look. If you do not check this checkbox, transported objects have a three-dimensional gray-scale appearance.

The following options are included in the Windows version of the dialog when you partially transport items:

Objects New to Windows check box

Check this option to have all objects that are new to the Windows version of the file included in the partial transport.

Objects More Recently Modified Than Windows Equivalent Objects check box

Check this option when you want to include existing objects that have been modified in another platform.

All Objects [image] Replace Existing Definitions check box

Check this option to replace all the object definitions.


Transporter SeeAlso
See Also

Font Dialog

Screen Design Window


Try It Dialog

See Also

When a Menu Design window is active, you can check the results of your menu definition at any time by using the Try It push button.  When you choose the Try It push button, the menu system you've defined appears at the top of the screen and a Try It dialog appears that displays the file name of the menu system.  When you choose menu pads and submenu options, the prompt that was selected and the command that's assigned with the option are displayed in the dialog.


Try It SeeAlso
See Also

Menu Design Window


Variable Definition Dialog

See Also

In this dialog you can add new variables, change or delete existing variables or change the order in which the variables are evaluated in a report.  The Variable Definition dialog contains these options:

Variable Name text box

Allows you to type in the name of the variable.

Value to Store... push button

Allows you to type in a value or choose the Value to Store... button to display the Expression Builder.

Initial Value... push button

Allows you to type in the initial value or choose the Initial Value... button to display the Expression Builder.  Initial value is the value of the variable before any calculations are performed.

Release After Report check box

Clears the report variable from memory after the report is printed.  If not checked, the variable remains in memory until you exit FoxPro or use the CLEAR ALL or CLEAR MEMORY commands.

Reset list

Specifies the point at which the variable is reset to its initial value.  End of Report is the default.  Other options include End of Page, End of Column and any groups you have created in the report.

Calculate area

Nothing

Count

Sum

Average

Lowest

Highest

Std. Deviation

Variance

Choose a radio button to perform the corresponding calculation on the variable.


Variable Definition SeeAlso
See Also

Expression Builder Dialog

Report Layout Window

Report Variables Dialog


View Window

See Also

The View window provides an easy way to open table files, establish relations and set many FoxPro switches.  Five picture buttons display the different panels of the View window.

Setup push button

Displays the Setup dialog for the table in the current work area.

Browse push button

Displays selected table in Browse window.

Open push button

Displays Open dialog to select table to be opened in work area.

Close push button

Removes the selected table and any associated files from the current work area.  The original work area letter or number reappears.

Relations push button

Shows relationships between tables.

1-To-Many push button

Brings forward 1-to-Many dialog allowing you to set a 1-to-many relationship between tables.

Work Areas list

Displays work areas and aliases for open tables.  Indexed tables are preceded by an up arrow; tables with 1-to-many relationship are connected by a double line in the relations area.

Relations area

Displays any relations that exist between table files in work areas.

 View button

Displays View panel to control table files.

 On/Off button

Displays On/Off panel.

 Files button

Displays Files panel so you can set defaults for FoxPro.

Default Drive popup

Allows you to specify default drive for all file input and output operations.

Working Directory... or Working Folder... push button

Allows you to change the current working directory or folder.

FoxPro Path... push button

Allows you to specifiy a path for FoxPro.

Clear Path push button

Deactivates current path.

Help File... push button

Allows you to specify a Help file.

Help check box

When checked, a Help file has been specified.

Resource File... push button

Allows you to specify a resource file.

Resource check box

When checked, a resource file has been specified, and any changes to the current FoxPro environment will be saved in the current resource file.

 International button

Displays the International panel, allowing you to specify international settings.

Date popup

Allows you to choose format for date expressions.

Show Century check box

When checked, displays complete four-digit year in all date output.

Date Delimiter check box

Allows you to specify date delimiter.  Type delimiter character of your choice in the text box.

Currency Symbol text box

Allows you to specify string of characters to precede or follow currency value.

Symbol at Left check box

Determines if symbol precedes or follows currency value.

Decimals text box

Specify number of places to follow decimal point.

Sample number below currency settings

Shows how currency data will appear.  To change the default comma and period that appear in currency values, select these delimiters in the sample number and enter different characters, then press Enter.

Collating Sequence popup

Allows you to specify a collation sequence for character fields in subsequent indexing and sorting.  This popup is disabled if the CODEPAGE configuration item is not included in CONFIG.FPW, the FoxPro configuration file.  See SET COLLATE for additional information about specifying a collation sequence.

 Misc button

Displays the Misc panel, allowing you to adjust the clock, bell and other settings.

Clock check box

Toggles clock on and off.  When checked, clock is on.  Use the popup to choose 12 or 24 hour format for clock.

Row and Column text boxes

Allows you to specify location of clock on monitor.  Coordinates can be adjusted (from 0 - 999).

Bell check box

Toggles bell on and off.  When checked, bell is on.

Freq and Duration text boxes

Allows you to adjust error tone that computer emits.

 button

Sounds bell as defined with frequency and length.

Talk check box

Toggles SET TALK ON and OFF.  When checked, SET TALK is ON.

Reporting Interval text box

Allows you to specify when information processed appears on screen when Talk is checked.


View SeeAlso
See Also

1-To-Many Dialog

Browse Window

Expression Builder Dialog

Open Dialog

Path Dialog

Save As Dialog

SET COLLATE Command

Setup Dialog

Window Menu


Window Menu

See Also

FoxPro System Menu Bar

The FoxPro Window menu options determine which windows are displayed and how they appear.

Hide

Makes a window invisible without closing it.

Clear

Removes all information from the current output window.

Cycle

Sequentially moves open windows to the top.

Command

Opens the Command window.

View

Displays the View Windowso you can specify work areas, table relations, and FoxPro Settings.

Window list

Displays the names of open windows. Choose the name of a window to bring it to the front.

Catalog Manager System Menu Bar

The Catalog Manager Window menu contains these options:

Cycle

Allows you to cycle through available windows.

Window list

Displays the names of open windows. Choose the name of a window to bring it to the front.


Window Menu SeeAlso
See Also

Command Window

Navigating in the Interface

View Window


Window Style Dialog

See Also

The Window Style dialog sets the type, attributes and border for the screen currently being built, and contains the following options:

Type list

Displays a list of available window types: Desktop, User, System, Dialog and Alert.

Attributes area

Close check box

Adds the control menu so that you can close the screen.  Only the system border is available when Close is selected.

Moveable check box

Allows you to move the screen around the desktop.  Only the system border is available when Float is selected.

Half Ht Title Bar check box

Defines the window with a half-height title bar.

Minimize check box

Enables maximize/minimize capability for the window and places the maximize/minimize buttons on the window's upper-right corner.

Border area

None radio button

Specifies no border.

Single radio button

Specifies a single-line border.

Double radio button

Specifies a double-line border.

Panel radio button

Specifies a thick border.

System radio button

Specifies the system borders, for example, the Command Window border.

Icon File... push button

Displays the Open dialog so that you can choose an icon file (.ICO) for the window.  When the user minimizes the generated screen, it will be reduced to the icon you select in this dialog.


Window Style SeeAlso
See Also

Open Dialog

Screen Design Window

Screen Layout Dialog


Switching from dBASE

dBASE and FoxPro are dialects of the same language, Xbase.  All dBASE III Plus programs and most dBASE IV programs will run in FoxPro without making any changes. If a program does not run correctly, or if you want to enhance a dBASE program in FoxPro, you must convert your dBASE files to FoxPro. If you want, the Catalog Manager can automatically convert these files for you.

Overview

The following procedure is an overview of the process you will use to convert your dBASE files into FoxPro. You can find detailed information about each step in the related Help topic.

1.	Create a backup copy of your dBASE files.

Although FoxPro will not overwrite them, it's a good idea to make a backup copy of your dBASE files before you convert them to FoxPro.

When you use a dBASE table in the Catalog Manager, FoxPro automigrates the table and its structural indexes (.MDX) and memo fields into FoxPro format. (If you want to, you can export the table at a later time in a dBASE-readable format.) With a dBASE screen, report, query, or label, the FoxPro Catalog Manager uses a copy of the file, leaving the original untouched.

2.	Determine if your program requires changes.

The recommended way to run a dBASE program in FoxPro is to use the Catalog Manager. You can open an existing dBASE catalog, or add individual files to a new catalog. When the screens, reports, labels, or queries are run or modified, they are automatically converted to FoxPro format. (For more information on converting dBASE programs, see Converting dBASE Files.) If you do not want to use the Catalog Manager, you can switch to the Command Window and use the Convert dBASE Files option on the Run menu. For more help on this option, press F1 or choose the Help button in the Convert Files dialog.

3.	Modify your files.

After you convert your files, you may need to make changes to your program to account for differences between FoxPro and dBASE. For detailed information, see Language Differences Between dBASE IV and FoxPro. For other dBASE information, see the Help topics in the General Information section below.

4.	Enhance your dBASE program or create a new FoxPro application.

To enhance your program or create new applications, you can use the FoxPro Power Tools, including the Screen Builder, Report Writer, and RQBE. FoxPro also provides a set of wizards for quickly creating tables, queries, screens, reports, and applications. Power Tools and wizards are accessible from within the Catalog Manager when you choose New or Modify, or from the Command Window.

For more information on switching from dBASE to FoxPro, see the following Help topics:

General Information

Catalog Manager

Converting dBASE Files

dBASE Compatibility

File Extension Differences

International Differences

Keyboard Differences

Language Differences Between dBASE IV and FoxPro

Running dBASE Programs

Terminology Differences Between dBASE IV and FoxPro

Language Details

Supported dBASE IV Commands and Functions

Unsupported dBASE IV Commands, Functions, and Clauses

SQL Differences Between dBASE IV and FoxPro

FoxPro Reserved Words

FoxPro Enhancements to the Xbase Language


Converting dBASE Files

See Also

The Catalog Manager and AutoMigrate technology make converting dBASE files to FoxPro easy. When you use dBASE files in the Catalog Manager, AutoMigrate automatically converts them by modifying dBASE tables and creating new FoxPro screens, reports, labels, and queries. Conversion takes no effort on your part and does not prevent you from using the files again in dBASE. Except for tables with memo fields, all your original dBASE files remain intact when they are converted for use in FoxPro. If your table has an index, AutoMigrate rebuilds it.

AutoMigrate automatically converts dBASE files when you:

Use a table with existing indexes or a memo field.

Use or modify a query.

Run or modify a screen.

Run or modify a report.

Run or modify a label.

dBASE queries and programs run without conversion. They are automatically recompiled in FoxPro. You can also run dBASE programs without converting them. For more information, see Running dBASE Programs.

In FoxPro for Windows, AutoMigrate also automatically transports files from MS-DOS to Windows. For more information on transporting, see Transporting Files.

Note   Compiled dBASE programs (.QBO, .FMO, .FRO, .LBO, and .DBO files) cannot be run in FoxPro unless the source code (.PRG) or design file (.QBE, .SCR, .FRG, .LBL) is available.

Effects of Conversion

Tables (Databases)	AutoMigrate converts dBASE tables when you use them. See Converting Tables for details.
Queries	AutoMigrate converts dBASE queries when you modify them. See Converting Queries for details.
Screens (Forms)	AutoMigrate converts dBASE forms to FoxPro screens when you modify or run them. Information about objects, fields, and so on is contained in a design file in dBASE. FoxPro copies the information in the dBASE file to a FoxPro .SCX file. Because of differences between MS-DOS and Windows, the appearance of your converted screens may need to be adjusted a little bit.
Reports and Labels	AutoMigrate converts dBASE reports and labels when you modify or print them. See Converting Reports and Labels for details.
Programs	In most cases, no changes need to be made to dBASE programs. They are recompiled in FoxPro when you run them. See Converting Programs and Applications for details. Note   When editing a dBASE program that contains accented characters, do not use the Modify button in the Catalog Manager. Instead, use the command MODIFY COMMAND <file> AS <codepage> in the command window in order to convert the accented characters in the program.


See Also

Catalog Manager

Converting Programs and Applications

Converting Queries

Converting Reports and Labels

Converting Tables

dBASE Compatibility

Running dBASE Programs

Transporting Files


Converting Tables

See Also

dBASE tables that have memo fields and/or indexes are converted when you use them.

To use a dBASE table in FoxPro:

In the Command Window, type:

USE <database name>

- Or -

From the File menu, choose Open and select the dBASE table you want to use.

Encrypted Tables

If your table is encrypted, you'll need to decrypt it in dBASE before conversion can take place.

Indexes

FoxPro uses a different indexing algorithm than dBASE, so if the table being converted has an associated dBASE .MDX or .NDX index, FoxPro automatically creates a FoxPro .CDX or .IDX index for the table.

To use a dBASE IV table with an index and without a memo field in dBASE after FoxPro has converted it, open the file in dBASE and reindex. This step is necessary only if you have changed any of the data.

Tables with Memo Files

If a dBASE table has one or more memo fields, FoxPro automatically converts the memo file so that it is compatible with FoxPro. You can use a dBASE III table or a dBASE IV table with a memo field in dBASE after it has been converted into FoxPro.

The FoxPro file format for memo fields allows you to store an amount of data limited only by your hard disk space.

To use a table in dBASE after it has been converted to a FoxPro format:

1.	Switch to the Catalog Manager.

2.	From the Data menu, choose Export....

FoxPro displays the Export dialog box.

3.	In the Export dialog, choose dBASE III/IV with Memo from the File Type popup.

4.	Choose the Save As... button to enter a new name for the table.

5.	Choose Export.

Warning - Large memo fields may be truncated when converted back to a dBASE format after you have used this conversion procedure.


See Also

Catalog Manager

Converting Programs and Applications

Converting Queries

Converting Reports and Labels

dBASE Compatibility

Transporting Files


Converting Reports and Labels

See Also

When FoxPro converts reports and labels, FoxPro creates an .FRX file with the information from the dBASE .FRM file, and a .LBX file with the information from the dBASE .LBL file.

What FoxPro Converts

FoxPro converts all bands, fields, calculated fields, hidden fields, picture templates, and functions for fields. FoxPro also converts style attributes such as underline, bold, italic, and colors. Fonts are not converted. However FoxPro for Windows supports all Windows-based fonts including True Type fonts, giving you even greater control over this area than before.

Word-wrap bands are converted to a series of one-line text fields in FoxPro reports. Band spacing and pitch information is not converted. FoxPro does not use a global ruler or a word-wrap paragraph ruler, so this information is not retained. Converted reports will have a right margin equal to the width of the report. The left margin is not changed but can be set in the FoxPro Report Writer.

Reports with tab characters may need to have their fields rearranged to achieve the desired appearance.

Differences After Conversion

Since empty report bands print in dBASE, FoxPro adds null characters to these bands so they will also print in FoxPro.

dBASE reports do not store complete environment information, only database aliases.  As a result, upon opening a converted report, you might get an error such as "Customer.dbf not found."  FoxPro reports can save database names, relations, skips, and index information.  Once in the Report Writer, set up the environment the way you want it and then save that information with that report.  No more such errors will appear.

Troubleshooting Hard-coded Reports

If the report is hard-coded, rather than created through the dBASE Report Design Tool, you'll want to keep in mind the following points:

Interspersing ??? printer direct control commands with @ ... SAY commands can cause a problem with the output.

If the report uses @ PROW( ) SAY commands to direct output to the printer, EJECT can cause the the printer to feed a new page before all the @ ... SAY fields have been sent to the printer. You can avoid this by replacing EJECT with @ 0,0 SAY "".

Make sure the command SET PRINTER TO is included at the end of the printing loop to force the output to the printer.


See Also

Catalog Manager

Converting Programs and Applications

Converting Queries

Converting Tables

dBASE Compatibility

Report Writer

Transporting Files


Converting Queries

See Also

FoxPro allows you to work with three types of queries: SQL queries, Updatable queries (.FPQ), and, in the Professional Edition, Client-Server queries (.CSQ). A dBASE query is a file with the .QBE extension that consists primarily of the dBASE IV commands required to execute the query. A dBASE query (.QBE) can be run in FoxPro without making changes, even though there is additional code at the bottom of the file in non-text format.

To run a dBASE query (.QBE)

In the Command Window, type:

DO <query name>.QBE

If you want to modify a dBASE query, you can use the Catalog Manager to run the Updatable Query Wizard. When you modify a dBASE .QBE query in the Updatable Query Wizard, FoxPro creates an .FPQ file. For more information, see Modifying a dBASE Query in the Catalog Manager.

Once you finish the Updatable Query Wizard, the modified query can be run from the Catalog Manager, or from the Command Window. For information on using a query in the Catalog Manager, see Working with Queries in the Catalog Manager. For information on running a modified query from the Command Window, see the following procedure.

To run a modified dBASE query (.FPQ)

In the Command Window, type:

DO <query name>.FPQ

Note:

To use dBASE queries that contain aggregate functions such as SUM( ) or AVG( ) you must recreate them as FoxPro SQL queries using the SQL Query Wizard or RQBE. Alternatively, you can group the results in a report.


See Also

Catalog Manager

Client-Server Query Wizard

Converting Programs and Applications

Converting Reports and Labels

Converting Tables

dBASE Compatibility

SQL Query Wizard

Transporting Files

Updatable Query Wizard

What's New Since FoxPro 2.5


Converting Programs and Applications

See Also

In general, dBASE IV programs and applications run unchanged in FoxPro. When you choose to run a dBASE program, FoxPro recompiles the .PRG file into an .FXP file and runs the .FXP.

Because of the differences in SQL implementation, dBASE IV .PRS programs cannot be run in FoxPro. See SQL Differences Between dBASE IV and FoxPro for additional information about differences in SQL implementation.

RunTime Errors

If a dBASE program produces a runtime error or unexpected results, you can debug the program using the FoxPro debugging tools, Trace and Debug.

The Trace window allows you to step through your code a line at a time. The Debug window has two panels. You can enter variables or FoxPro functions in the left panel. The right panel displays the runtime values assigned to the variables or returned by the functions. For more information about debugging in FoxPro, see the "Program Menu" chapter of the FoxPro User's Guide and the "Debugging Your Application" chapter of the FoxPro Developer's Guide.

Syntax Errors

If a syntax error occurs when you are running a program, FoxPro highlights the error line in an editing window. You can use the Help file to check the proper syntax and usage for the command or function that caused the error.

Debugging Tips

Make sure that the program does not include unsupported commands, functions and clauses listed in Unsupported dBASE IV Commands, Functions, and Clauses.

Make sure that the dBASE program does not have a procedure, function, variable, or an array named with any of the FoxPro Reserved Words.


See Also

Converting Queries

Converting Reports and Labels

Converting Tables

dBASE Compatibility

FoxPro Reserved Words

Unsupported dBASE IV Commands, Functions, and Clauses


Terminology Differences Between dBASE and FoxPro

See Also

Most of the terminology that a dBASE user encounters in FoxPro will be familiar, but there are a few differences. This table lists some of the more prominent differences.

dBASE Term	FoxPro Term
Database	Table
Form	Screen
Horizontal Bar Menu	Menu Bar
Pop-up Menu	Popup
Pull-down Menu	Menu or Menu Popup
View	Cursor


See Also

dBASE Compatibility

File Extension Differences Between dBASE and FoxPro

FoxPro Enhancements to the Xbase Language

Supported dBASE IV Commands and Functions

Unsupported dBASE IV Commands, Functions, and Clauses


File Extension Differences Between dBASE and FoxPro

See Also

The following table lists differences in file extensions between dBASE and FoxPro.

File Type	dBASE Extension(s)	FoxPro Extension(s)
Applications	.APP, .PRG	.APP
Catalogs	.CAT	.FPC, .FCT
Indexes	.MDX, .NDX	.IDX, .CDX
Labels	.LBL, .LBG	.LBX, .LBT
Menus	(none)	.MNX, .MNT, .MPR
Programs	.PRG, .PRS	.PRG, .FXP
Projects	(none)	.PJX, .PJT
Queries	.QBE, .QBO, .UPD, UPO	.QPR, .FPQ, .CSQ
Reports	.FRM, .FRG, .FRO	.FRX, .FRT
Screens	.SCR, .FMT, .FMO	.SCX, .SCT, .SPR
Tables	.DBF, .DBT	.DBF, .FPT


See Also

dBASE Compatibility

File Extensions

FoxPro Enhancements to the Xbase Language

Supported dBASE IV Commands and Functions

Unsupported dBASE IV Commands, Functions, and Clauses

Terminology Differences Between dBASE and FoxPro


International Differences
International Differences Between dBASE and FoxPro

See Also

dBASE provides international support through language drivers, the ASCIISORT and LANGTABLES configuration items, and the SET LDCHECK command. These are ignored in FoxPro.

FoxPro provides extensive international and cross-platform features, including automatic translation of accented characters (ä, é ,ô, and so on) across different FoxPro platforms.  Automatic translation of accented characters can occur in tables, programs and text files.  FoxPro provides flexible support for multiple collation sequences, allowing you to order tables for a specific language.

FoxPro provides its international and cross-platform feature through the CODEPAGE and COLLATE configuration items and several commands and functions.

For additional information the FoxPro international and cross-platform features, see the International and Cross-Platform Features help topic.


See Also

International and Cross-Platform Features


Keyboard Differences
Keyboard Differences Between dBASE and FoxPro

See Also

In FoxPro, the function keys provide the same functionality at all times. When a Browse window is active in dBASE, the F1 through F10 function keys provide different functionality.

The first table below lists the standard dBASE and FoxPro actions for each function key.

The second table lists the dBASE actions for the function keys when a Browse window is active. These actions are not supported in FoxPro.

FoxPro and dBASE Function Key Assignments

Key	Action

F1	Activate online help

F2	Set (displays the View window)

F3	List

F4	Dir(ectory)

F5	Display Structure

F6	Display Status

F7	Display Memory

F8	Display

F9	Append

F10	Activate/deactivate the system menu bar  same as Alt

dBASE Browse Window Function Key Assignments
(Not supported in FoxPro)

Key	Action

F1	Activate online help

F2	Toggle between Browse and Edit mode

F3	Previous record

F4	Next record

F5	No effect

F6	Extend select (select text in a memo field)

F7	Move (move selected text in a memo field)

F8	Copy (copy selected text in a memo field)

F9	Zoom memo field window to full screen

F10	Activate the Browse menu bar

DOWN
ARROW	Activate the append record prompt


See Also

SET FUNCTION


Language Differences
Language Differences Between dBASE IV and FoxPro

See Also

The FoxPro language supports practically all the commands and functions available in dBASE IV. However, there are several dBASE IV commands and functions that are not supported in FoxPro, and others that behave in a different manner in FoxPro.

The following topics describe the dBASE IV commands and functions that are new to FoxPro 2.6, those that are not supported in FoxPro and those that behave differently in FoxPro.

Supported dBASE IV Commands and Functions

This topic describes the dBASE IV commands and functions that are new to FoxPro 2.6.

Unsupported dBASE IV Commands, Functions, and Clauses

This topic describes the dBASE IV commands and functions that are not supported in FoxPro 2.6. Also, this topic describes command clauses unique to dBASE IV that are not supported in FoxPro 2.6.

SQL Differences Between dBASE IV and FoxPro

This topic describes the differences in SQL support in FoxPro and dBASE IV. It lists the dBASE IV SQL commands and functions that are not supported in FoxPro 2.6.

FoxPro Reserved Words

This topic lists the FoxPro reserved words. FoxPro generates an error when a FoxPro reserved word is used as a function or procedure name in a dBASE IV program.

FoxPro Enhancements to the Xbase Language

This topic lists the FoxPro commands and functions that are not available in dBASE IV. These commands and functions provide additional programming versatility and power.


See Also

Supported dBASE IV Commands and Functions

Unsupported dBASE IV Commands, Functions, and Clauses

SQL Differences Between dBASE IV and FoxPro

FoxPro Reserved Words

FoxPro Enhancements to the Xbase Language


Running dBASE Applications
Running dBASE Programs

See Also

You can run an existing dBASE program from the Catalog Manager or from the Command window and menu system. With the exception of programs, the Catalog Manager automatically converts dBASE files to FoxPro format. If you run the dBASE program from the Command Window, you may need to convert other files.For more information, see Converting dBASE Files.

To run a dBASE program from the Catalog Manager

1.	In the Catalog Manager, click the Program tab.

2.	Select the dBASE program you want to run.

- Or -

If the dBASE program name is not listed in the Catalog Manager window, choose the Add button, select the name of the dBASE program you want to run, and click Add.

3.	Select the dBASE Program checkbox.

(When you select the dBASE Program checkbox, it is the equivalent of issuing the SET COMPATIBLE DB4 command in the Command window.)

4.	Choose the Run button.

To run a dBASE program from the Command window or menu system

1.	In the Command window, type SET COMPATIBLE DB4 and then press Enter.

2.	Type DO followed by the name of the dBASE program you want to run, and then press Enter.

If you don't know the dBASE program name, choose Do from the Program menu, select the file name from the dialog, and click Do.


See Also

Adding a Program to a Catalog

Converting dBASE Files

Modifying a dBASE Program

Running a Program from the Catalog Manager

SET COMPATIBLE


Supported dBASE IV Commands and Functions

While earlier FoxPro versions support most dBASE IV commands and functions, commands and functions have been added to FoxPro 2.6 to provide compatibility with dBASE IV. See Unsupported dBASE IV Commands, Functions, and Clauses for a list of the dBASE IV commands, functions, and clauses that are not supported in FoxPro 2.6.

dBASE Command or Function	FoxPro Equivalent
@ ... SCROLL	See @ ... SCROLL
ASSIST	See ASSIST
BARCOUNT( )	See CNTBAR( )
BARPROMPT( )	See BARPROMPT( )
BLANK	See BLANK
DESCENDING( )	See DESCENDING( )
FOR( )	See FOR( )
FDATE( )	See FDATE( )
FLDCOUNT( )	Same as FCOUNT( )
FLDLIST( )	See FLDLIST( )
FTIME( )	See FTIME( )
HOME( )	Same as SYS(2004)
ID( )	Same as SYS(0)
ISBLANK( )	See ISBLANK( )
ISREADONLY( )	See ISREADONLY( )
KEYMATCH( )	See KEYMATCH( )
MEMORY(0)	Same as SYS(1001)
MEMORY(1)	Same as SYS(1001)
MEMORY(2)	Same as SYS(12)
MEMORY(3)	Same as SYS(1001)
MEMORY(4)	Same as SYS(23)
MEMORY(5)	Same as SYS(23)
MEMORY(6)	Same as SYS(1016)
ON BAR	See ON BAR
ON EXIT BAR	See ON EXIT BAR
ON EXIT MENU	See ON EXIT MENU
ON EXIT PAD	See ON EXIT PAD
ON EXIT POPUP	See ON EXIT POPUP
ON MENU	Same as ON SELECTION MENU
ON MOUSE	Same as ON KEY LABEL LEFTMOUSE
ON PAD	Same as ON SELECTION PAD
ON POPUP	Same as ON SELECTION POPUP
PADPROMPT( )	Same as PRMPAD( )
PCOUNT( )	Same as PARAMETERS( )
PRTINFO( )	See PRTINFO( )
REPLACE FROM ARRAY	See REPLACE FROM ARRAY
SET("ATTRIBUTES")	See SET( )
SET DIRECTORY	Same as SET DEFAULT
SET("DIRECTORY")	Same as SYS(5) + SYS(2003)
SET("DISPLAY")	See SET( )
SET FIELDS	See SET FIELDS
SET FORMAT	See SET FORMAT
SET KEY	See SET KEY
SET("LIBRARY")	See SET( )
SET MBLOCK	See SET BLOCKSIZE
SET("MBLOCK")	See SET( )
SET VIEW	See SET VIEW
SYS(1037)	Print Setup Dialog. See SYS(1037)
TAG( )	See TAG( )
TAGCOUNT( )	See TAGCOUNT( )
TAGNO( )	See TAGNO( )
UNIQUE( )	See UNIQUE( )
WINDOW( )	Same as WOUTPUT( )
New FoxPro Functions

The following FoxPro functions have been added:

NORMALIZE( ) converts a character expression into a form that can be compared with FoxPro function return values.

Enhanced FoxPro Commands and Functions

The following FoxPro commands have been enhanced:

bmc bullet.bmp}	APPEND has a new keyword, NOMENU, which prevents access to the Browse menu and its options by removing the Browse menu pad from the system menu bar.

BROWSE has a new keyword, NOINIT, which works the same as BROWSE LAST.

KEYBOARD has a new keyword, CLEAR.

SELECT( ) now supports a table alias. SELECT( ) returns the work area number of the table given the table's alias.

SET LIBRARY has been enhanced to work with procedure files as well as API libraries.

New FoxPro System Memory Variables

The following FoxPro system memory variables have been added:

_ASSIST specifies the program that is run when the ASSIST command is issued.

_SHELL specifies a program shell.


Unsupported dBASE IV Commands and Functions
Unsupported dBASE IV Commands, Functions, and Clauses

See Also

Almost all of the hundreds of commands and functions in dBASE IV work exactly the same way in FoxPro.  The degree of compatibility is extremely high, and even more so with dBASE IV 1.0 and 1.1.  However, the following commands, functions, and clauses differ in dBASE and FoxPro.

@ ... GET

In FoxPro, the dBASE REQUIRED clause in @ ... GET is ignored.

@ ... SCROLL

In FoxPro, the dBASE WRAP clause is ignored.

ACCESS( )

In FoxPro, the dBASE function ACCESS( ) always returns 0.

APPEND

In FoxPro, the dBASE NOORGANIZE clause in APPEND is ignored.

APPEND FROM

In FoxPro, the dBASE NOVERIFY and REINDEX clauses in APPEND FROM are ignored.

APPEND FROM ARRAY

In FoxPro, the dBASE REINDEX clause in APPEND FROM ARRAY is ignored.

Arrays and Functions

During program execution, FoxPro looks for functions before arrays. If you run a dBASE program in FoxPro and the program has an array with the same name as a FoxPro function or a user-defined function, FoxPro executes the FoxPro or user-defined function. See FoxPro Reserved Words for a list of FoxPro keywords which should not be used as array names.

BARCOUNT( )

BARCOUNT( ) is provided for dBASE compatibility. In dBASE, BARCOUNT( ) returns the number of bars in a defined popup, regardless of whether or not the popup has been activated. BARCOUNT( ) in FoxPro calculates the number of bars of active popups. BARCOUNT( ) returns 0 in FoxPro if a popup has been defined but not activated.

BEGIN TRANSACTION

In FoxPro, the dBASE BEGIN TRANSACTION command generates an error.

BROWSE

In FoxPro, the dBASE NOORGANIZE clause in BROWSE is ignored.

In FoxPro, any setup or cleanup code in a format file specified in the BROWSE FORMAT clause is ignored.

CALL( )

In FoxPro, the dBASE CALL( ) function generates an error. Use CALL instead.

CATALOG( )

In FoxPro, the CATALOG( ) function runs the Catalog Manager.

CERROR( )

In FoxPro, the dBASE CERROR( ) function is not supported.

CHANGE( )

In FoxPro, the dBASE CHANGE( ) function always returns false (.F.).

CLEAR SCREEN

In FoxPro, the dBASE CLEAR SCREEN command is ignored. Use RELEASE to clear screen type memory variables.

CLOSE PRINTER

In FoxPro, the dBASE CLOSE PRINTER command is identical to SET PRINTER TO.

COMPLETED( )

In FoxPro, the dBASE COMPLETED( ) function always returns false (.F.).

CONVERT

In FoxPro, the dBASE CONVERT command generates an error.

DEBUG

In FoxPro, the dBASE DEBUG command generates an error. Use the FoxPro Debug and Trace windows instead.

DEXPORT

In FoxPro, the dBASE DEXPORT command generates an error.

DGEN( )

In FoxPro, the dBASE DGEN( ) function generates an error.

DISPLAY HISTORY

In FoxPro, the dBASE DISPLAY HISTORY command is ignored. The FoxPro Command window always contains a list of commands that have been interactively executed.

END TRANSACTION

In FoxPro, the dBASE END TRANSACTION command generates an error.

FCREATE( ) and FOPEN( )

In dBASE IV, the second parameter in the FCREATE( ) and FOPEN( ) functions can be "R" (read-only), "W" (write-only), "A" (append-only), "RW" or "WR (read and write) or "RA" or "AR" (read and append). FoxPro supports these file attributes. The following table lists the FoxPro behavior for these dBASE parameters.

FCREATE( )
dBASE Parameter	FoxPro Behavior
RW or WR	Creates a file with read and write privileges  and sets the MS-DOS archive attribute.
A	Creates a file with read and write privileges  and sets the MS-DOS archive attribute.
RA or AR	Creates a file with read and write privileges  and sets the MS-DOS archive attribute.
R	Creates a file with read only privileges and sets the MS-DOS read only attribute.
FOPEN( )
dBASE Parameter	FoxPro Behavior
RW or WR	Opens the file with read and write privileges  and positions the file pointer at the beginning of the file.
A	Opens the file with read only privileges  and positions the file pointer at the end of the file.
RA or AR	Opens the file with read and write privileges  and positions the file pointer at the end of the file.
R	Opens the file with read only privileges  and positions the file pointer at the beginning of the file.
FLDLIST( )

In dBASE, FLDLIST( ) returns a field name followed by the -> operator and the table alias. In FoxPro, FLDLIST( ) returns a field name followed by a period and the table alias.

ID( )

ID( ) in dBASE returns the name of the machine that dBASE is running on. ID( ) in FoxPro returns the name of the machine that FoxPro is running on and the number of the machine in the network. If no network is present, ID( ) in FoxPro returns the machine name and 1.

ISMARKED( )

The ISMARKED( ) function is not supported in FoxPro.

LIST HISTORY

In FoxPro, the dBASE LIST HISTORY command is ignored. The FoxPro Command window always contains a list of commands that have been interactively executed.

LKSYS( )

The LKSYS( ) function is not supported in FoxPro.

MEMORY( )

In dBASE, issuing MEMORY( ) without a numeric argument returns the same value as MEMORY(0). This value is the amount of memory available to dBASE.

 In FoxPro, MEMORY( ) returns the amount of memory below 640K that is available to RUN an external program.

MEMORY(7)

In FoxPro, the dBASE function MEMORY(7) always returns 0.

NETWORK( )

In FoxPro, the dBASE function NETWORK( ) always returns true (.T.).

ON SELECTION POPUP

In FoxPro, the dBASE BLANK clause in ON SELECTION POPUP is ignored.

_PDRIVER

In FoxPro, if the printer driver you specify in _PDRIVER has a file name extension, you must include the file name extension with the printer driver file name. In dBASE, a .PR2 file name extension is assumed. You need only include a file name extension when the printer driver file name has an extension other than .PR2.

PROTECT

In FoxPro, the dBASE PROTECT command generates an error.

RETURN TO MASTER

If a dBASE program contains RETURN TO MASTER, it should not be run from the FoxPro Catalog Manager. In programs run in the FoxPro Catalog Manager, RETURN TO MASTER returns program control to the FoxPro Catalog Manager, which is the highest level calling program.

RESET

In FoxPro, the dBASE RESET command is ignored.

ROLLBACK

In FoxPro, the dBASE ROLLBACK command generates an error.

RUN( )

The dBASE RUN( ) function is not supported in FoxPro. Use the RUN command instead.

SAVE SCREEN

In FoxPro, a screen saved in a procedure with SAVE SCREEN is private to the procedure. In dBASE, a screen saved in a procedure is public.

To emulate the dBASE behavior in FoxPro, declare a public memory variable and then save the screen to the public memory variable.

SET BLOCKSIZE

In dBASE, the value you specify for the memo field block size with SET BLOCKSIZE is multiplied by 512.

In FoxPro, the value you specify for the memo field block size with SET BLOCKSIZE is multiplied by 512 if the value is between 1 and 32. If the value is greater than 32, the value is multiplied by 1.

SET CATALOG

In FoxPro, the dBASE SET CATALOG command is ignored. CATALOG is always off in FoxPro.

SET DBTRAP

In FoxPro, the dBASE SET DBTRAP command is ignored. DBTRAP is always off in FoxPro.

SET DEBUG

In FoxPro, the dBASE SET DEBUG command is ignored. Use the FoxPro Debug and Trace windows instead.

SET DESIGN

In FoxPro, the dBASE SET DESIGN command is ignored. DESIGN is always on in FoxPro.

SET EXCLUSIVE

In FoxPro and dBASE IV version 2.0, SET EXCLUSIVE is ON by default. In dBASE IV version 1.5, SET EXCLUSIVE is OFF by default

SET FIELDS

In dBASE you can add /R to a field in the SET FIELDS command to make it read-only.  This switch is ignored in FoxPro 2.6.

SET IBLOCK

In FoxPro, the dBASE SET IBLOCK command is ignored.

SET INSTRUCT

In FoxPro, the dBASE SET INSTRUCT command is ignored. INSTRUCT is always off in FoxPro.

SET LDCHECK

In FoxPro, the dBASE SET LDCHECK command is ignored. LDCHECK is always off in FoxPro.

SET MBLOCK

In dBASE, the value you specify for the memo field block size with SET MBLOCK is multiplied by 64.

In FoxPro, the value you specify for memo field block size with SET MBLOCK is multiplied by 64 if the value is between 1 and 512. If the value is greater than 512, the value is multiplied by 1.

SET MESSAGE

In FoxPro, the dBASE AT clause in SET MESSAGE is ignored.

SET PRECISION

In FoxPro, the dBASE SET PRECISION command is ignored. FoxPro always uses 16 digits for calculations.

SET SQL

In FoxPro, the dBASE SET SQL command is ignored. SQL is always on in FoxPro.

SET TRAP

In FoxPro, the dBASE SET TRAP command is ignored. TRAP is always on in FoxPro.

SET('BORDER')

In FoxPro, the border characters are returned. In dBASE, SET('BORDER') returns ASCII values for the border characters.

SET("CATALOG")

In FoxPro, SET("CATALOG") always returns OFF.

SET("DBTRAP")

In FoxPro, SET("DBTRAP") always returns OFF.

SET("DESIGN")

In FoxPro, SET("DBTRAP") always returns ON.

SET('FIELDS',1)

In FoxPro, when FIELDS is set to LOCAL and COMPATIBLE is set to FOXPLUS or OFF, aliases are not returned with the fields names.

SET("IBLOCK")

In FoxPro, SET("DBTRAP") always returns 0.

SET("INSTRUCT")

In FoxPro, SET("INSTRUCT") always returns OFF.

SET("LDCHECK")

In FoxPro, SET("LDCHECK") always returns OFF.

SET("PRECISION")

In FoxPro, SET("PRECISION") always returns 16.

SET("SQL")

In FoxPro, SET("SQL") always returns ON.

SET("TRAP")

In FoxPro, SET("TRAP") always returns ON.

SET("VIEW")

In FoxPro, SET("VIEW") always returns the null string ("").

SYSPROC Configuration Item

In dBASE, you can include the SYSPROC configuration item in the dBASE configuration file to open a procedure file. The procedure file remains open during the entire dBASE session.

In FoxPro, you can use SET LIBRARY to open a procedure file. If you open additional procedure files, include the ADDITIVE keyword to prevent open procedure files from being closed.

USE

In FoxPro, the dBASE NOSAVE and NOLOG clauses in USE are ignored.

USER( )

In FoxPro, USER( ) always returns the null string.

SQL in dBASE IV and FoxPro

There are significant differences in the implementations of SQL in dBASE IV and FoxPro and the following dBASE IV SQL commands and functions are not supported in FoxPro.

See SQL Differences Between dBASE IV and FoxPro for additional information about SQL implementation differences in dBASE and FoxPro.

The following dBASE SQL commands and functions are not supported in FoxPro.

ALTER TABLE	CLOSE <cursor name>	CREATE DATABASE
CREATE INDEX	CREATE SYNONYM	CREATE VIEW
DBCHECK	DBDEFINE	DECLARE CURSOR
DELETE	DELETE WHERE CURRENT	DROP DATABASE
DROP INDEX	DROP SYNONYM	DROP TABLE
DROP VIEW	FETCH	GRANT
LOAD DATA	OPEN	REVOKE
ROLLBACK	RUNSTATS	SHOW DATABASE
START DATABASE	STOP DATABASE	UNLOAD DATA
UPDATE


See Also

Supported dBASE IV Commands and Functions

SQL Differences Between dBASE IV and FoxPro

FoxPro Reserved Words

FoxPro Enhancements to the Xbase Language


Microsoft Support Services

When You Have a Question

Product Support Within the United States and Canada

Product Support Worldwide

CompuServe - The FoxForum

Troubleshooting


When You Have a Question

If you have a question about Microsoft FoxPro, first look in the printed product documentation or consult online Help. You can also find late-breaking updates and technical information in the Readme file that came with your FoxPro disks. To diagnose a specific problem, consult the Troubleshooting Charts and Tips Help topic. If you cannot find the answer, contact the Microsoft Support Network.

Outside the United States and Canada, contact Microsoft Product Support Services at the Microsoft subsidiary office that serves your area. For information about Microsoft subsidiary offices, see Product Support Worldwide.

The Microsoft Support Network

The Microsoft Support Network offers you a wide range of choices and access to high-quality, responsive technical support. Microsoft recognizes that support needs vary from user to user; the Microsoft Support Network allows you to choose the type of support that best meets your needs, with options ranging from electronic bulletin boards to annual support programs. For information about support services in the United States and Canada, see Product Support Within the United States and Canada.

Services vary outside the United States and Canada. In other locations, contact a local Microsoft subsidiary for information. The Microsoft Support Network is subject to Microsoft's then-current prices, terms, and conditions, and is subject to change without notice.


Product Support Within the United States and Canada

In the United States and Canada, the following support services are available through the Microsoft Support Network:

Electronic Services

Priority Support

Standard Support

Text Telephone

Other Support Options

Product Training and Consultation

See Also

Product Support Worldwide


Electronic Services

These services are available 24 hours a day, 7 days a week, including holidays.

Microsoft FastTips

(800) 936-4300 on a touch-tone telephone. Receive automated answers to common questions, and access a library of technical notes, all delivered by recording or fax. You can use the following keys on your touch-tone telephone after you reach FastTips:

To	Press
Advance to the next message	*
Repeat the current message	7
Return to the beginning of FastTips	#
CompuServe

Interact with other users and Microsoft support engineers, or access the Microsoft Knowledge Base to get product information. At any ! prompt, type go microsoft to access Microsoft forums, or type go mskb to access the Microsoft Knowledge Base, or type go foxforum to access FoxPro-specific information. For an introductory CompuServe membership kit, call (800) 848-8199, operator 519.

Microsoft Download Service

Access, via modem, the Driver Library and the most current technical notes (1200, 2400, 9600, or 14400 baud; no parity; 8 data bits; 1 stop bit). In the United States, call (206) 936-6735. In Canada, call (905) 507-3022.

Internet

Access the Driver Library and the Microsoft Knowledge Base. The Microsoft Internet FTP archive host, ftp.microsoft.com, supports anonymous login. When logging in as anonymous, you should type your complete electronic mail name as your password.

See also

Priority Support

Standard Support

Text Telephone

Other Support Options

Product Training and Consultation


Priority Support

The Microsoft Support Network offers priority telephone access to Microsoft support engineers 24 hours a day, 7 days a week, except holidays.

In the United States, call (900) 555-2300; $2 (U.S.) per minute, $95 (U.S.) maximum. Charges appear on your telephone bill.

In the United States, call (800) 936-5800; $95 (U.S.) per incident, billed to your VISA card, MasterCard, or American Express card.

In Canada, call (800) 668-7975 for more information.

See also

Electronic Services

Standard Support

Text Telephone

Other Support Options

Product Training and Consultation


Standard Support

In the United States, no-charge support from Microsoft support engineers is available via a toll call between 6:00 A.M. and 6:00 P.M. Pacific time, Monday through Friday, excluding holidays. This support is available for 90 days after you make your first call.

For technical support for FoxPro for MS-DOS and Windows, call (206) 635-7191.

For technical support for FoxPro for Macintosh, call (206) 635-7192.

In Canada, support engineers are available via a toll call between 8:00 A.M. and 8:00 P.M. Eastern time, Monday through Friday, excluding holidays. Call (905) 568-3503.

When you call, you should be at your computer and have the appropriate product documentation at hand. Be prepared to give the following information:

The version number of the Microsoft product that you are using

The type of hardware that you are using

The exact wording of any messages that appeared on your screen

A description of what happened and what you were doing when the problem occurred

A description of how you tried to solve the problem

See also

Electronic Services

Priority Support

Text Telephone

Other Support Options

Product Training and Consultation


Text Telephone

Microsoft text telephone (TT/TDD) services are available for the deaf or hard-of-hearing. In the United States, using a TT/TDD modem, dial (206) 635-4948 between 6:00 A.M. and 6:00 P.M. Pacific time, Monday through Friday, excluding holidays. In Canada, using a TT/TDD modem, dial (905) 568-9641 between 8:00 A.M. and 8:00 P.M. Eastern time, Monday through Friday, excluding holidays.

See also

Electronic Services

Priority Support

Standard Support

Other Support Options

Product Training and Consultation


Other Support Options

The Microsoft Support Network offers annual support plans. For information, in the United States, contact the Microsoft Support Network Sales and Information group at (800) 936-3500 between 6:00 A.M. and 6:00 P.M. Pacific time, Monday through Friday, excluding holidays. In Canada, call (800) 668-7975 between 8:00 A.M. and 8:00 P.M. Eastern time, Monday through Friday, excluding holidays.

Electronic Services

Priority Support

Standard Support

Text Telephone

Product Training and Consultation


Product Training and Consultation

Microsoft Solution Providers are independent organizations that provide consulting, integration, customization, development, technical support and training, and other services for Microsoft products. These companies are called Solution Providers because they apply technology and provide services to help solve real-world problems.

In the United States, for more information about the Microsoft Solution Providers program or the Microsoft Solution Provider nearest to you, please call (800) 426-9400 between 6:30 A.M. and 5:30 P.M. Pacific time, Monday through Friday, excluding holidays. In Canada, call (800) 668-7975 between 8:00 A.M. and 8:00 P.M. Eastern time, Monday through Friday, excluding holidays.

See also

Electronic Services

Priority Support

Standard Support

Text Telephone

Other Support Options


Product Support Worldwide

If you are outside the United States or Canada and have a question about a Microsoft product, first:

Consult the documentation and other printed information included with your product.

Check online Help.

Check the Readme files that come with your product disks. These files provide general information that became available after the books in the product package were published.

Consult electronic options such as CompuServe forums or bulletin boards, if available.

If you cannot find a solution, you can receive information on how to obtain product support by contacting the Microsoft subsidiary office that serves your country.

The Microsoft Support Network

The Microsoft Support Network, where available, offers you a wide range of choices and access to high quality, responsive technical support. Microsoft recognizes that support needs vary from user to user; the Microsoft Support Network allows you to choose the type of support that best meets your needs, with options ranging from electronic bulletin boards to annual support programs.

The Microsoft Support Network is subject to Microsoft's then-current prices, terms, and conditions in place in each country at the time the services are used and is subject to change without notice.


Microsoft Subsidiary Information

Calling a Microsoft Subsidiary Office

When you call, you should be at your computer and have the appropriate product documentation at hand. Be prepared to give the following information:

The version number of Microsoft product that you are using.

The type of hardware that you are using, including network hardware, if applicable.

The operating system that you are using.

The exact wording of any messages that appeared on your screen.

A description of what happened and what you were doing when the problem occurred.

A description of how you tried to solve the problem.

For more information about reaching a Microsoft subsidiary, click the appropriate country:

If there is no Microsoft office in your country, please contact the establishment from which you purchased your Microsoft product.

Argentina

Australia

Austria

Belgium

Bolivia

Brazil

Canada

Caribbean

Chile

Colombia

Denmark

Dubai

Finland

France

French Polynesia

Germany

Greece

Hong Kong

Israel

Italy

Japan

Korea

Liechtenstein

Luxembourg

México

Netherlands

New Zealand

Norway

Papua New Guinea

Paraguay

Portugal

Republic of China

South Africa

Spain

Sweden

Switzerland

Turkey

United Kingdom

Uruguay

Venezuela

See Also

Microsoft Support Services

Product Support Within the United States and Canada


Support in Argentina, Bolivia, Paraguay, and Uruguay

Subsidiary:	Microsoft de Argentina S.A.
Customer Service:	(54) (1) 814 [image] 5105
	(54) (1) 814 [image] 4807
	(54) (1) 814 [image] 4808
	(54) (1) 814 [image] 7199
Technical Support:	(54) (1) 815 [image] 1521
Fax:	(54) (1) 814 [image] 0372


Support in Australia and Papua New Guinea

Subsidiary:	Microsoft Pty. Ltd.
Install & Setup:	(61) (02) 870 [image] 2870
Fax:	(61) (02) 805 [image] 0519
Bulletin Board Service:	(61) (02) 878 [image] 5200
Technical Support:	(61) (02) 870 [image] 2131
Sales Information Centre:	(61) (02) 870 [image] 2100


Support in Austria

Subsidiary:	Microsoft Ges.m.b.H.
Phone:	0222 [image] 68 76 07
Fax:	0222 [image] 68 16 2710
Information:	0660 [image] 6520
Prices, updates, etc.:	0660 [image] 6520
CompuServe:	GO MSEURO (Microsoft Central Europe)
FoxPro Technical support:	0660 [image] 6592


Support in Belgium

Subsidiary:	Microsoft NV
Phone:	02 [image] 7303911
Customer Service:	02 [image] 7303922
CompuServe:	02 [image] 2150530 (GO MSBEN)
Bulletin Board Service:	02 [image] 7350045
	(1200/2400/9600 baud, 8 bits, no parity, 1 stop bit, ANSI terminal emulation)
Technical Support:
(Dutch speaking):	02 [image] 5133274
(English speaking):	02 [image] 5023432
(French speaking):	02 [image] 5132268


Support in Brazil

Subsidiary:	Microsoft Informatica Ltda.
Phone:	(55) (11) 530 [image] 4455
Fax:	(55) (11) 240 [image] 2205
Technical Support Phone:	(55) (11) 533 [image] 2922
Technical Support Fax:	(55) (11) 241 [image] 1157
Technical Support Bulletin Board Service:	(55) (11) 872 [image] 4106


Support in Canada

Subsidiary:	Microsoft Canada Inc.
Head Office Phone:	1 (905) 568 [image] 0434
Customer Support Centre	1 (800) 563 [image] 9048
Microsoft Support Network:	Standard Technical Support Phone: 1 (905) 568 [image] 3503
	Priority Support Information: 1 (800) 668 [image] 7975
	Technical Support Bulletin Board Service: 1 (905) 507 [image] 3022
	Text Telephone (TT/TDD) 1 (905) 568 [image] 9641


Support in the Caribbean

Subsidiary:	Microsoft Caribbean, Inc.
Tel:	(809) 273 [image] 3600
Fax:	(809) 273 [image] 3636


Support in Chile

Subsidiary:	Microsoft Chile S.A.
Tel:	56 2 218 5771, 56 2 218 5711, 56 2 218 7524
Fax:	56 2 218 5747


Support in Colombia

Subsidiary:	Microsoft Colombia
Tel:	(571) 618 2245
Soporte Tecnico:	(571) 618 2255
Fax:	(571) 618 2269


Support in Denmark

Subsidiary:	Microsoft Denmark AS
Phone:	(45) (44) 89 01 00
Technical Support:	(45) (44) 89 01 11
Microsoft Sales Support:	(45) (44) 89 01 90
Microsoft BBS:	(45) (44) 66 90 46 (Document 303030 in FaxSvar contains detailed instructions)
Microsoft FaxSvar:	(45) (44) 89 01 44


Support in Dubai

Subsidiary:	Microsoft Middle East
Phone:	(971) 4 513 888
Fax:	(971) 4 527 444


Support in Finland

Subsidiary:	Microsoft OY
For Technical Support, please contact your local dealer.
Phone:	(358) (9) 0 525 501
Microsoft BBS:	(46) (0) 8 750 47 42 (Information in Swedish and English)
Microsoft FaxSvar:	(46) (0)8 752 29 00 (Information in Swedish and English)


Support in France and French Polynesia

Subsidiary:	Microsoft France
Phone:	(33) (1) 69 [image] 86 [image] 46 [image] 46
Telex:	MSPARIS 604322
Fax:	(33) (1) 64 [image] 46 [image] 06 [image] 60
Technical Support Phone:	(33) (1) 69 [image] 86 [image] 10 [image] 20
Technical Support Fax:	(33) (1) 69 [image] 28 [image] 00 [image] 28
Fax Information Service:	(33) (1) 69 [image] 29 [image] 11 [image] 55


Support in Germany

Subsidiary:	Microsoft GmbH
Phone:	089 [image] 3176 [image] 0
Telex:	(17) 89 83 28 MS GMBH D
Fax:	089 [image] 3176 [image] 1000
Information:	089 [image] 3176 1199
Prices, updates, etc.:	089 [image] 3176 1199
Bulletin board, device drivers, tech notes:	Btx: microsoft# or *610808000#
CompuServe:	GO MSEURO (Microsoft Central Europe)
FoxPro Technical support:	089/3176 [image] 1181


Support in Greece

Subsidiary:	Microsoft Hellas, S.A.
Phone:	(30) (1) 6893 631 through (30) 1 6893 635
Fax:	(30) (1) 6893 636


Support in Hong Kong

Subsidiary:	Microsoft Hong Kong Limited
Technical Support:	(852) 804 [image] 4222
Fax:	(852) 560 [image] 2217


Support in Israel

Subsidiary:	Microsoft Israel  Ltd.
Phone:	972 [image] 3 [image] 575 [image] 7034
Fax:	972 [image] 3 [image] 575 [image] 7065


Support in Italy

Subsidiary:	Microsoft SpA
Phone:	(39) (2) 269121
Telex:	340321 I
Fax:	(39) (2) 21072020
Customer Service (Prices, new product info, product literature):	(39) (2) 26901359
Bulletin Board:	(39) (2) 21072051
Technical Support:	(39) (2) 26901351


Support in Japan

Subsidiary:	Microsoft Company Ltd., Tokyo Japan
Phone:	(81) (3) 5454 [image] 8000
Fax:	(81) (3) 5454 [image] 7972
Macintosh Products:	(81) (3) 5454 [image] 2349
PSS Technical Support Fax:	(81) (3) 5454 [image] 7955
Customer Service Phone (Version upgrade/Registration):
Phone:	(81) (3) 5454 [image] 2305
Fax:	(81) (3) 5454 [image] 7952
Channel Marketing Information Center (Pre-sales Product Support):
Phone:	(81) (3) 5454 [image] 2300
Fax:	(81) (3) 5454 [image] 7951


Support in Korea

Subsidiary:	Microsoft CH
Phone:	(82) (2) 552 [image] 9505
Fax:	(82) (2) 555 [image] 1724
Technical Support:
Phone:	(82) (2) 531 [image] 4800
Fax:	(82) (2) 563 [image] 5194
Bulletin Board Service:	(82) (2) 538 [image] 3256


Support in Liechtenstein and Switzerland

Subsidiary:	Microsoft AG
Phone:	01 [image] 839 61 11
Fax:	01 [image] 831 08 69
Documentation:
Phone:	155 59 00
Fax:	064 [image] 224294
	Microsoft Info-Service, Postfach, 8099 Zürich
Prices, updates, etc.:	01/839 61 11
CompuServe:	GO MSEURO(Microsoft Central Europe)
FoxPro Technical support:	01/831 [image] 1580
Technical support: (French speaking)	022 [image] 738 96 88


Support in Luxembourg

Subsidiary:	Microsoft NV
Phone:	(32) 2 [image] 7303911
Customer Service:	(32) 2 [image] 7303922
CompuServe:	(32) 2 [image] 2150530 (GO MSBEN)
Bulletin Board Service:	(32) 2 [image] 7350045
	(1200/2400/9600 baud, 8 bits, No parity, 1 stop bit, ANSI terminal emulation)
Technical Support:
(Dutch speaking):	(32) 2 [image] 5133274
(English speaking):	(32) 2 [image] 5023432
(French speaking):	(32) 2 [image] 5132268


Support in México

Subsidiary:	Microsoft México, S.A. de C.V.
Phone:	(52) (5) 325 [image] 0910
Customer Service:	(52) (5) 325 [image] 0911
Bulletin Board Service:	(52) (5) 590 [image] 5988
	(1200/2400 baud, 8 bits, No parity, 1 stop bit, ANSI terminal emulation)
Fax:	(52) (5) 280 [image] 7940
Technical Support:
Desktop & OS:	(52) (5) 325 [image] 0912
Developers & Advanced Systems:	(52) (5) 237 [image] 4800


Support in Netherlands

Subsidiary:	Microsoft BV
Phone:	02503 [image] 89189
Customer Service:	02503 [image] 77700
CompuServe:	020 [image] 6880085 (GO MSBEN)
Bulletin Board Service:	02503 [image] 34221
	(1200/2400/9600 baud, 8 bits, No parity, 1 stop bit, ANSI terminal emulation)
Technical Support:
(Dutch speaking)	02503 [image] 77877
(English speaking)	02503 [image] 77853


Support in New Zealand

Subsidiary:	Microsoft New Zealand Ltd.
Phone:	64 (9) 358 [image] 3724
Fax:	64 (9) 358 [image] 3726
Technical Support (Technology Link Centre):
Phone:	64 (9) 357 [image] 5575
Fax:	64 (9) 358 [image] 0092


Support in Norway

Subsidiary:	Microsoft Norway AS
Phone:	(47) 22 02 25 00
Technical Support:	(47) 22 02 25 50
Microsoft Sales Support:	(47) 22 02 25 80
Microsoft BBS:	(47) 22 18 22 09 (Document 404040 in FaxSvar contains detailed instructions)
Microsoft FaxSvar:	(47) 22 02 25 70


Support in Portugal

Subsidiary:	MSFT, Lda.
Phone:	(351) 1 4412205
Fax:	(351) 1 4412101


Support in the Republic of China

Subsidiary:	Microsoft Taiwan Corp.
Phone:	(886) (2) 504 [image] 3122
Fax:	(886) (2) 504 [image] 3121
Technical Support :	(886) (2) 508 [image] 9501


Support in South Africa

Subsidiary:	Microsoft South Africa
Phone:	(27) 11 444 0520
Fax:	(27) 11 444 0536


Support in Spain

Subsidiary:	Microsoft Iberica SRL
Phone:	(34) (1) 804 [image] 0000
Fax:	(34) (1) 803 [image] 8310
Technical Support:	(34) (1) 803 [image] 9960


Support in Sweden

Subsidiary:	Microsoft AB
Phone:	(46) (8) 752 56 00
Technical Support:	(46) (8) 752 09 29
Sales Support:	(46) (8) 752 56 30
Microsoft BBS:	(46) (8) 750 47 42 (Document 202020 in FaxSvar contains detailed instructions)
Microsoft FaxSvar:	(46) (8) 752 29 00


Support in Turkey

Subsidiary:	Microsoft Turkey
Phone:	(90) 212 2585998
Fax:	(90) 212 2585954


Support in England, Ireland, Scotland, and Wales
Support in the United Kingdom (England, Ireland, Scotland, and Wales)

Subsidiary:	Microsoft Limited
Phone:	(44) (734) 270000
Fax:	(44) (734) 270002
Upgrades & Registration:	(44) (81) 614 8000
Technical Support:
Bulletin Board Service:	(44) (734) 270065 (2400 Baud) (44) (734) 270060 (9600 Baud)
Fax Information Service:	(44) (734) 270080
Main Line (All Products):	(44) (734) 271000
MSDOS 90 day F.O.C. Support:	(44) (734) 271900
MSDOS Charged Support:	(44) (891) 315500


Support in Venezuela

Subsidiary:	Corporation MS 90 de Venezuela S.A.
Technical Support:	58.2.910046, 58.2.910510
Other information:	58.2.910008, 58.2.914739, 58.2.913342
Fax:	58.2.923835


CompuServe - The FoxForum

See Also

FoxForum [image] A Place to Share Ideas

Thousands of members use Microsoft Fox products to develop database applications.  Share your knowledge or tap theirs for programming tips that will save you time and money.

Communicate directly with Microsoft.  Members of the FoxForum can send messages to Microsoft 24 hours a day.

Professional developers and Microsoft support staff share hints and tips on applications created with FoxPro for MS-DOS, FoxPro for Windows, FoxPro for Macintosh, FoxBASE+ and FoxBASE+ for Macintosh.

FoxForum [image] A Place to Receive Product Support

Questions are answered on a daily basis with 24- to 48-hour turnaround (Monday-Friday).  Forum libraries contain sample programs and the FoxForum archives contain messages reflecting commonly asked questions, hints and tips organized by topic.

Obtain software.  Download software from professional developers and Microsoft in the forum libraries.

How the Forum is Structured

The forum consists of two parts:

FoxForum is the standard technical support forum.

FoxUser Forum is the Fox user community forum.

Tips on using the FoxForum


CompuServe - The FoxForum SeeAlso
See Also

FoxForum

FoxUser Forum

Tips on using the FoxForum


FoxForum

See Also

Accessing the FoxForum

Enter GO FOXPRO at any ! prompt.

FoxForum is divided into the following areas:

1) Marketing/Sales/Info

2) Getting Started

3) FoxPro for MS-DOS/FoxPro for Windows Configuration/Install

4) FoxPro for Macintosh Configuration/Install

5) Screens/Menus

6) FoxPro for Macintosh/FoxPro for Windows Reports/Printing

7) FoxPro for MS-DOS Reports/Printing

8) Language

9) Queries/SQL/Browse

10) LCK API & Externals

11) Project Manager

12) OLE/DDE/Interoperability

13) Networking/ODBC

14) Convert/Cross-Platform

15) FoxBASE+

16) Distribution Kit/Application Distribution

17) Third Party Products (not monitored by Microsoft)


FoxForum SeeAlso
See Also

CompuServe - The FoxForum

FoxUser Forum

Tips on using the FoxForum


FoxUser Forum

See Also

Accessing the FoxUser Forum

Enter GO FOXGANG at any ! prompt.

FoxUser Forum is divided into the following areas:

1) New Forum Users

For new users who may be having problems with the forums, or just have a question about working on the forums.

2) FoxPro Publications (not monitored by Microsoft)

A place to talk about magazines, books, and other publications related to FoxPro.

3) Consultants Corner (not monitored by Microsoft)

Discussions with and among consultants.

4) What's New (not monitored by Microsoft)

A place for everyone to post information about new products, new books that are available and so on.

5) Developers Exchange (not monitored by Microsoft)

A place to just generally discuss any development issues you may have. This is a chatter for those who like to theorize and talk about computers, databases and so on.

6) Fox User Groups (not monitored by Microsoft)

A place to go to discuss Fox User Group meetings, announcements regarding them and other information.

7) Conventions & Events (not monitored by Microsoft)

Here you can talk about your favorite event, including Devcon, Comdex and all of those events people get to go to.

8) Chatter (not monitored by Microsoft)

The Fox Chatter section is a place for regular and new members to discuss issues such as science fiction, iguanas, and even special recipes!  We like to think of this message section as a "coffee shop" where you can just take a break with a friend or meet some new ones!


FoxUser Forum SeeAlso
See Also

CompuServe - The FoxForum

FoxForum

Tips on using the FoxForum


Tips on Using the FoxForum

See Also

You may find it useful to print these out. From the File menu, choose Print Topic.

Hard and Fast Rules

Manners and Ambience

Who's Microsoft and Who Isn't

What To Do If You're Upset

Emoticons and Acronyms

Forum Organization - Messages, Threads and Sections

Message Traffic and Scroll Rate

Private and Public Messages

Asking Questions

Responding to Answers

Thread Integrity and Continuity

Message Etiquette

Deleting Messages

Online vs. Off-Line

Sysops

Libraries

Compressed Files

Updates to Fox Products

Downloading Files

Uploading Files

Afterword - The Spirit of Contribution


Tips on Using the FoxForum SeeAlso
See Also

CompuServe - The FoxForum

FoxForum


The FoxForum on CompuServe: Hard and Fast Rules

This forum requests that you use your full name in your CompuServe (CIS) identification.  If you have omitted your first name or last name, please change it.

To change your name, sign on to CompuServe and type GO FOXFORUM to get to the FoxForum prompt or type GO FOXUSER to get to the FoxUser Forum.  Then type OPTIONS to see a menu of options you can change.  Choose option 4 (name), enter the new name, press ENTER and then tell CIS to make the change permanent.  You can bypass the menus by typing "OPT;N <newname>;P".

If you normally use a company CompuServe account with the company name but plan to be a regular participant, please change the identification (at least locally in the FoxForum or FoxUser Forum) to your name and enclose the company name (or abbreviation) in brackets after your name if you wish.  If several people will be using the same account, each individual should include his or her complete name in the body of the message.

Please refrain from using profanity, being abusive, advocating illegal actions, or performing any act that may injure another.  Microsoft reserves the right to deny access to the forum to anyone posting offensive messages.

This isn't a "hard and fast rule" but it's close [image] please do not type your messages all in upper case (use mixed case as you would in a letter).  Upper case is hard to read and is considered "SHOUTING" on CompuServe [image] you'll see what we mean if you read enough messages.

There are no other "rules" but there are some conventions of behavior that will ease your life in the forum.  Please see Manners and Ambience.


The FoxForum on CompuServe: Manners and Ambience

Here are some pointers on using the forum by Fox user Nancy Jacobsen.

This is the FoxForum, so naturally what brings people together is an interest in Microsoft Fox products [image] most of the people here are working with FoxPro, FoxBASE+, or FoxBASE+ for Macintosh.  These include developers, people using the products to manage their own data, and hobbyists.  The range of skill and expertise is very wide [image] from the loftiest FoxPro guru to the absolute beginner.  Experts and beginners are equally valued [image] beginners sometimes ask the best questions.

In addition to the people who write messages on the forum, there is another group we (affectionately) call "lurkers" [image] people who monitor the forum (reading messages, downloading files) but for one reason or another haven't chosen to write any messages to us.  We might tease lurkers from time to time (that's why we said "affectionately"), but we value them as well, and if you want to lurk, that's fine with us.

Although intended as a "working" forum for sharing information and professional expertise, this forum is also a friendly and informal place.  People here can become quite close [image] and a newcomer quickly finds him/herself accepted.  When you join the forum, "old timers" will treat you as a friend as long as you behave yourself (smile).

As with any group of friends, you'll find that there are lots of "in" jokes, many teasing comments, heated debates, occasional spats and feuds, people having a bad day who may be cranky [image] the usual stuff of human interaction.  You'll find the reason we're friends is that we share common interests, are working in generally the same field, and appreciate the opportunity to communicate.  For some of us who are isolated, the forum members are the only people we know who understand what we're talking about (grin).

So, when you "walk" into the forum, it will be more like walking into a large party with people who share professional interests than like walking into an office or a professional association.  It's like a user's group with no specific agenda.  We hear that not all other forums share our "friendly" attitude and you may be in for a a shock if you're used to a more formal atmosphere.

As with all CompuServe forums, forum members range widely in personality, geography, race, gender, religion, etc., and this is definitely an equal-opportunity forum.

Manners

As for manners, all we ask is that you be considerate of everybody else.  When we say "considerate," we mean consider that the person on the other end of your message is a human being with ups and downs, strong and weak points, and good days and bad days.  Consider that a person may reside in a non-English speaking country and use English as a second language.  Consider that a person might have a disability or that a person may not be the gender you think he or she is based on name alone.

Also, please consider that people here represent different nationalities, races, ethnic groups, religions, abilities/disabilities, and genders, and respect these differences.  In this forum, it is important to us that we provide an environment where we all feel safe.  If any one of us is ridiculed or insulted, we all lose because we lose that person's enthusiasm to participate with us and contribute to the work we do.

Consideration can be most important when you are upset.  Within the bounds of consideration, you can complain, whine or throw tantrums, if you need to [image] we think we all have at one time or another.  But it takes a certain amount of skill to complain, whine or throw a tantrum politely and with consideration for others.  If you're upset, consider how your message might affect you if you were to receive it.

If you're considerate, you shouldn't run into too many problems here.  But we must warn you that you are subject to teasing (because you're considered a friend from the beginning [image] please don't take this personally) and if you should stray beyond the bounds of what's considered "appropriate" behavior, you may receive a gentle admonition.  If you are really out of line, a Sysop may decide to step in [image] a Sysop is a final authority on behavior, and even long-term forum members quake before a Sysop's pronouncements (smile).

As a rule of thumb, a belligerent attitude is frowned upon [image] it tends to make us uncomfortable because it upsets the balance of friendliness and consideration and retards the free flow of communication.  Frankly, we seem to be able to have very "loud" arguments without resorting to this approach.


The FoxForum on CompuServe: Who's Microsoft and Who Isn't

People on the forum who work for Microsoft tech support have [MSFT] or "Sysop" after their names in their identification.  If somebody doesn't have [MSFT] or "Sysop" after his or her name, s/he is not an employee of the company and is just being helpful.  Some forum members are so helpful that people assume they work for Microsoft even if they don't.  Although we would hesitate to say that you can treat Microsoft people differently than anybody else, we think it's fair to say that it's their job to deal with questions and problems related to the Fox line of products, and you can relate to them in that context.

You may be interested to know that senior managers and many of the staff at Microsoft review the forum messages every day.  They are all paying attention to what you have to say and their products reflect this interest.  Also various Microsoft staff members will contribute to the forum from time to time.  They will either have "(Microsoft)" after their name or identify themselves in their signature.


The FoxForum on CompuServe: What To Do If You're Upset

It's not uncommon for people to log onto the forum for the first time because they're upset [image] because they've spent hours and hours working on a problem and can't solve it [image] because something about one of the Fox products doesn't work the way it should or the way they think it should (often there's a difference) [image] because they've tried calling tech support and haven't received an acceptable answer yet [image] because they had something working in one product that suddenly doesn't work in an upgrade.

We understand [image] and it just may be that we can help you if you give us a chance.  If this is true for you, here's what we recommend: First, consider the other forum members (see Manners and Ambience) and second, start your message with, "I'm upset."  Then try to explain your problem as succinctly as possible.  For further guidelines, see Asking Questions.


The FoxForum on CompuServe: Emoticons and Acronyms

As you may have noticed, so far we've been trying to express humorous comments with such things as "(grin)" or "(smile)."  One of the things that most puzzles newcomers is the use of acronyms and what are called "emoticons."

Emoticons

In an electronic medium such as the forum, it's pretty hard to get across certain elements of face-to-face communications that would otherwise be expressed with tone of voice, inflection or body language [image] elements such as humor, irony, sadness and various non-verbal "comments" on what is being discussed.  Consequently, certain conventions have arisen to express those elements.

Technically, an emoticon is an "icon designating emotions" depicted with symbols.  Perhaps the most common of which is:

:-) = a smiling face on its side (tilt your head to the left to read it).

There are literally hundreds of others.  However, we are also using the term to apply to the text-based equivalents that are more commonly used on this forum:

<g>	Grin [image] either the previous comment was meant humorously or one is responding with a laugh to somebody else's humorous comment [image] perhaps the most widely used symbol on this forum.

<s>	Smile [image] usually means that one is smiling at somebody else's comment or could refer to one's own comment that is slightly humorous.

<gd&r>	Grinning, ducking and running [image] the previous comment was a "tease" and the person issuing the tease is now hiding out from his or her target.  Some variations of this are a simple <gd> (grinning and ducking) or <gd&r vvf> (grinning, ducking and running, very, very fast).

<rofl> or <rof,l>	Rolling on the floor laughing [image] the ultimate acknowledgment of somebody else's humor or an indication that you think you just said something yourself that is pretty ridiculous.

"*" or "_" 	As in *emphasize* or _emphasize_ [image] equivalent to italics or underlining.

Creative people on the forum will sometimes make up their own emoticons from time to time but they almost always explain them since nobody would otherwise know what they're talking about <g>.

Acronyms

Many acronyms have also become standard [image] mainly to save typing.  Some of the common ones are explained here.  Any others you encounter, you'll have to figure out for yourself, but once you've got the "trick" down, it's kind of fun.

General CIS-wide acronyms:

BTW	By the way

CIS	CompuServe Information Service

FWIW	For what it's worth

IAC	In any case (also IAE [image] in any event)

IANAL	I am not a lawyer

IMO	In my opinion

IMHO	In my honest/humble opinion (in the latter case a sure sign the opinion is not going to be humble at all <g>)

IOW	In other words

JIC	Just in case

KOW	Knock on wood

OIC	Oh, I see!

OTOH	On the other hand

PITA	Pain in the "acronym"

POV	Point of view

PPN	Programmer project number, i.e. a CIS user's id#

RSN	Real soon now (computer lingo for "don't hold your breath")

RTFM	Read the f* manual (variously interpreted as, read the fine manual, read the fabulous manual, etc.)

TIA	Thanks in advance

TSR	Terminate and stay resident program

WYSIWYG	What you see is what you get

YA...	Yet another .... (as in YAA [image] yet another acronym)

Fox and Xbase Related Acronyms:

FB+	FoxBASE+

FB+/M	FoxBASE+ for Macintosh

FP	FoxPro (1.02, 2.00 and 2.5)

FPW	FoxPro for Windows

API	Application programming interface

CF, C&F	Commands and Functions manual, now known as the Language Reference

DD	Data dictionary

DDE	Dynamic Data Exchange

DLL	Dynamic Link Library

ER	Enhancement request (request for an enhancement to a Microsoft Fox product or documentation)

GUI	Graphical user interface

LLFF	Low level file functions

LR	Language Reference manual

MU	Multi-user

ODBC	Open Database Connectivity

OKL	On key label

OLE	Object Linking and Embedding

OO, OOP	Object oriented, object oriented programming

RW	Report writer

SU	Single user

TP	Transaction processing

UDF	User defined function

UG	User's Guide

XCMD	External command

XFNC	External function

In addition there are a large number of platform specific acronyms and abbreviations such as QEMM, DV, WIN, INIT, CDEV, DA, which you'll either know or can ask about.


The FoxForum on CompuServe: Forum Organization [image] Messages, Threads and Sections

The forum is comprised of individual messages from one forum member to another.  These messages are organized by thread.  A "thread" is simply a string of related messages and replies brought together under a "thread topic," which serves as the "message header" for every message in that thread.

Threads begin when an individual creates a new message (not replying to a previous message) and grow as other individuals reply.  A new thread may also be created when replying to a previous message by changing the topic or posting the reply to a different section.

New threads should be posted to the section appropriate to the topic.

Messages themselves may be either private or public (see Private and Public Messages) and cannot exceed about 10,000 characters in length.  For assistance in composing and posting messages, please refer either to the CIS help files or to the documentation provided with your communications software.


The FoxForum on CompuServe: Message Traffic and Scroll Rate

Message traffic is the number of messages which get posted to a forum in a day.  The volume on the FoxForum is very high [image] ranging from about 100 messages a day when a lot of folks are at the developers conference to as many as 700 messages a day when something really interesting happens (such as a new version of one of the Microsoft Fox line of products).  Message traffic probably averages about 300-400 per day.

A CIS forum is limited to a certain number of message "slots" or total number of messages at any one time.  As messages are posted, the message slots fill up.  When they are full, messages begin to "scroll off" (disappear) on a first in, first out basis (early messages scroll off before later ones).  With message traffic (also called the scroll rate) of 300 messages a day, the first messages in the queue will disappear in about six days.


The FoxForum on CompuServe: Private and Public Messages

Some forums, and this is one, allow members to post private messages to each other.  Private messages can cut down on some of the extraneous messages that everybody has to wade through, but they also take up message slots.  Please delete private messages to or from you when they have been received.  Many forums do not allow private messages because the sysops can't delete them.  However, Microsoft feels that its forum members are responsible enough to delete their own messages so that important public messages will be available longer.


The FoxForum on CompuServe: Asking Questions

The nature of threads and the high scroll rate in this forum frequently have consequences for how you ask questions, how you formulate replies, and how you can help the forum function efficiently.  Details will be included in later discussions where appropriate.

Forum members are very helpful, patient and forgiving [image] no matter what level of expertise you have.  You will almost certainly get an answer to your questions, if you are aware of certain facts of life.

Due to the high message volume on the FoxForum, forum members who read all the messages (and there are many) are trying to keep up with forum traffic, be helpful, earn a living, and live something like normal lives [image] all at the same time.

It's recommended that you check in again within two or three days after you leave a message and that you read all the messages in your thread [image] otherwise you might 1) miss responses that have disappeared due to the high scroll rate and 2) miss responses that may not have been addressed directly to you [image] people tend to reply to the most recent message in the thread rather than going back to your original inquiry.  Any message sent directly to you and not read before it scrolls will automatically be sent to you via CompuServe Mail.

Before You Ask

You are welcome to ask just about anything, but you might want to check out our archives first.

It should be no surprise that over the course of this forum's existence, many questions are asked over and over again and many have already been answered.  But this is FoxPro/FoxBASE+ territory and we've got a solution to this.  We have archivists who patiently and unselfishly accumulate the collected wisdom of the forum messages into database and text files that are available in the Forum libraries.  The database files are in the form of the FoxPro or FoxBASE+ for Macintosh Help file and can be accessed in FoxPro and FoxBASE+ for Macintosh by issuing the command:  SET HELP TO <archive file name>.  They can also be read via BROWSE or EDIT in any flavor of Fox product.  Moreover, FoxPro users can take advantage of several programs that were written specifically to view the file.  If your question is one of the most common, you may be directed to the archives [image] especially the databases [image] for an answer, and if you use the Microsoft Fox line of products a lot, you'll want them anyway [image] they're an invaluable resource.

For more information, see Libraries.

Phrasing Your Question

The way you phrase your question can make a big difference in the kind of response you get.

Here's the "worst case" question [image] one that forum members will want to avoid (tech support will answer, of course, but you may be missing an opportunity to get a speedy reply from someone else):

"I just got Fox and it doesn't work.  Can anybody help?"

Obviously, the first things anybody has to ask are:  Which of the Fox products are you using and what version of it?  What do you mean it "doesn't work"?  Just finding out the basics could take quite a bit of time.

So, here are some guidelines:

Be specific.  Tell us exactly which Fox product you're using and include the version and platform. Be sure to post your message in the appropriate section of the forum.

Tell us whether you are writing a program or using a Fox product interactively.

Tell us exactly what error messages you are getting, if any.

Tell us what you are trying to do, what you did just before the problem occurred, and exactly what happened.

If it's a programming problem, post the actual bit of code that you think is causing the problem or a close approximation.

For really difficult problems, it helps to post code that can be extracted from your message and run without modification.  Obviously, if this involves data files, it helps to know what files are needed, what their structures are, what kind of fields they have, and how they relate to each other.  However, for brevity's sake, try to post something that's informative but not necessarily complete.  If further action is required, you can begin to fill in the details.

In addition:

Post your question to the proper forum section.  Some forum members only read messages in specific sections [image] if you post in the wrong place, the person with the answer might not see it.  And choose a suitable, informative, and specific topic for your message.  "Debugging UDFs" in the Report Writer section will almost certainly get a better response than "HELP!"

Post any program code unformatted.  CompuServe normally "formats" or "word wraps" code that's uploaded to the forums [image] it strings all the lines together if they are not separated by a completely blank line.  This will turn your carefully indented code into a garbled mess that is very difficult to read.  You can avoid this when you're online with CIS by using the "POST UNFORMATTED" command.  With various programs such as TAPCIS or Navigator (that allow you to read and respond to messages off-line), use their "Unformatted" option.  You may also insure proper indentation by preceding each line of code with one or more spaces or a tab.

Roughly, if you're having a problem with an error that is listed in the documented error messages (per the manuals for the product), please provide us with the version of the product you have.  Each version of a Microsoft Fox product has a version date as well as a number and you can get the version date by typing "? VERSION(1)" (without the quotes) at the dot prompt (FoxBASE+) or the command window (FoxPro or FoxBASE+ for Macintosh).  If you're having a problem with a Runtime version, you need to use a development version to write and compile a program that shows the version date and then run it under Runtime.

Roughly (again) if you're having a problem which appears to involve the way a Fox product interacts with your hardware such as loading or operating slowly, not loading at all, running out of memory or disk space, operating in Windows or DesqView, running under QEMM, running on a network, etc., please be as specific as possible about your operating environment, perhaps including your operating system (MS-DOS 3.3, MS-DOS 4.1,  MS-DOS 5.0, Mac System 6.05), your CONFIG.SYS, AUTOEXEC.BAT, Windows .PIF settings, DesqView settings or your Mac INITs, type of network, network settings, and so on.

Uploading Files

If you have a very difficult or complex problem, it may eventually be resolved only by sending it to someone else for review.  There are two approaches:

If tech support specifically requests that you send them your problem (and at no other time), upload it to the forum libraries.  Problems sent this way will be treated as private communications [image] however, if you want to have the problem reviewed by non-Fox folks, you may specifically ask the sysops to post it publicly to the libraries.  Uploading to forum libraries is free of connect charges so this is definitely the most efficient way to send things to Microsoft.

If a non-Microsoft forum member has been assisting you, you can send your problem to him or her via CompuServe mail.  However, there is a "rule" about this:

DO NOT UPLOAD ANYTHING TO ANYBODY WITHOUT THEIR SPECIFIC PRIOR APPROVAL.

Downloading something from CompuServe costs the recipient money in phone and CIS connect charges.  Many active forum members use automated programs to download their messages and files and these programs do not give them the chance to refuse a download [image] anything in their box is downloaded automatically.  It's simply not fair to impose this burden on them without their consent.  The above rule also means that if somebody has been kind enough to look at something before, it doesn't necessarily mean they want to look at it again.  It's a simple matter to request and receive permission before you upload.

In either case, when you upload something to somebody, be considerate again [image] send them the minimum that's necessary to "get the job done", in other words, give them the information they need to assist you (a small sample program with sample .DBF files, etc. if possible) and compress the file (using PKZIP for DOS or Stuffit for the Mac) to reduce transmission time.


The FoxForum on CompuServe: Responding to Answers

If you have asked a question and someone has replied with an answer, read what they have to say carefully.  If they've solved your problem, great! If they haven't, but are trying to help, answer their questions.  Remember they may be in a hurry, or have misunderstood your question or situation, or may even be telling you something incorrect (not on purpose, of course), so if you don't understand something they say, don't be afraid to say "I don't understand."

Acknowledgments

If somebody helps you out, a simple "Thanks!" is appreciated.  However, these simple messages add to the forum message traffic and take up precious message slots.  If you want to thank a lot of people, generally one "thanks, Bob and Ann" message will suffice.  If you're thanking just one person, post it privately (and make sure to delete it when it's received) or, better yet, send it via CompuServe mail.

If you've had a particularly knotty problem that appears to have been a challenge to resolve and/or if many people have made a lot of different and possibly conflicting suggestions [image] when you've finally got it working, we'd appreciate knowing what exactly you did that worked.  The reason we appreciate this kind of summary is because many of us may have or anticipate having the same kind of problem.  In addition, it may be valuable to the forum archives.

If You Don't Get an Answer

If you leave a message and nobody responds, it may be because it "just happens" that nobody has time to respond, because everybody simultaneously decides that "somebody else will answer," or because your message was unclear and nobody knew how to respond.

You can increase your chances of having a response to your message by:

Posting your message again [image] and saying that your original message was not addressed.

Posting your message directly to a sysop or to "all."

Rephrasing your message.


The FoxForum on CompuServe: Thread Integrity and Continuity

As we mentioned earlier, the message traffic on the FoxForum is very high, averaging 300-400 messages a day.  It can be quite a chore to manage this volume of communication and keep CIS connect charges to a minimum.  Here are a variety of hints that may prove useful.

All forum members, experienced and novice, benefit from the forum threads.  Often a thread will address a problem that many other forum members have or anticipate having.  Consequently, it is important that all messages that contribute to the thread remain available during its lifetime (thread integrity).  In addition, it's extremely useful if relevant messages are contained within the thread and in the proper order (continuity).  With this in mind:

Public messages should not be deleted if they contribute to the thread.

Relevant responses to existing messages should be generated by replying to the message rather than starting a new message.

Multiple-part messages, as much as possible, should be kept together.

Related to this issue is the "other side of the coin" where messages are no longer relevant to the topic.  It is possible on CIS to scan available messages by "message header" or thread topic.  This can be a useful approach if you're trying to save on connect charges.  However, this is not guaranteed to be a foolproof approach.  Threads on this forum tend to wander, and strict adherence to a thread topic is not rigorously enforced.  Consequently if you're downloading a thread whose topic looks interesting, you may discover:

The messages have wandered off the thread topic.

The messages have deteriorated into a series of jokes.

At a rough guess, some of us estimate that the really relevant messages in a thread are the first 1 to 10, although that is not necessarily the case [image] when a topic is complicated, messages may still be useful during the thread's entire life or, OTOH, a thread may deteriorate into jokes almost immediately.  Unfortunately, due to the high message traffic, the beginning of a thread may scroll off so that all that remains in the forum are the less relevant messages.  This is not to say that the messages which aren't relevant to the topic aren't useful [image] indeed, they are frequently useful [image] and the jokes are often good, too.


The FoxForum on CompuServe: Message Etiquette

In consideration of forum members who do not read all the messages (those who download the threads whose topics sound interesting) and to support thread integrity and continuity, please observe the following suggestions:

Please post your message to the most applicable section.

When starting a new thread, try to name it something that captures the essence of your message and be as specific as possible.

When replying to a message, if your reply is substantially changing the subject, please post it under a different topic and to a different section if applicable.

If your reply is directly relevant to the current topic, please don't post it to a different topic or section.  Use CIS or your off-line software to reply to the message.

If you want to make sure that a specific person sees your message and sees it as quickly as possible, make sure you address it specifically to him or her and be sure to include his/her CIS ID number.  This is important because:

Some people read only messages addressed directly to them and will miss your message entirely.  (Note: reading only personal messages is not recommended practice in this forum because you will almost certainly miss further possibly relevant messages in a thread.)

Many active participants will read their personal messages during the day and download everything else in the evening [image] so they might not see a particular message until later.

If the message scrolls off before the addressee sees it, CompuServe can not forward it to CompuServe mail without an ID number.

Long messages: If you have a particularly long message, remember that individual messages are limited to about 2,000 characters.  When a message exceeds that limit, you can either send it via CIS Mail to an individual or you can split it into parts and post it on the forum.  CIS Mail has a very high message length limit, but no one on the forum will see messages sent that way.

In the interests of thread integrity and continuity:

Post long messages that are relevant to an existing thread, or that are of general interest, to the forum not to CIS mail so we can all benefit.  Other long messages may of course be posted as well.  If you find that you seem to be engaged in a topic that is not particularly Fox-related or is really a conversation between you and one other person, consider moving that conversation to CIS mail (you might want to ask first to see if anybody has been following the conversation and would like to see it continue).

There are two approaches to splitting messages which are a little contradictory.

First, there is an option called /SPLIT (please refer to CIS help or your CIS communications software documentation).  By inserting /SPLIT at the bottom of a message, the next message you send will automatically continue the message.  The benefit of /SPLIT is that it keeps the parts of your message together when they are posted.  The drawback is that subsequent messages are addressed to you rather than the person to whom you were originally replying.  Since (as mentioned earlier) some people read only messages addressed directly to themselves, these people will not see the continued parts (or may not see them until later).

The alternate approach is to send continued messages by simply continuing to reply to a message and manually inserting "more" and "continued" in your messages as appropriate.  The benefit of this is that the intended recipient will be sure to receive all parts of the message in a timely fashion.  The drawback is that messages split this way may not get posted together and can be interrupted by other replies (which impairs continuity).

Rule of thumb: Use /SPLIT unless you want to guarantee that the recipient will see all parts or all parts as soon as possible.  In the latter case, continue to reply.


The FoxForum on CompuServe: Deleting Messages

If someone sends you a private message, please delete it (after you read it) so that it will not take up a message slot.  Private messages can be deleted only by the sender or receiver so the sysops can not sweep them out when they have been received.  Sysops can delete public messages and may delete simple "thank you" notes when they have been delivered.  Do not delete public messages if they are relevant to a thread.  Do delete public messages that were garbled or duplicated in transmission, that contain errors or misstatements, or that were ill-considered (in this particular case, "repent in haste" <g>).


The FoxForum on CompuServe: Online vs. Off-Line

CIS connect charges are high and FoxForum message traffic is high [image] the two can combine to deliver whopping credit card bills (not, unfortunately, much to joke about).  If you plan to frequent the forum or other CIS forums, it is highly recommended that you investigate several programs that download and upload forum messages in a more efficient and less costly way.

Note: CompuServe offers a product called CIM (CompuServe Information Manager) for both the PC and the Mac which is useful to manage your work on CIS [image] however, it mainly works online and will not reduce your connect charges as much as some of the other products that are available.


The FoxForum on CompuServe: Sysops

Forum sysops are the people who keep the forum running smoothly.  They handle chores such as making sure uploaded files are free of viruses, keeping order in the threads, managing the libraries, answering questions about the Microsoft Fox line of products, and offering technical support.  The forum sysops, and their CIS identification numbers change from time to time so we won't give you a detailed list here.  A list of current sysops is published frequently in a public notice on the forum.

Tech support questions should be addressed to "sysop" or "all."  Avoid sending questions to a specific sysop because these people's assignments change frequently. The tech support sysops keep a close eye on all messages and may respond if no one else has given you an answer [image] however, to get the quickest response from tech support, a message directly to them is most effective.

Tech support may download messages in groups.  If your messages are posted afterwards, you may not receive a response from the sysops until the following day (Monday, if you miss the last Friday download).  Response time from tech support is also dependent on the message traffic and other factors.  For instance, Monday's download, a download after a holiday, or a day of high message traffic may take longer for tech support to process.

If you want to order a demo of one of the Microsoft Fox line of products, order a product, or request an upgrade, do so through the new MSIC (Microsoft Service and Information Center) forum for non-technical information, product orders, and so on.


The FoxForum on CompuServe: Libraries

The forum libraries contain many informative and useful files.  An exploration of the libraries is well worth the trouble.

Files in the libraries come in two basic forms: ASCII and binary.  ASCII files are text files that will be readable without further attention.  Binary files are either files (including text files) that have been compressed to save space and downloading connect charges or other binary files such as programs or graphics files.


The FoxForum on CompuServe: Compressed Files

There are several types of compressed files:

File Type	Description
.ZIP files (DOS/Mac)	Compressed using PKZIP [image] these are uncompressed by using PKUNZIP.EXE.  PKZIP/UNZIP are shareware programs available in the forum libraries under the name PKZ110.EXE.  PKZIP/UNZIP are DOS programs, but files archived this way may be unzipped by Mac users with UNZIP.SIT.
.EXE files (DOS/Mac)	Mostly this extension indicates that the file is a "self-extracting" compressed file.  This means that the file will unpack itself when you type the file name.  Usually these files are also compressed using PKZIP [image] however, because they're self-extracting, they do not require PKUNZIP.  UNZIP.SIT (Mac) should also work on these files but you will need to include the .EXE extension when you are referencing the file.  Sometimes .EXE files may be compressed using another compression method and UNZIP.SIT won't work in that case.
.COM files	Sometimes also self-extracting files.  Unless the person who provides the file reveals the compression method, it may not be possible for Mac users to uncompress using UNZIP.SIT.
.ARC files	Compressed using Arc utilities or such commonly available compatible programs as ARC-A.COM.  Can be uncompressed with ARC-E.COM, available in the IBMCOM forum, and elsewhere (look for ARC-E.COM and ARC-E.DOC).
.SIT files (Mac)	Compressed using Stuffit and uncompressed with UnStuffit.  Stuffit (including UnStuffit) is shareware and is located in the MACNEW forum.  Look for STUFFI.SEA [image] a file that "installs StuffIt Classic 1.6 to your disk.  This version fully supports both StuffIt 1.5.1 and StuffIt Deluxe Archives.  It compresses files much smaller than 1.5.1 and is easier to use.  It has many new features."
.CPT files (Mac)	Compressed using Compactor Pro.
.SEA files (Mac)	Self-extracting Compactor Pro and Stuffit files.

Note   Several forum members have reported that downloading Macintosh files (.SIT, .SEA, etc.) to a PC and then transferring them to the Macintosh corrupts the files and make them unreadable on the Macintosh.


The FoxForum on CompuServe: Updates to Fox Products

Patches are available for various FoxPro products in an update library.  There is also a READ.ME file that explains how to apply the patches.  It is extremely important that you read the READ.ME file before you proceed.  When you are reading this file, pay special attention to the product that you must patch.  Patches are cumulative and only one patch is required per product to bring it up to date.  This may change as we refine patching techniques, so be sure to read the READ.ME file carefully.

In addition to the patches themselves, Microsoft has provided change logs which list all changes to FoxPro between patches.  As changes are made, a new change log is added to the libraries (they are not cumulative).  If you review the change logs and do not see any changes that would affect you, you do not need to apply the patches [image] although you may wish to do so to stay current.  If you run into a problem that Microsoft tech support cannot duplicate, techs may ask you to install the patches in case your problem has already been addressed.

Patches are also available on disk by requesting them from tech support.


The FoxForum on CompuServe: Downloading Files

Scanning the library listings for files to download can often be rather confusing.  This is especially true if you're trying to scan them online.  To make things slightly less confusing, we recommend first downloading either the file FOXFIL (.ZIP or .SIT) or the file LIBDBF (.ZIP or .SIT) that contains all library listings, updated approximately monthly.

It's somewhat confusing that updates to files may coexist with earlier versions.  Usually the file name and narrative make it clear which is the most recent and the date will also provide a clue.  For instance, PROER5 is an upgrade to and replaces PROER4.  (Note to people uploading files: You can help alleviate this problem if you upload a revised file under a different name, by deleting the old file yourself at the CIS Library menu.)

However, some upgrade files are not replacements to prior files but additions to them.  For example, the updates to the second forum archive THREADS2.DBF are named THD01, THD02, etc.each of these files contains completely separate information and should be appended (preferably in order and using the updating programs) to THREADS2.DBF.

Note   When files are uploaded, there is a delay between the time they are sent and the time they are merged into the libraries.  This time is needed to check for viruses and evaluate the suitability of the file for the FoxForum.

Note   Several forum members have reported that downloading Macintosh files (.SIT, .SEA, etc.) to a PC and then transferring them to the Macintosh corrupts the files and make them unreadable on the Macintosh.


The FoxForum on CompuServe: Uploading Files

Most files in the libraries have been uploaded by forum members for use by other forum members and we encourage you to do the same.  If you have developed a utility or a function or a bit of code or have some particular information to share that appears to spark general interest, please send it on up.  Remember, uploading to forum libraries is free of connect charges.

If tech support specifically requests it (and at no other time), you can also upload code you're having a problem with and which appears to be too lengthy or complex to post on the forum itself.

The mechanics of uploading a file can be fairly tricky.  Please refer either to CIS Help or your CIS communications software documentation.  If you want additional help, CIS has a practice forum (GO PRACTICE) where you can practice uploading a file, writing messages, etc.  Time spent in the practice forum is free of connect charges.

Here are some guidelines for uploading:

Combine and compress any files you are sending into one archived file using PKZIP (DOS) or Stuffit (Mac) or the self-extracting options of other compression schemes.

For some reason, CIS limits file names in libraries to only six characters (not including extension).  It's better if you limit your file name to six characters yourself [image] otherwise CIS may truncate the file name in a way that you don't really want.  File names should begin with a letter and contain only letters and numbers.  They should not contain spaces or punctuation (including underlines and hyphens), or miscellaneous characters such as * or ^.

When uploading, please include a brief but complete description of the files included and what they do.  If space allows, we always like to see the name of the person who's sending it and a note about how large the file will be when uncompressed (disk space is sometimes tight).

The sysop will check the file for viruses and perform some other maintenance.  Consequently, it may be a few days before the file becomes available to others.

Let people on the forum know that you've uploaded the file, what its name is, and where you sent it.

Note   If you are uploading a file with the same name as a file you  previously uploaded, the old file will be replaced with the new one.  However, if you are uploading a revision and want to use a new name, please help with library housekeeping by deleting the old file yourself using the CIS Library Menu.


The FoxForum on CompuServe: Afterword [image] The Spirit of Contribution

One of the things we feel distinguishes the FoxForum from many others is the very unselfish way forum members help each other day after day.  We feel there is an underlying intent on the part of most forum folk to make a contribution to others on the same path.  We also feel as long as this "spirit of contribution" remains a force, the forum will work well for all of us.

You can really help maintain the value of the forum by logging on with an intent to contribute.  If you want to ask a question, ask it with an eye toward contributing to our knowledge as well as yours.  Share experiences that you feel will be of value to others.  Answer the questions of others.  And try, especially, to keep to the public agenda and avoid self-promotion.

There's certainly opportunity on the forum for vendors of products and services to offer their wares (in moderation), and vendors are just the kind of people we need to help us.  Yet it's always a little irritating when we see a vendor log on only to promote something while so many others are helping for free.  If you are a vendor, hang around a little and contribute; give back a little to the community that supports you.  (And from a purely practical point of view, establishing a helpful presence on the forum should serve to enhance your marketability.)

Although making a contribution is always a source of personal satisfaction, we firmly believe that there's more at stake here [image] we are building a community that can support us in our work and in our lives.  We think that's something worth investing in [image] contribution is truly an investment in our future.


Troubleshooting

Information in this section has been extracted from the FoxPro Resource Kit. The Resource Kit is a troubleshooting aid that is distributed in its entirety on CD-ROM as part of the Microsoft Developer Network (MSDN) and TechNet programs. For more information on these programs, call Microsoft Consumer Sales at 1-800-426-9400 in the United States or contact your local sales office or subsidiary.

Troubleshooting Basics

How To Troubleshoot a Problem

How To Perform a Clean Boot

Suggested Solutions for Error Messages

Installation and Setup Error Messages

Network Error Messages

Printing Error Messages

Internal Consistency or Transgressed Handle Error Messages

Insufficient Memory

Connectivity Kit Error Messages

General Protection Faults

Tips from the Engineers

Top 25 Common Issues

Top 20 Coding Errors


How To Troubleshoot a Problem

See Also

This topic presents troubleshooting methods for solving problems that you might encounter while using FoxPro or while running your FoxPro application.

Error Messages While Using Microsoft FoxPro

If you encounter an error message while using Microsoft FoxPro and you are not running a program:

Look up the error message in the list of Error Messages in this help file. Each error message topic gives more detail on the cause of the error.

Look under "Suggested Solutions for Error Messages" in the Troubleshooting topic for possible solutions.

Unexpected or Undesirable Behavior While Running Your Application

If you are running a program, screen, or query that you created:

Identify the specific line of code causing the problem. For help in doing this see "The Trace and Debug Windows" section later in this topic.

Note   If you need to contact Microsoft Product Support, please be ready to provide a small code sample which can be used to reproduce your problem.

Error Messages While Running Your Application

If you are encountering error messages while running a program, screen, query, or application:

Identify the specific line of code which is causing the problem. See "The Trace and Debug Windows" and "Debugging Your Code" section later in this topic.

Look up the error message in the list of Error Messages. Each error message topic gives more detail on the cause of the error.

The Trace and Debug Windows

To analyze your code, use the Trace Window to step through your code as it is executing. You can use the Debug Window to check the values of variables, fields, functions, and expressions while stepping through your code.

Both the Debug window and Trace Window can also be used to set breakpoints in your code. When the breakpoint is activated, and your code stops executing, you can step through the code line by line.

Debugging Your Code

To determine which line of code is causing an error message, place the following line at the start of your application:

ON ERROR Do ErrHand WITH LINENO(),PROGRAM(),ERROR(),MESSAGE()

This line instructs FoxPro to call a procedure called ErrHand when an error occurs. The procedure ErrHand displays information about the error. Ensure that the ON ERROR command is not used elsewhere in your application. Subsequent use of this command will override the ON ERROR command shown above.

The code for ErrHand should be added to the top level program in your application:

PROCEDURE ErrHand

PARAMETERS mLine,mProgram,mError,mMessage

DEFINE WINDOW ShowErr FROM 10,10 TO 19,60 ;

TITLE "AN ERROR HAS OCCURRED"

ACTIVATE WINDOW ShowErr

@ 02,01 SAY "   Line: " + LTRIM(STR(mLine))

@ 03,01 SAY "Program: " + mProgram

@ 04,01 SAY "  Error: " + LTRIM(STR(mError))

@ 05,01 SAY "Message: " + mMessage

= INKEY(0)

RELEASE WINDOW ShowErr

RETURN

When this error window is displayed, it will indicate the program in which the error occurred, as well as the number of the line that was executing at the time.

Before You Call Product Support

After trying these steps, be prepared to explain how to reproduce the problem. If the problem involves an application that you wrote, reduce the code to the smallest size necessary to reproduce the problem and be willing to share this small code sample. If the problem involves using FoxPro, be able to explain the exact steps that must be followed to reproduce the problem. If the problem requires data, please use one of the sample tables (such as CUSTOMER.DBF) that are included with FoxPro.


See Also

Troubleshooting

Debug Window

Error Messages

Trace Window


Solutions for Installation and Setup Error Messages

Locate your error message in the table below. The letters to the right of the error message correspond to suggested solutions listed below the error message table.

For error message:	Try solutions:
Not enough disk space	A, B, C, E, H
Please call Technical Support	A, C, E, I, J
Cannot change properties of FOXPROW.EXE	C, E, F, J, M, N
Could not write to file named SETUP.INI	Q
Sharing system resources exceeded	B, E, K, L
The path you specified for FoxPro does not exist or does not begin with a drive letter	A, C, E, M
File in use by another	B, D, E, M, N
System resources exhausted	B, C, E, K, L
Sharing violation reading drive . . .	B, C, D, E, M, N
Data error reading drive . . .	A, B, E, U
Too many files open	B, E
FoxPro SETUP.EXE continually asks for the same diskette.	C, E, G
File access denied	A, B, D, E, M, N, O, U
Cannot find DDEML.DLL	A, C, E, L, R
FoxPro sign on screen shows that the registered owner is Microsoft Corporation and that the registered company is (Engineering Prototype).	P, R
Could not create directory . . .	A, C, E, S, T
Suggested Solutions:

A.	Run CHKDSK /F to correct file allocation table errors and to determine amount of free space on drive.

B.	Ensure sufficient file handles:

In CONFIG.SYS, check the FILES statement:

FILES = 99

In NET.CFG = or SHELL.CFG, check the FILE HANDLES statement:

FILE HANDLES = 99

In AUTOEXEC.BAT, if SHARE is loaded, check the /F and /L parameters:

SHARE.EXE /F:5120 /L:500

C.	Perform a clean boot (See How to Perform a Clean Boot).

D.	Mark .EXE, .ESL (Distribution Kit), .FLL, .DLL, .BMP, .MSK, .APP, FOXRUN.PIF and FOXUSER.DBF (if it is shared) files as read-only.

E.	Ensure that the latest network patches or drivers are used.

F.	Disable virus protection programs.

G.	Use the DRIVPARM /D:<drive number>  /F:<drive type>  in CONFIG.SYS.

H.	Free up disk space by deleting unnecessary items. 15 MB is recommended for a full installation of FoxPro for Windows.

I.	Try using NETx driver instead of EMSNETx and XMSNETx.

J.	Ensure that each user who installs FoxPro has READ, WRITE, DELETE, CREATE and MODIFY rights for the directory into which FoxPro is being installed.

K.	Add \NUMHANDLES = 128 to the HIMEM.SYS line in CONFIG.SYS:

DEVICE=HIMEM.SYS /NUMHANDLES = 128

L.	Turn off disk caching.

M.	Log in as SUPERVISOR or Network Administrator.

N.	Ensure that no other users are logged onto the network volume that FoxPro is being installed in.

O.	Ensure that the person installing FoxPro for Windows has READ, WRITE, DELETE, CREATE, and MODIFY rights to the shared Windows directory (if Windows is being shared).

P.	Installation of FoxPro for Windows was not completed. Re-install FoxPro.

Q.	Remove the write-protect tab from the first installation diskette.

R.	Re-install FoxPro for Windows in a clean sub-directory.

S.	Re-install FoxPro for Windows into a less complicated directory structure. The largest directory structure supported by MS-DOS is 66 characters long.

T.	Make sure that you do not have too many entries in your root directory. Try deleting some unnecessary items.

U.	Diskettes could be bad, or if using a SETUP /N, the administrative copy of FoxPro for Windows could be corrupted.


Solutions for Network Error Messages

Locate your error message in the table below. The letters to the right of the error message correspond to suggested solutions listed below the error message table.

For error message:	Try solutions:
Not enough disk space	A, D, F
Please call Technical Support	C, H, I
Cannot create program workspace	D, I
Link command failed	A, D
Sharing system resources exceeded	A, D, J, K
File does not print	D, L
File in use by another	A, B, C, D
System resources exhausted	A, D, J, K
Sharing violation reading drive...	A, C, D, I
Peer to peer networks	B, C, D, E, G, I
Too many files open	A, D
Duplicate redirection	D, M
File access denied	A, D
Data corruption	D, K
Suggested Solutions:

A.	Ensure sufficient file handles:

In CONFIG.SYS, the FILES statement:

FILES = 99

In NET.CFG = or SHELL.CFG, check the FILE HANDLES statement:

FILE HANDLES = 99

In AUTOEXEC.BAT, if SHARE is loaded, the /F parameter:

SHARE.EXE /F:5120 /L:500

B.	Issue the SET EXCLUSIVE OFF command or use EXCLUSIVE = OFF

C.	Mark .EXE, .OVL, .RSC (FoxBASE+), .ESO (Distribution Kit), .ESL (Distribution Kit) and FOXUSER.DBF (if it is shared) files as read-only.

D.	Ensure that the latest network patches or drivers are used.

E.	It may be possible to increase performance of a peer-to-peer network by loading the server software into high memory. Please refer to the DEVICEHIGH and LOADHIGH commands for more information on how to load this software into high memory.

F.	If the network is Novell Netware, issue the NDIR statement at MS-DOS prompt to ensure the file has a proper owner. If the owner is "NA" give the file a proper owner.

G.	If you have Novell Lite, do not load NetBios.

H.	Use NETx driver instead of EMSNETx and XMSNETx if at all possible.

I.	Verify TMPFILES, PROGWORK, SORTWORK, and EDITWORK are directed to a valid directory with enough space for temporary (.TMP) files. It is better for performance to place .TMP files on the local drive. If a local drive is not available, ensure that each user who installs FoxPro has READ, WRITE, DELETE, CREATE and MODIFY rights for the directory into which FoxPro is being installed.

J.	Add NUMHANDLES = 128 to the HIMEM.SYS line in CONFIG.SYS.

DEVICE=HIMEM.SYS /NUMHANDLES = 128

K.	Minimize or turn off disk caching.

L.	Issue SET PRINT TO to release the print job to the queue.

M.	Make sure the user is logged in to only one workstation.


Solutions for Printing Error Messages

Locate your error message in the table below. The letters to the right of the error message correspond to suggested solutions listed below the error message table.

For error message:	Try solutions:
No printed output until exiting FoxPro	C, D, F
No printed output using @...say or ? commands	A, B, C, D, F
Cannot print a report created with the report writer	A, B, C, E, F
Garbled pr partial printed output on network	A, B, C, F, G, H, I
Suggested Solutions:

A.	Verify that a file can be printed from MS-DOS by typing in the following command at the MS-DOS prompt:

COPY autoexec.bat LPT1:

B.	If running Windows, ensure that it is possible to print from other Windows applications. Recommended tests are:

1.	Print a large bitmap file from Paintbrush to verify that there is not a problem with printing large, graphical files from Windows.

2.	Print a .WRI file from Write using the same font that is being used in FoxPro to verify that there is not a problem with fonts.

C.	Try a simple printing test, such as the following:

DISPLAY STATUS TO PRINTER

SET PRINTER TO

D.	Use the SET PRINTER TO command after SET PRINTER OFF or SET DEVICE TO SCREEN commands to release the print job. (Note: You may need more than one SET PRINTER TO command if there is more than one spooler, such as Windows' Print Manager and a network spooler.) Example:

SET PRINTER ON

? "This is a test."

SET PRINTER OFF

SET PRINTER TO

E.	Create and print a Quick Report in FoxPro using a database in the Tutorial subdirectory to ensure that a basic report prints correctly.

F.	If on a network, try printing to a local printer to determine whether there is a problem on the network.

G.	Try increasing the time-out value for the network print queue.

H.	Verify that SET TEMP in the AUTOEXEC.BAT file is set to a valid directory.

I.	Try a clean boot configuration to determine whether the problem is being caused by the environment. (See How to Perform a Clean Boot)


Solutions for Internal Consistency or Transgressed Handle Error Messages

Locate your problem in the table below. The letters to the right of the error message correspond to suggested solutions listed below the table.

For this problem:	Try solutions:
Error encountered while printing	A, B, D, E, F, H, L, M
Error encountered on network	A, B, D, E, F, H, J, N, O
Using Windows 3.0	A, B, D, E, F, H, K
Error encountered while using Report Writer/Label Generator	B, C, D, E, F, H, I, K
Error encountered using RQBE	B, C, D, E, F, H, I, K, M
Error encountered running or creating screens	B, C, D, E, F, H, I, K
Error encountered opening DBFs	B, C, D, E, F, H, I, K
Error encountered using LCK or Library	B, D, E, H, N, P, Q
Error encountered using new hardware	B, D, E, H
Error encountered issuing RUN command . . .	B, D, E, F, G, H
Suggested Solutions:

A.	If running Windows, change your video driver to standard VGA.

B.	Remove extra device drivers and TSRs in CONFIG.SYS and AUTOEXEC.BAT. (See  How to Perform a Clean Boot)

C.	Recreate your index.

With an IDX file, delete the index file, and recreate.

With a CDX file, DELETE TAG ALL, and recreate tags.

D.	Remove disk caches (both hardware and software).

E.	Delete or rename CONFIG.FPW, FOXUSER.DBF, FOXUSER.FPT.

F.	Increase files the number of files:

In CONFIG.SYS, FILES = statement

In SHELL.CFG, FILE HANDLES =  statement

In AUTOEXEC.BAT, delete SHARE or add /F=5120 /L=500 to SHARE line.

G.	Increase shell environment in CONFIG.SYS.

H.	Run CHKDSK or SCANDISK (MS-DOS 6.2).

I.	Recreate your database by following these steps:

Issue COPY STRUCTURE to create a new file.

USE new database.

APPEND FROM old database.

J.	Place following command in AUTOEXEC.BAT:

SET FOXPROW = -SAVEREGS

K.	Increase the MEMLIMIT setting in CONFIG.FPW. For example, the following statement allocates 80 percent of your system's available memory to FoxPro with a minimum allocation of 4096K and a maximum of 8192K:  MEMLIMIT = 80, 4096, 8192

L.	Change the printer driver.

M.	Remove third-party fonts.

N.	If running Windows, exclude upper memory:

In CONFIG.SYS, add x=a000-FFFF on the EMM386 line

Issue WIN /D:X to start Windows

O.	Use latest network drivers.

P.	Use _SetHandSize( ) to set handle size.

Q.	Free all locked handles


Solutions for Insufficient Memory

Locate your situation in the table below. The letters to the right of the error message correspond to suggested solutions listed below the table.

For this situation:	Try solutions:
Stand-alone system	A, B, C, E, F, G
Network system	A, B, C, D, E, F, G
Using large memo fields	A, B, C, E, F, G, I
Using large array	A, B, C, E, F, G, I, J
Using run command	K
Using large number of bars in popup	H
A.	If running FoxPro for Windows, add the MEMLIMIT option to CONFIG.FPW. This option will allow FoxPro for Windows to use more memory than the default of approximately 1.5 MB. See the Installation and Configuration manual (page. 3-4 and 2-7) for more details on MEMLIMIT.

B.	Perform a clean boot. (See  How to Perform a Clean Boot)

C.	If running FoxPro for Windows, increase virtual memory. In the Windows Main group, select the Control Panel icon. Inside the Control Panel, select Enhanced, and Virtual Memory. Increase the amount of Permanent Virtual Memory (if applicable).

D.	Ensure latest network patches or drivers are used.

E.	Add EMM386 to CONFIG.SYS, then use LOADHIGH and/or DEVICEHIGH to place TSR and device drives into high memory. This allows you to increase the amount of free conventional memory. See your MS-DOS documentation for more information.

F.	Reduce the size of software and hardware disk caching.

G.	Ensure the path for temporary files is valid, and has at least 5 MB of free disk space available. Clear out any unnecessary files.

H.	Reduce the number of bars to less than 400.

I.	Release any unnecessary memory variables.

J.	Make the array less than 65,000 elements (65K is the maximum number of memory variables).

K.	If running FoxPro for Windows, increase or decrease memory in PIF settings as necessary.


Solutions for Connectivity Kit Error Messages

Locate the characteristics of your error, and the driver you are using, in the table below. The letters to the right of the error message correspond to suggested solutions listed below the table.

For error characteristics:	Try solutions:
Does not contain "FPSQL", "ODBC" or text in square brackets. Any driver.	A, E
Begins with "FPSQL". Any driver.	B, E
Does not contain "FPSQL". Contains text in square brackets. Driver not purchased from Microsoft.	C, E
Does not contain "FPSQL". Contains text in square brackets. Message contains "[Microsoft]" followed by "[ODBC Single-Tier Driver]" or "[driver name]". An ODBC Desktop Database or ODBC SDK driver.	D
Does not contain "FPSQL". Contains text in square brackets. SQL Server or Oracle driver from Connectivity Kit, or ODBC Desktop Database or ODBC SDK driver.	E
Suggested Solutions:

A.	Error is generated by FoxPro and is unrelated to connectivity. Look in other Troubleshooting topics for this error message.

B.	Error is generated by the Connectivity Kit. Look up the error message in the Error Messages appendix of the Connectivity Kit User's Guide.

C.	Look for vendor name in square brackets. Contact that driver vendor for assistance.

D.	Call Microsoft ODBC support at (800) 936-5900.

E.	Call Microsoft FoxPro support at (206) 635-7191.


Solutions for General Protection Faults

A GP fault signifies that something unexpected has happened within the Windows environment, usually an improper memory access. In other words, something running within the Windows environment has made a call to a location in memory that it did not have access to, potentially overwriting and corrupting other program code in that area of memory. More specifically, an application or Windows component might read or write to a memory location that it has not preallocated, or memory that it does not "own." All memory management within Windows is handled by the Windows environment itself, and when applications and Windows components directly access memory, the result is often a GP fault.

The only other causes of GP faults are corrupted files or faulty hardware. Sometimes, when a file in Windows or FoxPro becomes corrupt, the system will know that there is a problem, but will be unable to report it correctly, and will return a "generic" error.

Isolate the Problem

When does it occur?

•	Certain part of code?

Copy the code into blank .PRG, and test whether it reoccurs. The original file may be corrupt.

Occur in all applications?

If it happens no matter what's running, the problem is a Windows issue. Please contact the Windows Support Group at (206) 637-7098, or check the Windows Resource Kit for possible solutions.

Check Configuration

On a network?

1.	Novell Netware:

Check SHELL.CFG or NET.CFG for "file handles = ". This should be the same as the FILES =  line in CONFIG.SYS. MS-DOS allows 254 file handles between the two files.

In AUTOEXEC.BAT, check for the line C:\DOS\SHARE.EXE. Some Windows applications will load this by default. Novell Netware handles its own file sharing, so this device can cause a conflict. Comment this line out, or remove it completely.

2.	Lantastic:

As a peer-to-peer network, Lantastic requires the addition of SHARE.EXE. Be sure that there is a File (/F)and Lock (/L) parameter. The share line should look like this:

C:\DOS\SHARE.EXE  /F:5120 /F:500

Is there anything running at the same time in Windows? Take it out!

1.	Third-party fonts

•	Drivers like ATM, Facelift, PowerPak, Intellifont, etc.

•	Cartridge drivers

•	Check the SYSTEM.DRV = line in the SYSTEM.INI

2.	OEM video drivers

Reset back to Standard VGA

FoxPro for Windows makes intensive use of screen I/O, which does not work well with some video cards. The following video cards have been identified as conflicting with FoxPro for Windows:

•	ATI Ultra Graphics Pro (local bus)

•	AST Power Premium 486 with VGA motherboard

•	Genoa 7900 MM card

•	Dell 486/20 with VGA on motherboard

•	COMPAQ QVision

•	Speed Star 24x

•	Trident 8900C

•	TIGA 1024 x 768 x 256 small fonts

•	NEC 2A

•	MACH32

•	MATROX MGA video driver using 1024 x 768 resolution

•	Orchid Fahrenheit 1280 card using Microsoft Windows version 3.1

If this is the cause, contact the video card manufacturer for a new driver.

3.	Screen Savers

•	AfterDark, Screen Peace, Windows Screen Savers

4.	Third party desktops

•	HDC Express, Norton Desktop, etc

See How To Perform a Clean Boot.

Which Windows version?

Which FoxPro version?

Eliminate Possible Corrupted Files

Initialization files

1.	Rename FOXPRO.INI (in Windows directory)

2.	Set different printer driver as default

Database files

1.	Copy structure to new file, append from old file to new

2.	Re-create indexes

Report/label files

Create new file or use previously saved files

Program files

Reinstall drivers, FoxPro, Windows

Other Problems

Launch Windows with switches /D:[F][S][V][X]

Syntax: WIN/D:[F][S][V][X]]

/D  Used for troubleshooting when Windows does not start correctly.

:F  Turns off 32-bit disk access. Equivalent to SYSTEM.INI [386enh] setting: 32BitDiskAccess=FALSE.

:S  Specifies that Windows should not use ROM address space between F000:0000 and 1 MB for a break point. Equivalent to SYSTEM.INI [386enh] setting:  SystemROMBreakPoint=FALSE.

:V  Specifies that the ROM routine handles interrupts from the hard drive controller. Equivalent to SYSTEM.INI [386enh] setting: VirtualHDIRQ=FALSE.

:X  Excludes all of the adapter area from the range of memory that Windows scans to find unused space. Equivalent to SYSTEM.INI

Changes settings in the [386Enh] section of the SYSTEM.INI.

[386enh] setting: EMMExclude=A000-FFFF.

Lost clusters

Try CHKDSK /F or SCANDISK( DOS 6.2)

Invalid Temp directory?

Create a directory C:\TEMP

SET  TEMP C:\TEMP

Recommended Actions

Run clean for a while to see if problem reoccurs

Always quit and reboot after a General Protection Fault or UAE

Save files frequently

Other Tips

Check BIOS date - must be dated 1991 or later.

Disable shadow RAM/ROM (in CMOS settings)

Disable math coprocessor


Top 25 Common Issues

I create a stand alone .EXE file and the objects on my screen are not aligned.

The font that the screen was created under is not present. To make sure it is available, issue the following command: MODIFY WINDOW SCREEN FONT "<fontname>",<size>

I keep getting a repetition of the same record on my report when I send my query output(RQBE) to the report. What's wrong?

In the report, remove any reference to the database in front of the fields. Don't forget to check the data grouping also for a database alias.

I issue the command "SET TALK ON" in my CONFIG.FPW and it doesn't seem to take effect. Why not?

CONFIG.FPW can be thought of as an extended SET command. Therefore, the word SET cannot appear in it. The correct syntax is option = value, i.e. "TALK=ON".

My application works fine as an .APP, but it won't run as an .EXE. My menu appears for a few seconds and it goes back to Windows. What is going on?

When the code that you have created for the menu is executed, it loads the menu in memory and then finishes, returning to the FoxPro environment. This leaves you at the Command window where you can make your menu choices. In an .EXE file, since there is no COMMAND window, control returns to the operating system. For more information, please refer to the Distribution Kit User's Guide.

Why do I get extra characters appearing randomly in a report or on a screen?

While there could be other reasons, one of the most common mistakes is having SET TALK ON. Try issuing SET TALK OFF.

When I run my .APP or an .EXE, it won't save any changes to my database file. Why are my changes lost?

If your application has files that are going to be modified, be sure to mark them as excluded in the project. Refer to "Project - The Main Organizing Tool" chapter in the FoxPro Developers' Guide.

I thought FoxPro was a multi-user program right out of the box, so why am I getting "File is in use", when somebody tries to use the same file on a network?

You are correct, FoxPro is multi-user. However, EXCLUSIVE is ON by default.

Issue SET EXCLUSIVE OFF to open the files shared. Please refer to the SET EXCLUSIVE help topic for more information.

Why I am getting a "Sharing violation" error message when I try to run the same application somebody else is running?

Make sure the .EXE/.ESL and resource files are marked read only.

I get a "Not Enough Diskspace" error message when I try to use my application. I have more than 200 MB available on my Novell network.

More than likely, one or more of the files your application uses has been flagged with the N/A parameter. Use the Novell NDIR command to view the ownership rights. Consult your Novell manual to give these files valid ownerships.

When I try to build my application I get an "Unable to find unknown array" message even though it is defined in the program. Why can't it find it?

The project manager needs to be alerted when an array is created in a program and then used in a lower level program. Issue the command EXTERNAL ARRAY <arrayname> just before it is referenced in the lower program.

I get a "too many files open" error message even though I have "Files=80" in my CONFIG.SYS file. Would it make a difference if I am on a Novell network?

A SHELL.CFG or a NET.CFG file may be needed by your system to increase the number of file handles required by Novell. For example, "FILE HANDLES=80" should be placed in the SHELL.CFG or the NET.CFG.

Why I am getting a "Sharing violation" error message when I try to run the same application somebody else is running? Would it make a difference if I am on a peer-to-peer network ?

Be sure that SHARE is loaded on each workstation that you are running your application. SHARE can be loaded in the AUTOEXEC.BAT using parameters like "SHARE /F:5120 /L:500"

After the RUN command has finished executing, the MS-DOS window stays on the desktop.

You will have to open the FOXRUN.PIF file through the PIF editor, and check the Close Window On Exit" button.

I am trying to print from FoxPro, but it only prints after I quit FoxPro.

After you print something from FoxPro, the information is sent over the printer queue in Windows. To release this job from within FoxPro,  issue SET PRINTER TO.

I would like to use the RQBE window to do an outer join. Is that possible?

The RQBE window allows only one SQL-SELECT statement, so you cannot do an outer join in the RQBE tool. Instead, type your SQL-SELECT statement in a .PRG file and run it.

I am trying to check for a NULL value on my numeric field. Can I do this?

FoxPro will always put a ZERO if the numeric field is left blank. There is not a way to check for NULL values.

I have a parent-child relationship set up. Whenever I switch from one record to the next, my child Browse window stays on the same record.

Issue the command SHOW WINDOW <window name> REFRESH after you skip from one record to another.

I have a report based on a one-to-many database relationship set up, but only one record in the child database shows up for each parent record. What is going on?

Among other things, be sure the one-to-many relationship is set up correctly. This is done by issuing the SET SKIP TO <child database> command while you are in the parent database work area.

I am getting a "Too many READs in effect" error message.

If a screen runs another screen, the current number of READs in effect is increased by one. The maximum READ level an application can have is five. A Foundation READ can be incorporated in your application to avoid this error message. For more information, refer to the READ help topic and to the sample applications EX1.APP and EX2.APP.

In my report, the records do not show up correctly.

Although there might be other reasons, please be sure that the correct database is selected for the report. Check the View window to see which database is currently selected.

I would like to change the title of the main FoxPro window from Microsoft FoxPro to my own title.

Issue the command MODIFY WINDOW SCREEN TITLE "My Title"

When I run my .SPR file, it seems to open up few database I don't want. I have closed the database I don't want before generating the .SPR code. Is this a bug?

FoxPro will save the environment that was used when the screen was created. So if an environment was saved while the other database were open, FoxPro will automatically open up those databases. To get around this problem:Close the database you don't want. Go to Screen Layout. Click on Environment. Click on Clear (to clear old environment). Click on Environment again. Click on Save (to save the new environment).

In my report, some of the numeric fields are appearing with "****" instead of the actual value.

If there is not enough space for the numeric value to appear, FoxPro will put "****" in place of the actual value. You can avoid this problem by extending the numeric output field so that the numeric value can fit in entirely.


Top 20 Coding Errors

FoxPro Errors

"Feature not Available" error in executable.

This error is a result of the following situations:

1.	Using commands that are not supported in a run-time version of FoxPro.

2.	Using macro substitution.

"Record in Use by Another" when executing screens in a multi-user environment.

This is frequently caused by the READ command causing the first record in the database to be locked upon entering the screen. The solution is to use a READ NOLOCK to not automatically lock the record, and handle the record locking in your screen.

"Too Many READs in Effect" Error

The error is commonly generated commonly by executing screens from VALID clauses. Below is a typical example:

Push Button Valid

CLEAR READ

DO next.SPR

This looks correct: the READ is cleared, then another screen is executed. Upon closer inspection, however, we discover a problem. The READ cannot be cleared while we are in a clause of an object inside that READ. In order for the READ to be cleared, we must have correctly exited from any clauses associated with that READ. Therefore, although we have issued the clear read, the read will not have been cleared, until we exit the NEXT screen and return to this VALID clause. What is the alternative? A correct example:

Setup Code

NextScrn = .f.

Push Button Valid

CLEAR READ

NextScrn = .t.

Cleanup Code

IF NextScrn = .t.

DO next.SPR

ENDIF

In this example the READ will be cleared because the VALID is allowed to exit, and the screen is run from the cleanup code, after the READ has been cleared.

"File not Found" or similar error caused by hardcoded paths

Use SET DEFAULT TO and SET PATH TO as an alternative to hardcoding the path in a program. Example:

USE c:\sales\invoices\orders

could be replaced with:

SET DEFAULT TO c:\sales\invoices\

USE orders

"Position Is Off the Screen" error

The setting of the screen font and/or the resolution of the video driver can cause this error when transporting executables to different machines. To help resolve this issue, design screens for the lowest resolution that the executable will run on and use the MODIFY WINDOW SCREEN FONT to define the font. Example:

MODIFY SCREEN FONT "arial",8

Speed/Efficiency Enhancements

Using the LOCATE command as opposed to the SEEK command or function

The SEEK command or function takes advantage of the speed of Rushmore, and uses the index to search for a value. Using the SEEK( ) function returns even if the value was found, whereas LOCATE is generally slower and you must use the FOUND( ) function to return the status of the search. SEEK is generally preferable when performing searches on large databases.

Using a DO ... WHILE loop as opposed to the SCAN ... ENDSCAN loop or REPLACE ... ALL command

Consider the following code:

GOTO TOP

DO WHILE .NOT. EOF()

IF state = "NC"

REPLACE state WITH "North Carolina"

ENDIF

SKIP

ENDDO

Can be much more efficient:

SCAN FOR state = "NC"

REPLACE state WITH "North Carolina"

ENDSCAN

And even more reduced:

REPLACE state WITH "North Carolina" FOR state = "NC" ALL

Also, the UPDATE command is a one-step method to update the contents of one database, with another database. Example:

UPDATE ON cno FROM newinfo REPLACE state WITH fullstate(newinfo.state)

All of these commands (SCAN...ENDSCAN, REPLACE and UPDATE) save processing time.

Issuing INDEX ON to change the order of a database, as opposed to the command SET ORDER TO

Using the INDEX ON command has many drawbacks, such as requiring exclusive use of the database, slowing down the system, and causing the CDX to increase in size. A better alternative is to create the index once with the INDEX ON command, and use the SET ORDER TO to activate the desired index tag.

Command Usage

The value of SET EXACT affecting comparisons

SET EXACT affects how comparisons are made. For example: consider a character field, 20 characters wide, titled 'name', with the value of "John Smith" and a variable titled 'mname' with the value "John".

With SET EXACT ON, name = mname would return .F. With SET EXACT OFF, name = mname would return .T.. This setting will also affect the outcome of SEEK, SEEK( ), and LOCATE.

Unable to retrieve the COMMAND WINDOW after hiding it

Many users know the following method of hiding the Command window:

DEFINE WINDOW HIDECOMM FROM 1,1 to 2,2

ACTIVATE WINDOW command IN HIDECOMM

However, how do you get it back?

CLEAR WINDOW HIDECOMM

ACTIVATE WINDOW command IN SCREEN

It must be noted, however, that if a Foundation READ is used, hiding the Command window is not necessary.

Creating ON SHUTDOWN or ON ERROR routines that do not give you backdoor escape when debugging.

When debugging an ON SHUTDOWN or ON ERROR routine, you need to give yourself an out. An ON KEY LABEL command is a good way to do this. Your ON KEY LABEL routine might issue ON SHUTDOWN or ON ERROR without a program to turn the routine off. Once you have perfected the routine, the ON KEY LABEL can be removed.

Adding a criteria to the APPEND FROM command that is not evaluated until after the records have been appended.

A common example of this is the following command:

APPEND FROM test FOR NOT DELETED()

What is expected is that all the records that are not deleted will be copied to the selected database, but because the criteria is evaluated AFTER the copy takes place, the result is that all of the records are copied. An alternative is to use the COPY TO command:

COPY TO newdbf FOR NOT DELETED()

BROWSE window appears in unexpected location

The most recently used coordinates for the position of the Browse window are stored in the resource file if the resource file is NOT read-only. This can cause unexpected results in an application if you have not taken this into account. Use DEFINE WINDOW to direct the Browse window to a specific location.

Dimensioning an array too small when creating a list from an array

If the array is dimensioned before using the COPY TO ARRAY command, the array must be dimensioned to the maximum size of the resulting array. However, it is not necessary to dimension the array before issuing the COPY TO ARRAY command. If you would like the array to be automatically sized, simply issue the COPY TO ARRAY command. The array listed will be automatically created and sized.

Trying to join SQL-SELECT cursors that are not compatible

In order to join two cursors created from a SQL-SELECT, the resulting cursors MUST have the same structure, in terms of field types and sizes.

Issuing a SET VIEW TO or running a screen, report or label with saved environment

This activity is common but does not cause immediate problems. It will cause an apparent "ghost" error later on in the code when a SET command is different, or a unexpected database is selected. Be careful when changing the environment, and be sure to take that possibility into account later on in the code.

SET PRINTER TO <port> does not work in the Windows product

Unlike FoxPro for MS-DOS, FoxPro for Windows must go through the Windows printing system to output to the printer. There are three main options for changing the current printer programmatically:

1.	Using the REPORT FORM ....PROMPT or SET PRINTER ON PROMPT commands

2.	Issuing RUN /N CONTROL PRINTERS to bring up the Control Panel in Windows

3.	Sending commands to the Windows API through FOXTOOLS.FLL to change the printer.

Logical

Having two variables with the same name

This can be done intentionally or unintentionally. However, in both instances having two variables with the same name can cause problems. Many times an error can occur when a variable is defined to be used in a higher level program, and the same variable name is used and/or modified in a lower level program. Once returning to the higher level program, unexpected results can occur, such as "Data Type Mismatch" because the variable type was changed. As a general rule, it is not a good idea to use the same variable name in different programs. If you need to modify a variable in another program, pass the variable by reference to a different variable name as an alternative. See the following example.

Num = 1

=changenum(@num)        && the @ forces the variable to pass by reference

? num                   && returns

PROCEDURE changenum

PARAMETER newnum

newnum = (150 * newnum)/35

RETURN .t.

See SET UDFPARMS for more information on passing by reference versus passing by value.

Issuing the SET SYSMENU OFF disables access to any hot keys defined within the menu

If this command is issued, hot keys such as Copy (CTRL+C), Paste (CTRL+V), Cycle Windows (CTRL+F1), and Append in a Browse (CTRL+N) do not work because the menu is disabled. In order to recover these keys, you need to SET SYSMENU ON or AUTOMATIC or program an ON KEY LABEL to provide the same functionality.

An ON KEY LABEL cannot be used to provide functionality for Copy (CTRL+C) or Paste (CTRL+V) if SET SYSMENU OFF is issued.

Reports/Screens

Order of evaluation of variables and detail lines in the Report Writer

The report writer evaluates the variables as it increments through the database. Therefore, placing a summary variable in the group header would result in the totals for the previous group. To do this you need to create a UDF to calculate the variable total.

Using an alias on a report or screen

This issue causes unpredictable results in the Report Writer. The typical symptom is the first record of the aliased database repeated for the report. Using the alias in the Screen Builder can also be an issue as it can prohibit the creation of a "generic" screen that can be used with several databases. There is a time for aliases, however. If your screen or report contains references to more than one database, an alias is necessary to determine which database the information should be gathered from. In this instance, not using an alias can result in the error "Variable not found". See below an example of a field with an alias:

customer.cno

It is not always necessary to use a UDF to calculate totals in the Report Writer

As we discussed earlier, it is sometimes necessary to create a UDF to calculate a total. However, the Report Writer variables can be used to calculate totals in a more efficient manner.


How to Perform a Clean Boot

This following topics discuss how to perform a clean boot for FoxPro:

Configuring Microsoft MS-DOS for a Clean Boot

Configuring Microsoft Windows for a Clean Boot

Configuring Microsoft FoxPro for Windows for a Clean Boot

Additional Steps

Performing a Clean Boot


Clean Boot

Rebooting your computer after all unnecessary commands and device drivers have been removed from your CONFIG.SYS and AUTOEXEC.BAT files. A clean boot is used as a basic troubleshooting step to eliminate system errors and test for possible conflicts between FoxPro and various device drivers and terminate-and-stay-resident (TSR) programs.


Configuring Microsoft MS-DOS for a Clean Boot

This topic discusses:

Preparing to Clean Boot

Drivers that SHOULD NOT be Removed

Commands and Drivers that SHOULD be Removed

Preparing to Clean Boot

Create a startup disk that contains the MS-DOS system files and any other files that are required to make your system operational. If disk-partitioning, disk-compression, or other third-party software is required to boot the computer, the startup files on the disk created should appear as follows:

CONFIG.SYS	AUTOEXEC.BAT
DEVICE=C:\WINDOWS\HIMEM.SYS	PATH C:\DOS;C:\WINDOWS;C:\FOXPROW
FILES=99	PROMPT $P$G
BUFFERS=20	SET TEMP = C:\WINDOWS\TEMP * Ensure that the TEMP environment variable points to a sub-directory that really exits. NEVER point to the ROOT directory of any drive for temporary files.
<Third-party disk-partitioning software>	SET FOXPROW = -SAVEREGS * Only if Novell Netware ODI drivers are being used
<Third-party disk-compression driver>	<Third-party networking drivers> * Only if FoxPro cannot be used without the network
<Other third-party drivers> * Only if the system cannot be operated without these drivers
STACKS=9,256
SHELL=C:\DOS\COMMAND.COM /E:1024 /P
Drivers That SHOULD NOT Be Removed

The following are examples of drivers that SHOULD NOT be removed. They are used when the computer is booted to make the hard disk accessible. This is not a complete list, but it does include frequently used drivers:

Hard Disk Drivers

SQY55.SYS	SSTBIO.SYS	SSTDRIVE.SYS
AH1544.SYS	ILIM386.SYS	ASPI4DOS.SYS
SCSIHA.SYS	SCSIDSK.EXE	SKYDRVI.SYS
ATDOSXL.SYS	NONSTD.SYS
Disk-Partitioning Software

DMDRVR.BIN	SSTOR.SYS	HARDRIVE.SYS
EDVR.SYS	FIXT_DRV.SYS	LDRIVE.SYS
ENHDISK.SYS
Disk-Compression Utilities

STACKER.COM	SSWAP.COM	SSTOR.EXE
DEVSWAP.COM
The products listed above are manufactured by vendors independent of Microsoft; we make no warranty, implied or otherwise, regarding these products' performance or reliability. If you do not know the purpose of a device driver or program, DO NOT remove it. Most device drivers and programs display a message describing their purpose when they are initialized.

Commands and Drivers that SHOULD be Removed

A clean boot does not include the following items:

DOS=HIGH,UMB	Third-party disk caches
EMM386.EXE	Various third-party TSRs
INSTALL=SHARE.EXE	SET FOXPROCFG=CONFIG.FPW
INSTALL=FASTOPEN.EXE	Virus checkers
Third-party memory managers	Drivers for scanners/faxes
RAM disk devices	Drivers for CD-ROM/networks
JOIN, GRAPHICS, PRINT, SUBST, APPEND	Tape backup
MODE for printer redirection	Spoolers/Redirectors/Buffers
Multiple PATH statements	Data-acquisition units
MS-DOS-level mouse drivers	Keyboard accelerators/buffers
Third-party MS-DOS shells	4DOS, NDOS, etc.


Configuring Microsoft Windows for a Clean Boot

To configure Windows for a clean boot, check these areas:

Video Drivers

Windows Initialization Files

Important   When editing any configuration file, make a backup copy of the file before making any changes.

Video Drivers

As a standard troubleshooting procedure, use a video driver that is shipped with Microsoft Windows, such as VGA. This can be installed through the Windows Setup icon in the main group.

Tip   If you are using standard VGA and suspect a problem with the video driver, run Windows Setup via the icon in the Main group and change the driver to VGA 3.0. When the dialog prompts "A driver for this display is already on the system. Do you want to use the currently installed driver or install a new driver?", select New to replace the files on the hard drive. You will need your Windows diskettes in order to install a different video driver.

Windows Initialization Files

The two main Microsoft Windows initialization files are WIN.INI and SYSTEM.INI. To edit the SYSTEM.INI and WIN.INI files, run the SYSEDIT program by selecting File and then Run from the Program Manager menu. At the Command Line prompt, type SYSEDIT. You will see the Windows System Editor appear with several open windows, two of which will be SYSTEM.INI and WIN.INI.

Note   You will also see the CONFIG.SYS and AUTOEXEC.BAT files in windows of their own. This is a good way to edit all of these files.

Changes to WIN.INI

1.	Comment out the lines LOAD= and RUN= in the [windows] section by placing a semicolon (;) in front of these lines.

2.	If you are using any third-party Windows font managers like Adobe Type Manager, Bitstream FaceLift, HP Intellifont, etc., comment modifications that these programs may have made to WIN.INI.

•	For Adobe Type Manager, comment any lines that begin with Softfont=.

•	For HP Intellifont, find the section marked [Intellifont] and comment out all of the lines in this section.

Changes to SYSTEM.INI

1.	If you are using any third-party Windows shell programs like Norton Desktop for Windows, or HP Dashboard for Windows, disable these shells by commenting the SHELL= line in the [boot] section of SYSTEM.INI. To do this place a semicolon in front of this line (i.e. ;SHELL=NDW.EXE). Add a line to the [boot] section that reads:

SHELL=PROGMAN.EXE.

2.	If using any third-party Windows font managers like Adobe Type Manager, Bitstream FaceLift, HP Intellifont, etc., comment the modifications that these programs may have made to the SYSTEM.INI.

•	For Adobe Type Manager comment the following lines in the [boot] section:

SYSTEM.DRV=ATMSYS.DRV

ATM.SYSTEM.DRV=SYSTEM.DRV

Also, add the following line to the [boot section]

SYSTEM.DRV=SYSTEM.DRV

•	For HP Intellifont comment the line:

CHAIN_DISPLAY=<name of video driver in use>


Clean Boot for Microsoft FoxPro for Windows

To configure FoxPro for a clean boot, perform these steps:

•	Rename the FOXUSER.DBF and FOXUSER.FPT files. FoxPro will recreate a default FOXUSER resource file if it cannot find one.

•	Run FoxPro with the -C switch to avoid loading the CONFIG.FPW file - OR - Rename the CONFIG.FPW file.


Additional Steps

•	Remove all items from the Program Manager STARTUP group.

•	Remove any anti-virus utilities that load automatically.

•	Remove any automatic back-up schedulers.

•	If the problem is printing related, install the Generic/Text Only printer driver and set it as the default.

•	Run CHKDSK with the /F parameter to ensure that MS-DOS does not see any problems with your hard disk's configuration.

•	Run a program like MS-DOS version 6.0's DEFRAG.EXE, that defragments the files on your hard disk.

Tip   A good way to see what files are fragmented on your hard drive is to issue the command CHKDSK *.* at the MS-DOS command prompt. This will report if any files are non-contiguous.


Performing a Clean Boot

Once you have completed modifications to your system's configuration files, reboot your computer. If the problems you were experiencing no longer occur, gradually add components back to your system's configuration one at a time. This will allow you to determine the source of the conflict. Once you have made this determination, contact the manufacturer of the product for an updated version or for further troubleshooting steps.


Wizards

The following topics provide information about using the Microsoft FoxPro 2.6 wizards:

Using Wizards

Client-Server Query Wizard

Group/Total Report Wizard

Label Wizard

Mail Merge Wizard

Multi-Column Report Wizard

Report Wizard

Screen Wizard

SQL Query Wizard

Table Wizard

Updatable Query Wizard


Using Wizards

See Also

Microsoft FoxPro 2.6 provides the following wizards to help you complete common data management tasks:

Client-Server Query Wizard	Report Wizard
Group/Total Report Wizard	Screen Wizard
Label Wizard	SQL Query Wizard
Mail Merge Wizard	Table Wizard
Multi-Column Report Wizard	Updatable Query Wizard
Note   The Client-Server Query Wizard is only available with the Professional edition of Microsoft FoxPro 2.6.

Starting a Wizard

There are two ways to start a wizard:

In the Catalog Manager, you can choose a wizard option when creating new tables, queries, screens, reports, or labels. A Mail Merge Wizard is available when you choose the Mail Merge option on the Tools menu.

When using the FoxPro menu system and Command window, you can choose the Wizard... option from the Run menu, and select the type of wizard you want to use. Microsoft FoxPro either starts the wizard, or, if there are several related wizards to choose from, displays a screen from which you can select one.

Note   When you start a wizard from the Catalog Manager, Step 1 of the wizard is skipped because you have already selected a table to work with.

Navigating the Wizard Screens

Once you have the wizard running, just answer the questions on each screen, and choose the Next button when you are ready to proceed to the next screen.

If you make a mistake or change your mind, choose the Back button to see the previous screen so you can make changes. Choose Cancel to exit the wizard without producing any results.

When you reach the last screen, choose the Finish button when you have selected an option and are ready to exit the wizard.

If you are in a hurry, you can choose the Finish button to proceed to the end of the wizard sequence, skipping the entry of optional information. The Next and/or Finish buttons will be disabled if you need to supply additional information before continuing.

Saving Wizard Results

The last screen of each wizard may ask you to supply a title and, depending upon the type of wizard you are using, give you save, preview, browse, modify, or print options.  When you have selected the option you want, choose the Finish button.

Modifying Wizard-Created Items

When using the Catalog Manager, you can use a wizard to make changes to wizard-generated tables, queries, screens, reports, and labels. Just select the wizard-generated item in the Catalog Manager, and choose the Modify button.

Important   You cannot use wizards to modify tables, queries, screens, reports, or labels that were not created with a wizard; and, you cannot use a wizard to modify wizard-generated items that you have modified with the FoxPro power tools.


See Also

Table Wizard

SQL Query Wizard

Client-Server Query Wizard

Updatable Query Wizard

Screen Wizard

Report Wizard

Multi-Column Report Wizard

Group/Total Report Wizard

Label Wizard

Mail Merge Wizard


Table Wizard

See Also	Using Wizards

The Table Wizard helps you set up a new Microsoft FoxPro table. Just choose the fields you want for your table from the sample tables provided. These samples are already set up with typical data types and field lengths:  You can use them as they are, or rename them and change the data types and field lengths as needed.

Table Wizard Steps

Step 1 of 3:	Selecting fields to include in your table

First, select a sample table from the Tables list. The fields in the sample table are shown in the Fields list; select the fields you want to use in your table. Use the arrow buttons to add or remove fields in the Selected Fields list. You can combine fields from several different tables if necessary.

When you select a field, the status bar at the bottom of the screen shows the field's data type and length. For example:

Last Name:  [C(50)]

If you want to change the name, data type, or length of a field, select it in the Selected Fields list, and choose the Modify Field... button. This displays the Modify Field dialog, where you can modify the characteristics of the field.

Step 2 of 3:	Setting the sort order

Select up to three fields from the Available Fields list to set the sort order for the records in your new table. The selected fields are combined to create an index tag for the table.

For example, if you choose State and then City, the records in your table will be sorted by state, and then by city within each state.

Choose the Ascending option to sort records from the beginning of the alphabet, the lowest number, or the earliest date; choose the Descending option to sort records from the end of the alphabet, the highest number, or the latest date.

Step 3 of 3:	Saving, browsing, or modifying your table

Select one of the four options and choose the Finish button:

Save table 	displays the Save As dialog so you can give the table a name and save it as a .DBF file.

Save and browse for data entry 	saves the table and displays it in a Browse window so you can view, enter, and edit records.

Save and create an AutoScreen for data entry 	saves the table and automatically creates a wizard-generated data-entry screen so you can view, enter, and edit records.

Modify structure of table 	displays the Save As dialog so you can give the table a name, then displays the Table Structure dialog, where you can modify the table as needed.


See Also

Browse Window

Save As Dialog

Table Structure Dialog

Using Wizards

Working with Tables in the Catalog Manager


Screen Wizard

See Also	Using Wizards

The Screen Wizard creates a FoxPro screen you can use to view and modify the information in your tables. The screen includes a series of buttons for displaying, editing, and printing records. You can choose from three different styles of screens, and have your choice of buttons with text labels, such as "Next" or "Top," or buttons with pictures that represent each button's function.

Note   If you want your screens to work in a multi-user environment, you need to make sure that you set the EXCLUSIVE option to OFF.  You can change this setting from the Catalog Manager by choosing the Settings command from the Tools menu.  If you are not using the Catalog Manager, type SET EXCLUSIVE OFF in the Command window.

Screen Wizard Steps

Step 1 of 5:	Selecting a table

Note   If you start the wizard from the Catalog Manager, this step is skipped because you have already selected a table to work with.

Select a table from the list (which shows all the tables in use before you started the wizard). If no names are displayed, or you want to use a different table, choose the Open... button and use the Open dialog to select a table.

Step 2 of 5:	Selecting fields to include in your screen

To select fields from a table to use in your screen, you can:

Double-click each field name in the Available Fields box.

Select each field name and choose the Add button.

Choose the Add All button to use all the fields.

If you add a field you don't need, select it and choose the Remove button.

Step 3 of 5:	Setting the sort order

Note   This step will be skipped if you are basing your screen on a query.

To set the order in which records will be displayed in the screen, select up to three fields from the Available Fields list. The selected fields are combined to create an index tag.

For example, if you choose State and then City, when you view your records in the finished screen, they will be sorted by state, and then by city within each state.

Choose the Ascending option to view records from the beginning of the alphabet, the lowest number, or the earliest date; choose the Descending option to view records from the end of the alphabet, the highest number, or the latest date.

Step 4 of 5:	Selecting a style for the screen and its buttons

Select a style option for the screen from the list of styles; then select the type of navigation and editing buttons (text or pictures) you want to appear along the bottom of the screen.

Step 5 of 5:	Naming the screen and saving, running, or modifying it

Enter the title you want to appear at the top of your new screen, then select one of the three options, and choose the Finish button:

Save screen for later use creates an .SCX file that you can later use to generate and then run the screen.

Save and run screen creates and generates the screen, and displays it so you can view, modify, or print records.

Modify screen with design tool displays the Save As dialog so you can give the table a name, then displays the screen in the Screen Design window, so you can modify it as needed.

Wizard-Generated Screens

The screens created by the wizard include the screen title and the fields you chose to include.

Wizard-generated screen buttons

The buttons at the bottom of the screen work as follows:

Button	Picture	Function
Top		Displays the first record in the table.
Prev		Displays the previous record in the table.
Locate		Displays a browse window so you can search for the record you want.
Next		Displays the next record in the table.
End		Displays the last record in the table.
Add		Adds a new record to the table. Choose Save when you are done entering the record, or Cancel to discard the new record. Not available if you are displaying a read-only table or query. Not available if you are using a query which includes tables related on an expression field.
Edit		Allows you to make changes to the record currently displayed. Choose Save when you are done editing, or Cancel to discard the changes. Not available if you are displaying a read-only table or query.
Delete		Deletes the current record.
Save		Saves a new record, or changes made during editing. Not available if you are displaying a read-only table or query.
Cancel		Cancels a new record, or changes made during editing. Not available if you are displaying a read-only table or query.
Print		Displays a dialog box so you can print the current record, or all the records in the table. The wizard creates a report with the same name as the screen. You can preview the report, or send it directly to the printer.
Close		Closes the screen.


See Also

Browse Window

Open Dialog

Screen Design Window

Using Wizards

Working with Screens in the Catalog Manager


SQL Query Wizard

See Also	Using Wizards

The SQL Query Wizard searches one or more tables for records that match the criteria you specify.  It creates a query file with a .QPR extension, the same type of query created when you use FoxPro's RQBE.

FoxPro .QPR queries allow you to use aggregate functions (such as AVG, COUNT, MAX, MIN, or SUM) in your query.  The query results are read-only; you can browse them or incorporate them into a report, but cannot update the records.

SQL Query Wizard Steps

The SQL Query Wizard has six main steps:

1.	Selecting and joining tables

2.	Selecting fields and adding expressions.

3.	Setting grouping options

4.	Setting the sort order of records (optional)

5.	Limiting or filtering the records retrieved (optional)

6.	Viewing, saving, and browsing the query, or creating an AutoReport from it

Detailed instructions for each step are provided below.

Step 1 of 6:	Selecting tables

First, select the table or tables you want to use from the Available Tables list.

Note  If you are using the Query Wizard from the Catalog Manager, the tables on which you want to base your query must reside in the open catalog. If there are no tables found in the catalog and you click the Query Wizard button, you will be prompted to name your query and select a table on which to base the query. Next, RQBE will start from which you can create a query. If you are not using the Query Wizard from the Catalog Manager, you can also choose the Open Table... button to use a table that is not currently open.

Step 1a of 6:	Joining tables

When you select more than one table, the wizard displays this screen so you can join the tables. Select matching fields from the parent table and the child table, then choose Add.

For example, if you are setting a join between the Customer table and the Invoices table, you could set Customer.cno equal to Invoices.cno.

If you want to delete the relationship between two tables, select the relationship and choose the Remove button.

When you are done joining tables, choose Next to continue to the next step.

Step 2 of 6:	Selecting fields and adding expressions

Select the fields you want to include in the query. The list of available fields includes fields from all the tables you have selected.

To select fields, you can:

Double-click each field name in the Available Fields list.

Select each field name and choose the Add button.

Choose the Add All button to use all the table fields.

If you add a field you don't need, select it and choose the Remove button.

Adding expressions to your query

You can also add expressions to your query. An expression is a combination of operators, functions, and field names that evaluate to a single value. For example, you might want your query to include the sum of all prices:

SUM(cost)

When you choose the Expression... button, the wizard displays the Expression dialog, where you can create the expression to add to your query.

To create an expression with the Expression dialog

1.	Enter a name for your expression in the Name of calculated field box.

2.	Either type the expression directly into the Expression box, or select String, Math, or Date expressions and combine them with the Fields available.

3.	When you've finished building the expression, choose OK to confirm it.

If you need to modify an expression after you have created it, select it in the Selected Fields list, and choose the Expression... button again.

Step 3 of 6:	Grouping the query results

From the Available Fields list, select up to three fields by which to group the records in your query results.

For example, if you choose to group by state and zip code, the records will be sorted into groups by state, then grouped and sorted by zip code within each state.

This type of grouping can be useful in conjunction with any expressions you incorporate into your query. For example, you could include an expression which does a SUM of all sales, then group the results by State, to find the total sales by state.

Step 3a of 6:	Setting additional grouping options

You can add optional modifiers to your grouping criteria to control how records are grouped in the query results.

When you group by entire field, each unique field is placed in a separate group. If you want to make the groupings larger, you can specify that the fields be grouped by their first character, or their first two or three characters.

For example, if you were grouping the names Smith, Samuels, and Snyder by the entire field, each name would appear in its own group. If you grouped by first letter, all three names would appear in the same group.

For numeric fields, by default each unique number constitutes a separate group. If you choose, for example, to group by 10s, then all the values from 0 to 9 would be part of the same group.

Step 4 of 6:	Setting the sort order for the records

In this screen, you determine how the records retrieved by the query will be sorted.

Select up to three fields from the Available Fields list to set the sort order of the records.  You can sort on fields from any of the selected tables.

For example, if you choose Customer.Name and Invoice.Ino, the records will be sorted by customer name, from the Customer table, and then by invoice number from the Invoices table.

Choose the Ascending option to sort records from the beginning of the alphabet, the lowest number, or the earliest date; choose the Descending option to sort records from the end of the alphabet, the highest number, or the latest date.

Step 5 of 6:	Limiting the contents of the query

In this screen you can add an optional expression to further limit the records retrieved by the query. The effect is like filtering the results so that only records meeting certain criteria are included in the query results. For example, you could limit the search to last names starting with J by using the expression:

Customer.lastname BeginsWith J

First select a field from the Fields list and an operator from the Operator list. Then enter a comparison value in the Value field, and choose the Add button to add the new expression to the expression box.

Entering values

In the Value field, type the value you want the query to compare the field against. For example, if you are looking for customer records with a particular last name, type that name in the Value box, after choosing the last name field and the equal-sign operator. The resulting query expression would look like this:

LAST_NAME = JOHNSON

You can combine more than one value in the Value field by separating them by commas. For example, this expression would find records with last name equal to any of the names shown:

LAST_NAME = JOHNSON, JACKSON, JACOBSEN

Combining expressions

You can create more complex queries by adding more expressions.

When you combine expressions, they are combined with an AND operator by default. For example:

STATE = WA
AND ORDER > $100

If you want the query to find records that match either expression, but not both, choose the OR button to add an OR operator between expressions.  For example:

STATE = WA
OR
STATE = CA

You can add parentheses around an expression to make sure the expressions are evaluated as a unit. For example:

(STATE=WA
OR
STATE=CA)
AND
ORDER > $100

To create an expression

1.	Select a field from the Fields list.

2.	Select an operator from the Operator list.

3.	Enter one or more values for comparison in the Value box.

4.	Choose the Add button to add the resulting expression line to the expression box.

5.	To check the results of the filter expression on the query, choose the Preview button.

To remove an expression

  Select the expression line and choose the Remove button.

Step 6 of 6:	Previewing, saving, and browsing your query

Choose the Preview... button to see the results of your query in a Browse window. If you are satisfied with the results, choose one of the following options, and choose the Finish button.

Save query for later use creates a standard Microsoft FoxPro SQL query file (.QPR file) you can run later.

Save and run query saves the query and displays the records in a Browse window.

Save and create an AutoReport saves the query and creates and runs an automatic report based on the fields in the query.


See Also

Browse Window

Client-Server Query Wizard

Expression Dialog

Updatable Query Wizard

Using Wizards

Working With Queries in the Catalog Manager


Updatable Query Wizard

See Also	Using Wizards

The Updatable Query Wizard searches one or more tables for records that match the criteria you specify.  It creates an updatable query file with an .FPQ extension. When you run your query, you create a set of data which you can edit; changes you make to the records in the query results will be reflected in the tables the query is based upon.

Updatable Query Wizard Steps

The Updatable Query Wizard has five main steps:

1.	Selecting and relating tables

2.	Selecting fields and adding expressions

3.	Setting the sort order of records (optional)

4.	Limiting or filtering the records retrieved (optional)

5.	Viewing, saving, and browsing the query, or creating an AutoReport from it

Detailed instructions for each step are provided below.

Step 1 of 5:	Selecting tables

First, select the table or tables you want to use from the Available Tables list.

Note  If you are using the Query Wizard from the Catalog Manager, the tables on which you want to base your query must reside in the open catalog. If there are no tables found in the catalog and you click the Query Wizard button, you will be prompted to name your query and select a table on which to base the query. Next, RQBE will start from which you can create a query. If you are not using the Wizard from the Catalog Manager, you can also choose the Open Table... button to use a table that is not currently open.

Step 1a of 5:	Relating Tables

When you have more than one table selected, the wizard displays this screen so you can relate the tables. Select matching fields from the parent table and the child table, then choose Add.

For example, if you are setting a relationship between the Customer table and the Invoices table, you could set Customer.cno equal to Invoices.cno.

The Outer Join check box affects which records will be included in the output of your query. When the box is checked, all the parent table records are included, even if they do not have a matching record in the child table. When the box is not checked, your query will only contain records from the parent table if matches are found in the child table.

If you want to delete the relationship between two tables, select the relationship and choose the Remove button.

When you are done relating tables, choose Next to continue to the next step.

Step 2 of 5:	Selecting fields and adding expressions

Select the fields you want to include in the query. The list of available fields includes fields from all the tables you have selected.

To select fields, you can:

Double-click each field name in the Available Fields list.

Select each field name and choose the Add button.

Choose the Add All button to use all the table fields.

If you add a field you don't need, select it and choose the Remove button.

Adding expressions to your query

You can also add expressions to your query. An expression is a combination of operators, functions, and field names that evaluate to a single value.

Note   You cannot use aggregate functions (such as AVG, COUNT, MAX, MIN, or SUM) in your query.

When you choose the Expression... button, the wizard displays the Expression dialog, where you can create the expression to add to your query.

To create an expression with the Expression dialog

1.	Enter a name for your expression in the Name of calculated field box.

2.	Either type the expression directly into the Expression box, or select String, Math, or Date expressions and combine them with the Fields available.

3.	When you've finished building the expression, choose OK to confirm it.

If you need to modify an expression after you have created it, select it in the Selected Fields list, and choose the Expression... button again.

Step 3 of 5:	Setting the sort order for the records

In this screen, you determine how the records retrieved by the query will be sorted.

Select up to three fields from the Available Fields list to set the sort order of the records.  Only fields from the parent table are available for sorting.

For example, if you choose Customer.Lastname and Customer.Ino, the records will be sorted by customer name and then by customer invoice number.

Choose the Ascending option to sort records from the beginning of the alphabet, the lowest number, or the earliest date; choose the Descending option to sort records from the end of the alphabet, the highest number, or the latest date.

Step 4 of 5:	Limiting the contents of the query

In this screen you can add an optional expression to further limit the records retrieved by the query. The effect is like filtering the results so that only records meeting certain criteria are included in the query results. For example, you could limit the search to last names starting with J by using the expression:

Customer.lastname BeginsWith J

First select a field from the Fields list and an operator from the Operator list. Then enter a comparison value in the Value field, and choose the Add button to add the new expression to the expression box.

Entering Values

In the Value field, type the value you want the query to compare the field against. For example, if you are looking for customer records with a particular last name, type that name in the Value box, after choosing the last name field and the equal-sign operator. The resulting query expression would look like this:

LAST_NAME = JOHNSON

Combining Expressions

You can create more complex queries by adding more expressions.

When you combine expressions, they are combined with an AND operator by default. For example:

STATE = WA
AND ORDER > $100

If you want the query to find records that match either expression, but not both, choose the OR button to add an OR operator between expressions.  For example:

STATE = WA
OR
STATE = CA

You can add parentheses around an expression to make sure the expressions are evaluated as a unit. For example:

(STATE=WA
OR
STATE=CA)
AND
ORDER > $100

To create an expression

1.	Select a field from the Fields list.

2.	Select an operator from the Operator list.

3.	Enter one or more values for comparison in the Value box.

4.	Choose the Add button to add the resulting expression line to the expression box.

5.	To check the results of the filter expression on the query, choose the Preview button.

To remove an expression

  Select the expression line and choose the Remove button.

Step 5 of 5:	Previewing, saving, and browsing your query

Choose the Preview... button to see the results of your query in a Browse window. If you are satisfied with the results, choose one of the following options, and choose the Finish button.

Save query for later use creates an Updatable query file with an .FPQ extension.

Save and run query saves the query and displays the records in a Browse window, so you can view and update them.

Save and create an AutoReport saves the query and creates and runs an automatic report based on the fields in the query.


See Also

Client-Server Query Wizard

SQL Query Wizard

Using Wizards

Working With Queries in the Catalog Manager


Client/Server Query Wizard
Client-Server Query Wizard

See Also	Using Wizards

The Client-Server Query Wizard lets you connect to any ODBC data server and use a SQL query to retrieve data from it.  It creates a query file with a .CSQ extension.  Each time you run the query file, it will initiate a connection with the server and run the query.

FoxPro .CSQ queries allow you to use aggregate functions (such as AVG, COUNT, MAX, MIN, or SUM) in your query where the ODBC source allows that capability.  The resulting query is read-only; you can browse it or incorporate it into a report, but you cannot update the records.

Note   The Client-Server Query Wizard is available only if you are using the Professional edition of Microsoft FoxPro 2.6. Some backend database servers do not support all the functionality available through the wizard, such as outer joins. Be sure to check to see if your ODBC driver supports the functions you request from the wizard. For information on troubleshooting connectivity issues, see Connectivity Kit Error Messages.

Before using the Client-Server Query Wizard, you need to:

Install the Microsoft FoxPro Connectivity Kit.

Install ODBC.

Register data sources or servers with ODBC.

For more information, see the FoxPro Connectivity Kit and ODBC documentation.

Client-Server Query Wizard Steps

The Client-Server Query Wizard has seven main steps:

1.	Selecting and connecting to a server or data source

2.	Selecting and joining tables

3.	Selecting fields and adding expressions

4.	Setting options to group query results

5.	Setting the sort order of records (optional)

6.	Limiting or filtering the records retrieved (optional)

7.	Viewing, saving, or browsing the query, or creating an AutoReport from it

Detailed instructions for each step are provided below.

Step 1 of 7:	Selecting a server and connecting to it

In this step, you log onto the server or data source you want to connect to when running your query.  Check with your system administrator if you need help with server names or your user identifier and password.

Note   If you enter a password on this screen, the resulting query will be password-protected; that is, you will need to supply this password every time you run the query.

Data Source   From the list, select the name of the server or data source you want to use.  The list contains the names of all registered data sources from the ODBC.INI file.

User Identifier  Enter your user identifier or user name.

Password   Enter your password, if required, for this server.

Database   (This name is optional) If there is more than one database on the server, enter the name of the database you want to use.

Step 2 of 7:	Selecting and joining tables

First select the table or tables you want to use from the Available Tables list.

Note  If you are using the Query Wizard from the Catalog Manager, the tables on which you want to base your query must reside in the open catalog. If there are no tables found in the catalog and you click the Query Wizard button, you will be prompted to name your query and select a table on which to base the query. Next, RQBE will start from which you can create a query. If you are not using the Query Wizard from the Catalog Manager, you can also choose the Open Table... button to use a table that is not currently open.

Step 2a of 7:	Joining tables

When you select more than one table, the wizard displays this screen so you can join the tables. Select matching fields from the parent table and the child table, then choose Add.

For example, if you are setting a join between the Customer table and the Invoices table, you could set Customer.cno equal to Invoices.cno.

The Outer Join check box affects which records will be included in the output of your query. When the box is checked, all the parent table records are included, even if they do not have a matching record in the child table. When the box is not checked, your query will only contain records from the parent table if matches are found in the child table.

If you want to delete the relationship between two tables, select the relationship and choose the Remove button.

When you are done joining tables, choose Next to continue to the next step.

Step 3 of 7:	Selecting fields and adding expressions

Select the fields you want to include in the query. The list of available fields includes fields from all the tables you have selected.

To select fields, you can:

Double-click each field name in the Available Fields list.

Select each field name and choose the Add button.

Choose the Add All button to use all the table fields.

If you add a field you don't need, select it and choose the Remove button.

Adding expressions to your query

You can also add expressions to your query. An expression is a combination of operators, functions, and field names that evaluate to a single value. For example, you might want your query to include the sum of all prices:

SUM(cost)

When you choose the Expression... button, the wizard displays the Expression dialog, where you can create the expression to add to your query.

To create an expression with the Expression dialog

1.	Enter a name for your expression in the Name of calculated field box.

2.	Either type the expression directly into the Expression box, or select String, Math, or Date expressions and combine them with the Fields available.

3.	When you've finished building the expression, choose OK to confirm it.

If you need to modify an expression after you have created it, select it in the Selected Fields list, and choose the Expression... button again.

Step 4 of 7:	Grouping the query results

From the Available Fields list, select up to three fields by which to group the records in your query results.

For example, if you choose to group by state and zip code, the records will be sorted into groups by state, then grouped and sorted by zip code within each state.

This type of grouping can be useful in conjunction with any expressions you incorporate into your query. For example, you could include an expression which does a SUM of all sales, then group the results by State, to find the total sales by state.

Step 5 of 7:	Setting the sort order for the records

In this screen, you determine how the records retrieved by the query will be sorted.

Select up to three fields from the Available Fields list to set the sort order of the records.  You can sort on fields from any of the selected tables.

For example, if you choose Customer.Name and Invoice.Ino, the records will be sorted by customer name, from the Customer table, and then by invoice number from the Invoices table.

Choose the Ascending option to sort records from the beginning of the alphabet, the lowest number, or the earliest date; choose the Descending option to sort records from the end of the alphabet, the highest number, or the latest date.

Step 6 of 7:	Limiting the contents of the query

In this screen you can add an optional expression to further limit the records retrieved by the query. The effect is like filtering the results so that only records meeting certain criteria are included in the query results. For example, you could limit the search to last names starting with J by using the expression:

Customer.lastname BeginsWith J

First select a field from the Fields list and an operator from the Operator list. Then enter a comparison value in the Value field, and choose the Add button to add the new expression to the expression box.

Entering Values

In the Value field, type the value you want the query to compare the field against. For example, if you are looking for customer records with a particular last name, type that name in the Value box, after choosing the last name field and the equal-sign operator. The resulting query expression would look like this:

LAST_NAME = JOHNSON

Combining expressions

You can create more complex queries by adding more expressions.

When you combine expressions, they are combined with an AND operator by default. For example:

STATE = WA
AND ORDER > $100

If you want the query to find records that match either expression, but not both, choose the OR button to add an OR operator between expressions.  For example:

STATE = WA
OR
STATE = CA

You can add parentheses around an expression to make sure the expressions are evaluated as a unit. For example:

(STATE=WA
OR
STATE=CA)
AND
ORDER > $100

To create an expression

1.	Select a field from the Fields list.

2.	Select an operator from the Operator list.

3.	Enter one or more values for comparison in the Value box.

4.	Choose the Add button to add the resulting expression line to the expression box.

5.	To check the results of the filter expression on the query, choose the Preview button.

To remove an expression

  Select the expression line and choose the Remove button.

Step 7 of 7:	Previewing, saving, and browsing your query

Choose the Preview... button to see the results of your query in a Browse window. If you are satisfied with the results, choose one of the following options, and choose the Finish button.

Save query for later use creates a Client-Server query file (.CSQ extension) which you can run later.

Save and run query saves the query and displays the records in a Browse window.

Save and create an AutoReport creates and runs an automatic report based on the fields in the query.


See Also

SQL Query Wizard

Updatable Query Wizard

Using Wizards

Working With Queries in the Catalog Manager


Report Wizard

See Also	Using Wizards

The Report Wizard creates a report from a table, using a style, layout, and sort order that you select.

Report Wizard Steps

Step 1 of 6:	Selecting a table

Note   This step is skipped if you start the wizard from the Catalog Manager, and a table is already in use.

First select the table you want to use. The list contains the tables that were open when you started the wizard.  If you want to use a table that is not currently open, choose the Open... button.

Step 2 of 6:	Selecting a report style

Select one of the available styles for your report; the graphic in the wizard screen changes to show you what the report will look like.

Step 3 of 6:	Selecting fields to include in the report

Select the fields you want to include in your report. The list of available fields shows all the fields in the table you selected.

To select fields, you can:

Double-click each field name in the Available Fields list.

Select each field name and choose the Add button.

Choose the Add All button to use all the table fields.

If you add a field you don't need, select it and choose the Remove button.

Step 4 of 6:	Selecting a report layout

Choose Horizontal if you want the field names to appear as column titles across the top of the page; choose Vertical if you want the field names to run down the left margin of the report.

If you need to further adjust the layout of the report, choose the Print Setup... button. This displays the Print Setup dialog, where you can select a printer, set paper orientation and size, and set printer options.

Step 5 of 6:	Setting the sort order for records

Note   This step will be skipped if you are basing your report on a query.

To set the order in which records will be displayed in the report, select up to three fields from the Available Fields list. The selected fields are combined to create an index tag.

For example, if you choose State and then City, the records in the finished report will be sorted by state, and then by city within each state.

Choose the Ascending option to sort records from the beginning of the alphabet, the lowest number, or the earliest date; choose the Descending option to sort records from the end of the alphabet, the highest number, or the latest date.

Step 6 of 6:	Naming, previewing, saving, or modifying the report

First, enter the title you want to appear at the top of your new report. Then, choose the Preview... button to see your report in a preview window. If you are satisfied with the results, select one of the following options, and choose the Finish button.

Save report for later use creates a Microsoft FoxPro report file (.FRX file) that you can later use to run your report.

Save and print report displays the Save As dialog so you can name the report, then displays the Print dialog so you can print it.

Modify report with design tool saves the report and displays it in the Report Layout window, so you can modify it as needed.


See Also

Group/Total Report Wizard

Multi-Column Report Wizard

Print Setup Dialog

Report Layout Window

RQBE Window

Using Wizards

Working With Reports in the Catalog Manager


Mail Merge Wizard

See Also	Using Wizards

Using a Microsoft FoxPro table, the Mail Merge Wizard creates a data source that your word processor can use in a mail merge.  After completing the wizard, follow your word processor's steps for merging this data source with a main document such as a form letter, label, envelope, or catalog.

Note   If you are using Microsoft Word for Windows 6.0 for the mail merge, you must first clear the Exclusive checkbox in the Catalog Manager Settings dialog (to turn exclusive OFF). If you don't clear the checkbox, a "File in Use" error occurs before you can complete the wizard.

Mail Merge Wizard Steps

Step 1 of 5:	Selecting a table

Note   This step is skipped if you start the wizard from the Catalog Manager, and a table is already in use.

First select the table you want to use as a data source for your mail merge.  The list contains the tables that were open when you started the wizard.  If you want to use a table that is not currently open, choose the Open... button.

Step 2 of 5:	Specifying your word processing program

From the list, select the word processing program you'll be using.

If you choose the Word for MS-DOS, WordPerfect, or Other options, the wizard skips to Step 5 of 5 so you can complete the mail merge.

Step 3 of 5:	Selecting or creating a main document (Microsoft Word for Windows users)

If you selected Microsoft Word for Windows version 2.0 or 6.0, this screen displays so you can either create a new main document or select a main document you have already created.

If you need to create a main document, select the Create new document option, and choose Next to continue.

If you have already created a main document, select the Use existing document option and enter the file name, or choose the File... button to open the document, then choose Next. The wizard will skip to Step 5 of 5.

Step 4 of 5:	Specifying the type of main document (Microsoft Word for Windows 6.0 users only)

This step appears only if you choose to create a new Microsoft Word for Windows 6.0 main document.

Select the type of Microsoft Word 6.0 main document you want to create: form letter, label, envelope, or catalog. Consult you Microsoft Word documentation for more information about these options.

Step 5 of 5:	Completing the mail merge

If you are using Microsoft Word for Windows version 2.0 or 6.0, choosing the Finish button starts up Microsoft Word so that you can continue with the mail merge process.

If you are using another word processor, choosing the Finish button displays the Save As dialog, so that you can save your source document as a text file.  Next, start your word processor and use the document you created as a data source for the mail merge.


See Also

Using Wizards


Multi-Column Report Wizard

See Also	Using Wizards

The Multi-Column Report Wizard uses a table you specify to set up a report with one, two, or three columns of data per page.  You can choose the report style and layout.

Note   This wizard is available only if you are using Microsoft FoxPro for Windows.

Multi-Column Report Wizard Steps

Step 1 of 7:	Selecting a table

Note   This step is skipped if you start the wizard from the Catalog Manager, and a table is already in use.

First select the table you want to use for your report. The list contains the tables that were open when you started the wizard.  If you want to use a table that is not currently open, choose the Open... button.

Step 2 of 7:	Selecting a style for the report

Select one of the available styles for your report. The graphic on the wizard screen changes to show you what the report will look like.

Step 3 of 7:	Setting the number of columns

Under Number of columns for each page, select the 1 column, 2 columns, or 3 columns option to control how many columns are printed on each page of your report.

Step 4 of 7:	Selecting the fields to include in the report

Select the fields you want to include in your report. The list of Available Fields shows all the fields in the table you selected.

To select fields you can:

Double-click each field name in the Available Fields list.

Select each field name and choose the Add button.

Choose the Add All button to use all the table fields.

If you add a field you don't need, select it and choose the Remove button.

Step 5 of 7:	Selecting a layout for the report

Select Horizontal if you want the field names to appear as titles above the columns on the page; select Vertical if you want the field names to run down the left side of each column in the report.

If you need to further adjust the layout of the report, choose the Print Setup... button. This displays the Print Setup dialog, where you can select a printer, set paper size and orientation, and set printer options.

Step 6 of 7:	Setting the sort order for the report

Note   This step will be skipped if you are basing your report on a query.

Select up to three fields from the Available Fields by which to sort the records in your report. The selected fields are combined to create an index tag.

For example, if you choose State and then City, the records in the finished report will be sorted by state, and then by city within each state.

Choose the Ascending option to sort records from the beginning of the alphabet, the lowest number, or the earliest date; choose the Descending option to sort records from the end of the alphabet, the highest number, or the latest date.

Step 7 of 7:	Naming, previewing, saving, modifying, and printing the report

First, enter the title you want to appear at the top of your new report. Then, choose the Preview... button to see your report in a preview window. If you are satisfied with the results, select one of the following options, and then choose the Finish button.

Save report for later use creates a Microsoft FoxPro report (.FRX) file you can later use to run your report.

Save and print report displays the Save As dialog so you can save the report, then displays the Print dialog so you can select print options and send it to a printer.

Modify report with design tool saves the report and displays it in the Report Layout window, so you can modify it as needed.


See Also

Print Setup Dialog

Report Layout Window

Using Wizards

Working With Reports in the Catalog Manager


Label Wizard

See Also	Using Wizards

The Label Wizard sets up information in your tables to be printed out in label form. You can choose a variety of Avery label types in English or Metric label sizes.

Label Wizard Steps

Step 1 of 5:	Selecting a table

Note   This step is skipped if you start the wizard from the Catalog Manager, and a table is already in use.

First select the table you want to use.  The list contains the tables that were open when you started the wizard.  If you want to use a table that is not currently open, choose the Open... button.

Step 2 of 5:	Selecting a label type

First, select the English or Metric option, then select the label dimensions and number of columns you want to use.  If you need to adjust your printer settings to accommodate the label size you select, choose the Print Setup... button.

Step 3 of 5:	Setting up the label

Select the fields in the order you want them to appear on the label.  Either double-click the field name, or select the field name and choose the > button.

Choose the New Line button to start a new line.

To place more than one field on the same line: Add the first field, then choose the Space button, or one of the punctuation buttons, then add the next field.

The picture in the wizard window shows approximately how your label will look. Check this picture to see if the fields you have chosen will fit on the label. The text lines will extend beyond the bottom edge of the label if there are too many lines; red arrows will display to warn you if the text extends beyond the right margin of the label.

Step 4 of 5:	Setting the sort order for records

Note   This step will be skipped if you are basing your label on a query.

Select up to three fields from the Available Fields list to set the sort order for your labels.

For example, if you choose Customer.state and Customer.zip, the labels will be sorted by state, and then by zip code within each state.

Choose the Ascending option to sort records from the beginning of the alphabet, the lowest number, or the earliest date; choose the Descending option to sort records from the end of the alphabet, the highest number, or the latest date.

Step 5 of 5:	Previewing, saving, modifying, and printing the labels

First, choose the Preview... button to see your labels in a preview window. If you are satisfied with the results, select one of the following options, then choose the Finish button.

Save label for later use creates a Microsoft FoxPro label (.LBX) file which you can later use to generate and run your labels.

Save and print label displays the Save As dialog so you can save the labels, then displays the Print dialog so you can select print options and send the labels to a printer.

Modify label with design tool saves the label and displays the label format in the Report Layout window, so you can modify it as needed.


See Also

Report Layout Window

Using Wizards

Working With Labels in the Catalog Manager


Group/Total Report Wizard

See Also	Using Wizards

The Group/Total Report Wizard creates a report that sorts records into up to three groupings, and optionally provides subtotals and totals for numeric fields.

Group/Total Report Wizard Steps

Step 1 of 7:	Selecting a table

Note   This step is skipped if you start the wizard from the Catalog Manager, and a table is already in use.

First, select the table you want to use for your report.  The list contains the tables that were open when you started the wizard.  If you want to use a table that is not currently open, choose the Open... button.

Step 2 of 7:	Selecting a style for the report

Select one of the available styles for your report. The graphic on the wizard screen changes to show you what the report will look like.  If you need to adjust your printer settings, choose the Print Setup... button.

Step 3 of 7:	Selecting the fields to include in the report

First, select the fields you want to include in your report. The Available Fields list shows all the fields in the table you selected.

To select fields, you can:

Double-click each field name in the Available Fields list.

Select each field name and choose the Add button.

Choose the Add All button to use all the table fields.

If you add a field you don't need, select it  and choose the Remove button.

Step 4 of 7:	Setting group levels

From the Available Fields list, select up to three fields by which to group and sort the records in your report.

For example, if you group by state and zip code, the records will be sorted into groups by state, then grouped and sorted by zip code within each state.

Choose the Ascending option to sort records from the beginning of the alphabet, the lowest number, or the earliest date; choose the Descending option to sort records from the end of the alphabet, the highest number, or the latest date.

Step 5 of 7:	Setting grouping options

You can group the fields in your report by the entire contents of each field. If you want to make the groupings larger, you can specify that the fields be grouped by their first character, or their first two or three characters.

For example, if you were grouping the names Smith, Samuels, and Snyder by the entire field, each name would appear in its own group. If you grouped by first letter, all three names would appear in the same group.

For numeric fields, by default each unique number constitutes a separate group. If you choose, for example, to group by 10s, then all the values from 0 to 9 would be part of the same group.

Step 6 of 7:	Including totals and/or subtotals

This step appears only if your table contains numeric fields that are not used as a group header in the report. Numeric fields will be totaled and/or subtotaled within each group defined.

Step 7 of 7:	Naming, previewing, saving, modifying, or printing the report

First, enter the title you want to appear at the top of your new report. Then, choose the Preview... button to see your report in a preview window. If you are satisfied with the results, select one of the following options, and then choose the Finish button.

Save for later use creates a Microsoft FoxPro report file (.FRX file) which you can later use to run your report.

Save and print report displays the Save As dialog so you can save the report, then displays the Print dialog so you can select print options and send it to a printer.

Modify report with design tool saves the report and displays it in the Report Layout window, so you can modify it as needed.


See Also

Report Layout Window

Using Wizards

Working With Reports in the Catalog Manager


Expression Dialog

Use the Expression dialog to create an expression (calculated field) to include in the output of your query.

You can type an expression directly into the Expression box, or select field names from the Fields popup, and combine them with String, Math, or Date functions to create an expression.  Choose Verify when done to confirm that you have created a valid expression, then choose OK to return to the query wizard.

Name of calculated field:

Enter a name to assign to the expression.

String popup

Select a string function to include in your expression.

Date popup

Select a date function to include in your expression.

Math popup

Select a math function to include in your expression.

Fields popup

Select one or more fields to incorporate into your expression.

Expression text box

Displays the functions or fields you select from the String, Math, Date, or Fields popups, so that you can combine them to create an expression.  You can also type expressions directly into this box.


SQL Differences Between dBASE IV and FoxPro

See Also

There are significant differences in the implementations of SQL in dBASE IV and FoxPro and some dBASE IV SQL commands are not supported in FoxPro.

dBASE SQL

To work with dBASE IV data in SQL, you create a SQL database and perform operations on it in a special SQL mode. Programs using SQL must be separate and distinct from other dBASE programs (.PRS v .PRG programs). The semicolon is a continuation character for dBASE commands and a required command termination character for SQL commands.

FoxPro SQL

FoxPro supports the SQL commands CREATE CURSOR, CREATE TABLE, INSERT, and SELECT. SQL is fully integrated in FoxPro. You can use SQL commands exactly as you would use any other FoxPro commands, interspersing FoxPro and SQL commands if you want. The semicolon is a continuation character for all FoxPro and SQL commands.

Because of the significant differences between the implementation of SQL in dBASE IV and in FoxPro, complex dBASE IV SQL programs may not run in FoxPro and will have to be rewritten.

dBASE IV SQL commands not supported in FoxPro:

ALTER TABLE	CLOSE <cursor name>	CREATE DATABASE
CREATE INDEX	CREATE SYNONYM	CREATE VIEW
DBCHECK	DBDEFINE	DECLARE CURSOR
DELETE	DELETE WHERE CURRENT	DROP DATABASE
DROP INDEX	DROP SYNONYM	DROP TABLE
DROP VIEW	FETCH	GRANT
LOAD DATA	OPEN	REVOKE
ROLLBACK	RUNSTATS	SHOW DATABASE
START DATABASE	STOP DATABASE	UNLOAD DATA
UPDATE


See Also

dBASE Compatibility

CREATE CURSOR Command - SQL

CREATE TABLE Command - SQL

INSERT Command - SQL

SELECT Command - SQL


FoxPro Enhancements to the Xbase Language

FoxPro contains many commands and functions that do not exist in dBASE IV (or, of course, dBASE III PLUS).  Here is a partial list of those commands.

Memory Variable/Array Manipulation

ACOPY( )

ADEL( )

ADIR( )

AELEMENT( )

AFIELDS( )

AINS( )

ALEN( )

ASCAN( )

ASORT( )

ASUBSCRIPT( )

SCATTER

General Commands and Functions

BETWEEN( )

CURDIR( )

EMPTY( )

EXTERNAL

FOR ... ENDFOR ..NEXT

GETFILE( )

GOMONTH( )

HEADER( )

HELP IN WINDOW

LOCFILE( )

OCCURS( )

ON( )

POP KEY

PUSH KEY

RDLEVEL( )

RESTORE FROM FROM <file> | FROM MEMO

RESTORE MACROS FROM <file> | FROM MEMO

SCHEME( )

SCOLS( )

SET HELP TO

SET HOURS TO 12|24

SET NOTIFY ON|OFF

SET PDSETUP TO

SET RESOURCE

SET SHADOWS

SET TRBETWEEN

SET UDFPARMS

SROWS( )

TARGET( )

WAIT WINDOW

Low Level File I/O Functions

FCHSIZE( )

FCLOSE( )*

FCREATE( )*

FEOF( )*

FERROR( )*

FFLUSH( )*

FGETS( )*

FOPEN( )*

FPUTS( )*

FREAD( )*

FSEEK( )*

FWRITE( )*

HEADER( )*

* found only in dBASE IV version 1.5 and higher

SQL Statements

CREATE TABLE FROM ARRAY

INSERT INTO ... VALUES ... FROM ARRAY

SELECT ALL ... DISTINCT ... FROM INTO

SET ANSI

Window Processing Commands and Functions

WBORDER( )

WCHILD( )

WCOLS( )

WEXIST( )

WLAST( )

WLCOL( )

WLROW( )

WMAXIMUM( )

WMINIMUM( )

WONTOP( )

WOUTPUT( )

WPARENT( )

WREAD( )

WROWS( )

WVISIBLE( )

Menu Related Commands and Functions

CNTBAR( )

CNTPAD( )

POP MENU ... TO MASTER

POP POPUP

PRMBAR( )

PRMPAD( )

PUSH MENU

PUSH POPUP

RELEASE BAR

RELEASE PAD

SET MARK OFs

SET STICKY

SET SYSMENU

SIZE POPUP

SKPBAR( )

SKPPAD( )

Keyboard and Mouse Commands and Functions

CAPSLOCK( )

CHRSAW( )

INSMODE( )

KEYBOARD

MDOWN( )

NUMLOCK( )

SET MOUSE TO

Text and Data Formatting

ATCLINE( )

ATLINE( )

PUTFILE( )

MODIFY MEMO

@ ... EDIT - Text Edit Regions

Project/Create Application Commands

BUILD APP ... FROM <project>

BUILD EXE FROM  <project>

BUILD PROJECT

Screen Related Commands

_CUROBJ

OBJNUM( )

RESTORE SCREEN FROM memvar

SHOW GET ... ENABLE | DISABLE

SHOW GETS ENABLE | DISABLE

SHOW OBJECT

Generator Directives

Generator Directives

#ITSEXPRESSION

#READCLAUSES

#REDEFINE

#SECTION

#WNAME


FoxPro Reserved Words

If a dBASE IV program uses a FoxPro reserved word as an array name, FoxPro displays the error message "Attempt to use FoxPro function as an array." If you use a reserved word as a UDF name, FoxPro will call the internal command or function instead, with varying error messages. The following table lists all the FoxPro reserved words:

#ENDIF	#IF	#ITSEXPRESSION
#READCLAUSES	#REGION	#SECTION
#WNAME	.AND.	.F.
.NOT.	.OR.	.T.
@FUNCTION	@PROCEDURE	_ALIGNMENT
_BOX	_CALCMEM	_CALCVALUE
_CLIPTEXT	_CUROBJ	_DBLCLICK
_DIARYDATE	_DOS	_GENGRAPH
_GENMENU	_GENPD	_GENSCRN
_GENXTAB	_INDENT	_LMARGIN
_MAC	_MLINE	_PADVANCE
_PAGENO	_PBPAGE	_PCOLNO
_PCOPIES	_PDRIVER	_PDSETUP
_PECODE	_PEJECT	_PEPAGE
_PFORM	_PLENGTH	_PLINENO
_PLOFFSET	_PPITCH	_PQUALITY
_PRETEXT	_PSCODE	_PSCODE
_PSPACING	_PWAIT	_RMARGIN
_TABS	_TALLY	_TEXT
_THROTTLE	_TRANSPORT	_WINDOWS
_WRAP	ABS	ACCEPT
ACCESS	ACOPY	ACOS
ACTIVATE	ADD	ADDITIVE
ADEL	ADIR	AELEMENT
AFIELDS	AFONT	AFTER
AGAIN	AINS	ALEN
ALIAS	ALL	ALLTRIM
ALTERNATE	AMERICAN	AMPM( )
AND	ANSI	ANSITOOEM
APP	APPEND	APPLICATION
ARRAY	AS	ASC
ASCAN	ASCENDING	ASIN
ASORT	ASSIST	ASUBSCRIPT
AT	ATAN	ATC
ATCLINE	ATLINE	ATN
ATN2	AUTO	AUTOMATIC
AUTOSAVE	AVERAGE	AVG
BAR	BEFORE	BEGIN
BELL	BETWEEN	BG
BLANK	BLINK	BLOCKSIZE
BOF	BORDER	BOTTOM
BOX	BR	BREAK
BRITISH	BROWSE	BRSTATUS
BUILD	BY	CALCULATE
CALL	CANCEL	CAPSLOCK
CARRY	CASE	CATALOG
CDOW	CDX	CEILING
CENTER	CENTURY	CGA
CHAIN	CHANGE	CHR
CHRSAW	CHRTRAN	CLEAR
CLOCK	CLOSE	CMONTH
CNT	CNTBAR	CNTPAD
COL	COLOR	COLOUR
COLUMN	COMMAND	COMMIT
COMPACT	COMPATIBILITY	COMPATIBLE
COMPILE	COMPLETED	COMPRESS
CONFIRM	CONSOLE	CONTINUE
CONVERT	COPY	COS
COUNT	CREATE	CTOD
CURDIR	CURRENCY	CURSOR
CYCLE	DATABASE	DATABASES
DATE	DAY	DB
DB4	DBASEII	DBDATE
DBF	DBMEMO3	DDEAbortTrans
DDEAdvise	DDEEnabled	DDEExecute
DDEInitiate	DDELastError	DDEPoke
DDERequest	DDESetOption	DDESetService
DDESetTopic	DDETerminate	DEACTIVATE
DEBUG	DECIMALS	DECLARE
DEFAULT	DEFINE	DELETE
DELETED	DELIMITED	DELIMITER
DELIMITERS	DESC	DESCENDING
DESIGN	DEVELOPMENT	DEVICE
DIF	DIFFERENCE	DIMENSION
DIR	DIRECTORY	DISABLE
DISKSPACE	DISPLAY	DISTINCT
DMY	DO	DOHISTORY
DOS	DOUBLE	DOW
DTOC	DTOR	DTOS
ECHO	EDIT	EGA25
EGA43	EJECT	ELSE
ELSEIF	EMPTY	ENABLE
ENCRYPT	ENCRYPTION	END
ENDCASE	ENDDO	ENDFOR
ENDIF	ENDPRINTJOB	ENDSCAN
ENDTEXT	ENVIRONMENT	EOF
ERASE	ERROR	ESCAPE
EVALUATE	EXACT	EXCEPT
EXCLUSIVE	EXIT	EXP
EXPORT	EXTENDED	EXTERNAL
FCHSIZE	FCLOSE	FCOUNT
FCREATE	FEOF	FERROR
FFLUSH	FGETS	FIELD
FIELDS	FILE	FILER
FILES	FILL	FILTER
FIND	FIXED	FKLABEL
FKMAX	FLOAT	FLOCK
FLOOR	FLUSH	FONTMETRIC
FOOTER	FOPEN	FOR
FORM	FORMAT	FOUND
FOXPLUS	FOXPRO	FOXQ
FOXSWAP	FPUTS	FREAD
FREEZE	FRENCH	FROM
FSEEK	FSIZE	FULLPATH
FV	FW	FW2
FWRITE	GATHER	GB
GENERAL	GERMAN	GET
GETBAR	GETDIR	GETENV
GETEXPR	GETFILE	GETFONT
GETPAD	GETS	GO
GOMONTH	GOTO	GR
GROUP	GROW	HAVING
HEADER	HEADING	HEIGHT
HELP	HELPFILTER	HIDE
HIGHLIGHT	HISTORY	HOURS
IF	IIF	IMPORT
IN	INDEX	INDEXES
INFORMATION	INKEY	INLIST
INPUT	INSERT	INSMODE
INSTRUCT	INT	INTENSITY
INTO	ISALPHA	ISCOLOR
ISDIGIT	ISLOWER	ISMARKED
ISUPPER	ITALIAN	JAPAN
JOIN	KEY	KEYBOARD
KEYCOMP	LABEL	LAST
LASTKEY	LEDIT	LEFT
LEN	LEVEL	LIB
LIBRARY	LIKE	LINE
LINENO	LINKAGE	LIST
LKSYS	LOAD	LOCATE
LOCFILE	LOCK	LOG
LOG10	LOGERRORS	LOGOUT
LOOKUP	LOOP	LOWER
LPARTITION	LTRIM	LUPDATE
MACKEY	MACRO	MACROS
MARGIN	MARK	MASTER
MAX	MCOL	MDOWN
MDX	MDY	MEMLINES
MEMO	MEMORY	MEMOWIDTH
MEMVAR	MENU	MENUS
MESSAGE	MESSAGES	MIN
MINIMIZE	MLINE	MOD
MODAL	MODIFY	MODULE
MONO43	MONTH	MOUSE
MOVE	MOVER	MRKBAR
MRKPAD	MROW	MULTI
MULTILOCKS	NDX	NEAR
NETWORK	NEXT	NOALIAS
NOAPPEND	NOCLEAR	NOCLOSE
NOCONSOLE	NODEBUG	NODELETE
NOEDIT	NOEJECT	NOENVIRONMENT
NOFLOAT	NOFOLLOW	NOGROW
NOINIT	NOLGRID	NOLINK
NOLOCK	NOMARGIN	NOMENU
NOMODIFY	NOMOUSE	NONE
NOOPTIMIZE	NOOVERWRITE	NOREFRESH
NORGRID	NORM	NORMAL
NOSAVE	NOSHADOW	NOSHOW
NOT	NOTAB	NOTE
NOTIFY	NOUPDATE	NOWAIT
NOWINDOW	NOZOOM	NPV
NUMBER	NUMLOCK	OBJECT
OBJNUM	OCCURS	ODOMETER
OEMTOANSI	OF	OFF
ON	ONKEY	ONLY
OPEN	OPTIMIZE	OR
ORDER	OS	OTHERWISE
OVERWRITE	PACK	PAD
PADC	PADL	PADR
PAGE	PALETTE	PANEL
PARAMETERS	PARTITION	PATH
PAUSE	PAYMENT	PCOL
PDOX	PDRIVER	PDSETUP
PFS	PI	PICTURE
PLAIN	PLAY	POINT
POP	POPUP	POPUPS
PRECISION	PREFERENCE	PREVIEW
PRIMARY	PRINT	PRINTER
PRINTJOB	PRINTSTATUS	PRIVATE
PRMBAR	PRMPAD	PRODUCTION
PROGRAM	PROJECT	PROMPT
PROPER	PROW	PUBLIC
PUSH	PUTFILE	PV
QUERY	QUIT	RAND
RANDOM	RANGE	RANK
RAT	RATLINE	RB
RDLEVEL	READ	READERROR
READKEY	RECALL	RECCOUNT
RECNO	RECORD	RECSIZE
REDIT	REFERENCE	REFRESH
REGION	REGIONAL	REINDEX
RELATION	RELATIVE	RELEASE
REMARK	RENAME	REPLACE
REPLICATE	REPORT	REPROCESS
RESET	RESOURCE	REST
RESTORE	RESUME	RETRY
RETURN	RG	RIGHT
RLOCK	ROLLBACK	ROUND
ROW	RPD	RTOD
RTRIM	RUN	SAFETY
SAME	SAMPLE	SAVE
SAY	SCAN	SCATTER
SCHEME	SCOLS	SCOREBOARD
SCREEN	SCROLL	SDF
SECONDARY	SECONDS	SECTION
SEEK	SELECT	SELECTION
SEPARATOR	SEQUENCE	SET
SHADOW	SHADOWS	SHELL
SIGN	SIN	SHOW
SIZE	SKIP	SINGLE
SKPPAD	SNAP	SKPBAR
SNAPMACRO	SOFTSEEK	SNAPCODE
SOUNDEX	SPACE	SORT
SQRT	SROWS	SQL
STD	STEP	STATUS
STORE	STR	STICKY
STRUCTURE	STUFF	STRTRAN
SUBSTR	SUM	STYLE
SUSPEND	SYLK	SUMMARY
SYSMENU	SYSMETIRC	SYS
TAB	TABLE	SYSTEM
TAG	TALK	TABS
TARGET	TEXT	TAN
TIME	TIMEOUT	TEXTMERGE
TITLES	TO	TITLE
TOPIC	TOTAL	TOP
TRANSFORM	TRAP	TRANSACTION
TRIM	TXTWIDTH	TRBETWEEN
TYPEAHEAD	UDFPARMS	TYPE
UNIQUE	UNLOCK	UNION
UPDATE	UPDATED	UNPACK
USA	USE	UPPER
USER	USERS	USED
VAL	VALID	USING
VALUES	VAR	VALUE
VERSION	VGA	VARREAD
VGA50	VIEW	VGA25
WBORDER	WCHILD	WAIT
WEXIST	WFONT	WCOLS
WHERE	WHILE	WHEN
WINDOW	WINDOWS	WIDTH
WK	WK1	WITH
WKS	WLAST	WK3
WLROW	WMAXIMUM	WLCOL
WONTOP	WORKAREA	WMINIMUM
WPARENT	WR	WOUTPUT
WRAP	WREAD	WR1
WROWS	WRK	WTITLE
WVISIBLE	XLS	YEAR
YMD	ZAP	ZOOM