Raised This Month: $ Target: $400
 0% 

Whats the difference between ++ and +=


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
GXLZPGX
Veteran Member
Join Date: Sep 2009
Old 08-10-2010 , 09:50   Whats the difference between ++ and +=
Reply With Quote #1

When adding to a variable, what is the difference between:

Variable[id]++

and

Variable[id]+=

I believe ++ adds 1 automatically each time, but += allows you to define how much to add each time, correct?
__________________
Currently accepting payment US DOLLARS ONLY for custom plugins, contact me through PM.
GXLZPGX is offline
hleV
Veteran Member
Join Date: Mar 2007
Location: Lithuania
Old 08-10-2010 , 09:55   Re: Whats the difference between ++ and +=
Reply With Quote #2

Yes.
__________________
hleV is offline
Leon M.
Senior Member
Join Date: Apr 2009
Location: Germany
Old 08-10-2010 , 12:26   Re: Whats the difference between ++ and +=
Reply With Quote #3

http://wiki.amxmodx.org/Pawn_Tutorial#Expressions
__________________
  • ZapTic - Paintball (Version 7.1.3 b1303)
  • Your #1 CS Paintball Server since 2008
  • 85.131.163.101:27015
Leon M. is offline
wrecked_
Veteran Member
Join Date: Jan 2010
Location: New York (GMT-5)
Old 08-10-2010 , 16:11   Re: Whats the difference between ++ and +=
Reply With Quote #4

www.google.com
__________________
[ Paid Requests ]
DO NOT PM ME ABOUT BLOCKMAKER
NO PRIVATE SUPPORT
wrecked_ is offline
Flipper_SPb
Senior Member
Join Date: Jun 2009
Location: Worldspawn
Old 08-10-2010 , 16:16   Re: Whats the difference between ++ and +=
Reply With Quote #5

Equivalents:

Variable[id] = Variable[id] + 1

and

Variable[id] = Variable[id] + x
Flipper_SPb is offline
Send a message via ICQ to Flipper_SPb
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 21:52.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode