The L-BASIC compiler
#19
(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
Reply


Messages In This Thread
The L-BASIC compiler - by luke - 01-06-2023, 01:16 PM
RE: The L-BASIC compiler - by Kernelpanic - 01-06-2023, 08:06 PM
RE: The L-BASIC compiler - by cage - 01-06-2023, 10:24 PM
RE: The L-BASIC compiler - by SpriggsySpriggs - 01-10-2023, 02:39 PM
RE: The L-BASIC compiler - by mnrvovrfc - 01-06-2023, 10:59 PM
RE: The L-BASIC compiler - by mnrvovrfc - 01-08-2023, 08:22 PM
RE: The L-BASIC compiler - by Kernelpanic - 01-08-2023, 09:40 PM
RE: The L-BASIC compiler - by PhilOfPerth - 01-06-2023, 11:01 PM
RE: The L-BASIC compiler - by SMcNeill - 01-07-2023, 12:05 AM
RE: The L-BASIC compiler - by luke - 01-07-2023, 02:27 AM
RE: The L-BASIC compiler - by Kernelpanic - 01-07-2023, 04:01 PM
RE: The L-BASIC compiler - by mnrvovrfc - 01-07-2023, 11:57 PM
RE: The L-BASIC compiler - by Jack - 01-07-2023, 01:39 PM
RE: The L-BASIC compiler - by bplus - 01-07-2023, 02:40 PM
RE: The L-BASIC compiler - by Kernelpanic - 01-07-2023, 06:56 PM
RE: The L-BASIC compiler - by Kernelpanic - 01-07-2023, 08:15 PM
RE: The L-BASIC compiler - by luke - 01-08-2023, 05:08 AM
RE: The L-BASIC compiler - by Kernelpanic - 01-08-2023, 05:24 PM
RE: The L-BASIC compiler - by luke - 01-08-2023, 09:55 PM
RE: The L-BASIC compiler - by Kernelpanic - 01-08-2023, 11:21 PM
RE: The L-BASIC compiler - by a740g - 01-10-2023, 01:13 PM



Users browsing this thread: 5 Guest(s)