View Single Post
  #3  
Old 06-28-2002, 11:04 AM
mikepg mikepg is offline
Registered User
Join Date: Nov 2001
Location: VA, USA
Posts: 501
mikepg is on a distinguished road
Send a message via AIM to mikepg Send a message via Yahoo to mikepg
also

you can also set values of arrays like this:

array = {0,1,2,4,5,-15,..n};

setarray arrayname,10;

this would give you (in the debugger)
arrayname = 0/{0,0,0,0,0,0,0,0,0,0}
(the 0/ part does nothing, as far as i know)

example of an array in a for statement:

NPC Code:

setarray count,10;
for (i=1; i<=arraylen(count); i++ {
count[i-1]=i;
}



and you'd get back
count = 0/{1,2,3,4,5,6,7,8,9,10}

count[x] is the "slot" of the array you are accessing..so
after we ran the forstatement above,
count[3] would be 4, because the array begins with count[0] (not count[1])

And...that's pretty much the basics...I don't know if that helped, that's the way I looked at it.
__________________
~War Lord Mpg2
Bravo Online's Asst. Staff Manager

"Sittin by the tree, sippin eggnog, waitin on christmas gifts"
Reply With Quote