Jump to content



Photo

To many else statements?


  • Please log in to reply
3 replies to this topic

#1 themax90

themax90

    A new beginning

  • Active Members
  • PipPipPipPipPipPip
  • 1,265 posts

Posted 25 December 2004 - 12:08 AM

I am running a line of If commands through my scripts which work perfectly fine normally but now all a sudden I get to many else statements for matching if statement.
  If $msg = 15 Then       $dip_1 = GUICtrlRead($ip_1)       $dport_1 = GUICtrlRead($port_1)       $lport_1 = GUICtrlRead($listen_1)       If $dip_1 = "" Or $dport_1 = "" Or $lport_1 = "" Then          MsgBox(48, "Invalid amount of data", "It seems you did not complete one or more of the fields. Please complete all fields.")       Else          Run(@ScriptDir & "\core.exe " & $lport_1 & " " & $dip_1 & " " & $dport_1)


Or in this form

  If $msg = 15 Then       $dip_1 = GUICtrlRead($ip_1)       $dport_1 = GUICtrlRead($port_1)       $lport_1 = GUICtrlRead($listen_1)       If $dip_1 = ""  Then MsgBox(48, "Invalid amount of data", "It seems you did not complete one or more of the fields. Please complete all fields.")       ElseIf $dport_1 = "" Then MsgBox(48, "Invalid amount of data", "It seems you did not complete one or more of the fields. Please complete all fields.")       ElseIf $lport_1 = "" Then          MsgBox(48, "Invalid amount of data", "It seems you did not complete one or more of the fields. Please complete all fields.")       Else          Run(@ScriptDir & "\core.exe " & $lport_1 & " " & $dip_1 & " " & $dport_1)
Is this a new bug or am I coding wrong>?





#2 SlimShady

SlimShady

    AutoIt lover

  • Active Members
  • PipPipPipPipPipPip
  • 2,383 posts

Posted 25 December 2004 - 12:10 AM

Am I blind or did you forget to use EndIfs in your code?

#3 themax90

themax90

    A new beginning

  • Active Members
  • PipPipPipPipPipPip
  • 1,265 posts

Posted 25 December 2004 - 12:16 AM

No dude thats just a section, I am not going to show the rest, there are endifs, nvm I figured it out, there was 4 If message statements in one if string which it overloading it. Fixed. Sorry for the posts.

To B14ck: And projects that can develope into something really good are usuallt :HINT: CLOSED SOURCE untill the creator feels to release it or someone buys the legal copyright.

Edited by Agent Smith, 25 December 2004 - 12:19 AM.


#4 b14ck

b14ck

    Universalist

  • Active Members
  • PipPipPipPipPipPip
  • 379 posts

Posted 25 December 2004 - 12:18 AM

Hey... These forums are generally open source. *hint*
-I am the giver of life and the bringer of death.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users