source code

dialog procalc {
  title "Prozentrechner~ v7 ~ ME"
  size -1 -1 199 109
  option dbu
  button "Chance in %", 1, 0 0 40 12
  button "Rechenmetho.", 2, 40 0 40 12
  button "Rückrechnen", 3, 80 0 40 12
  button "Eurorechner", 4, 120 0 40 12
  button "Reset", 5, 160 0 40 12
  edit "", 6, 0 80 200 30, multi, read
  text "Rechenmethode:", 7, 1 70 45 8
  edit "", 8, 55 60 100 10
  text "Chance in %", 9, 5 60 50 8
  text "Value 1:", 10, 0 30 25 8
  edit "", 11, 30 30 50 10
  text "Prozent: 100", 12, 0 45 50 8, disable
  button "+", 13, 50 45 6 6
  button "-", 14, 56 45 6 6
  text "Value 2:", 15, 80 30 25 8
  edit "", 16, 100 30 50 10
}
on *:Dialog:procalc:*:*:{
  if ($devent == sclick) {
    if ($did == 1) {
      set %ergebnis $calc(%value1 * %value2 / %value3)
      did -ra procalc 8 %ergebnis
    }
    if ($did == 4) {
      dialog -c procalc procalc
      dialog -m eurocalc eurocalc
      }
      if ($did == 5) {
        unset %value*
      }
      if ($did == 2) {
        did -ra procalc 6 Zuerst rechnete das Script: %value1 mal %value2 = $calc(%value1 * %value2) danach teilte das Script es durch 100 = $calc(%value1 * %value2 / 100)
      }
      if ($did == 13) {
        set %value3 $calc(%value3 * 10)
        did -ra procalc 12 %value3
      }
      if ($did == 14) {
        set %value3 $calc(%value3 / 10)
        did -ra procalc 12 %value3
      }
    }
    if ($devent == edit) {
      if ($did == 11) {
        set %value1 $did(procalc,11)
      }
      if ($did == 16) {
        set %value2 $did(procalc,16)
      }
    }
  }
 
Diese Webseite wurde kostenlos mit Homepage-Baukasten.de erstellt. Willst du auch eine eigene Webseite?
Gratis anmelden