Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Record Arrays
#1
So, using arrays as record elements is not possible in QB. OK, but declaring record arrays is also possible in QB.

I've tried this according to the QBasic manual, only a rudimentary guide, but something isn't working. The program runs without errors, but there is no meaningful output. I'm thinking wrong.

Code: (Select All)

Type Motorrad
  Modell As String * 30
  Kilowatt As Double
  Preis As Double
End Type

Dim MotorradMarken(2) As Motorrad

Dim As Integer anzahl, satzNummer

satzNummer = 1
Do
  Input "Modell    : ", Motorrad.Modell
  Input "Kilowatt  : ", Motorrad.Kilowatt
  Input "Preis      : ", Motorrad.Preis

  satzNummer = satzNummer + 1
Loop Until satzNummer = 2

For anzahl = 1 To satzNummer
  Print MotorradMarken(anzahl).Modell
  Print MotorradMarken(anzahl).Kilowatt
  Print MotorradMarken(anzahl).Preis
Next

[Image: Record-Array2024-07-01.jpg]

Does anyone know where the error is? Thanks!
Reply


Messages In This Thread
Record Arrays - by Kernelpanic - 07-01-2024, 08:34 PM
RE: Record Arrays - by DSMan195276 - 07-01-2024, 08:48 PM
RE: Record Arrays - by TerryRitchie - 07-01-2024, 09:42 PM
RE: Record Arrays - by bplus - 07-01-2024, 09:00 PM
RE: Record Arrays - by Kernelpanic - 07-01-2024, 10:13 PM
RE: Record Arrays - by Jack - 07-01-2024, 10:37 PM
RE: Record Arrays - by Kernelpanic - 07-02-2024, 05:53 PM



Users browsing this thread: 1 Guest(s)