How to Pass Parameters from MS-DOS to FoxPro for MS-DOS

Last reviewed: April 17, 1995
Article ID: Q92971
The information in this article applies to:
  • Microsoft FoxPro for MS-DOS, versions 1.02, 2.0, 2.5, and 2.5a

SUMMARY

The method used to pass parameters from the MS-DOS prompt to Microsoft FoxPro for MS-DOS differs between version 1.02 and later versions. Below are the requirements for each version.

MORE INFORMATION

The following rules apply to FoxPro versions 2.0 and later for MS-DOS:

  • Do not enclose Character-type parameters in single quotation marks.
  • Separate multiple parameters with a space.
  • Each parameter is received in the Character type. Use the conversion functions when parameters have other types.
  • If an application is invoked in the FoxPro command line, the application must begin with a PARAMETERS statement.

    For example, in FoxPro 2.0 and later, use the following command from the MS-DOS prompt:

          FOXPROL test.prg hello 24 01/01/89 .T.
    

    The contents of TEST.PRG are listed below:

          Test.prg    && For FoxPro 2.0 and 2.5
          parameters x,y,z
    
          wait window "This is parameter 1: "+x
          wait window "This is parameter 2: "+y
          wait window "This is parameter 3: "+z
    
    
The following rules apply to FoxPro version 1.02 for MS-DOS:
  • Enclose character type parameters in single quotation marks.
  • The WITH keyword must be used when starting FoxPro.
  • Use a comma to separate multiple parameters.
  • Any type of parameter (logical, numeric, and so on) can be used.

    For example, in FoxPro 1.02 use the following command from the MS-DOS prompt:

          FOXPROLN test.prg WITH 'hello', 24, {01/01/89}, .T.
    

    The contents of TEST.PRG are listed below:

          Test.prg    && For FoxPro 1.02
          parameters x,y,z
    
          wait window "This is parameter 1: "+x
          wait window "This is parameter 2: "+str(y)
          wait window "This is parameter 3: "+DTOC(z)
    
    

REFERENCES

For information about passing parameters from Windows to FoxPro for Windows, query on the following words here in the Microsoft Knowledge Base:

   passing and parameters and foxpro and windows and character


Additional reference words: FoxDos 2.00 2.50 2.50a
KBCategory: kbprg
KBSubcategory:


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: April 17, 1995
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.