How do I find all the user's variables?

  1. Home
  2. Knowledge Base
  3. GMS
  4. How do I find all the user's variables?

Question

Each user in GMS has a set of variables defined. While some of these are mandatory (e.g. "Type"), many are optional and any number of new variables can be added to any user account.

Answer

To obtain a list of all the variables defined for a specific user, use an MML variable of the form:

  domainuservariablenames


This will return a list of all the defined variables space separated.

For example, to obtain a list of all the variables defined for David@gordano.com, you could use the following MML:

  domain = "gordano.com";
  username = "david";
  print(#domain##username#variablenames);


The following statement is exactly equivalent to the above MML code:

  print(gordano.comdavidvariablenames);

If you wish to manipulate the variables, use the functions LSLength and LSElement. The following code will list all the variables and their values:

  domain = "gordano.com";
  username = "david";
  names = #domain##username#variablenames;
  number_names = LSLength(names);

  for(i=1; i < number_names+1; i = i + 1)
  {
    print(LSElement(names, i),  = ",
          #domain##username##LSElement(names,i)#,
          "<BR>");
  }

More information can be found in section 2.9 of the MML Programmers' Guide.

Keywords:MML user variables find listing settings

Was this article helpful?

Related Articles