Microsoft KB Archive/92971

{| = How to Pass Parameters from MS-DOS to FoxPro for MS-DOS =
 * width="100%"|

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 &quot;This is parameter 1: &quot;+x wait window &quot;This is parameter 2: &quot;+y wait window &quot;This is parameter 3: &quot;+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.</li>  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 &quot;This is parameter 1: &quot;+x wait window &quot;This is parameter 2: &quot;+str(y) wait window &quot;This is parameter 3: &quot;+DTOC(z) </li></ul>