[21:19] anyway. [21:19] so [21:19] an array is basically a list. [21:19] instead of doing this: [21:19] string item1; [21:19] string item2; [21:19] string item3; [21:19] etc [21:19] you can do this: [21:19] instead of doing Clint's idea okay :P [21:20] string[] item = new string[5]; [21:20] what that does [21:20] is [21:20] it tells the system to make 5 "item" variables [21:20] well, 5 strings really. [21:20] ok [21:20] they're all called item. [21:20] so item == whatever I want to call it? [21:20] and you access each one by going in sequential order [21:20] starting from 0 [21:21] ok [21:21] so 0 to 4 [21:21] so string[5] contains string[0], string[1] ... string[3], string[4] [21:21] note [21:21] there is no string[5] [21:21] it doesn't exist [21:21] because 0-4 is 5 things [21:21] yeah [21:21] its kinda weird that wasy [21:21] arrays can be whatever you want [21:21] like im this smiler thing i'm doing [21:21] i have an Image[] array [21:22] now, cay you wanted to do something to each thing in the array [21:22] say... add 5 to an int[] array [21:22] instead of going through each one and saying int[0] = int[0] + 5; [21:22] you can [21:22] er [21:22] i should ask first [21:22] do you know what a for loop is? [21:23] no =\ [21:23] for(... ; ... ; ...) { [21:23] statements; [21:23] } [21:23] ah well [21:23] okay. [21:23] a for loop is a set of commands that get executed more than once [21:23] so [21:23] if we do [21:23] well, the syntax first [21:23] is [21:23] okay, so I could always route the strings to that for loop? (but continue on the code or whatever) [21:24] for( ; ; ) [21:24] { [21:24] } [21:24] i know it seems weird [21:24] but its not [21:24] for an array [21:24] you'd want to do this: [21:25] for(int i = 0; i < numbers.GetUpperBound(); i++) { [21:25] numbers[i] += 5; [21:25] } [21:25] okay [21:25] lets break that down [21:25] first line, the for loop [21:26] it goes in and it says "make variable 'i'." [21:26] and set it to 0 [21:26] ok [21:26] then each time it checks, and it says "hey, keep looping WHILE , and in this case it's while i is less than the number of numbers in our array (whatever it may be)" [21:26] and then after each loop it adds one to i [21:27] you know ++; right? [21:27] and --; [21:27] "? [21:27] erm..no.. [21:27] oh [21:27] okay basically [21:27] var = var + 1; is the SAME THING as var++; [21:27] or -- for -1; [21:27] :) [21:27] so anyway [21:27] ok [21:28] okay [21:28] back to the loop [21:28] second line is a shorthand way of saying numbers[i] = numbers[i] - 5; [21:28] so var += 5 will add 5 to var [21:28] string += " hello" will add 'hello' to a string [21:29] Clint.IQ -= 100; [21:29] will take 100 points from Clint's IQ. [21:29] just kidding ;) [21:29] heh [21:29] so thats that [21:29] a for loop is just like [21:29] an easy way to iterate (keyword of the day) over each element in an array. [21:29] mmkay [21:30] and, no, we couldn't use it to add each UrL [21:30] unless you added a prompt for each one [21:30] something like [21:30] * Cloudy (~cloudhunt@3b-B4AC8356.range86-136.btcentralplus.com) has joined #Spike [21:30] . [21:30] for(...) { url[i] = System.InputBox("Enter the URL for element " + i + ":"); } [21:32] so [21:32] now if you look at my code [21:32] can you see what I did with the array there? [21:32] I think [21:33] hm [21:33] how do you enable line numbers in vs [21:33] you set up an array, added URLs to each string [21:38] right-o [21:38] well [21:38] anyway :) [21:38] on line 32, for example [21:38] note we're inside a for loop, so using that variable i is valid [21:38] yeah [21:39] and i say url[i] <-- which is a string, url[i] = image.fromfile(url[i]) [21:39] i could also go image.fromfile("http://image.com/image.jpg") [21:39] so that finds the url of said image? [21:39] but instead of typing it out twice [21:40] it [21:40] see [21:40] im not sure [21:40] theoretically [21:40] it will download the image from the internet [21:40] so like [21:40] you set up each url, right [21:40] url[0] = blah [21:40] url[1] etc [21:40] then [21:40] i loop through [21:40] and because the url actually points to the image we want... we just loop through and download them. [21:41] I see [21:41] we say "okay, here's url[0], it's a string. now, go to the Image class and parse that string (which points to the image), download it, and load it into our Image[] array. [21:41] " [21:41] .