Yesterday, 06:01 PM
(This post was last modified: Yesterday, 06:08 PM by Kernelpanic.)
This thread seems to me have gone off the rails. The original question was whether arrays are possible within records. They aren't! But maybe there's a way to circumvent this limitation by "simulating" it.
I tried this, and it should come pretty close to arrays within records for certain programming tasks. I couldn't think of a better example.
Some data is requested, and then the answer is displayed, along with an image. Nice!
Image of the answer: "No" was entered.
I tried this, and it should come pretty close to arrays within records for certain programming tasks. I couldn't think of a better example.
Some data is requested, and then the answer is displayed, along with an image. Nice!
Code: (Select All)
'Verschachtelte Recordarrays - 7./10. Maerz 2026
Screen _NewImage(550, 390, 32)
$Color:32
Option _Explicit
Type Automodelle
Modell As String
Hubraum As String
Leistung As String
End Type
Type Datenblatt
Modelldaten As Automodelle
Farbe As String
FarbeBrilliant As String
Verbrauch As String
Tankgroesse As String
Preis As String
End Type
Type Spezielles
Extra As Datenblatt
Sonderausstattung As String
End Type
Dim Modell(5) As Datenblatt
Dim Special(2) As Spezielles
Dim As String ps
Dim As Long Bild
Locate 2, 3
Input "Modell : ", Modell(1).Modelldaten.Modell
Locate 3, 3
Input "Hubraum in ccm : ", Modell(1).Modelldaten.Hubraum
Locate 4, 3
Input "Motorleistung Kw : ", Modell(1).Modelldaten.Leistung
Locate 5, 3
Input "Farbauswahl : ", Modell(1).Farbe
Locate 6, 3
Input "Farbe brilliant Ja/Nein: ", Special(1).Extra.FarbeBrilliant
Sleep 2
Cls
Locate 2, 3
Print "Ihre Auswahl war:"
Locate 4, 3
Print "Modell : "; Modell(1).Modelldaten.Modell
Locate 5, 3
Print "Hubraum : "; Modell(1).Modelldaten.Hubraum; " ccm"
Locate 6, 3
'KW auch als PS ausgeben
ps = Str$(Val(Modell(1).Modelldaten.Leistung) * 1.36)
Print "Motorleistung: "; Modell(1).Modelldaten.Leistung; " Kw"; " ("; ps; " PS )"
Locate 7, 3
Print "Farbauswahl : "; Modell(1).Farbe
Locate 9, 3
If Special(1).Extra.FarbeBrilliant = "Ja" Then
Modell(1).Preis = "52.899.00"
Print "Preis Ihrer Modellauswahl: "; Modell(1).Preis
Else
Modell(1).Preis = "49.500.00"
Print "Preis Ihrer Modellauswahl: "; Modell(1).Preis
End If
Bild = _LoadImage("..\..\..\Bilder\AudiS3-Kl.jpg") 'Siehe Hinweis unten um das Bild zu erhalten
_PutImage (20, 185), Bild 'Platzierung des Bildes. Haengt von der Fenstergroesse ab
End
Image of the answer: "No" was entered.

