Error - 'Else' without 'if'
Blitz3D Forums/Blitz3D Beginners Area/Error - 'Else' without 'if'
| ||
For the life of me, I cannot figure out why I am getting an error. Can someone help me out here please. I keep getting this Error - 'Else' without 'if' on this code: ;Camera mode If (KeyHit (1)) Then splitScreen = 0 CameraViewport (myCam_01,0,0,screenW,screenH) Else If (KeyHit (2)) Then splitScreen = 1 CameraViewport (myCamSplit_A,0,0,screenW/2,screenH) CameraViewport (myCamSplit_B,screenW/2,0,screenW,screenH) ;Else splitScreen = 0 ;I tried this because I got the error 'Else without if' EndIf |
| ||
The problem here is that "one line If" is a valid construct, without EndIf:If (KeyHit (1)) Then splitScreen = 0 You probably want something like If (KeyHit (1)) splitScreen = 0 CameraViewport (myCam_01,0,0,screenW,screenH) Else If (KeyHit (2)) splitScreen = 1 CameraViewport (myCamSplit_A,0,0,screenW/2,screenH) CameraViewport (myCamSplit_B,screenW/2,0,screenW,screenH) EndIf And this looks like Blitz3D so I'm moving it. |
| ||
That seems to work. Thanks, and thanks for replying so quickly. |
| ||
by the way use Ideal Editor for your blitz3d code http://www.fungamesfactory.com/ |