Environ( "Directory") problem

Why wouldn’t the LS code

Dim strNotesDataDir$

strNotesDatadir = Environ$( “Directory”)

work? A blank is returned. I looked in notes.ini and it’s there. CurDir works just fine. Help! Thanks.

-Don Lawton

Subject: Environ( “Directory”) problem

From Designer Help:

Environ function

Returns information about an environment variable from the operating system.

Instead of using Environ, you should be using NotesSession.GetEnvironmentString (and set the System parameter to True)

Subject: RE: Environ( “Directory”) problem

Ah, but also from Designer Help:

“If you specify the environment variable by name with environName, LotusScript returns the value of the specified environment variable.”

So theoretically the code in question should work. I can’t say I’ve ever used it that way, though, and do use GetEnvironmentString successfully.

Subject: RE: Environ( “Directory”) problem

Esther, the code in question cannot work for what Don’s using it for.

Yes, the Environ function works with named environment variables, but it’s strictly for operating system variables.

It will not return any value from the Notes.ini file. Stick with NotesSession.GetEnvironmentString for that purpose.

Subject: RE: Environ( “Directory”) problem

Ahhh, so ENVIRON is just for OS environment variables (I looked up ClassPath just for fun!). I should read the docs more carefully. NotesSession.GetEnvironmentString works as expected. Thanks all.

-Don