foxpro - Conditionally modifying multiple strings with For -
so have 13 binary values, call b_1... b_13, , based off these values i'd either set call indic_j defined string called inf_j, or nothing @ all. possible without using 13 "if..." statements? tried below
inf_1 = "aaaaa" inf_2 = "bbbbb"
... , on defining 13 infs, aaaaa, bbbbb etc names of columns ina table want select then
for j = 1 13 if b_j = 1 "indic_"+j = inf_j + ","; else "indic_"+j = "" endif endfor
also, before havent introduced called indic_1, indic_2, etc. needed? thanks!
edit: end goal transfer selected columns on excel. i've no porblems doing predetermined columns, im not sure how allow selected columns only.
i've tried using 13 if statements, i'm getting operator/operand type mismatch. code is
iif(b_1 = 1, indic_1 = inf_1 + ",",indic_1 = "") iif(b_2 = 1, indic_1 = inf_2 + ",",indic_1 = "") iif(b_3 = 1, indic_1 = inf_3 + ",",indic_1 = "")
and on 13 times, , then
selectionrang = indic_1 + indic_2 + indic_3 + indic_4 + indic_5 + indic_6 +indic_7 + indic_8 + indic_9 + indic_10 + indic_11 + indic_12 + indic_13 selectionrange = left(selectionrang,len(selectionrang)-1)
Comments
Post a Comment