• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 208
  • Last Modified:

Accessing Environment variables

Hi all,

I want to know if its possible to access the values that are already in the Notes.ini. (not user defined variables).

Reason is this - I need to get a UserId out of the Notes.ini, the only way to get the user Id is to use the ID filename (eg userid.id) and the only way I can get to this effectively is to use the ini.

I tried using @environment("Keyfilename") but this returns a NULL. If I use @environment("Keyfilename";"Test") to set it, then a new value turns up in the ini as $Keyfilename=test - which I dont want!

I guess what Im really asking is there anyway to get the filename of the id file that is currently in use? (So that it changes when you use SwitchID). I have tried using @maildbname, but this doesnt change when I use switch ID.

Any ideas?

Mat
0
prenexus
Asked:
prenexus
1 Solution
 
ArunkumarCommented:
Hi Mat,

I am not sure to what you are upto.

Anyway,
Try setting the environment values using script.  You can avoid the $ prepending the variable name.

Check SetEnvironmentVar in Notes help for more details...

Good Luck !

-Arun

0
 
HemanthaKumarCommented:
HI

You can extract the system parameters defined in Notes.ini using script, Here is the code to do that:

     Dim session As New NotesSession
     Msgbox session.GetEnvironmentString( "KeyFileName", True )

Simple, but there is no way (as far as my knowledge goes) to do it thru Notes Formula Lang,

Good Luck
~Hemanth
0
 
stampCommented:
Hi,

put into your (I hope admin) mail memo for a button.

Put into button click event this code:
Sub Click(Source As Button)
 Dim FileName As String
 Dim fileNumber As Integer
 Dim InputLine As String
 FileName = "notes.ini"
 FileNumber = Freefile()
 Open FileName For Input As #FileNumber
 Do While Not Eof(FileNumber)
  Input #FileNumber, InputLine
  If (Left$(InputLine,12) = "KeyFilename=") Then
   Print InputLine                  
  End If
 Loop
 Close #FileNumber
End Sub

Send such a memo to user and let him try...

Perhaps he hes to allow you access in his ECL!!!

But wath do you need this for???

Regards,
stamp

0
 
stampCommented:
I forgot...

if you are interested, I have the code to automaticaly send back to you
the complete notes.ini from user...

Give me a note.

Regards,
stamp
0
 
prenexusAuthor Commented:
Thanks everyone!

All those answers were great!

Ill give the points to Arun, seeing as he ws first in this morning.

Many thanks again,

Mat
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now