|
-
Senior Member
yet another question (its a small one)
i created two buttons ,one wich increase a number at the edit box
by 1 and the other wich decreaseit by 1 (i used ++ command)
however when i tried to make the buttons to increase/decrease by 2
they where still increasing/decreasing by 1 and now the each one
of them increases/decreases two different numbers (for ex:i clicked on the increase button 4 times-the number increased to 5 but then
i clicked on the decrease button and the number returns to 1)
(i used the command : text = ++2)
in other words my question is how to make and increasement/decreasement by more then 1 ?
-
KoolMoves Moderator
to increase by 2 use +=2
for a variable named myvar you
myvar+=2
(decrease is -=2)
Or if you want it to be easier to read just
myvar=myvar+2
(decrease is myvar=myvar-2)
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|