Microsoft KB Archive/92971

From BetaArchive Wiki
< Microsoft KB Archive
Revision as of 14:19, 21 July 2020 by X010 (talk | contribs) (Text replacement - "&" to "&")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

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

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:


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