Environment Variable Must Be Uppercase in ENVIRON$ (62208)



The information in this article applies to:

  • Microsoft QuickBASIC 4.0
  • Microsoft QuickBASIC 4.0b
  • Microsoft QuickBASIC 4.5
  • Microsoft BASIC Compiler for MS-DOS and OS/2 6.0
  • Microsoft BASIC Compiler for MS-DOS and OS/2 6.0b
  • Microsoft Basic Professional Development System for MS-DOS 7.0
  • Microsoft Basic Professional Development System for MS-DOS 7.1

This article was previously published under Q62208

SUMMARY

If "Set name=test" is entered in lowercase letters at the DOS command line, the ENVIRON$("NAME") function returns "test" only if "name" is in all uppercase letters in the ENVIRON$ function. If "name" 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$("NAME")          'Don't use ENVIRON$("name")
   PRINT A$
				

Output

test


Modification Type:MinorLast Reviewed:8/16/2005
Keywords:KB62208