| View previous topic :: View next topic |
| Author |
Message |
dakun Guest
|
Posted: Wed Jul 09, 2008 8:25 pm Post subject: array iteration? |
|
|
im attempting to reduce the size of one of my programs but i cant get arrays to work. but when i try to run the reduced code, it doesnt store anything to the variables.
im trying to reduce this
| Code: | varReset:
total=0
20s=0
19s=0
18s=0
17s=0
16s=0
15s=0
14s=0
13s=0
12s=0
11s=0
10s=0
9s=0
8s=0
7s=0
6s=0
5s=0
4s=0
3s=0
2s=0
1s=0
GuiControl,, output,
gui,submit,noHide
return |
to this
| Code: | varReset2:
it=1
total=0
loop 20{
%it%s:=0
%it%++
}
GuiControl,, output,
gui,submit,noHide
return |
|
|
| Back to top |
|
 |
tonne
Joined: 06 Jun 2006 Posts: 1160 Location: Denmark
|
Posted: Wed Jul 09, 2008 8:47 pm Post subject: |
|
|
| Code: | loop, 20
{
%a_index%s := 0
} |
_________________ there's a dog barking close within the range of my ear
sounds like he wants to escape the chain
he would probably bite me to death if he could
but the chain lets me spit in his face
- Kashmir |
|
| Back to top |
|
 |
dakun Guest
|
Posted: Wed Jul 09, 2008 9:33 pm Post subject: |
|
|
| thx, why is it that we cant use our own variables? |
|
| Back to top |
|
 |
tonne
Joined: 06 Jun 2006 Posts: 1160 Location: Denmark
|
Posted: Wed Jul 09, 2008 9:46 pm Post subject: |
|
|
You can (but you had a typo:
| Code: | it=1
total=0
loop 20{
%it%s:=0
it++ ; no % here
} | ) _________________ there's a dog barking close within the range of my ear
sounds like he wants to escape the chain
he would probably bite me to death if he could
but the chain lets me spit in his face
- Kashmir |
|
| Back to top |
|
 |
dakun Guest
|
Posted: Wed Jul 09, 2008 10:26 pm Post subject: |
|
|
| i had that there before and it didnt work, i think |
|
| Back to top |
|
 |
|