Funcion GetUserName

HMG en Español

Moderator: Rathinagiri

Post Reply
User avatar
luisvasquezcl
Posts: 1154
Joined: Thu Jul 31, 2008 3:23 am
Location: Chile
Has thanked: 15 times
Been thanked: 15 times
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: 3333
Joined: Thu Sep 11, 2008 5:31 am
Location: Myszków, Poland
Has thanked: 252 times
Been thanked: 152 times
Contact:

Post by mol »

What this function should to do?
(i don't know GetUserName()...)

User avatar
luisvasquezcl
Posts: 1154
Joined: Thu Jul 31, 2008 3:23 am
Location: Chile
Has thanked: 15 times
Been thanked: 15 times
Contact:

Post by luisvasquezcl »

Hi Mol,
With this function you can get the user name
computer.
regards,
luis vasquez

User avatar
Rathinagiri
Posts: 5287
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Has thanked: 178 times
Been thanked: 196 times
Contact:

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 313 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:

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: 4529
Joined: Wed Jul 30, 2008 9:17 pm
DBs Used: DBF
Location: iskenderun / Turkiye
Has thanked: 402 times
Been thanked: 114 times
Contact:

Post by esgici »

Thanks Rathi :)

Regards

--

Esgici
Viva INTERNATIONAL HMG :D

User avatar
luisvasquezcl
Posts: 1154
Joined: Thu Jul 31, 2008 3:23 am
Location: Chile
Has thanked: 15 times
Been thanked: 15 times
Contact:

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: 1154
Joined: Thu Jul 31, 2008 3:23 am
Location: Chile
Has thanked: 15 times
Been thanked: 15 times
Contact:

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: 193
Joined: Fri Aug 01, 2008 1:51 pm
DBs Used: DBF,mysql,mariadb,postgresql,sqlite,odbc
Been thanked: 9 times
Contact:

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