# ++ question

**URL:** https://forum.kirupa.com/t/question/2735
**Category:** flash
**Created:** [April 23, 2002, 1:58pm UTC](https://forum.kirupa.com/t/question/2735 "2002-04-23T13:58:34Z")
**Posts on this page:** 18
**Page:** 1

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [April 23, 2002, 1:58pm UTC](https://forum.kirupa.com/t/question/2735/1 "2002-04-23T13:58:34Z")

</div>

I often encounter variables attached to a ++\rfor example in a “for” statement.\rfor (i=2; i\>2; i++)\rsomething like that.\rWhat does the whole “for” thingy do and what do the two ++ mean?\rANd what does it mean, when you add a plus or a minus sign in front or behind an equal sign?\r\rI really need some easy to understand help with this.\r\rTHX\r\rDon Albino

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [April 23, 2002, 2:21pm UTC](https://forum.kirupa.com/t/question/2735/2 "2002-04-23T14:21:56Z")

</div>

when a counter says something like \r\rii++ it means that every time that frame is entered 1 gets added to ii\r\ralternatively \r\rii-- means 1 is subtracted.\r\rThe for thingy creates a loop.\r\rfor(i=2;i\>2;i++) \r\rthe i=2 sets i equal to 2. the i\>2 means that the loop will perform as long as i is greater than 2 and the i++ adds 1 to i every time the frame is entered.\r\r\rsomething like this\r\r\_x -= nXstart\r\rthis means that everytime the frame is entered or this script is accessed that nXstart is subtracted from \_x

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [April 23, 2002, 2:31pm UTC](https://forum.kirupa.com/t/question/2735/3 "2002-04-23T14:31:22Z")

</div>

Well done, jubba, but don’t send the guy into infinite loops (that means the condition will always be true, so the loop never stops).

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [April 23, 2002, 4:47pm UTC](https://forum.kirupa.com/t/question/2735/4 "2002-04-23T16:47:57Z")

</div>

actually eyez, that loop won’t run at all.

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [April 23, 2002, 6:10pm UTC](https://forum.kirupa.com/t/question/2735/5 "2002-04-23T18:10:01Z")

</div>

yeah i thought that would be an infinite loop, but thats the example he gave me! lol, I forgot to mention it. Supra, why won’t it run?\r\rnevermind I see it.\r\rAlbino Boy:: a for statement would look like this\r\rfor(ii=0; ii\<=10; ii++) that has no errors I believe

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [April 23, 2002, 6:17pm UTC](https://forum.kirupa.com/t/question/2735/6 "2002-04-23T18:17:56Z")

</div>

what does a hairless primate know about AS anyway, lol 🙂 \rcourse it won’t, still looks too close for comfort??

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [April 23, 2002, 6:56pm UTC](https://forum.kirupa.com/t/question/2735/7 "2002-04-23T18:56:27Z")

</div>

Thx a lot.\rSInce I didn’t know anything about loops until you two explained it to me, I just took some numbers and put them together.\rWould my exmple loop work, when it would be “i–” ?\rAnd why “i” always used? Does it have some certain status in Flash?\rAnd when would you use a loop like that?\r\rThx in advance\r\rDon Albino

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [April 23, 2002, 7:18pm UTC](https://forum.kirupa.com/t/question/2735/8 "2002-04-23T19:18:41Z")

</div>

using i is a matter of preference. i use ii\r\ryoure code would not have worked because you had\r\ri=2;i\>2;i-- \r\rthe last part doesnt matter you set i equal to 2 and then the next part (i\>2) is the condition. So i = 2, and the condition is i\>2 but i can’t be greater than2 cuz it is 2 u understand?

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [April 24, 2002, 1:50pm UTC](https://forum.kirupa.com/t/question/2735/9 "2002-04-24T13:50:55Z")

</div>

I got it.\rBut you still didn’t answer the “i” question?\rWhat IS i?\rWhy don’t we use x, or y, or something like that? Does “i” have special status in Flash?\r\rDon Albino

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [April 24, 2002, 3:23pm UTC](https://forum.kirupa.com/t/question/2735/10 "2002-04-24T15:23:41Z")

</div>

i did answer that. Its just a variable and it doesnt matter what you name it. You could name it SupercalifragalisticExpialodosious for what it matters. X and Y are not used mainly because they are already used to determine the positoin of things such as movieclips \_x and \_y, and if you used x and y as variables then the code could get messy. I guess someone originally used i and it caught on.

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [April 24, 2002, 6:34pm UTC](https://forum.kirupa.com/t/question/2735/11 "2002-04-24T18:34:11Z")

</div>

Sorry.\rI got English as a second language and didn’t get the “preference” part. I just thought “i” was special since everybody uses it.\r\rthx again

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [April 24, 2002, 9:36pm UTC](https://forum.kirupa.com/t/question/2735/12 "2002-04-24T21:36:38Z")

</div>

sorry about the misunderstanding. Nope, nothing special about it…its just common

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [April 24, 2002, 11:26pm UTC](https://forum.kirupa.com/t/question/2735/13 "2002-04-24T23:26:33Z")

</div>

“i” is from the early days of programing… I’m not sure why they started using that as opposed to “j” for instance… it is strange.\r\rProbebly in order to hear the story of the origin of that, we’d have to take a cobal course or something.

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [April 24, 2002, 11:41pm UTC](https://forum.kirupa.com/t/question/2735/14 "2002-04-24T23:41:15Z")

</div>

Well, for what it is worth, i is the common integer variable in mathematics, just as E is a vectorial space.\r\rpom 0]

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [April 24, 2002, 11:45pm UTC](https://forum.kirupa.com/t/question/2735/15 "2002-04-24T23:45:32Z")

</div>

ahhhh… that makes a lot of sense… thanks Pom

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [April 25, 2002, 9:45am UTC](https://forum.kirupa.com/t/question/2735/16 "2002-04-25T09:45:27Z")

</div>

In Math we use “i” as the square root of -1\rIt is an imaginery number, since there is no square root of any negative number.\rHow about we all just start using a, instead of i, just for the sake of changing something.\r\rDon Albino

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [April 25, 2002, 9:48am UTC](https://forum.kirupa.com/t/question/2735/17 "2002-04-25T09:48:47Z")

</div>

I believe like x y and z, a b and c are used as locations on a grid, in three dimensional space, which is why we don’t typicaly use them… for the sake of clarity. Though you are welcome to use any letter which suits you of course.

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [April 25, 2002, 6:50pm UTC](https://forum.kirupa.com/t/question/2735/18 "2002-04-25T18:50:56Z")

</div>

Exactly. And since we are liviong in a free world I am going to start to make my own letter and will ask all of you to follow me. Since this letter is not invented yet, it will be kind of hard to express it on a normal keyboard. Maybe I will draw it and post it (but then again, maybe not)\r\rDon Albino
