In versions prior to 3ds Max 2012, the caption parameter of a rollout or UI control is provided as a string literal and cannot be specified using a variable name. This made it difficult to use computed names as it required the setting of the rollout's or control's caption property after its construction, or the creation of the whole rollout using string building and evaluation or the Rollout Creator functions.
3ds Max 2012 added the ability to specify captions of rollouts and UI controls uisng non-local variable name. This means that the variable cannot be a local variable or a variable name passed through as a function parameter. The variable must be either in the global scope or in the top-level scope such as, a structure definition, MacroScript definition, or scripted plugin definition.
This restriction stems from the fact that a rollout definition is a compile-time construct, and the local variables are defined using the context when the rollout is compiled. However, an evaluation of the variables is attempted when the rollout is created, by which time it is no longer in the compile context. So, if a local variable is used as the caption, a compile time error will be thrown:
If you change the above usage of cap1 to a string literal, you will get another error on the usage of cap2.
The following shows various usages that compile successfully: