The information in this article applies to:
- Microsoft FoxPro for Windows, version 2.6a
- Microsoft FoxPro for MS-DOS, version 2.6a
SYMPTOMS
A FoxPro stand-alone executable ignores parameters passed to it if they are
preceded by a hyphen, even if the whole expression is enclosed in quotes.
The subsequent parameters (if any) are shifted to the left.
RESOLUTION
Pass the parameters with a different preceding character. Some valid
characters are:
- Forward slash: /
- Pound sign: #
- Left parenthesis: (
- Right parenthesis: )
STATUS
Microsoft has confirmed this to be a problem in the Microsoft products
listed at the beginning of this article. We are researching this problem
and will post new information here in the Microsoft Knowledge Base as it
becomes available.
MORE INFORMATION
Steps to Reproduce Problem
- Create a new project by using the File menu.
- In the project window, choose New; then choose program.
- In the newly created program window, type the following code:
PARAMETERS n1, n2, n3, n4
WAIT WINDOW "Parameters received: " + LTRIM(STR(PARAMETERS()))
WAIT WINDOW IIF(TYPE("n1")=="N", STR(n1), n1)
WAIT WINDOW IIF(TYPE("n2")=="N", STR(n2), n2)
WAIT WINDOW IIF(TYPE("n3")=="N", STR(n3), n3)
WAIT WINDOW IIF(TYPE("n4")=="N", STR(n4), n4)
- Press CTRL+W to close and save this program. When prompted for a name,
enter MYFILE.PRG.
- In the project window, choose build. Then choose build executable. The
type of executable in FoxPro for MS-DOS is irrelevant to this example.
Confirm the subsequent dialogs. When prompted for a name, type MYFILE
each time.
- Close FoxPro.
- Start the executable, passing it four parameters, two of which are
negative numbers.
- In FoxPro for MS-DOS, type the following at the MS-DOS prompt
and press ENTER:
MYFILE.EXE 5 -6 7 -8
- In FoxPro for Windows, choose Run from the File menu, and type the
command line:
MYFILE.EXE 5 -6 7 -8
- Note that the first wait window reports that only two parameters were
passed. The subsequent wait windows show that the executable ignored the
second and fourth parameters, and shifted the third parameter to the
left, assigning its value to the second variable. The last two wait
windows generate errors because they have no variable to display.
|