Page 1 of 1

end if without block if error

Posted: Wed Jun 20, 2007 3:20 pm
by Quicky
What does then END IF without block IF error mean?

Posted: Wed Jun 20, 2007 5:26 pm
by sid6.7
in your nesting of IF THEN statements

you have and END IF that doesnt have a preivous IF...


IF blah blah


THEN blah blah


END IF

you may have a whole bunch of these nested one within another
go back and match them up...

Posted: Thu Jun 21, 2007 10:13 am
by Patz QuickBASIC Creations
I'll try to explain...

A block IF/THEN is an IF/THEN with the following syntax:

Code: Select all

IF <condition> THEN
<command>
<another>
<hey, look! it's another command!>
END IF
The main plus about it is that you can have multiple commands execute, as opposed to the line IF/THEN, or:

Code: Select all

IF <condition> THEN <command>
The error you described is means that the END IF is missing in that block, but is not needed for the line IF/THEN.

Posted: Mon Jun 25, 2007 10:27 am
by Erik
Check to see if you don't have an extra "END IF" in your IF statement blocks.

I know I've found myself doing that sometimes when they get large... (esp. when they're nested)