Hello!
I'm quite new to Visual Foxpro and would like some help with a for loop.
I have the fields klubb1-12 in my table and lets say all even numbers are "checked" (klubb1="1", klubb2="2" etc) and I would like to loop through some rows and move everything +1. So if 2 is checked, then unckeck 2 and make 3 checked.
I thought this would work but I get "Command contains unrecognized phrase/keyword. on the second line.
Any suggestions or improvements? Thanks!
I'm quite new to Visual Foxpro and would like some help with a for loop.
I have the fields klubb1-12 in my table and lets say all even numbers are "checked" (klubb1="1", klubb2="2" etc) and I would like to loop through some rows and move everything +1. So if 2 is checked, then unckeck 2 and make 3 checked.
I thought this would work but I get "Command contains unrecognized phrase/keyword. on the second line.
Code:
FOR lnRaknare = 1 TO 12
IF Kunder.klubb&lnRaknare = ALLTRIM(STR(lnRaknare))
IF lnRaknare = 12
Kunder.klubb12 = ""
Kunder.klubb1 = "1"
ELSE
Kunder.klubb&lnRaknare = ""
Kunder.klubb&lnRaknare+1 = ALLTRIM(STR(lnRaknare+1))
ENDIF
ENDIF
ENDFOR