11-07-2022, 10:21 PM
(This post was last modified: 11-07-2022, 10:22 PM by Kernelpanic.)
Thank you for the hints. But unfortunately none of that works.
It's about Select Case and Select EveryCase. I wrote a small program about buying a used car to illustrate this. The program shall fall on Case Else if the purchase price is greater than 7000.00.
If greater than 5500.00, then "VW Polo . . ." are displayed, but also if it ist greater 7000.00. Yes, maybe Select Case really doesn't work so and you have to come up with something else.
Until this case it works:
It's about Select Case and Select EveryCase. I wrote a small program about buying a used car to illustrate this. The program shall fall on Case Else if the purchase price is greater than 7000.00.
If greater than 5500.00, then "VW Polo . . ." are displayed, but also if it ist greater 7000.00. Yes, maybe Select Case really doesn't work so and you have to come up with something else.
Code: (Select All)
'Beispiel fuer Select Case und EveryCase - 7. Nov. 2022
Option _Explicit
Dim As Double kaufpreis
Print "Gebrauchtwagenkauf"
Print
Input "Wieviel moechten Sie ausgeben? ", kaufpreis
Print "Select Case:"
Select Case kaufpreis
Case 4000 To 5000
Print "Trabant, blau, frisiert - 31 KW."
Case 5000 To 6000
Print "Wartburg, dunkelgruen, 74.00 KM, 40 KW."
Case Is > 5500
Print "VW Polo, beige, 110.000 KM, 44 KW"
Case Else
Print "Haben wir leider nicht im Angebot!"
End Select
Print
Print "Select EveryCase:"
Select EveryCase kaufpreis
Case 4000 To 5000
Print "Trabant, blau, frisiert - 31 KW."
Case 5000 To 6000
Print "Wartburg, dunkelgruen, 74.00 KM, 40 KW."
Case Is > 5500
Print "VW Polo, beige, 110.000 KM, 44 KW"
Case Else
Print "Haben wir leider nicht im Angebot!"
End Select
End
Until this case it works: