7 Replies Latest reply on Jan 3, 2017 10:49 AM by David Moyer

Can I use the List function on a repeating variable?

Howdy,

in case I'm missing something, I ask ...

The List function does not appear to handle repeating variables in the same way it handles repeating fields.  For example, if \$\$test[1] = "a" and \$\$test[2] = "b", then List ( \$\$test ) yields the ? of ambiguity.  List ( \$\$test[1]; \$\$test[2] ) will yield a¶b.

Any recourse? (without writing/finding yet another custom function to convert)

• 1. Re: Can I use the List function on a repeating variable?

Any recourse? No.

Remember that "repeating" variables are completely different from repeating fields.

If you define a repeating field to have 100 reps; then you know how to list them.

But a repeating variable has no such structure or consistency.

You could have \$\$test[1]; \$\$test[0]; \$\$test[32768]; \$\$test[-666].

1 of 1 people found this helpful
• 2. Re: Can I use the List function on a repeating variable?

beverly

• 3. Re: Can I use the List function on a repeating variable?

Thanks for the info Bruce.

For anybody reading, I found that (along with List) GetRepetition and IsEmpty also fail in regards to evaluating repeating variables.

• 4. Re: Can I use the List function on a repeating variable?

GetRepetition is specifically for FIELDS, says so in the description.

GetRepetition ( repeatingField ; number )

IsEmpty works when you define the variable correctly. All repeating variables use the specific format "\$Var[1]" or "\$\$Var[1]".

IsEmpty ( \$Var[1] )

Tests the First repeat, because the repeating variable definition starts at 1 it is not required when referring the First (Primary) instance of the variable "\$\$var".

To test the second instance you use

IsEmpty ( \$\$var[2] )

However, just like \$\$var[2] you can also define a repetition \$\$var[0]. Note that it is NOT the First (Primary) instance.

1 of 1 people found this helpful
• 5. Re: Can I use the List function on a repeating variable?

You could use *another* global variable to keep track of the repetitions you created (say, targetVar[0]), then loop through that to retrieve the values.

• 6. Re: Can I use the List function on a repeating variable?

There is no such thing as a "repeating" variable.