Jump to content
Sign in to follow this  
autoitxp

add and subtract

Recommended Posts

autoitxp

hi this simple add and subtract showing on status bar but im stuck on one thing all working fine like i want it . but subtract method ends on 0 i want this simply ends on 1 .

can any one tell me where is problem try this script and let me know soultion

#include <GUIConstants.au3>
#Include <GuiStatusBar.au3>
Local $gui
Local $a_PartsText[3]
Local $a_PartsRightEdge[3] = [200, 500, -1]

$add = 1


$gui = GUICreate("Database Gui", 800,600)  
$StatusBar1 = _GUICtrlStatusBarCreate ($gui, $a_PartsRightEdge, $a_PartsText)
$next =  GUICtrlCreateButton ("add",  100, 500,100) 
$prv =   GUICtrlCreateButton ("subtract",  300, 500,100) 

GUISetState (@SW_SHOW)  



While 1
    
$msg = GUIGetMsg()

    Select
        Case $msg = $GUI_EVENT_CLOSE
            ExitLoop
        Case $msg = $next
             $add = 1 + $add
             call("_next") 
         Case $msg = $prv
             $add = $add - 1 
             if $add = -1  then
                $add = 1
                 EndIf
             call("_prv")


    EndSelect


Wend

func _prv()
    _GUICtrlStatusBarSetText($StatusBar1,$add)
EndFunc
func _next()
    _GUICtrlStatusBarSetText($StatusBar1,$add)
EndFunc
Edited by autoitxp

Share this post


Link to post
Share on other sites
SmOke_N

Case $msg = $prv
             If $add > 1 Then $add -= 1
             _prv()


Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Share this post


Link to post
Share on other sites
autoitxp

Thanks Buddy <_<

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×