My Blitz Basic Code gives the Error: Expecting EndIf. what can I do?

22 Views Asked by At

I am making this calculator programm in Blitz Basic and everytime I run it, it tells me Expecting EndIf, even tho my code contains EndIf in the right place I belive. Can someone pease help me?

AppTitle "Taschen Rechner"
Graphics 1280, 720, 32, 2

operator$ = Input$("Enter um vortzufahren")

Print "Blitz Taschenrechner V1.0"

zahl1 = Input("Erste Zahl: ")
rechenart$ = Input$("Operator (+, -, *, /): ")
zahl2 = Input("Zweite Zahl: ")

If rechenart$ = "+"
    Then zahl3 = zahl1 + zahl2

ElseIf rechenart$ = "-"
    Then zahl3 = zahl1 - zahl2

ElseIf rechenart$ = "*"
    Then zahl3 = zahl1 * zahl2 

ElseIf rechenart$ = "/"
    Then zahl3 = zahl1 / zahl2

Else
    Print "Der Operator " + rechenart$ + " wird nicht unterstützt"
EndIf

Print zahl3

WaitKey 
End

I read through all the code and I dont see a problemm. I also asked ChatGPT and BingAI, but they loop responded the same broken code (To be expected).

0

There are 0 best solutions below