Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Environment Variables

Status
Not open for further replies.

lolo327

Programmer
Nov 25, 2003
14
GB
I would like to read (and write) environment variables the
application.

I have tried to use the API funciton GetEnvironmentVariableA but, if
I do not use a set beafore, the string is empty. I would like, for
example, read the value for the environment variable PATH.

Has anyone any idea about how to do ?

Thx


 
Try this:.....

ContextKeyword lcxk_base
string ls_Path
string ls_values[]

this.GetContextService("Keyword", lcxk_base)
lcxk_base.GetContextKeywords("path", ls_values)
IF Upperbound(ls_values) > 0 THEN
ls_Path = ls_values[1]
ELSE
ls_Path = "*UNDEFINED*"
END IF

messagebox ( "ls" , ls_path)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top