Microsoft KB Archive/62208

= Environment Variable Must Be Uppercase in ENVIRON$ =

Article ID: 62208

Article Last Modified on 11/21/2006

-

APPLIES TO


 * Microsoft QuickBasic 4.0
 * Microsoft QuickBASIC 4.0b
 * Microsoft QuickBasic 4.5 for MS-DOS
 * Microsoft BASIC Compiler 6.0
 * Microsoft BASIC Compiler 6.0b
 * Microsoft BASIC Professional Development System 7.0
 * Microsoft BASIC Professional Development System 7.1

-



This article was previously published under Q62208



SUMMARY
If &quot;Set name=test&quot; is entered in lowercase letters at the DOS command line, the ENVIRON$(&quot;NAME&quot;) function returns &quot;test&quot; only if &quot;name&quot; is in all uppercase letters in the ENVIRON$ function. If &quot;name&quot; is not in uppercase letters or if it is in mixed case, a null string will be returned. In other words, the argument to the ENVIRON$ function must be in all uppercase letters or a null string will be returned.

This behavior occurs in Microsoft QuickBasic versions 4.00, 4.00b, and 4.50, Microsoft Basic Compiler versions 6.00 and 6.00b, and Microsoft Basic Professional Development System (PDS) versions 7.00 and 7.10 for MS-DOS.

Program
A$= ENVIRON$(&quot;NAME&quot;)         'Don't use ENVIRON$(&quot;name&quot;) PRINT A$

Output
test

Additional query words: QuickBas BasicCom

Keywords: KB62208

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.