Funcion GetUserName
Moderator: Rathinagiri
- luisvasquezcl
- Posts: 1258
- Joined: Thu Jul 31, 2008 3:23 am
- Location: Chile
- Contact:
Funcion GetUserName
Hola estimados:
quisiera saber si es posible implementar la funcion getusername() o si existe alguna parecida en hmg.
saludos cordiales,
LUis Vasquez
quisiera saber si es posible implementar la funcion getusername() o si existe alguna parecida en hmg.
saludos cordiales,
LUis Vasquez
Re: Funcion GetUserName
What this function should to do?
(i don't know GetUserName()...)
(i don't know GetUserName()...)
- luisvasquezcl
- Posts: 1258
- Joined: Thu Jul 31, 2008 3:23 am
- Location: Chile
- Contact:
Re: Funcion GetUserName
Hi Mol,
With this function you can get the user name
computer.
regards,
luis vasquez
With this function you can get the user name
computer.
regards,
luis vasquez
- Rathinagiri
- Posts: 5471
- Joined: Tue Jul 29, 2008 6:30 pm
- DBs Used: MariaDB, SQLite, SQLCipher and MySQL
- Location: Sivakasi, India
- Contact:
Re: Funcion GetUserName
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:
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
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
Some other environment variables you can get can be seen here.
http://www.scriptlogic.com/support/Cust ... rence.html
- Attachments
-
- libgetenv.zip
- (424 Bytes) Downloaded 657 times
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
South or North HMG is worth.
...the possibilities are endless.
- Alex Gustow
- Posts: 290
- Joined: Thu Dec 04, 2008 1:05 pm
- Location: Yekaterinburg, Russia
- Contact:
Re: Funcion GetUserName
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.
(DEMO.PRG - file date 2006-12-21)
It works fine (as I can see).
Rathi, thanks for advice about "getenv" library.
- luisvasquezcl
- Posts: 1258
- Joined: Thu Jul 31, 2008 3:23 am
- Location: Chile
- Contact:
Re: Funcion GetUserName
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
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
- luisvasquezcl
- Posts: 1258
- Joined: Thu Jul 31, 2008 3:23 am
- Location: Chile
- Contact:
Re: Funcion GetUserName
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,
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,
- karweru
- Posts: 220
- Joined: Fri Aug 01, 2008 1:51 pm
- DBs Used: DBF,mysql,mariadb,postgresql,sqlite,odbc
- Contact:
Re: Funcion GetUserName
Waoooh...Thanks everyone. This will be very usefull for me.I saw the page that Rathi kindly informed us and I find it
may access these environment variables with the command
GETE ( 'var_name').
Kind regards,
Gilbert.
Gilbert.