Funcion GetUserName

HMG en Español

Moderator: Rathinagiri

Post Reply
User avatar
luisvasquezcl
Posts: 1024
Joined: Thu Jul 31, 2008 3:23 am
Location: Chile
Has thanked: 11 times
Been thanked: 14 times
Contact:

Funcion GetUserName

Post by luisvasquezcl » Mon Dec 14, 2009 4:57 pm

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: 2833
Joined: Thu Sep 11, 2008 5:31 am
Location: Myszków, Poland
Has thanked: 118 times
Been thanked: 62 times
Contact:

Post by mol » Mon Dec 14, 2009 8:47 pm

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

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

Post by luisvasquezcl » Tue Dec 15, 2009 2:00 am

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

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

Post by Rathinagiri » Tue Dec 15, 2009 4:03 am

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 138 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 » Tue Dec 15, 2009 5:05 am

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

Post by esgici » Tue Dec 15, 2009 10:23 am

Thanks Rathi :)

Regards

--

Esgici
Viva INTERNATIONAL HMG :D

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

Post by luisvasquezcl » Tue Dec 15, 2009 6:15 pm

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

Post by luisvasquezcl » Tue Dec 15, 2009 6:30 pm

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: 149
Joined: Fri Aug 01, 2008 1:51 pm
Contact:

Post by karweru » Wed Dec 16, 2009 6:30 am

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