Naming Variables

You can name your custom variables anything you like, but there are a few guidelines to follow:

  1. All variable names should begin and end with a percentage sign (%).

  2. Variable names are not case sensitive-the names %MyVar% and %myvar% both refer to the same variable.

  3. Don't use the same variable name twice unless you mean to.

    Using a name twice is fine if you're defining a variable in one place, and using it in another. Just be careful not to unintentionally give the same name to two different variables if they're being used to represent two different things.

    Of course, it's okay to define a variable twice if you want its value to change. In that case, the first value will only be in effect until the second one "overwrites" it.

  4. Don't use a built-in variable name for one of your custom variables unless you know what you're doing.

    For example, calling a variable %SysDir% would override the built-in variable with the same name. Take time to familiarize yourself with the built-in variable names so you don't use any of them by accident.

  5. Try to use meaningful names.

    For example, if you read a product's installation date from the Registry, naming the variable %Greegleborg452sx% probably isn't a good idea. Use a variable name like %InstallDate% instead.

  6. Be consistent.

    If you start out with %UserName% and %UserAge%, don't name your third variable %WhereTheUserGoesToWork%. A name like %UserCompanyName% will be easier to remember when you find yourself asking "what did I name that variable, again?"

  7. When in doubt, double-check.

    A common mistake is to name a variable one thing in one part of Setup Factory, and start calling it something else later. If you're not sure what name you used, double-check by going back to the screen where you defined the variable.

 

See Also: Variables, Built-in Variables, Custom Variables, A Little Common Sense Never Hurts