01-08-2023, 11:21 PM
(01-08-2023, 09:55 PM)luke Wrote: You're nearly there! It doesn't know how to compile END, but it does know SYSTEM so you can use that instead.
Ok, this works without end now, with "two numbers...". The next program doesn't work again: "KW-PS2.bas". - The devil is in the details!
Quote:D:\Programme\lbasic>lbasic Zwei-Zahlen-addieren.bas
D:\Programme\lbasic>Zwei-Zahlen-addieren
25
D:\Programme\lbasic>lbasic KW-PS2.bas
codegen: Bad expr type 18
D:\Programme\lbasic>
KW-PS2.bas
Code: (Select All)
Option _Explicit
Dim PS As Double, KW As Double
Dim Auswahl As Integer
Print "1 -- PS in Kilowatt"
Print "2 -- Kilowatt in PS"
Print
Input "Ihre Wahl: ", Auswahl
Print
If Auswahl = 1 Then
Input "Anzahl PS: ", PS
KW = PS / 1.36
Rem Print Fehler!
Print KW
Else
Input "Anzahl Kilowatt: ", KW
PS = KW * 1.36
Print
Print PS
End If