John117 Posted December 8, 2007 Share Posted December 8, 2007 (edited) I need all of these to be true before it continues, or else it fails and does not continue. What am I doing wrong? ;Should be working If 2 > 1 Then If 2 < 3 Then If 4 > 3 Then If 4 < 5 Then MsgBox(0, "1", "Working") EndIf EndIf EndIf Else MsgBox(0, "1", "NotWorking") EndIf ;Should be notworking If 2 > 1 Then If 4 < 3 Then If 4 > 3 Then If 4 < 5 Then MsgBox(0, "2", "NotWorking") EndIf EndIf EndIf Else MsgBox(0, "2", "Working") EndIf ;Should be notworking If 1 > 2 Then If 2 < 3 Then If 2 > 3 Then If 4 < 5 Then MsgBox(0, "3", "NotWorking") EndIf EndIf EndIf Else MsgBox(0, "3", "Working") EndIf Edited December 8, 2007 by Hatcheda Link to comment Share on other sites More sharing options...
Generator Posted December 8, 2007 Share Posted December 8, 2007 I need all of these to be true before it continues, or else it fails and does not continue. What am I doing wrong? ;Should be working If 2 > 1 Then If 2 < 3 Then If 4 > 3 Then If 4 < 5 Then MsgBox(0, "1", "Working") EndIf EndIf EndIf Else MsgBox(0, "1", "NotWorking") EndIf ;Should be notworking If 2 > 1 Then If 4 < 3 Then If 4 > 3 Then If 4 < 5 Then MsgBox(0, "2", "NotWorking") EndIf EndIf EndIf Else MsgBox(0, "2", "Working") EndIf ;Should be notworking If 1 > 2 Then If 2 < 3 Then If 2 > 3 Then If 4 < 5 Then MsgBox(0, "3", "NotWorking") EndIf EndIf EndIf Else MsgBox(0, "3", "Working") EndIfObviously you can tell that 5 is greater than 4 and 2 is greater than 3 and 1 is lesser than 2. What are you trying to do. Link to comment Share on other sites More sharing options...
John117 Posted December 8, 2007 Author Share Posted December 8, 2007 (edited) fixed ;Should be working If 2 > 1 Then If 2 < 3 Then If 4 > 3 Then If 4 < 5 Then MsgBox(0, "complete", "Working") Else MsgBox(0, "if 4", "NotWorking") EndIf Else MsgBox(0, "if 3", "NotWorking") EndIf Else MsgBox(0, "if 2", "NotWorking") EndIf Else MsgBox(0, "if 1", "NotWorking") EndIf *Edit* I will post the real thing in a few after I finish updating it. Edited December 8, 2007 by Hatcheda Link to comment Share on other sites More sharing options...
John117 Posted December 8, 2007 Author Share Posted December 8, 2007 here is what I was working on -if you move off the gui it gets smaller- if you move back to where it was it gets bigger expandcollapse popupGlobal $ParentWin_Width = 450 Global $ParentWin_Height = 700 Global $ParentWin_Left = ((@DesktopWidth - $ParentWin_Width) / 2) Global $Top = 25 Global $ParentWin = GUICreate("Example", 450, $ParentWin_Height, $ParentWin_Left, $Top) Opt("GUIOnEventMode", 1) HotKeySet("{ESC}", "_Custom_Exit") GUISetState(@SW_SHOW, $ParentWin) While 1 Sleep(1000) Global $size = WinGetPos($ParentWin) Global $pos = MouseGetPos() ;MouseLeft < GuiLeft If $pos[0] > $size[0] Then ;MouseRight > GuiRight If $pos[0] < ($size[0] + $size[2]) Then ;MouseTop < GuiTop If $pos[1] > $size[1] Then ;MouseBottom > GuiBottom If $pos[1] < ($size[1] + 500) Then _Expand() Else ;MsgBox(0, "if 4", "NotWorking") _Colapse() EndIf Else ;MsgBox(0, "if 3", "NotWorking") _Colapse() EndIf Else ;MsgBox(0, "if 2", "NotWorking") _Colapse() EndIf Else ;MsgBox(0, "if 1", "NotWorking") _Colapse() EndIf WEnd Func _Colapse() ;WinMove ( "title", "text", x, y [, width [, height[, speed]]] ) If $size[3] > 40 Then For $i = $ParentWin_Height To 40 Step - 5 WinMove($ParentWin, "", $size[0], $size[1], $size[2], $i) Next EndIF EndFunc ;==>_Colapse Func _Expand() ;MsgBox(0, "if 5", "working") If $size[3] = 40 Then For $i = 40 To $ParentWin_Height Step 5 WinMove($ParentWin, "", $size[0], $size[1], $size[2], $i) Next EndIf EndFunc ;==>_Expand Func _Custom_Exit() Exit EndFunc ;==> _exit() Link to comment Share on other sites More sharing options...
JustinReno Posted December 8, 2007 Share Posted December 8, 2007 Thats a really neat script, but a little slow. Link to comment Share on other sites More sharing options...
John117 Posted December 8, 2007 Author Share Posted December 8, 2007 Just change the step to bump it up -I wanted it slower for appearance Link to comment Share on other sites More sharing options...
therks Posted December 8, 2007 Share Posted December 8, 2007 Why do I keep seeing people do this? $ParentWin_Left = ((@DesktopWidth - $ParentWin_Width) / 2) Did you know if you use Default for the X parameter it will be centered? Also, you can use AND in your if statements. That will really cleanup your code here. For example, try this for your While loop. While 1 Sleep(1000) Global $size = WinGetPos($ParentWin) Global $pos = MouseGetPos() If $pos[0] > $size[0] And $pos[0] < ($size[0] + $size[2]) And $pos[1] > $size[1] And $pos[1] < ($size[1] + 500) Then _Expand() Else _Colapse() EndIf WEnd And your results confuse me a bit. The window expands when the mouse is in just about any area below it, was that intentional? Otherwise neat idea. Here's something I did a while ago that is similar in idea, but quite different in execution. This won't replicate your behaviour though, it's just similar. Global $GUI_EVENT_CLOSE = -3 Global $GUI_DOCKBORDERS = 102 Global $iHeightExpand = 500, $iHeightCollapse = 200 Global $bCollapsed = True $hGui = GUICreate('Hover and expand', 200, 200, Default, 50) GUICtrlCreateLabel('', 0, 0, 200, 200) GUICtrlSetResizing(-1, $GUI_DOCKBORDERS) GUISetState() Do $gc = GUIGetCursorInfo($hGui) If Not @error Then If $gc[4] And $bCollapsed Then WinMove($hGui, '', Default, Default, Default, $iHeightExpand) $bCollapsed = False ElseIf Not $gc[4] And Not $bCollapsed Then WinMove($hGui, '', Default, Default, Default, $iHeightCollapse) $bCollapsed = True EndIf EndIf $gm = GUIGetMsg() Until $gm = $GUI_EVENT_CLOSE My AutoIt Stuff | My Github Link to comment Share on other sites More sharing options...
John117 Posted December 8, 2007 Author Share Posted December 8, 2007 (edited) Hey, I have to run but I will test yours out later. -mine was just a first draft. I am thinking that I will duplicate the code for expansion if over a smaller area of the gui. (and area that will say 'Expand' but stay expanded if over anywhere. -Thanks for the info. I tried and but was getting errors so I needed to error proff it. -thats why the error stuff is there I will update and edit this later! Edited December 8, 2007 by Hatcheda Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now