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

Possibly Related Threads…
Thread Author Replies Views Last Post
Question Experimenting with a "StringList" type for simpler handling of string arrays/lists Heimdall 18 1,226 12-19-2025, 12:51 PM
Last Post: Heimdall
  Question about _MEM blocks and arrays FCS_coder 19 2,655 06-15-2025, 10:09 AM
Last Post: TempodiBasic
Question sound file playback (and record) - manipulating speed + pitch in realtime? madscijr 12 1,997 02-26-2025, 06:33 PM
Last Post: Petr
  Arrays In User Data Types Consolemu 2 876 01-18-2024, 09:49 PM
Last Post: bplus

Forum Jump:


Users browsing this thread: 1 Guest(s)