Hello,
I was wondering if I could get some help with this code below:
Example:
Table\_1 = {monthly\_income, home\_address} Table\_2 = {1,4) Table\_3 = {1,4) Table\_4 = {1,4) Table\_5 = {1,4) Table\_6 = {1,4) Table\_7 = {1,4) Table\_8 = {1,4) Table\_9 = {1,4) Table\_10 = {1,4) for i=1, table.getn(Table\_1) do if Table\_1[i] == "monthly\_income" then Reason\_Code1 = Table\_1[i] Reason\_Code2 = Table\_2[i] Reason\_Code3 = Table\_3[i] Reason\_Code4 = Table\_4[i] Reason\_Code5 = Table\_5[i] Reason\_Code6 = Table\_6[i] Reason\_Code7 = Table\_7[i] Reason\_Code8 = Table\_8[i] Reason\_Code9 = Table\_9[i] Reason\_Code10 = Table\_10[i] end if Table\_1[i] == "drivers\_license" then Reason\_Code11 = Table\_2[i] Reason\_Code12 = Table\_3[i] Reason\_Code13 = Table\_4[i] Reason\_Code14 = Table\_5[i] Reason\_Code15 = Table\_6[i] Reason\_Code16 = Table\_7[i] Reason\_Code17 = Table\_8[i] Reason\_Code18 = Table\_9[i] Reason\_Code19 = Table\_10[i] end if Table\_1[i] == "bank\_account" then Reason\_Code20 = Table\_2[i] Reason\_Code21 = Table\_3[i] Reason\_Code22 = Table\_4[i] Reason\_Code23 = Table\_5[i] Reason\_Code24 = Table\_6[i] Reason\_Code25 = Table\_7[i] Reason\_Code26 = Table\_8[i] Reason\_Code27 = Table\_9[i] Reason\_Code28 = Table\_10[i] end if Table\_1[i] == "home\_address" then Reason\_Code29 = Table\_2[i] Reason\_Code30 = Table\_3[i] Reason\_Code31 = Table\_4[i] Reason\_Code32 = Table\_5[i] Reason\_Code33 = Table\_6[i] Reason\_Code34 = Table\_7[i] Reason\_Code35 = Table\_8[i] Reason\_Code36 = Table\_9[i] Reason\_Code37 = Table\_10[i] end end
Output:
Reason_Code1 = 1
Reason_Code2 = 1
Reason_Code3 = 1
Reason_Code4 = 1
Reason_Code5 = 1
Reason_Code6 = 1
Reason_Code7 = 1
Reason_Code8 = 1
Reason_Code9 = 1
Reason_Code10 = 1
Reason_Code11 = 1
Reason_Code12 = 1
Reason_Code13 = 1
Reason_Code14 = 1
Reason_Code15 = 1
Reason_Code16 = 1
Reason_Code17 = 1
Reason_Code18 = 1
Reason_Code19 = 1
Reason_Code20 = 1
Reason_Code21 = 1
Reason_Code22 = 1
Reason_Code23 = 1
Reason_Code24 = 1
Reason_Code25 = 1
Reason_Code26 = 1
Reason_Code27 = 1
Reason_Code28 = 1
Reason_Code29 = 4
Reason_Code30 = 4
Reason_Code31 = 4
Reason_Code32 = 4
Reason_Code33 = 4
Reason_Code34 = 4
Reason_Code35 = 4
Reason_Code36 = 4
Reason_Code37 = 4
Reason_Code11 - Reason_Code28 should not have a value.
Is my code correct?
Would really appreciate some help.
Thanks