Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Case Anweisung

Empfohlene Antworten

Veröffentlicht

HI Luete.

Hat jemand Ahnung wie ich bei einer case Anweisung einen bestimmten Wert eingrenzen kann.

Bei Delphi kann ich mit ".." den wert eingrenzen

z.B: case 0..99

ciao

ja nämlich garnicht.

ich müsste entweder sowas wie folgendes schreiben.


switch (zahl)

{

   case 1:

   case 2:

   case 3:

   // ...

   case 99:

   {

      // CODE...

   }

   break;

}

da das aber ziemlich umstänliche ist und auch 99 zeilen kostet. ist der einzige sinnvolle weg der über die if- abfragen

if (zahl >= 1 && zahl <= 99)

{

   // CODE...

}

:D Ja, indem du Pascal benutzt. In C/C++ sind in case-Anweisungen keine Bereiche, sondern nur feste Werte ordinaler Typen zulässig :(

Wenn du kleine Bereiche hast, kannst du folgendes machen:


switch(bla)

{

	case 1:

	case 2:

	case 3:

		tuWas();

		break;

	case 4:

		tuWasAnderes();

		break;

	default:

		tuNix();

}

Für größere Bereiche kannst du den Bereich abfragen und dann halt einen garantiert nicht vorkommen könnenden Wert setzen, eventuell switch() über eine Hilfsvariable.

oder einen, der Vorkommt!

  

if(Zahl>1 && Zahl<99)

  Zahl=1;


switch(Zahl)

{

 case 1:

  //code für 1 bis 99

 case 100:

  // usw

}; 


oder, Käptn?

<FONT COLOR="#a62a2a" SIZE="1">[ 24. Oktober 2001 22:03: Beitrag 1 mal editiert, zuletzt von Kristian ]</font>

Jupp !

Archiv

Dieses Thema wurde archiviert und kann nicht mehr beantwortet werden.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.