Mehram
asked on
Dynamic setitem
version 10.5
user last input values for a particular report are already present
in string variables
ls_column_1,ls_column_2, ls_column3.... upto ls_column_16
in integer variable
Li_column_1, Li_column_2 upto Li_column_8 etc
when the user call the report next time we set his last saved values like this
FOR J = 1 to a_stParm.s_field_req
choose case J
case 1
dw_1.setitem(1,"s_column_1 ", ls_column_1)
case 2
dw_1.setitem(1,"s_column_2 ",ls_colum n_2)
case 3
dw_1.setitem(1,"s_column_3 ",ls_colum n_3)
and case upto 16
end choose
I wanted to get rid of repeated dw_1.setitem and did this, which worked.
arr_scolumn[] = {ls_column_1, ls_column_2,ls_column_3,ls _column_4, ls_column_ 5,ls_colum n_6,ls_col umn_7,ls_c olumn_8,ls _column_9, ls_column_ 10,ls_colu mn_11,ls_c olumn_12,l s_column_1 3,ls_colum n_14,ls_co lumn_15,ls _column_16 }
arr_icolumn[] = {li_column_1, li_column_2,li_column_3,li _column_4, li_column_ 5,li_colum n_6,li_col umn_7,li_c olumn_8}
FOR J = 1 to a_stParm.s_field_req
dw_1.setitem(1,'s_column_' + string(J), arr_scolumn[J])
next
FOR J = 1 to a_stParm.i_field_req
dw_1.setitem(1,'i_column_' + string(I), arr_icolumn[J])
next
This is working correctly.
My question is , can we get rid of array.
Can we do someghint like this
dw_1.setitem(1,'s_column_' + string(J), EVALUATE (or whatever it may be) 'ls_column' + string(J))
In foxpro we can evaluate something by the sign '&', can we do something similiar here.
user last input values for a particular report are already present
in string variables
ls_column_1,ls_column_2, ls_column3.... upto ls_column_16
in integer variable
Li_column_1, Li_column_2 upto Li_column_8 etc
when the user call the report next time we set his last saved values like this
FOR J = 1 to a_stParm.s_field_req
choose case J
case 1
dw_1.setitem(1,"s_column_1
case 2
dw_1.setitem(1,"s_column_2
case 3
dw_1.setitem(1,"s_column_3
and case upto 16
end choose
I wanted to get rid of repeated dw_1.setitem and did this, which worked.
arr_scolumn[] = {ls_column_1, ls_column_2,ls_column_3,ls
arr_icolumn[] = {li_column_1, li_column_2,li_column_3,li
FOR J = 1 to a_stParm.s_field_req
dw_1.setitem(1,'s_column_'
next
FOR J = 1 to a_stParm.i_field_req
dw_1.setitem(1,'i_column_'
next
This is working correctly.
My question is , can we get rid of array.
Can we do someghint like this
dw_1.setitem(1,'s_column_'
In foxpro we can evaluate something by the sign '&', can we do something similiar here.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I am checking importstring.