Funcion GetUserName

HMG en Español

Moderator: Rathinagiri

Post Reply
User avatar
luisvasquezcl
Posts: 1258
Joined: Thu Jul 31, 2008 3:23 am
Location: Chile
Contact:

Funcion GetUserName

Post by luisvasquezcl »

Hola estimados:
quisiera saber si es posible implementar la funcion getusername() o si existe alguna parecida en hmg.
saludos cordiales,
LUis Vasquez
User avatar
mol
Posts: 3718
Joined: Thu Sep 11, 2008 5:31 am
Location: Myszków, Poland
Contact:

Re: Funcion GetUserName

Post by mol »

What this function should to do?
(i don't know GetUserName()...)
User avatar
luisvasquezcl
Posts: 1258
Joined: Thu Jul 31, 2008 3:23 am
Location: Chile
Contact:

Re: Funcion GetUserName

Post by luisvasquezcl »

Hi Mol,
With this function you can get the user name
computer.
regards,
luis vasquez
User avatar
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

Post 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
Attachments
libgetenv.zip
(424 Bytes) Downloaded 582 times
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
User avatar
Alex Gustow
Posts: 290
Joined: Thu Dec 04, 2008 1:05 pm
Location: Yekaterinburg, Russia
Contact:

Re: Funcion GetUserName

Post 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.
User avatar
esgici
Posts: 4543
Joined: Wed Jul 30, 2008 9:17 pm
DBs Used: DBF
Location: iskenderun / Turkiye
Contact:

Re: Funcion GetUserName

Post by esgici »

Thanks Rathi :)

Regards

--

Esgici
Viva INTERNATIONAL HMG :D
User avatar
luisvasquezcl
Posts: 1258
Joined: Thu Jul 31, 2008 3:23 am
Location: Chile
Contact:

Re: Funcion GetUserName

Post 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
User avatar
luisvasquezcl
Posts: 1258
Joined: Thu Jul 31, 2008 3:23 am
Location: Chile
Contact:

Re: Funcion GetUserName

Post 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,
User avatar
karweru
Posts: 220
Joined: Fri Aug 01, 2008 1:51 pm
DBs Used: DBF,mysql,mariadb,postgresql,sqlite,odbc
Contact:

Re: Funcion GetUserName

Post 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.
Kind regards,
Gilbert.
Post Reply