Jump to content
Sign in to follow this  

add and subtract

Recommended Posts


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()

        Case $msg = $GUI_EVENT_CLOSE
        Case $msg = $next
             $add = 1 + $add
         Case $msg = $prv
             $add = $add - 1 
             if $add = -1  then
                $add = 1



func _prv()
func _next()
Edited by autoitxp

Share this post

Link to post
Share on other sites

Case $msg = $prv
             If $add > 1 Then $add -= 1

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

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  


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.