vcount is given an initial value of 50, and its first pass through the loop increases that to 51. After that its value is always 51 when it hits the stoploopif statement, so none of the rest of the code in the inner loop ever runs again. When it ends, vresult still has the value it was given on that first pass, when vtotal_ sequence_count had a value of 0. The value of vtotal_ sequence_count was actually increased to 1, but that value is never used.
It sounds like not only should it be 1, but the assignment to 1 should be after the looparray statement. Don’t you want to reset it back to 1 for each element of the vparent_data array?
In its amended form, vtotal_ sequence_count now finishes at 150 (not 149) as you must have meant: starting at zero and incremented fifty times for each of the three elements of the array.
But why use
loop
stoploopif vcount > 50
when you could write it thus:
loopwhile vcount ≤ 50
And why write
vtotal_sequence_count = vtotal_sequence_count + 1
when you could have this:
increment vtotal_sequence_count
Also, why add the optional index parameter to the looparray statement if you are not going to make use of the value of index within the loop?
And if the inner loop should always run fifty times, it’s much more efficient to replace
for vcount, 1, 50
vresult = vresult + cr() + element + " - " + str(vtotal_sequence_count)
increment vtotal_sequence_count
endloop
And you appear to be using ", " as the separator where vparent_data is assigned, but then use "," in the looparray statement, thus the second and third values of element will have a leading space. Is that what you want?