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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

? getenv("username")

Status
Not open for further replies.

blumash

Programmer
Oct 2, 2003
50
0
0
HU
I have this command to get the username & it's working fine in FPW , my question is how can I combine this command in a program & put the return username in a memory variable.

Thanks
 
I hope I'm answering the question you're asking. To preserve the username, write a little function stored in a PRG:

Code:
* GetUName.PRG
RETURN GetEnv("username")

To use your function, simply call it and store the result from another program:

Code:
cUserName = GetUName()

GetUName.PRG needs to be in the FoxPro path for that call to work.

Tamar
 
Thank's TamarGranor . It's working fine , I need the user name in a form screen program , can I skip the PRG & put evrything in the form program ???

Thank's again
 
Sure. You can just call GetEnv() and store the result in a variable:

cUserName = GetEnv("username")

Then, you can use that variable.

Tamar
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top