How To…Dynamic Variables in RAP

Question

“Is it possible to dynamically create multiple variables based on my data via RAP code?”

Solution

Use a TList object in RAP to keep track of each variable created in RAP. This way when you need to assign each value, you will have a reference to every variable you dynamically created. Use the OnCalc of an invisible variable as a way to assign each dynamic variable’s value. See the example below for more information.

Download: DynamicVarInRAP.zip

Sample RAP code: