I'm a beginner at coding in Clarion and I'm coping with problem which can be described as basic.
I have this code:
L_COUNTER1 = 2
LOOP
IF INSTRING(L_COUNTER2& ';',L_STRING,1,L_COUNTER1 = 0 THEN
L_LIST[L_COUNTER2] = SUB(L_STRING,2,L_COUNTER1-3)
L_STRING = SUB(L_STRING,L_COUNTER1,LEN(L_STRING) - L_COUNTER1 + 1)
BREAK
ELSE
L_COUNTER1 = L_COUNTER + 1
END
Variable Counter1 is part of the outer loop. This code produces me data such
L_LIST[1]='test1'
L_LIST[2]='test2'
L_LIST[3]=''(empty)
L_LIST[4]=''(empty)
L_LIST[5]=''(empty)
L_LIST[6]='test3'
L_LIST[7]=''(empty)
L_LIST[8]=''(empty)
L_LIST[9]=''(empty)
I'm trying to achieve:
L_LIST[1]='test1'
L_LIST[2]='test2'
L_LIST[3]='test3'
Or at least
L_LIST[1]='test1'
L_LIST[2]='test2'
L_LIST[3]='test3'
L_LIST[4]=''(empty)
L_LIST[5]=''(empty)
L_LIST[6]=''(empty)
L_LIST[7]=''(empty)
L_LIST[8]=''(empty)
L_LIST[9]=''(empty)
But I'm stuck on this problem. I tried looping through the elements and checking if they're not equal to empty string but didn't have much success.