sdpsc
Technical User
- Feb 10, 2001
- 76
I'm brand new to FoxPro coding. Can someone tell me why the below code gives me an error that says ' An IF | ELSE | ENDIF statement is missing.', at the if x = 0 line. Thanks.
set stat on
x = 0
numFields=aFields(aColumns)
For i=1 To numFields
If Upper(aColumns(i,1))='lname1'
x = 1
EndIf
Next
if x = 0
For i=1 To numFields
If Upper(aColumns(i,1))='ln'
alter table testdb rename column ln to lname1
EndIf
Next
end if
set stat on
x = 0
numFields=aFields(aColumns)
For i=1 To numFields
If Upper(aColumns(i,1))='lname1'
x = 1
EndIf
Next
if x = 0
For i=1 To numFields
If Upper(aColumns(i,1))='ln'
alter table testdb rename column ln to lname1
EndIf
Next
end if