I placed strReportsRun = Environment("UserName") & "->" & Environment("LocalHostRun") in my vbs file and then I tried in my function file and test file. I still get "Variable is undifined" for both in my watch list.
There are multiple ways you can associate a function library:
1. Goto File -> Settings -> Resources -> Associate Function Libraries
2. ExecuteFile "C:\mylib.vbs" which will load the Function Library. The disadvantage here if you put breakpoint in vbs file the control flow wont stop at breakpoint.
3. LoadFunctionLibrary "C:\mylib.vbs".., works only from QTP 11 onwards.
Regarding to accessing Environmental variables,
Environment("UserName") and Environment.value("UserName") are same
For Environmental varaiables "Value" is default property.
Dont use the code like
strReportsRun = A & "->" & C (or B & D)
strReportsRun = A & "->" & C
strReportsRun = B & "->" & D