Home
Search
 
What's New
Index
Books
Links
Q & A
Newsletter
Banners
 
Feedback
Tip Jar
 
 
 
 
 
 
 
 
Old Pages
 
Old Index
Site Map
What's New
 
Books
How To
Tips & Tricks
Tutorials
Stories
Performance
Essays
Links
Q & A
New in VB6
Free Stuff
Pictures
 
 
 
TitleDisplay all of a program's environment variables
Keywordsenvironment variables
CategoriesSoftware Engineering, Windows
 
The Environ function takes as a parameter either the name of a variable or an index into the collection of variables defined. To list all of the environment variables, pass the function increasing indexes until it returns an empty string.
 
Private Sub Form_Load()
Dim i As Integer
Dim txt As String

    i = 1
    Do
        If Environ(i) = "" Then Exit Do

        txt = txt & Environ(i) & vbCrLf
        i = i + 1
    Loop

    Text1.Text = txt
End Sub
 
 
Copyright © 1997-2003 Rocky Mountain Computer Consulting, Inc.   All rights reserved.
  Updated