If Then Else: mehrzeilige Anweisung

  • Moin, Moin!
    Mach jetzt schon ein paar mal mit AutoIt rum - tolles Ding!
    Und obwohl ich meine rudimentären Programmierkenntnisse auf nem SinclairQL erworben habe klappt das schon ganz gut.
    Nur manchmal (JETZT!) fühl ich mich wie´n Depp, es geht ganz schlicht darum wie ich nach IF ... THEN mehrere Kommandos ausführen kann.

    If $instr = $inval1 Then GUICtrlSetBkColor($inv1, 0x00a800) : Run($pro1) So gehts nicht ...

    If $instr = $inval1 Then GUICtrlSetBkColor($inv1, 0x00a800)
    Run($pro1) ... so auch nicht

    Also wie ?

    Danke im Voraus

    qtl {
    position: absolute;
    border: 1px solid #cccccc;
    -moz-border-radius: 5px;
    opacity: 0.2;
    line-height: 100%;
    z-index: 999;
    direction: ltr;
    }

    qtl:hover,qtl.open {
    opacity: 1;
    }

    qtl,qtlbar {
    height: 22px;
    }

    qtlbar {
    display: block;
    width: 100%;
    background-color: #cccccc;
    cursor: move;
    }

    qtlbar img {
    border: 0;
    padding: 3px;
    height: 16px;
    width: 16px;
    cursor: pointer;
    }

    qtlbar img:hover {
    background-color: #aaaaff;
    }

    qtl>iframe {
    border: 0;
    height: 0;
    width: 0;
    }

    qtl.open {
    height: auto;
    }

    qtl.open>iframe {
    height: 200px;
    width: 300px;
    }

    [Blockierte Grafik: http://www.qtl.co.il/img/copy.png]http://int.ask.com/web?siteid=100…is&q=ich%20[Blockierte Grafik: http://translate.google.com/favicon.ico]
    </iframe>

    Einmal editiert, zuletzt von rococo (30. August 2011 um 11:17)

  • Wenn dann eher so:

    [autoit]


    If $instr = $inval1 Then
    GUICtrlSetBkColor($inv1, 0x00a800)
    Run($pro1)
    EndIf

    [/autoit]

    Was soll der Text am Ende sein?

    Gruß,
    UEZ

    Auch am Arsch geht ein Weg vorbei...

    ¯\_(ツ)_/¯

  • Hallo UEZ, der Text am Ende stammt eigentlich nicht von mir.
    Hallo L3viathan: Hätte ich mich korrekt ausgedrückt hättest Du mir bestimmt sofort helfen können.

    While 1

    $instr = _CommGetString()

    If $instr <> '' Then

    If GUICtrlRead($Checkbox1) = $GUI_CHECKED Then $instr = StringReplace($instr,@CR,@CRLF)
    If $instr = $inval1 Then GUICtrlSetBkColor($inv1, 0x00a800) : Run($pro1)
    If $instr = $inval2 Then Run($pro2)
    If $instr = $inval3 Then Run($pro3)

    GUICtrlSetData($Edit1, $instr,1)

    EndIf

    WEnd

    qtl {
    position: absolute;
    border: 1px solid #cccccc;
    -moz-border-radius: 5px;
    opacity: 0.2;
    line-height: 100%;
    z-index: 999;
    direction: ltr;
    }

    qtl:hover,qtl.open {
    opacity: 1;
    }

    qtl,qtlbar {
    height: 22px;
    }

    qtlbar {
    display: block;
    width: 100%;
    background-color: #cccccc;
    cursor: move;
    }

    qtlbar img {
    border: 0;
    padding: 3px;
    height: 16px;
    width: 16px;
    cursor: pointer;
    }

    qtlbar img:hover {
    background-color: #aaaaff;
    }

    qtl>iframe {
    border: 0;
    height: 0;
    width: 0;
    }

    qtl.open {
    height: auto;
    }

    qtl.open>iframe {
    height: 200px;
    width: 300px;
    }

    [Blockierte Grafik: http://www.qtl.co.il/img/copy.png]http://int.ask.com/web?siteid=100…0%20%20%20EndIf[Blockierte Grafik: http://translate.google.com/favicon.ico]
    </iframe>

  • [autoit]


    While 1

    [/autoit][autoit][/autoit][autoit]

    $instr = _CommGetString()

    [/autoit][autoit][/autoit][autoit]

    If $instr <> '' Then

    [/autoit][autoit][/autoit][autoit]

    If GUICtrlRead($Checkbox1) = $GUI_CHECKED Then $instr = StringReplace($instr,@CR,@CRLF)
    If $instr = $inval1 Then
    GUICtrlSetBkColor($inv1, 0x00a800)
    Run($pro1)
    EndIf
    If $instr = $inval2 Then Run($pro2)
    If $instr = $inval3 Then Run($pro3)

    [/autoit][autoit][/autoit][autoit]

    GUICtrlSetData($Edit1, $instr,1)

    [/autoit][autoit][/autoit][autoit]

    EndIf

    [/autoit][autoit][/autoit][autoit]

    WEnd

    [/autoit]

    Du hast beim letzten dein problem immernoch nicht wirklich beschrieben, da die Lösungen eigentlich gegeben worden sind. Benutze bitte auch die Autoit Tags
    [autoit**][/autoit]

    mfg BB

    "IF YOU'RE GOING TO KILL IT
    OPEN SOURCE IT!"

    by Phillip Torrone

    Zitat von Shoutbox

    [Heute, 11:16] Andy: ....böseböseböseböse....da erinnere ich mich daran, dass man den Puschelschwanz eines KaRnickels auch "Blume" nennt....ob da eins zum anderen passt? :rofl: :rofl: :rofl: :rofl:

    https://autoit.de/index.php?page…leIt#post251138

    Neon Snake