spamstr = alltrim(xfer_payroll.spall) ALINES(a__gen5, CHRTRAN(spamstr," ",CHR(13))) && copy the values to array If vartype(a__gen5) # 'U' and vartype(a__gen5) # 'L' first_sw = .t. FOR i = 1 TO ALEN(a__gen5,0) IF !EMPTY(ALLTRIM(a__gen5(i))) IF first_sw = .t. first_sw = .f. crtspam = ALLTRIM(a__gen5(i)) && don't put space between string ELSE crtspam = crtspam + ' ' + ALLTRIM(a__gen5(i)) && put space while building spam str ENDIF ENDIF ENDFOR RELEASE a__gen5 ALINES(a__gen6, CHRTRAN(crtspam," ",CHR(13))) && copy the values to array FOR .f1 = 1 TO ALEN(a__gen6,0) g1 = ALLTRIM(a__gen6(.f1)) Do case Case g1 == 'FLSA' cummflsa = evaluate('xfer_payroll.spamt'+allt(str(.f1,3,0))) hldflsa = hldflsa + cummflsathe only problem is that the array always seems to be created, even if there is no value in the spamstr. I'm not sure how I can prevent from going into a for loop if the string is empty after testing for "If vartype(a__gen5) # 'U' and vartype(a__gen5) # 'L' ". I was hoping no array is created if the string is empty. However it does and I don't know how to prevent from looping on an empty array. thanks....Nick