Opens an editing window so you can modify or create a program file.
MODIFY COMMAND [FileName | ?] [NOEDIT] [NOMENU] [NOWAIT] [RANGE nStartCharacter, nEndCharacter] [[WINDOW WindowName1] [IN [WINDOW] WindowName2 | IN SCREEN]] [AS nCodePage] [SAME] [SAVE] |
Parameters
- FileName
- Specifies the file name for the program to open or create. If you don't specify an extension for a new program file, Visual FoxPro automatically assigns a .prg extension. MODIFY COMMAND supports a file skeleton that contains the asterisk (*) and question mark (?) wildcards. An editing window is opened for each program whose file name matches the file skeleton. If you omit the file name, an editing window opens for a file initially named Prog1.prg. When you close the editing window, you can save the file with a different name.
- ?
- Displays the Open dialog box. Choose one of the existing programs or enter the name of a new program to create.
- NOEDIT
- Specifies that the program file can't be changed, but can be viewed and copied to the Clipboard.
- NOMENU
- Removes the Format menu title from the Visual FoxPro system menu bar, preventing changes to font, font size, line spacing, and indentation.
- NOWAIT
-
Continues program execution after the editing window is opened. The program doesn't wait for the editing window to be closed, but continues execution on the program line immediately following the line that contains MODIFY COMMAND NOWAIT. If you omit NOWAIT when MODIFY COMMAND is used in a program, an editing window is opened and program execution pauses until the editing window is closed.
NOWAIT is effective only from within a program. It has no effect on MODIFY COMMAND when issued from the Command window.
An implicit NOWAIT occurs if you open more than one editing window with a single MODIFY COMMAND command. For example:
В Copy Code MODIFY COMMAND *.PRG.
- RANGE nStartCharacter, nEndCharacter
- Specifies a range of characters selected when the editing window is opened. Characters are selected starting at the position specified with nStartCharacter up to (but not including) the character position of nEndCharacter. If nStartCharacter is equal to nEndCharacter, no characters are selected, and the cursor is placed at the position specified with nStartCharacter.
- WINDOW WindowName1
- Specifies a window whose characteristics the editing window takes on. For example, if the window is created with the FLOAT option of DEFINE WINDOW, the editing window can be moved. The window need not be active or visible, but it must be defined.
- IN [WINDOW] WindowName2
- Specifies a parent window in which the editing window is opened. The editing window doesn't assume the characteristics of the parent window and cannot be moved outside the parent window. If the parent window is moved, the editing window moves with it. The parent window must first be defined with DEFINE WINDOW, and must be visible, to access the editing window.
- IN SCREEN
- Explicitly opens the editing window in the main Visual FoxPro window, after it has been placed in a parent window. An editing window is placed in a parent window by including the IN WINDOW clause.
- AS nCodePage
- Automatically converts accented characters in a program file created on another Visual FoxPro platform. The numeric expression nCodePage specifies the code page of the Visual FoxPro platform on which the program file was created. The file is saved in this code page unless you choose Save As from the File menu to save the file in a different code page.
- SAME
- Prevents the editing window from coming forward as the active window. If the editing window is hidden, it is displayed but doesn't become the active window.
- SAVE
- Leaves the editing window open after another window is activated. If you omit SAVE, the editing window is closed when another window is activated. Including SAVE has no effect when issued from the Command window.
Remarks
When modifications are made to a program file, the updated file is written to disk. In Visual FoxPro, a backup file with a .bak extension is created if you select the Make Backup Copy check box on the Edit Properties dialog box, which appears when you choose Properties from the Edit menu.
The built-in Visual FoxPro editor is used unless you specify an external editor with TEDIT in your configuration file.