Microsoft KB Archive/41137

From BetaArchive Wiki
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

MS-DOS Shell Variables Must Be Initialized PSS ID Number: Q41137 Article last modified on 09-16-1993 PSS database name: O_MSDOS

4.00 4.01

MS-DOS

The information in this article applies to:
- Microsoft MS-DOS operating system versions 4.0 and 4.01

SUMMARY

Example 3 on page 99 of the “Microsoft MS-DOS Shell User’s Guide” for versions 4.0 and 4.01 is incorrect.

When you use this example to create custom dialog boxes and variables, and you start a program that uses the dialog box variables, the following error message is displayed:

Parameter uninitialized in program startup command.

MORE INFORMATION

The /D“%1” option in Example 3 in the “Microsoft MS-DOS Shell User’s Guide” is incorrect when invoked without a previous setting of the %1 parameter. It may function properly in some cases where the %1 variable is already initialized.

The /D“%1” option tells the MS-DOS Shell to use whatever is in %1 as the default entry. However, if the %1 variable has not been initialized, /D will fail. The /C“%1” option will use the last saved %1 variable from any process run within the MS-DOS Shell.

Therefore, if you set up and run Example 1 and then execute Example 3, you will get the expected results. If you execute Example 3 as the first application, the MS-DOS Shell will issue the “Parameter uninitialized in program startup command” error message. The MS-DOS Shell does not use a default value of null if the variable has not been initialized.

The /D“%n” option is not usually recommended because it is difficult to guarantee that your application will be executed at least once to initialize the variable.

NOTE: This documentation error does not occur in later versions.

Additional reference words: 4.00 4.01 noupd docerr

Copyright Microsoft Corporation 1993.