Page 1 of 1
Funcion GetUserName
Posted: Mon Dec 14, 2009 4:57 pm
by luisvasquezcl
Hola estimados:
quisiera saber si es posible implementar la funcion getusername() o si existe alguna parecida en hmg.
saludos cordiales,
LUis Vasquez
Re: Funcion GetUserName
Posted: Mon Dec 14, 2009 8:47 pm
by mol
What this function should to do?
(i don't know GetUserName()...)
Re: Funcion GetUserName
Posted: Tue Dec 15, 2009 2:00 am
by luisvasquezcl
Hi Mol,
With this function you can get the user name
computer.
regards,
luis vasquez
Re: Funcion GetUserName
Posted: Tue Dec 15, 2009 4:03 am
by Rathinagiri
You can use this user defined function.
Save this libgetenv.a in c:\hmg\lib folder. Add getenv library in your linker list.
Run this simple program:
Code: Select all
# include "minigui.ch"
function main
msginfo(getenvironmentvariable("UserName"))
return nil
You can get the current username.
Some other environment variables you can get can be seen here.
http://www.scriptlogic.com/support/Cust ... rence.html
Re: Funcion GetUserName
Posted: Tue Dec 15, 2009 5:05 am
by Alex Gustow
Hmm... But what's wrong (for you, Luis) with "\SAMPLES\BASIC\GetUserName" ?
(DEMO.PRG - file date 2006-12-21)
It works fine (as I can see).
Rathi, thanks for advice about "getenv" library.
Re: Funcion GetUserName
Posted: Tue Dec 15, 2009 10:23 am
by esgici
Thanks Rathi
Regards
--
Esgici
Re: Funcion GetUserName
Posted: Tue Dec 15, 2009 6:15 pm
by luisvasquezcl
Muchas gracias a todos por sus respuestas.
Probaré el ejemplo de Rathi.
Estimado Alex, la funcion GetuserName existe en minigui extend pero no en hmg.
Thanks for all
Best Regards,
Luis Vasquez
Re: Funcion GetUserName
Posted: Tue Dec 15, 2009 6:30 pm
by luisvasquezcl
Dear,
I saw the page that Rathi kindly informed us and I find it
may access these environment variables with the command
GETE ( 'var_name').
Again thanks for your support.
Best regards,
Estimados,
Vi la pagina que gentilmente nos informó Rathi y me encuentro que es
posible acceder a esas variables de entorno con el comando
GETE('Nombre_variable').
Nuevamente gracias por su apoyo.
Saludos cordiales,
Re: Funcion GetUserName
Posted: Wed Dec 16, 2009 6:30 am
by karweru
I saw the page that Rathi kindly informed us and I find it
may access these environment variables with the command
GETE ( 'var_name').
Waoooh...Thanks everyone. This will be very usefull for me.