Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

If statements

Status
Not open for further replies.

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
 

Code:
if x = 0
        For i=1 To numFields
            If Upper(aColumns(i,1))='ln'
                alter table testdb rename column ln to lname1
            EndIf
        Next        
   [b][blue]end if [/blue] [/b]

Remove the space in your last ENDIF.


Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top