Skip to main content
Solved

Automatically show username

  • January 31, 2023
  • 4 replies
  • 76 views

Forum|alt.badge.img+1

Hello,

 

I want to show a user name automatically for every person that uses my model, for example when Jim opens he aimms project, I want the model to detect it’s Jim and  save it in parameter and show it in page my question is how can we detect user infos when the model is opened ?  Thank you

Best answer by Marcel Hunting

You can use

EnvironmentGetString( "USERNAME", str );

where ‘str’ is a string parameter in which the user name will be returned.

4 replies

Marcel Hunting
AIMMSian
Forum|alt.badge.img+4
  • AIMMSian
  • 258 replies
  • January 31, 2023

Hi @vixingit. On Windows you can use the procedure EnvironmentGetString with the key ‘USERNAME’ to retrieve the user name.


Forum|alt.badge.img+1
  • Author
  • Enthusiast
  • 2 replies
  • February 1, 2023

Hi @Marcel Hunting 

Thank you for the reply.

I don’t understand what should I put exactly in the body of the procedure, can you please give me more details please ?

Thank you


Marcel Hunting
AIMMSian
Forum|alt.badge.img+4
  • AIMMSian
  • 258 replies
  • Answer
  • February 1, 2023

You can use

EnvironmentGetString( "USERNAME", str );

where ‘str’ is a string parameter in which the user name will be returned.


Forum|alt.badge.img+1
  • Author
  • Enthusiast
  • 2 replies
  • February 1, 2023

@Marcel Hunting It worked thank you :D



Didn't find what you were looking for? Try searching on our documentation pages:

AIMMS Developer & PRO | AIMMS How-To | AIMMS SC Navigator