lawonama Posted August 12, 2011 Share Posted August 12, 2011 While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Start If $Begin = 0 then SplashTextOn("CSBH", "Hello", 700, 60, -1, -1, 1, "", 24) Sleep(2000) SplashOff() Sleep(100) $Begin = 1 EndIf If $Begin = 1 then SplashTextOn("CSBH", "Bye", 700, 60, -1, -1, 1, "", 24) Sleep(2000) SplashOff() Sleep(100) $Begin = 0 EndIf Case $Info MsgBox(4096, "Info", "Mady by Lawonama!") EndSwitch WEnd I have this code. It needs to; > Show a splash text > Sleep 2000 > Set the splash text off > Sleep 100 > Set the variable $begin to 0 without applying it. Buy it applies, how can I fix it? Link to comment Share on other sites More sharing options...
AdmiralAlkex Posted August 12, 2011 Share Posted August 12, 2011 Best would probably be to make it only 1 if, example: While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Start If $Begin = 0 then SplashTextOn("CSBH", "Hello", 700, 60, -1, -1, 1, "", 24) Sleep(2000) SplashOff() Sleep(100) $Begin = 1 ElseIf $Begin = 1 then SplashTextOn("CSBH", "Bye", 700, 60, -1, -1, 1, "", 24) Sleep(2000) SplashOff() Sleep(100) $Begin = 0 EndIf Case $Info MsgBox(4096, "Info", "Mady by Lawonama!") EndSwitch WEnd Or make sure the second If isn't run if the first one is, example: While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Start If $Begin = 0 then SplashTextOn("CSBH", "Hello", 700, 60, -1, -1, 1, "", 24) Sleep(2000) SplashOff() Sleep(100) $Begin = 1 ContinueLoop EndIf If $Begin = 1 then SplashTextOn("CSBH", "Bye", 700, 60, -1, -1, 1, "", 24) Sleep(2000) SplashOff() Sleep(100) $Begin = 0 EndIf Case $Info MsgBox(4096, "Info", "Mady by Lawonama!") EndSwitch WEnd .Some of my scripts: ShiftER, Codec-Control, Resolution switcher for HTC ShiftSome of my UDFs: SDL UDF, SetDefaultDllDirectories, Converting GDI+ Bitmap/Image to SDL Surface 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