The information in this article applies to:
- Microsoft FoxPro for MS-DOS, versions 2.0, 2.5x, 2.6, 2.6a
- Microsoft FoxPro for Windows, versions 2.5x, 2.6, 2.6a
- Microsoft FoxPro for Macintosh, versions 2.5x, 2.6a
- Microsoft FoxPro for UNIX, version 2.6
SUMMARY
This article explains how to change all variables from having aliases to
memory variables. For example, suppose the field on the screen has
CUSTOMER.CNO for input and M.CNO is wanted instead. There is no dialog box
in the interface that allows the variables to be globally changed.
MORE INFORMATION
There are two ways to change the variables:
- Double-click each field and manually remove the name of the database and
the period. Then add "m." (without the quotation marks) before the name
of the variable.
-or-
- Edit the screen file by issuing the following commands in the Command
window:
CLOSE ALL && closes all open windows and tables
USE <screen name>.scx && opens screen file as a database file
REPLACE name WITH ;
"m."+STRTRAN(name,<table name in quotes>+".","") ;
FOR objtype=15 && replace table alias with "m."
USE && close screen file
NOTE: This sample code is limited to changing GET fields and will
only work with screens that are based on a single table.
The following steps set up a sample screen and show how to implement the
second option above.
- Open the CUSTOMER table that is located in the FoxPro TUTORIAL
subdirectory.
- From the File menu, choose New, select the Screen radio button, and
choose the New button.
- From the Screen menu, choose Quick Screen.
A small window with the title "Quick Screen" appears.
- Make sure that the Add Alias check box is selected.
- Choose OK.
- Double-click one of the fields. Note that "customer.<field name>"
appears. Choose the Cancel button.
- Press CTRL+W to save the screen.
- Save the file as TEST.SCX, and save the environment when prompted.
- In the Command window, type the following command and press ENTER:
USE test.scx
- In the Command window, type the following command and press ENTER:
REPLACE name WITH "m."+STRTRAN(name,"customer.","") FOR objtype=15
- In the Command window, type the following command and press ENTER:
USE
Open the TEST.SCX screen and note that instead of having CUSTOMER.CNO,
CUSTOMER.STATE, CUSTOMER.YTDPURCH, the input for the fields on the screen
are M.CNO, M.STATE, and M.YTDPURCH.
REFERENCES
Microsoft FoxPro 2.6 for MS-DOS "Update" page 4-32 and Microsoft FoxPro
2.6 for Windows "Developer's Guide" page A-32.
|